From 8cc1861b5d54f22698490f3de136f58d357bfe53 Mon Sep 17 00:00:00 2001 From: amirroth Date: Wed, 21 Jun 2023 10:48:23 -0400 Subject: [PATCH 01/17] Rename makeUPPER and getEnumValue and initial (unintentional) RoomAirModel cleanup --- src/EnergyPlus/AirLoopHVACDOAS.cc | 28 +- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 78 +- src/EnergyPlus/BaseboardElectric.cc | 2 +- src/EnergyPlus/BoilerSteam.cc | 2 +- src/EnergyPlus/Boilers.cc | 2 +- src/EnergyPlus/BranchNodeConnections.cc | 16 +- src/EnergyPlus/CTElectricGenerator.cc | 2 +- src/EnergyPlus/ChillerAbsorption.cc | 2 +- src/EnergyPlus/ChillerElectricASHRAE205.cc | 10 +- src/EnergyPlus/ChillerElectricEIR.cc | 2 +- src/EnergyPlus/ChillerGasAbsorption.cc | 2 +- src/EnergyPlus/ChillerIndirectAbsorption.cc | 2 +- src/EnergyPlus/ChillerReformulatedEIR.cc | 2 +- src/EnergyPlus/Coils/CoilCoolingDX.cc | 2 +- .../Coils/CoilCoolingDXCurveFitPerformance.cc | 2 +- src/EnergyPlus/CondenserLoopTowers.cc | 30 +- src/EnergyPlus/ConvectionCoefficients.cc | 26 +- src/EnergyPlus/CoolTower.cc | 2 +- src/EnergyPlus/CostEstimateManager.cc | 2 +- src/EnergyPlus/CrossVentMgr.cc | 8 +- src/EnergyPlus/CurveManager.cc | 16 +- src/EnergyPlus/DElightManagerF.cc | 2 +- src/EnergyPlus/DXCoils.cc | 10 +- src/EnergyPlus/DataHVACGlobals.cc | 160 +- src/EnergyPlus/DataHVACGlobals.hh | 97 +- src/EnergyPlus/DataRoomAirModel.hh | 698 +++--- src/EnergyPlus/DataSurfaceColors.cc | 2 +- src/EnergyPlus/DataZoneEquipment.cc | 8 +- src/EnergyPlus/DaylightingManager.cc | 2 +- src/EnergyPlus/DemandManager.cc | 24 +- src/EnergyPlus/DualDuct.cc | 2 +- src/EnergyPlus/EMSManager.cc | 20 +- src/EnergyPlus/EarthTube.cc | 6 +- src/EnergyPlus/EconomicLifeCycleCost.cc | 24 +- src/EnergyPlus/EconomicTariff.cc | 6 +- src/EnergyPlus/ElectricPowerServiceManager.cc | 10 +- src/EnergyPlus/EvaporativeCoolers.cc | 8 +- src/EnergyPlus/EvaporativeFluidCoolers.cc | 10 +- src/EnergyPlus/ExhaustAirSystemManager.cc | 12 +- src/EnergyPlus/ExternalInterface.cc | 2 +- src/EnergyPlus/FanCoilUnits.cc | 2 +- src/EnergyPlus/Fans.cc | 2 +- src/EnergyPlus/FaultsManager.cc | 10 +- src/EnergyPlus/FileSystem.cc | 2 +- src/EnergyPlus/FluidProperties.cc | 8 +- src/EnergyPlus/FuelCellElectricGenerator.cc | 2 +- src/EnergyPlus/General.cc | 12 +- src/EnergyPlus/GeneralRoutines.cc | 12 +- src/EnergyPlus/GlobalNames.cc | 10 +- src/EnergyPlus/GroundHeatExchangers.cc | 44 +- .../GroundTemperatureModelManager.cc | 2 +- src/EnergyPlus/HVACControllers.cc | 4 +- src/EnergyPlus/HVACUnitaryBypassVAV.cc | 8 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 8 +- src/EnergyPlus/HWBaseboardRadiator.cc | 2 +- src/EnergyPlus/HeatBalFiniteDiffManager.cc | 2 +- src/EnergyPlus/HeatBalanceAirManager.cc | 38 +- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 2 +- .../HeatBalanceInternalHeatGains.cc | 2 +- src/EnergyPlus/HeatBalanceKivaManager.cc | 2 +- src/EnergyPlus/HeatBalanceManager.cc | 32 +- src/EnergyPlus/HeatRecovery.cc | 4 +- src/EnergyPlus/HeatingCoils.cc | 2 +- src/EnergyPlus/HighTempRadiantSystem.cc | 6 +- src/EnergyPlus/HybridModel.cc | 4 +- src/EnergyPlus/ICEngineElectricGenerator.cc | 2 +- src/EnergyPlus/IOFiles.cc | 2 +- .../InputProcessing/InputProcessor.cc | 18 +- src/EnergyPlus/InternalHeatGains.cc | 8 +- src/EnergyPlus/Material.cc | 20 +- .../MicroturbineElectricGenerator.cc | 2 +- src/EnergyPlus/MixedAir.cc | 8 +- src/EnergyPlus/MundtSimMgr.cc | 18 +- src/EnergyPlus/OutdoorAirUnit.cc | 4 +- src/EnergyPlus/OutputProcessor.cc | 54 +- src/EnergyPlus/OutputReportTabular.cc | 10 +- src/EnergyPlus/PackagedThermalStorageCoil.cc | 6 +- .../PhotovoltaicThermalCollectors.cc | 2 +- src/EnergyPlus/PipeHeatTransfer.cc | 2 +- src/EnergyPlus/Plant/PlantManager.cc | 4 +- src/EnergyPlus/PlantChillers.cc | 22 +- src/EnergyPlus/PlantCondLoopOperation.cc | 4 +- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 86 +- src/EnergyPlus/PlantPipingSystemsManager.cc | 2 +- src/EnergyPlus/PluginManager.cc | 30 +- src/EnergyPlus/PoweredInductionUnits.cc | 2 +- src/EnergyPlus/Pumps.cc | 20 +- src/EnergyPlus/ReportCoilSelection.cc | 7 +- src/EnergyPlus/ReturnAirPathManager.cc | 2 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 83 +- src/EnergyPlus/RoomAirModelManager.cc | 1932 ++++++++--------- src/EnergyPlus/RoomAirModelManager.hh | 2 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 2 +- src/EnergyPlus/RuntimeLanguageProcessor.cc | 8 +- src/EnergyPlus/SQLiteProcedures.cc | 2 +- src/EnergyPlus/SQLiteProcedures.hh | 6 +- src/EnergyPlus/ScheduleManager.cc | 6 +- src/EnergyPlus/SetPointManager.cc | 14 +- src/EnergyPlus/SimulationManager.cc | 8 +- src/EnergyPlus/SizingManager.cc | 18 +- src/EnergyPlus/SolarCollectors.cc | 2 +- src/EnergyPlus/SteamCoils.cc | 4 +- src/EnergyPlus/SurfaceGeometry.cc | 22 +- src/EnergyPlus/SystemAvailabilityManager.cc | 12 +- src/EnergyPlus/SystemReports.cc | 12 +- src/EnergyPlus/ThermalComfort.cc | 4 +- src/EnergyPlus/UnitHeater.cc | 2 +- src/EnergyPlus/UnitVentilator.cc | 12 +- src/EnergyPlus/UnitarySystem.cc | 120 +- src/EnergyPlus/UserDefinedComponents.cc | 6 +- src/EnergyPlus/UtilityRoutines.cc | 24 +- src/EnergyPlus/UtilityRoutines.hh | 12 +- src/EnergyPlus/VentilatedSlab.cc | 12 +- src/EnergyPlus/WaterThermalTanks.cc | 42 +- src/EnergyPlus/WaterToAirHeatPump.cc | 4 +- src/EnergyPlus/WaterUse.cc | 4 +- src/EnergyPlus/WeatherManager.cc | 20 +- src/EnergyPlus/WindTurbine.cc | 4 +- src/EnergyPlus/WindowManager.cc | 2 +- src/EnergyPlus/WindowModel.cc | 2 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 64 +- src/EnergyPlus/api/datatransfer.cc | 34 +- .../unit/ConvectionCoefficients.unit.cc | 4 +- .../unit/DisplacementVentMgr.unit.cc | 2 +- .../unit/EconomicLifeCycleCost.unit.cc | 26 +- .../unit/HeatBalanceIntRadExchange.unit.cc | 40 +- .../unit/HeatBalanceManager.unit.cc | 6 +- tst/EnergyPlus/unit/InputProcessor.unit.cc | 4 +- .../unit/RoomAirflowNetwork.unit.cc | 2 +- tst/EnergyPlus/unit/SQLite.unit.cc | 6 +- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 96 +- tst/EnergyPlus/unit/SystemReports.unit.cc | 8 +- tst/EnergyPlus/unit/ThermalComfort.unit.cc | 4 +- 133 files changed, 2167 insertions(+), 2430 deletions(-) diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 661706d7248..f4d53ba3fbb 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -225,8 +225,8 @@ namespace AirLoopHVACDOAS { ++AirLoopMixerNum; AirLoopMixer thisMixer; - thisMixer.name = UtilityRoutines::MakeUPPERCase(thisObjectName); - thisMixer.OutletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("outlet_node_name").get()); + thisMixer.name = UtilityRoutines::makeUPPER(thisObjectName); + thisMixer.OutletNodeName = UtilityRoutines::makeUPPER(fields.at("outlet_node_name").get()); thisMixer.m_AirLoopMixer_Num = AirLoopMixerNum - 1; thisMixer.OutletNodeNum = NodeInputManager::GetOnlySingleNode(state, thisMixer.OutletNodeName, @@ -245,7 +245,7 @@ namespace AirLoopHVACDOAS { int num = 0; for (auto const &NodeDOASName : NodeArray) { num += 1; - std::string name = UtilityRoutines::MakeUPPERCase(NodeDOASName.at("inlet_node_name").get()); + std::string name = UtilityRoutines::makeUPPER(NodeDOASName.at("inlet_node_name").get()); int NodeNum = UtilityRoutines::FindItemInList(name, state.dataLoopNodes->NodeID); if (NodeNum > 0 && num <= thisMixer.numOfInletNodes) { thisMixer.InletNodeName.push_back(name); @@ -380,8 +380,8 @@ namespace AirLoopHVACDOAS { ++AirLoopSplitterNum; AirLoopSplitter thisSplitter; - thisSplitter.name = UtilityRoutines::MakeUPPERCase(thisObjectName); - thisSplitter.InletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("inlet_node_name").get()); + thisSplitter.name = UtilityRoutines::makeUPPER(thisObjectName); + thisSplitter.InletNodeName = UtilityRoutines::makeUPPER(fields.at("inlet_node_name").get()); thisSplitter.m_AirLoopSplitter_Num = AirLoopSplitterNum - 1; auto NodeNames = fields.find("nodes"); @@ -391,7 +391,7 @@ namespace AirLoopHVACDOAS { int num = 0; for (auto const &NodeDOASName : NodeArray) { num += 1; - std::string name = UtilityRoutines::MakeUPPERCase(NodeDOASName.at("outlet_node_name").get()); + std::string name = UtilityRoutines::makeUPPER(NodeDOASName.at("outlet_node_name").get()); int NodeNum = UtilityRoutines::FindItemInList(name, state.dataLoopNodes->NodeID); if (NodeNum > 0 && num <= thisSplitter.numOfOutletNodes) { thisSplitter.OutletNodeName.push_back(name); @@ -431,9 +431,9 @@ namespace AirLoopHVACDOAS { ++AirLoopDOASNum; AirLoopDOAS thisDOAS; - thisDOAS.Name = UtilityRoutines::MakeUPPERCase(thisObjectName); + thisDOAS.Name = UtilityRoutines::makeUPPER(thisObjectName); // get OA and avail num - thisDOAS.OASystemName = UtilityRoutines::MakeUPPERCase(fields.at("airloophvac_outdoorairsystem_name").get()); + thisDOAS.OASystemName = UtilityRoutines::makeUPPER(fields.at("airloophvac_outdoorairsystem_name").get()); thisDOAS.m_OASystemNum = UtilityRoutines::FindItemInList(thisDOAS.OASystemName, state.dataAirLoop->OutsideAirSys); if (thisDOAS.m_OASystemNum == 0) { cFieldName = "AirLoopHVAC:OutdoorAirSystem Name"; @@ -466,8 +466,8 @@ namespace AirLoopHVACDOAS { bool InletNodeErrFlag = false; bool OutletNodeErrFlag = false; - const std::string typeNameUC = UtilityRoutines::MakeUPPERCase(thisOutsideAirSys.ComponentType(CompNum)); - ValidEquipListType foundType = static_cast(getEnumerationValue(validEquipNamesUC, typeNameUC)); + const std::string typeNameUC = UtilityRoutines::makeUPPER(thisOutsideAirSys.ComponentType(CompNum)); + ValidEquipListType foundType = static_cast(getEnumValue(validEquipNamesUC, typeNameUC)); switch (foundType) { case ValidEquipListType::OutdoorAirMixer: @@ -713,7 +713,7 @@ namespace AirLoopHVACDOAS { thisDOAS.m_HeatExchangerFlag = true; } - thisDOAS.AvailManagerSchedName = UtilityRoutines::MakeUPPERCase(fields.at("availability_schedule_name").get()); + thisDOAS.AvailManagerSchedName = UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); thisDOAS.m_AvailManagerSchedPtr = ScheduleManager::GetScheduleIndex(state, thisDOAS.AvailManagerSchedName); if (thisDOAS.m_AvailManagerSchedPtr == 0) { cFieldName = "Availability Schedule Name"; @@ -723,7 +723,7 @@ namespace AirLoopHVACDOAS { errorsFound = true; } - thisDOAS.AirLoopMixerName = UtilityRoutines::MakeUPPERCase(fields.at("airloophvac_mixer_name").get()); // + thisDOAS.AirLoopMixerName = UtilityRoutines::makeUPPER(fields.at("airloophvac_mixer_name").get()); // thisDOAS.m_AirLoopMixerIndex = getAirLoopMixerIndex(state, thisDOAS.AirLoopMixerName); if (thisDOAS.m_AirLoopMixerIndex < 0) { cFieldName = "AirLoopHVAC:Mixer Name"; @@ -733,7 +733,7 @@ namespace AirLoopHVACDOAS { } AirLoopMixer thisAirLoopMixer; thisDOAS.m_CompPointerAirLoopMixer = thisAirLoopMixer.factory(state, thisDOAS.m_AirLoopMixerIndex, thisDOAS.AirLoopMixerName); - thisDOAS.AirLoopSplitterName = UtilityRoutines::MakeUPPERCase(fields.at("airloophvac_splitter_name").get()); // + thisDOAS.AirLoopSplitterName = UtilityRoutines::makeUPPER(fields.at("airloophvac_splitter_name").get()); // thisDOAS.m_AirLoopSplitterIndex = getAirLoopSplitterIndex(state, thisDOAS.AirLoopSplitterName); if (thisDOAS.m_AirLoopSplitterIndex < 0) { cFieldName = "AirLoopHVAC:Splitter Name"; @@ -766,7 +766,7 @@ namespace AirLoopHVACDOAS { auto const &AirLoopArray = AirLoopNames.value(); int num = 0; for (auto const &AirLoopHVACName : AirLoopArray) { - std::string name = UtilityRoutines::MakeUPPERCase(AirLoopHVACName.at("airloophvac_name").get()); + std::string name = UtilityRoutines::makeUPPER(AirLoopHVACName.at("airloophvac_name").get()); int LoopNum = UtilityRoutines::FindItemInList(name, state.dataAirSystemsData->PrimaryAirSystems); num += 1; if (LoopNum > 0 && num <= thisDOAS.NumOfAirLoops) { diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 838065ed442..71cc6e0428e 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -343,7 +343,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); Real64 temperature(20.0); if (fields.find("reference_temperature") != fields.end()) { // required field, has default value temperature = fields.at("reference_temperature").get(); @@ -403,7 +403,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_at_reference_conditions")}; // Required field @@ -417,7 +417,7 @@ namespace AirflowNetwork { if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto refCrackCondName = fields.at("reference_crack_conditions").get(); - auto result = referenceConditions.find(UtilityRoutines::MakeUPPERCase(refCrackCondName)); + auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName)); if (result == referenceConditions.end()) { ShowSevereError(m_state, format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".", @@ -461,7 +461,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_when_the_zone_exhaust_fan_is_off_at_reference_conditions")}; // Required field @@ -506,7 +506,7 @@ namespace AirflowNetwork { if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto refCrackCondName = fields.at("reference_crack_conditions").get(); - auto result = referenceConditions.find(UtilityRoutines::MakeUPPERCase(refCrackCondName)); + auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName)); if (result == referenceConditions.end()) { ShowSevereError(m_state, format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".", @@ -562,10 +562,10 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround - std::string mixer_name = UtilityRoutines::MakeUPPERCase(fields.at("outdoor_air_mixer_name").get()); + std::string mixer_name = UtilityRoutines::makeUPPER(fields.at("outdoor_air_mixer_name").get()); Real64 coeff{fields.at("air_mass_flow_coefficient_when_no_outdoor_air_flow_at_reference_conditions")}; Real64 expnt{0.65}; if (fields.find("air_mass_flow_exponent_when_no_outdoor_air_flow") != fields.end()) { @@ -589,7 +589,7 @@ namespace AirflowNetwork { if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto refCrackCondName = fields.at("reference_crack_conditions").get(); - auto result = referenceConditions.find(UtilityRoutines::MakeUPPERCase(refCrackCondName)); + auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName)); if (result == referenceConditions.end()) { ShowSevereError(m_state, format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".", @@ -643,10 +643,10 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround - std::string mixer_name = UtilityRoutines::MakeUPPERCase(fields.at("outdoor_air_mixer_name").get()); + std::string mixer_name = UtilityRoutines::makeUPPER(fields.at("outdoor_air_mixer_name").get()); Real64 coeff{fields.at("air_mass_flow_coefficient_when_no_outdoor_air_flow_at_reference_conditions")}; Real64 expnt{0.65}; if (fields.find("air_mass_flow_exponent_when_no_outdoor_air_flow") != fields.end()) { @@ -667,7 +667,7 @@ namespace AirflowNetwork { if (!conditionsAreDefaulted) { if (fields.find("reference_crack_conditions") != fields.end()) { // not required field, *should* have default value auto refCrackCondName = fields.at("reference_crack_conditions").get(); - auto result = referenceConditions.find(UtilityRoutines::MakeUPPERCase(refCrackCondName)); + auto result = referenceConditions.find(UtilityRoutines::makeUPPER(refCrackCondName)); if (result == referenceConditions.end()) { ShowSevereError(m_state, format("{}: {}: {}. Cannot find reference crack conditions object \"{}\".", @@ -720,7 +720,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")}; @@ -1003,7 +1003,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")}; @@ -1046,7 +1046,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient_when_opening_is_closed")}; @@ -1092,7 +1092,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 ela{fields.at("effective_leakage_area")}; @@ -1144,7 +1144,7 @@ namespace AirflowNetwork { instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 flow_rate{fields.at("air_flow_value")}; @@ -1193,7 +1193,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 coeff{fields.at("air_mass_flow_coefficient")}; @@ -1231,7 +1231,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 elr{fields.at("effective_leakage_ratio")}; @@ -1273,7 +1273,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 L{fields.at("duct_length")}; @@ -1358,10 +1358,10 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround - std::string fan_name = UtilityRoutines::MakeUPPERCase(fields.at("fan_name").get()); + std::string fan_name = UtilityRoutines::makeUPPER(fields.at("fan_name").get()); std::string fan_type = fields.at("supply_fan_object_type").get(); int fanIndex; @@ -1370,7 +1370,7 @@ namespace AirflowNetwork { int inletNode; int outletNode; - if (UtilityRoutines::SameString(UtilityRoutines::MakeUPPERCase(fan_type), "FAN:SYSTEMMODEL")) { + if (UtilityRoutines::SameString(UtilityRoutines::makeUPPER(fan_type), "FAN:SYSTEMMODEL")) { m_state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(m_state, fan_name)); fanIndex = HVACFan::getFanObjectVectorIndex(m_state, fan_name); if (fanIndex < 0) { @@ -1477,7 +1477,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - // auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround std::string coil_name = fields.at("coil_name").get(); @@ -1485,7 +1485,7 @@ namespace AirflowNetwork { Real64 L{fields.at("air_path_length")}; Real64 D{fields.at("air_path_hydraulic_diameter")}; - DisSysCompCoilData(i).name = UtilityRoutines::MakeUPPERCase(coil_name); // Name of associated EPlus coil component + DisSysCompCoilData(i).name = UtilityRoutines::makeUPPER(coil_name); // Name of associated EPlus coil component DisSysCompCoilData(i).EPlusType = coil_type; // coil type DisSysCompCoilData(i).L = L; // Air path length DisSysCompCoilData(i).hydraulicDiameter = D; // Air path hydraulic diameter @@ -1517,7 +1517,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - // auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround std::string hx_name = fields.at("heatexchanger_name").get(); @@ -1525,7 +1525,7 @@ namespace AirflowNetwork { Real64 L{fields.at("air_path_length")}; Real64 D{fields.at("air_path_hydraulic_diameter")}; - DisSysCompHXData(i).name = UtilityRoutines::MakeUPPERCase(hx_name); // Name of associated EPlus heat exchange component + DisSysCompHXData(i).name = UtilityRoutines::makeUPPER(hx_name); // Name of associated EPlus heat exchange component DisSysCompHXData(i).EPlusType = hx_type; // coil type DisSysCompHXData(i).L = L; // Air path length DisSysCompHXData(i).hydraulicDiameter = D; // Air path hydraulic diameter @@ -1557,7 +1557,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - // auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + // auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround std::string tu_name = fields.at("terminal_unit_name").get(); @@ -1565,7 +1565,7 @@ namespace AirflowNetwork { Real64 L{fields.at("air_path_length")}; Real64 D{fields.at("air_path_hydraulic_diameter")}; - DisSysCompTermUnitData(i).name = UtilityRoutines::MakeUPPERCase(tu_name); // Name of associated EPlus coil component + DisSysCompTermUnitData(i).name = UtilityRoutines::makeUPPER(tu_name); // Name of associated EPlus coil component DisSysCompTermUnitData(i).EPlusType = tu_type; // Terminal unit type DisSysCompTermUnitData(i).L = L; // Air path length DisSysCompTermUnitData(i).hydraulicDiameter = D; // Air path hydraulic diameter @@ -1597,7 +1597,7 @@ namespace AirflowNetwork { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - auto const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + auto const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); m_state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, instance.key()); // Temporary workaround Real64 dp{fields.at("pressure_difference_across_the_component")}; @@ -1986,7 +1986,7 @@ namespace AirflowNetwork { // Find a flag for possible combination of vent and distribution system // This SELECT_CASE_var will go on input refactor, no need to fix { - auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(Alphas(2))); + auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(Alphas(2))); if (SELECT_CASE_var == "NOMULTIZONEORDISTRIBUTION") { simulation_control.type = ControlType::NoMultizoneOrDistribution; SimAirNetworkKey = "NoMultizoneOrDistribution"; @@ -2264,11 +2264,11 @@ namespace AirflowNetwork { cNumericFields); simulation_control.ductSizing.name = Alphas(1); - if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::MakeUPPERCase("MaximumVelocity"))) { + if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("MaximumVelocity"))) { simulation_control.ductSizing.method = DuctSizingMethod::MaxVelocity; - } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::MakeUPPERCase("PressureLoss"))) { + } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("PressureLoss"))) { simulation_control.ductSizing.method = DuctSizingMethod::PressureLoss; - } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::MakeUPPERCase("PressureLossWithMaximumVelocity"))) { + } else if (UtilityRoutines::SameString(Alphas(2), UtilityRoutines::makeUPPER("PressureLossWithMaximumVelocity"))) { simulation_control.ductSizing.method = DuctSizingMethod::VelocityAndLoss; } else { ShowSevereError(m_state, format("{} {} object, {} = {} is invalid.", RoutineName, CurrentModuleObject, cAlphaFields(2), Alphas(2))); @@ -2452,7 +2452,7 @@ namespace AirflowNetwork { { // These SELECT_CASE_vars will go on input refactor, no need to fix - auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(MultizoneZoneData(i).VentControl)); + auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(MultizoneZoneData(i).VentControl)); if (SELECT_CASE_var == "TEMPERATURE") { // checks on Temperature control if (MultizoneZoneData(i).LowValueTemp < 0.0) { // Code will never be executed, validation will catch invalid input @@ -2720,7 +2720,7 @@ namespace AirflowNetwork { if (!lAlphaBlanks(5)) MultizoneSurfaceData(i).VentSchName = Alphas(5); { // This SELECT_CASE_var will go on input refactor, no need to fix - auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(MultizoneSurfaceData(i).VentControl)); + auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(MultizoneSurfaceData(i).VentControl)); if (SELECT_CASE_var == "TEMPERATURE") { MultizoneSurfaceData(i).VentSurfCtrNum = VentControlType::Temp; MultizoneSurfaceData(i).IndVentControl = true; @@ -4116,7 +4116,7 @@ namespace AirflowNetwork { { // This SELECT_CASE_var will go on input refactor, no need to fix - auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(Alphas(3))); + auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(Alphas(3))); if (SELECT_CASE_var == "AIRFLOWNETWORK:MULTIZONE:COMPONENT:ZONEEXHAUSTFAN") { PressureControllerData(i).ControlTypeSet = PressureCtrlExhaust; } else if (SELECT_CASE_var == "AIRFLOWNETWORK:DISTRIBUTION:COMPONENT:RELIEFAIRFLOW") { @@ -10513,7 +10513,7 @@ namespace AirflowNetwork { MultiSpeedHPIndicator = 0; for (int i = 1; i <= DisSysNumOfCoils; ++i) { { - auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(DisSysCompCoilData(i).EPlusType)); + auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(DisSysCompCoilData(i).EPlusType)); if (SELECT_CASE_var == "COIL:COOLING:DX") { ValidateComponent(m_state, "Coil:Cooling:DX", DisSysCompCoilData(i).name, IsNotOK, format(RoutineName) + CurrentModuleObject); @@ -10690,7 +10690,7 @@ namespace AirflowNetwork { CurrentModuleObject = "AirflowNetwork:Distribution:Component:HeatExchanger"; for (int i = 1; i <= DisSysNumOfHXs; ++i) { { - auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(DisSysCompHXData(i).EPlusType)); + auto const SELECT_CASE_var(UtilityRoutines::makeUPPER(DisSysCompHXData(i).EPlusType)); if (SELECT_CASE_var == "HEATEXCHANGER:AIRTOAIR:FLATPLATE") { ValidateComponent( @@ -11790,7 +11790,7 @@ namespace AirflowNetwork { } if (m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).NumSubComps == 0) { DataLoopNode::ConnectionObjectType TypeOfComp = - static_cast(EnergyPlus::getEnumerationValue( + static_cast(EnergyPlus::getEnumValue( BranchNodeConnections::ConnectionObjectTypeNamesUC, m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).TypeOf)); std::string const &NameOfComp = diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index 6455e7e8edd..c0a25acda28 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -216,7 +216,7 @@ namespace BaseboardElectric { ++BaseboardNum; auto &thisBaseboard = baseboard->baseboards(BaseboardNum); thisBaseboard.EquipName = state.dataIPShortCut->cAlphaArgs(1); // name of this baseboard - thisBaseboard.EquipType = UtilityRoutines::MakeUPPERCase(cCurrentModuleObject); // the type of baseboard-rename change + thisBaseboard.EquipType = UtilityRoutines::makeUPPER(cCurrentModuleObject); // the type of baseboard-rename change thisBaseboard.Schedule = state.dataIPShortCut->cAlphaArgs(2); if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { thisBaseboard.SchedPtr = ScheduleManager::ScheduleAlwaysOn; diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index 61e87b39eb6..11053f560e1 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -196,7 +196,7 @@ namespace BoilerSteam { thisBoiler.Name = state.dataIPShortCut->cAlphaArgs(1); // Validate fuel type input - thisBoiler.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(2))); + thisBoiler.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(2))); // INPUTS from the IDF file thisBoiler.BoilerMaxOperPress = state.dataIPShortCut->rNumericArgs(1); diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index 7f7a12d8dd6..3d37f682608 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -206,7 +206,7 @@ void GetBoilerInput(EnergyPlusData &state) thisBoiler.Type = DataPlant::PlantEquipmentType::Boiler_Simple; // Validate fuel type input - thisBoiler.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(2))); + thisBoiler.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(2))); thisBoiler.NomCap = state.dataIPShortCut->rNumericArgs(1); if (state.dataIPShortCut->rNumericArgs(1) == 0.0) { diff --git a/src/EnergyPlus/BranchNodeConnections.cc b/src/EnergyPlus/BranchNodeConnections.cc index ac6567bb98d..6ab32aab23e 100644 --- a/src/EnergyPlus/BranchNodeConnections.cc +++ b/src/EnergyPlus/BranchNodeConnections.cc @@ -1790,15 +1790,15 @@ void SetUpCompSets(EnergyPlusData &state, // inlet/outlet nodes have been input. This routine assumes that identical // "CompSets" cannot be used in multiple places and issues a warning if they are. - std::string ParentTypeUC = UtilityRoutines::MakeUPPERCase(ParentType); - std::string CompTypeUC = UtilityRoutines::MakeUPPERCase(CompType); + std::string ParentTypeUC = UtilityRoutines::makeUPPER(ParentType); + std::string CompTypeUC = UtilityRoutines::makeUPPER(CompType); // TODO: Refactor this away by passing in enums DataLoopNode::ConnectionObjectType ParentTypeEnum = - static_cast(getEnumerationValue(ConnectionObjectTypeNamesUC, ParentTypeUC)); + static_cast(getEnumValue(ConnectionObjectTypeNamesUC, ParentTypeUC)); assert(ParentTypeEnum != DataLoopNode::ConnectionObjectType::Invalid); DataLoopNode::ConnectionObjectType ComponentTypeEnum = - static_cast(getEnumerationValue(ConnectionObjectTypeNamesUC, CompTypeUC)); + static_cast(getEnumValue(ConnectionObjectTypeNamesUC, CompTypeUC)); assert(ComponentTypeEnum != DataLoopNode::ConnectionObjectType::Invalid); int Found = 0; @@ -1957,9 +1957,9 @@ void SetUpCompSets(EnergyPlusData &state, state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).ComponentObjectType = ComponentTypeEnum; state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).CName = CompName; state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).InletNodeName = - UtilityRoutines::MakeUPPERCase(InletNode); // TODO: Fix this.... + UtilityRoutines::makeUPPER(InletNode); // TODO: Fix this.... state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).OutletNodeName = - UtilityRoutines::MakeUPPERCase(OutletNode); // TODO: Fix this.... + UtilityRoutines::makeUPPER(OutletNode); // TODO: Fix this.... if (!Description.empty()) { state.dataBranchNodeConnections->CompSets(state.dataBranchNodeConnections->NumCompSets).Description = Description; } else { @@ -2092,10 +2092,10 @@ void TestCompSet(EnergyPlusData &state, // c) If not found, call SetUpCompSets (with parent type and name UNDEFINED) // to add a new item in the CompSets array - std::string CompTypeUC = UtilityRoutines::MakeUPPERCase(CompType); + std::string CompTypeUC = UtilityRoutines::makeUPPER(CompType); // TODO: Refactor this away by passing in enums DataLoopNode::ConnectionObjectType ComponentTypeEnum = - static_cast(getEnumerationValue(ConnectionObjectTypeNamesUC, CompTypeUC)); + static_cast(getEnumValue(ConnectionObjectTypeNamesUC, CompTypeUC)); assert(ComponentTypeEnum != DataLoopNode::ConnectionObjectType::Invalid); // See if Already there diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc index 13bce9b2821..c07b1a2000d 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -316,7 +316,7 @@ namespace CTElectricGenerator { // Validate fuel type input state.dataCTElectricGenerator->CTGenerator(genNum).FuelType = - static_cast(getEnumerationValue(Constant::eFuelNamesUC, AlphArray(11))); + static_cast(getEnumValue(Constant::eFuelNamesUC, AlphArray(11))); if (state.dataCTElectricGenerator->CTGenerator(genNum).FuelType == Constant::eFuel::Invalid) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(11), AlphArray(11))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index b9c31f7efe1..c918dcf9bbe 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -449,7 +449,7 @@ void GetBLASTAbsorberInput(EnergyPlusData &state) thisChiller.PumpPowerCoef[2] = state.dataIPShortCut->rNumericArgs(14); thisChiller.TempLowLimitEvapOut = state.dataIPShortCut->rNumericArgs(15); - thisChiller.FlowMode = static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(8))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(8))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerElectricASHRAE205.cc b/src/EnergyPlus/ChillerElectricASHRAE205.cc index 998a6f43ebd..fc85aff6e07 100644 --- a/src/EnergyPlus/ChillerElectricASHRAE205.cc +++ b/src/EnergyPlus/ChillerElectricASHRAE205.cc @@ -146,7 +146,7 @@ void getChillerASHRAE205Input(EnergyPlusData &state) ++ChillerNum; auto &thisChiller = state.dataChillerElectricASHRAE205->Electric205Chiller(ChillerNum); - thisChiller.Name = UtilityRoutines::MakeUPPERCase(thisObjectName); + thisChiller.Name = UtilityRoutines::makeUPPER(thisObjectName); ip->markObjectAsUsed(state.dataIPShortCut->cCurrentModuleObject, thisObjectName); std::string const rep_file_name = ip->getAlphaFieldValue(fields, objectSchemaProps, "representation_file_name"); @@ -169,7 +169,7 @@ void getChillerASHRAE205Input(EnergyPlusData &state) ErrorsFound = true; } thisChiller.InterpolationType = - InterpMethods[UtilityRoutines::MakeUPPERCase(ip->getAlphaFieldValue(fields, objectSchemaProps, "performance_interpolation_method"))]; + InterpMethods[UtilityRoutines::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "performance_interpolation_method"))]; const auto &compressorSequence = thisChiller.Representation->performance.performance_map_cooling.grid_variables.compressor_sequence_number; // minmax_element is sound but perhaps overkill; as sequence numbers are required by A205 to be in ascending order @@ -260,7 +260,7 @@ void getChillerASHRAE205Input(EnergyPlusData &state) "Condenser Water Nodes"); thisChiller.FlowMode = static_cast( - getEnumerationValue(DataPlant::FlowModeNamesUC, ip->getAlphaFieldValue(fields, objectSchemaProps, "chiller_flow_mode"))); + getEnumValue(DataPlant::FlowModeNamesUC, ip->getAlphaFieldValue(fields, objectSchemaProps, "chiller_flow_mode"))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\"", std::string{RoutineName}, state.dataIPShortCut->cCurrentModuleObject, thisObjectName)); @@ -294,8 +294,8 @@ void getChillerASHRAE205Input(EnergyPlusData &state) } } - thisChiller.AmbientTempType = static_cast(getEnumerationValue( - AmbientTempNamesUC, UtilityRoutines::MakeUPPERCase(ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_indicator")))); + thisChiller.AmbientTempType = static_cast(getEnumValue( + AmbientTempNamesUC, UtilityRoutines::makeUPPER(ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_indicator")))); switch (thisChiller.AmbientTempType) { case AmbientTempIndicator::Schedule: { std::string const ambient_temp_schedule = ip->getAlphaFieldValue(fields, objectSchemaProps, "ambient_temperature_schedule"); diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 382f7955f34..f5a27acea9f 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -445,7 +445,7 @@ void GetElectricEIRChillerInput(EnergyPlusData &state) } thisChiller.FlowMode = - static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index d686248ff6f..b20bebe4b59 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -514,7 +514,7 @@ void GetGasAbsorberInput(EnergyPlusData &state) thisChiller.SizFac = state.dataIPShortCut->rNumericArgs(17); // Validate fuel type input - thisChiller.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(17))); + thisChiller.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(17))); if (thisChiller.FuelType == Constant::eFuel::Invalid) { ShowSevereError(state, format("{}=\"{}\", invalid value", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(17), state.dataIPShortCut->cAlphaArgs(17))); diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index b33640d19a7..2d4897cf871 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -442,7 +442,7 @@ void GetIndirectAbsorberInput(EnergyPlusData &state) { thisChiller.FlowMode = - static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(6))); + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(6))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index fcb54330e65..809c1d8edeb 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -400,7 +400,7 @@ void GetElecReformEIRChillerInput(EnergyPlusData &state) { thisChiller.FlowMode = - static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/Coils/CoilCoolingDX.cc b/src/EnergyPlus/Coils/CoilCoolingDX.cc index e5a33c49930..e1c1f06d275 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDX.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDX.cc @@ -84,7 +84,7 @@ int CoilCoolingDX::factory(EnergyPlus::EnergyPlusData &state, std::string const int handle = -1; for (auto const &thisCoil : state.dataCoilCooingDX->coilCoolingDXs) { handle++; - if (EnergyPlus::UtilityRoutines::MakeUPPERCase(coilName) == EnergyPlus::UtilityRoutines::MakeUPPERCase(thisCoil.name)) { + if (EnergyPlus::UtilityRoutines::makeUPPER(coilName) == EnergyPlus::UtilityRoutines::makeUPPER(thisCoil.name)) { return handle; } } diff --git a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc index 1de2008db17..3a6018ce2e7 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc @@ -107,7 +107,7 @@ void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::Ener } // Validate fuel type input this->compressorFuelType = - static_cast(getEnumerationValue(Constant::eFuelNamesUC, UtilityRoutines::MakeUPPERCase(input_data.compressor_fuel_type))); + static_cast(getEnumValue(Constant::eFuelNamesUC, UtilityRoutines::makeUPPER(input_data.compressor_fuel_type))); if (this->compressorFuelType == Constant::eFuel::Invalid) { ShowSevereError(state, std::string{routineName} + this->object_name + "=\"" + this->name + "\", invalid"); ShowContinueError(state, "...Compressor Fuel Type=\"" + input_data.compressor_fuel_type + "\"."); diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 7fa756384b3..2b7d48898b2 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -333,7 +333,7 @@ namespace CondenserLoopTowers { } tower.TowerFreeConvNomCapSizingFactor = NumArray(12); if (NumAlphas >= 4) { - tower.PerformanceInputMethod_Num = static_cast(getEnumerationValue(PIMNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4)))); + tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); if (tower.PerformanceInputMethod_Num == PIM::Invalid) { ShowSevereError(state, format("{}={}", cCurrentModuleObject, AlphArray(1))); ShowContinueError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), AlphArray(4))); @@ -404,7 +404,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumerationValue(EvapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(6)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); tower.UserEvapLossFactor = NumArray(19); // N11 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(20) / 100.0; // N12, \field Drift Loss Percent @@ -412,7 +412,7 @@ namespace CondenserLoopTowers { tower.SizFac = NumArray(25); // N17 \field Sizing Factor if (tower.SizFac <= 0.0) tower.SizFac = 1.0; - tower.BlowdownMode = static_cast(getEnumerationValue(BlowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(7)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(7)))); tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(8)); if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) { ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8))); @@ -458,7 +458,7 @@ namespace CondenserLoopTowers { tower.CapacityControl = CapacityCtrl::FanCycling; // FanCycling } else { tower.CapacityControl = - static_cast(getEnumerationValue(CapacityCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(11)))); + static_cast(getEnumValue(CapacityCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(11)))); if (tower.CapacityControl == CapacityCtrl::Invalid) { tower.CapacityControl = CapacityCtrl::FanCycling; ShowWarningError(state, @@ -487,7 +487,7 @@ namespace CondenserLoopTowers { // cell control for single speed tower if (!state.dataIPShortCut->lAlphaFieldBlanks(12)) { - tower.cellCtrl = static_cast(getEnumerationValue(CellCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(12)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(12)))); } // High speed air flow rate must be greater than free convection air flow rate. @@ -646,7 +646,7 @@ namespace CondenserLoopTowers { BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); if (NumAlphas >= 4) { - tower.PerformanceInputMethod_Num = static_cast(getEnumerationValue(PIMNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4)))); + tower.PerformanceInputMethod_Num = static_cast(getEnumValue(PIMNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); } else { // Since Performance Input Method has been omitted then assume it to be UA and DESIGN WATER FLOW RATE tower.PerformanceInputMethod_Num = PIM::UFactor; @@ -766,7 +766,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumerationValue(EvapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(6)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); tower.UserEvapLossFactor = NumArray(27); // N23 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(28) / 100.0; // N24, \field Drift Loss Percent @@ -774,7 +774,7 @@ namespace CondenserLoopTowers { tower.SizFac = NumArray(33); // N21 \field Sizing Factor if (tower.SizFac <= 0.0) tower.SizFac = 1.0; - tower.BlowdownMode = static_cast(getEnumerationValue(BlowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(7)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(7)))); tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(8)); if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) { ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8))); @@ -801,7 +801,7 @@ namespace CondenserLoopTowers { // cell control for two speed tower if (!state.dataIPShortCut->lAlphaFieldBlanks(11)) { - tower.cellCtrl = static_cast(getEnumerationValue(CellCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(11)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(11)))); } if (state.dataIPShortCut->lAlphaFieldBlanks(9)) { @@ -1435,7 +1435,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumerationValue(EvapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(8)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(8)))); tower.UserEvapLossFactor = NumArray(11); // N11 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(12) / 100.0; // N12, \field Drift Loss Percent @@ -1443,7 +1443,7 @@ namespace CondenserLoopTowers { tower.SizFac = NumArray(17); // N14 \field Sizing Factor if (tower.SizFac <= 0.0) tower.SizFac = 1.0; - tower.BlowdownMode = static_cast(getEnumerationValue(BlowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(9)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(9)))); tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(10)); if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) { ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(10), AlphArray(10))); @@ -1470,7 +1470,7 @@ namespace CondenserLoopTowers { // cell control for variable speed tower if (!state.dataIPShortCut->lAlphaFieldBlanks(13)) { - tower.cellCtrl = static_cast(getEnumerationValue(CellCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(13)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(13)))); } if (state.dataIPShortCut->lAlphaFieldBlanks(11)) { @@ -1695,7 +1695,7 @@ namespace CondenserLoopTowers { } // begin water use and systems get input - tower.EvapLossMode = static_cast(getEnumerationValue(EvapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(10)))); + tower.EvapLossMode = static_cast(getEnumValue(EvapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(10)))); tower.UserEvapLossFactor = NumArray(23); // N23 , \field Evaporation Loss Factor tower.DriftLossFraction = NumArray(24) / 100.0; // N24, \field Drift Loss Percent @@ -1703,7 +1703,7 @@ namespace CondenserLoopTowers { tower.SizFac = NumArray(29); // N29 \field Sizing Factor if (tower.SizFac <= 0.0) tower.SizFac = 1.0; - tower.BlowdownMode = static_cast(getEnumerationValue(BlowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(11)))); + tower.BlowdownMode = static_cast(getEnumValue(BlowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(11)))); tower.SchedIDBlowdown = ScheduleManager::GetScheduleIndex(state, AlphArray(12)); if ((tower.SchedIDBlowdown == 0) && (tower.BlowdownMode == Blowdown::Schedule)) { ShowSevereError(state, format("Invalid, {} = \"{}\"", state.dataIPShortCut->cAlphaFieldNames(12), AlphArray(12))); @@ -1730,7 +1730,7 @@ namespace CondenserLoopTowers { tower.TowerMassFlowRateMultiplier = tower.MaxFracFlowRate; // cell control for variable speed Merkel tower if (!state.dataIPShortCut->lAlphaFieldBlanks(15)) { - tower.cellCtrl = static_cast(getEnumerationValue(CellCtrlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(15)))); + tower.cellCtrl = static_cast(getEnumValue(CellCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(15)))); } if (state.dataIPShortCut->lAlphaFieldBlanks(13)) { diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index efd3ca0b335..4c9234547bf 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -761,7 +761,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) intConvUserCurve.Name = ipsc->cAlphaArgs(1); ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, intConvUserCurve.Name}; - intConvUserCurve.refTempType = static_cast(getEnumerationValue(RefTempNamesUC, ipsc->cAlphaArgs(2))); + intConvUserCurve.refTempType = static_cast(getEnumValue(RefTempNamesUC, ipsc->cAlphaArgs(2))); if (intConvUserCurve.refTempType == RefTemp::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -856,7 +856,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, extConvUserCurve.Name}; extConvUserCurve.windSpeedType = - static_cast(getEnumerationValue(RefWindNamesUC, UtilityRoutines::MakeUPPERCase(ipsc->cAlphaArgs(2)))); + static_cast(getEnumValue(RefWindNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); if (extConvUserCurve.windSpeedType == RefWind::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; @@ -1039,7 +1039,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) ErrorsFound = true; } - HcExt hcExt = static_cast(getEnumerationValue(HcExtNamesUC, Alphas(Ptr + 1))); + HcExt hcExt = static_cast(getEnumValue(HcExtNamesUC, Alphas(Ptr + 1))); switch (hcExt) { @@ -1160,7 +1160,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) continue; } - HcInt hcInt = static_cast(getEnumerationValue(HcIntNamesUC, Alphas(Ptr + 1))); + HcInt hcInt = static_cast(getEnumValue(HcIntNamesUC, Alphas(Ptr + 1))); switch (hcInt) { // Are these not used anymore? They can be deleted then @@ -1295,7 +1295,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) ipsc->cNumericFieldNames); // Check Field 1 for validity ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, ""}; - SurfaceFilter surfaceFilter = static_cast(getEnumerationValue(SurfaceFilterNamesUC, Alphas(1))); + SurfaceFilter surfaceFilter = static_cast(getEnumValue(SurfaceFilterNamesUC, Alphas(1))); for (int Pass = 1, Ptr = 2, FieldNo = 2, NumField = 1; Pass <= 2; ++Pass, Ptr += 4, FieldNo += 4, ++NumField) { @@ -1303,7 +1303,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) if (Alphas(Ptr) == "OUTSIDE") { - HcExt hcExt = static_cast(getEnumerationValue(HcExtNamesUC, Alphas(Ptr + 1))); + HcExt hcExt = static_cast(getEnumValue(HcExtNamesUC, Alphas(Ptr + 1))); switch (hcExt) { @@ -1411,7 +1411,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) } // switch (hcExt) } else if (Alphas(Ptr) == "INSIDE") { - HcInt hcInt = static_cast(getEnumerationValue(HcIntNamesUC, Alphas(Ptr + 1))); + HcInt hcInt = static_cast(getEnumValue(HcIntNamesUC, Alphas(Ptr + 1))); switch (hcInt) { @@ -1590,7 +1590,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) auto &intAlgo = state.dataConvect->intAdaptiveConvAlgo; for (int iInConvClass = 0, i = 2; iInConvClass < (int)IntConvClass::Num && i <= NumAlphas; ++iInConvClass, i += 2) { - intAlgo.intConvClassEqNums[iInConvClass] = static_cast(getEnumerationValue(HcIntNamesUC, ipsc->cAlphaArgs(i))); + intAlgo.intConvClassEqNums[iInConvClass] = static_cast(getEnumValue(HcIntNamesUC, ipsc->cAlphaArgs(i))); if (intAlgo.intConvClassEqNums[iInConvClass] == HcInt::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(i), ipsc->cAlphaArgs(i)); @@ -1628,7 +1628,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) for (int iOutConvClass = 0, i = 2; i < (int)ExtConvClass::Num && i <= NumAlphas; ++iOutConvClass, i += 2) { - extAlgo.extConvClass2EqNums[iOutConvClass] = static_cast(getEnumerationValue(HcExtNamesUC, ipsc->cAlphaArgs(i))); + extAlgo.extConvClass2EqNums[iOutConvClass] = static_cast(getEnumValue(HcExtNamesUC, ipsc->cAlphaArgs(i))); if (extAlgo.extConvClass2EqNums[iOutConvClass] == HcExt::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(i), ipsc->cAlphaArgs(i)); @@ -1981,9 +1981,9 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, } assert(state.dataRoomAirMod->AirModel.allocated()); - if (state.dataRoomAirMod->AirModel(surface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(surface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(surface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || + state.dataRoomAirMod->AirModel(surface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || + state.dataRoomAirMod->AirModel(surface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { // Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf if (state.dataSurface->surfIntConv(SurfNum).userModelNum != 0) { @@ -1996,7 +1996,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, -surface.CosTilt); // negative CosTilt because CosTilt is relative to exterior } - } else if (state.dataRoomAirMod->AirModel(surface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDCV) { + } else if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDCV) { Hf = 4.3 * Vhc()(surface.Zone); diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index 107b7180fe8..3f80f4eb588 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -233,7 +233,7 @@ namespace CoolTower { { state.dataCoolTower->CoolTowerSys(CoolTowerNum).FlowCtrlType = - static_cast(getEnumerationValue(FlowCtrlNamesUC, state.dataIPShortCut->cAlphaArgs(5))); // Type of flow control + static_cast(getEnumValue(FlowCtrlNamesUC, state.dataIPShortCut->cAlphaArgs(5))); // Type of flow control if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).FlowCtrlType == FlowCtrl::Invalid) { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\".", diff --git a/src/EnergyPlus/CostEstimateManager.cc b/src/EnergyPlus/CostEstimateManager.cc index 1fbbcdd9aa9..6c14058c4bd 100644 --- a/src/EnergyPlus/CostEstimateManager.cc +++ b/src/EnergyPlus/CostEstimateManager.cc @@ -182,7 +182,7 @@ namespace CostEstimateManager { IOStatus); state.dataCostEstimateManager->CostLineItem(Item).LineName = state.dataIPShortCut->cAlphaArgs(1); state.dataCostEstimateManager->CostLineItem(Item).ParentObjType = - static_cast(getEnumerationValue(ParentObjectNamesUC, state.dataIPShortCut->cAlphaArgs(3))); + static_cast(getEnumValue(ParentObjectNamesUC, state.dataIPShortCut->cAlphaArgs(3))); state.dataCostEstimateManager->CostLineItem(Item).ParentObjName = state.dataIPShortCut->cAlphaArgs(4); state.dataCostEstimateManager->CostLineItem(Item).PerEach = state.dataIPShortCut->rNumericArgs(1); state.dataCostEstimateManager->CostLineItem(Item).PerSquareMeter = state.dataIPShortCut->rNumericArgs(2); diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index c38d76f155f..5f6ce90d60d 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -724,7 +724,7 @@ namespace CrossVentMgr { if (thisSurface.Zone == ZoneNum) { if (state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum <= 0) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); - } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModelType == + } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDCV) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum); @@ -737,7 +737,7 @@ namespace CrossVentMgr { if (state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum <= 0) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); - } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModelType == + } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDCV) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum); @@ -747,11 +747,11 @@ namespace CrossVentMgr { } } } else if ((thisSurface.Zone == ZoneNum) && - (state.dataRoomAirMod->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModelType == + (state.dataRoomAirMod->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDCV)) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone); } else if ((thisSurface.Zone != ZoneNum) && - (state.dataRoomAirMod->AirModel(thisSurface.Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDCV)) { + (state.dataRoomAirMod->AirModel(thisSurface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDCV)) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(surfNum); } else { if (thisSurface.Zone == ZoneNum) { diff --git a/src/EnergyPlus/CurveManager.cc b/src/EnergyPlus/CurveManager.cc index 45b9aa5d573..bec8f4694b1 100644 --- a/src/EnergyPlus/CurveManager.cc +++ b/src/EnergyPlus/CurveManager.cc @@ -2269,7 +2269,7 @@ namespace Curve { auto const &fields = instance.value(); std::string const &thisObjectName = instance.key(); state.dataInputProcessing->inputProcessor->markObjectAsUsed("Table:IndependentVariable", thisObjectName); - state.dataCurveManager->btwxtManager.independentVarRefs.emplace(UtilityRoutines::MakeUPPERCase(thisObjectName), fields); + state.dataCurveManager->btwxtManager.independentVarRefs.emplace(UtilityRoutines::makeUPPER(thisObjectName), fields); } } @@ -2285,13 +2285,13 @@ namespace Curve { auto const &fields = instance.value(); std::string const &thisObjectName = instance.key(); state.dataInputProcessing->inputProcessor->markObjectAsUsed("Table:IndependentVariableList", thisObjectName); - std::string varListName = UtilityRoutines::MakeUPPERCase(thisObjectName); + std::string varListName = UtilityRoutines::makeUPPER(thisObjectName); std::vector gridAxes; // Loop through independent variables in list and add them to the grid for (auto &indVar : fields.at("independent_variables")) { - std::string indVarName = UtilityRoutines::MakeUPPERCase(indVar.at("independent_variable_name").get()); + std::string indVarName = UtilityRoutines::makeUPPER(indVar.at("independent_variable_name").get()); std::string contextString = format("Table:IndependentVariable \"{}\"", indVarName); std::pair callbackPair{&state, contextString}; Btwxt::setMessageCallback(BtwxtMessageCallback, &callbackPair); @@ -2404,7 +2404,7 @@ namespace Curve { } } // Add grid to btwxtManager - state.dataCurveManager->btwxtManager.addGrid(UtilityRoutines::MakeUPPERCase(thisObjectName), Btwxt::GriddedData(gridAxes)); + state.dataCurveManager->btwxtManager.addGrid(UtilityRoutines::makeUPPER(thisObjectName), Btwxt::GriddedData(gridAxes)); } } @@ -2419,10 +2419,10 @@ namespace Curve { ++CurveNum; Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum); - thisCurve->Name = UtilityRoutines::MakeUPPERCase(thisObjectName); + thisCurve->Name = UtilityRoutines::makeUPPER(thisObjectName); thisCurve->interpolationType = InterpType::BtwxtMethod; - std::string indVarListName = UtilityRoutines::MakeUPPERCase(fields.at("independent_variable_list_name").get()); + std::string indVarListName = UtilityRoutines::makeUPPER(fields.at("independent_variable_list_name").get()); std::string contextString = format("Table:Lookup \"{}\"", thisCurve->Name); std::pair callbackPair{&state, contextString}; @@ -2963,7 +2963,7 @@ namespace Curve { if (InInputType.empty()) { return true; // if not used it is valid } - CurveInputType found = static_cast(getEnumerationValue(inputTypes, UtilityRoutines::MakeUPPERCase(InInputType))); + CurveInputType found = static_cast(getEnumValue(inputTypes, UtilityRoutines::makeUPPER(InInputType))); return found != CurveInputType::Invalid; } @@ -2991,7 +2991,7 @@ namespace Curve { }; constexpr std::array(CurveOutputType::Num)> outputTypes = { "DIMENSIONLESS", "PRESSURE", "TEMPERATURE", "CAPACITY", "POWER"}; - CurveOutputType found = static_cast(getEnumerationValue(outputTypes, UtilityRoutines::MakeUPPERCase(InOutputType))); + CurveOutputType found = static_cast(getEnumValue(outputTypes, UtilityRoutines::makeUPPER(InOutputType))); return found != CurveOutputType::Invalid; } diff --git a/src/EnergyPlus/DElightManagerF.cc b/src/EnergyPlus/DElightManagerF.cc index ef53bc13de1..ef65bcd08a0 100644 --- a/src/EnergyPlus/DElightManagerF.cc +++ b/src/EnergyPlus/DElightManagerF.cc @@ -836,7 +836,7 @@ namespace DElightManagerF { // FUNCTION INFORMATION: // AUTHOR Robert J. Hitchcock // DATE WRITTEN August 2003 - // MODIFIED From UtilityRoutines::MakeUPPERCase( function by Linda K. Lawrie + // MODIFIED From UtilityRoutines::makeUPPER( function by Linda K. Lawrie // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index b53875349ef..8c61328bad1 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -1731,8 +1731,8 @@ void GetDXCoils(EnergyPlusData &state) state, Alphas2(7), ErrorsFound, - (DataLoopNode::ConnectionObjectType)getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, - UtilityRoutines::MakeUPPERCase(PerfObjectType)), + (DataLoopNode::ConnectionObjectType)getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, + UtilityRoutines::makeUPPER(PerfObjectType)), PerfObjectName, DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::OutsideAirReference, @@ -4017,7 +4017,7 @@ void GetDXCoils(EnergyPlusData &state) } // A12; \field Fuel type, Validate fuel type input - thisDXCoil.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, Alphas(12))); + thisDXCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(12))); thisDXCoil.NumOfSpeeds = Numbers(6); // Number of speeds if (thisDXCoil.NumOfSpeeds < 2) { @@ -4521,7 +4521,7 @@ void GetDXCoils(EnergyPlusData &state) } // A9; \field Fuel type, Validate fuel type input - thisDXCoil.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, Alphas(9))); + thisDXCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(9))); thisDXCoil.RegionNum = Numbers(8); // Region Number for HSPF Calc thisDXCoil.NumOfSpeeds = Numbers(9); // Number of speeds @@ -15504,7 +15504,7 @@ int GetHPCoolingCoilIndex(EnergyPlusData &state, DXCoolingCoilIndex = 0; DataLoopNode::ConnectionObjectType HeatingCoilTypeNum = static_cast( - getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::MakeUPPERCase(HeatingCoilType))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(HeatingCoilType))); DataLoopNode::ConnectionObjectType CompSetsParentType; // Parent object type which uses DX heating coil pass into this function std::string CompSetsParentName; diff --git a/src/EnergyPlus/DataHVACGlobals.cc b/src/EnergyPlus/DataHVACGlobals.cc index b42a7f17412..4e19337557e 100644 --- a/src/EnergyPlus/DataHVACGlobals.cc +++ b/src/EnergyPlus/DataHVACGlobals.cc @@ -200,86 +200,88 @@ namespace DataHVACGlobals { Array1D_string const cVRFHeatingPerformanceOATTypes(NumVRFHeatingPerformanceOATTypes, {"WetBulbTemperature", "DryBulbTemperature"}); - Array1D_string const ZoneHVACTerminalTypes(NumZoneHVACTerminalTypes, - {"ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", - "ZONEHVAC:ENERGYRECOVERYVENTILATOR", - "ZONEHVAC:FOURPIPEFANCOIL", - "ZONEHVAC:OUTDOORAIRUNIT", - "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER", - "ZONEHVAC:PACKAGEDTERMINALHEATPUMP", - "ZONEHVAC:UNITHEATER", - "ZONEHVAC:UNITVENTILATOR", - "ZONEHVAC:VENTILATEDSLAB", - "ZONEHVAC:WATERTOAIRHEATPUMP", - "ZONEHVAC:WINDOWAIRCONDITIONER", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:ELECTRIC", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", - "ZONEHVAC:BASEBOARD:CONVECTIVE:ELECTRIC", - "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", - "ZONEHVAC:HIGHTEMPERATURERADIANT", - "ZONEHVAC:DEHUMIDIFIER:DX", - "ZONEHVAC:IDEALLOADSAIRSYSTEM", - "ZONEHVAC:REFRIGERATIONCHILLERSET", - "ZONEHVAC:HYBRIDUNITARYHVAC", - "FAN:ZONEEXHAUST", - "WATERHEATER:HEATPUMP", - "AIRTERMINAL:DUALDUCT:CONSTANTVOLUME", - "AIRTERMINAL:DUALDUCT:VAV", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:REHEAT", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:NOREHEAT", - "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT", - "AIRTERMINAL:SINGLEDUCT:VAV:NOREHEAT", - "AIRTERMINAL:SINGLEDUCT:SERIESPIU:REHEAT", - "AIRTERMINAL:SINGLEDUCT:PARALLELPIU:REHEAT", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEINDUCTION", - "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT:VARIABLESPEEDFAN", - "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT", - "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:NOREHEAT", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", - "AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR", - "AIRLOOPHVACRETURNAIR"}); - - Array1D_string const ccZoneHVACTerminalTypes(NumZoneHVACTerminalTypes, - {"ZoneHVAC:TerminalUnit:VariableRefrigerantFlow", - "ZoneHVAC:EnergyRecoveryVentilator", - "ZoneHVAC:FourPipeFanCoil", - "ZoneHVAC:OutdoorAirUnit", - "ZoneHVAC:PackagedTerminalAirConditioner", - "ZoneHVAC:PackagedTerminalHeatPump", - "ZoneHVAC:UnitHeater", - "ZoneHVAC:UnitVentilator", - "ZoneHVAC:VentilatedSlab", - "ZoneHVAC:WaterToAirHeatPump", - "ZoneHVAC:WindowAirConditioner", - "ZoneHVAC:Baseboard:RadiantConvective:Electric", - "ZoneHVAC:Baseboard:RadiantConvective:Water", - "ZoneHVAC:Baseboard:RadiantConvective:Steam", - "ZoneHVAC:Baseboard:Convective:Electric", - "ZoneHVAC:Baseboard:Convective:Water", - "ZoneHVAC:HighTemperatureRadiant", - "ZoneHVAC:Dehumidifier:DX", - "ZoneHVAC:IdealLoadsAirSystem", - "ZoneHVAC:RefrigerationChillerSet", - "ZoneHVAC:HybridUnitaryHVAC", - "Fan:ZoneExhaust", - "WaterHeater:HeatPump", - "AirTerminal:DualDuct:ConstantVolume", - "AirTerminal:DualDuct:VAV", - "AirTerminal:SingleDuct:ConstantVolume:Reheat", - "AirTerminal:SingleDuct:ConstantVolume:NoReheat", - "AirTerminal:SingleDuct:VAV:Reheat", - "AirTerminal:SingleDuct:VAV:NoReheat", - "AirTerminal:SingleDuct:SeriesPIU:Reheat", - "AirTerminal:SingleDuct:ParallelPIU:Reheat", - "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction", - "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", - "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", - "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat", - "AirTerminal:SingleDuct:ConstantVolume:CooledBeam", - "AirTerminal:DualDuct:VAV:OutdoorAir", - "AirLoopHVACReturnAir"}); + constexpr std::array zoneEquipTypeNamesUC = { + "DUMMY", + "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", + "ZONEHVAC:ENERGYRECOVERYVENTILATOR", + "ZONEHVAC:FOURPIPEFANCOIL", + "ZONEHVAC:OUTDOORAIRUNIT", + "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER", + "ZONEHVAC:PACKAGEDTERMINALHEATPUMP", + "ZONEHVAC:UNITHEATER", + "ZONEHVAC:UNITVENTILATOR", + "ZONEHVAC:VENTILATEDSLAB", + "ZONEHVAC:WATERTOAIRHEATPUMP", + "ZONEHVAC:WINDOWAIRCONDITIONER", + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:ELECTRIC", + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", + "ZONEHVAC:BASEBOARD:CONVECTIVE:ELECTRIC", + "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", + "ZONEHVAC:HIGHTEMPERATURERADIANT", + "ZONEHVAC:DEHUMIDIFIER:DX", + "ZONEHVAC:IDEALLOADSAIRSYSTEM", + "ZONEHVAC:REFRIGERATIONCHILLERSET", + "ZONEHVAC:HYBRIDUNITARYHVAC", + "FAN:ZONEEXHAUST", + "WATERHEATER:HEATPUMP", + "AIRTERMINAL:DUALDUCT:CONSTANTVOLUME", + "AIRTERMINAL:DUALDUCT:VAV", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:REHEAT", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:NOREHEAT", + "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT", + "AIRTERMINAL:SINGLEDUCT:VAV:NOREHEAT", + "AIRTERMINAL:SINGLEDUCT:SERIESPIU:REHEAT", + "AIRTERMINAL:SINGLEDUCT:PARALLELPIU:REHEAT", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEINDUCTION", + "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT:VARIABLESPEEDFAN", + "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT", + "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:NOREHEAT", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", + "AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR", + "AIRLOOPHVACRETURNAIR"}; + constexpr std::array zoneEquipTypeNames = { + "DUMMY", + "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow", + "ZoneHVAC:EnergyRecoveryVentilator", + "ZoneHVAC:FourPipeFanCoil", + "ZoneHVAC:OutdoorAirUnit", + "ZoneHVAC:PackagedTerminalAirConditioner", + "ZoneHVAC:PackagedTerminalHeatPump", + "ZoneHVAC:UnitHeater", + "ZoneHVAC:UnitVentilator", + "ZoneHVAC:VentilatedSlab", + "ZoneHVAC:WaterToAirHeatPump", + "ZoneHVAC:WindowAirConditioner", + "ZoneHVAC:Baseboard:RadiantConvective:Electric", + "ZoneHVAC:Baseboard:RadiantConvective:Water", + "ZoneHVAC:Baseboard:RadiantConvective:Steam", + "ZoneHVAC:Baseboard:Convective:Electric", + "ZoneHVAC:Baseboard:Convective:Water", + "ZoneHVAC:HighTemperatureRadiant", + "ZoneHVAC:Dehumidifier:DX", + "ZoneHVAC:IdealLoadsAirSystem", + "ZoneHVAC:RefrigerationChillerSet", + "ZoneHVAC:HybridUnitaryHVAC", + "Fan:ZoneExhaust", + "WaterHeater:HeatPump", + "AirTerminal:DualDuct:ConstantVolume", + "AirTerminal:DualDuct:VAV", + "AirTerminal:SingleDuct:ConstantVolume:Reheat", + "AirTerminal:SingleDuct:ConstantVolume:NoReheat", + "AirTerminal:SingleDuct:VAV:Reheat", + "AirTerminal:SingleDuct:VAV:NoReheat", + "AirTerminal:SingleDuct:SeriesPIU:Reheat", + "AirTerminal:SingleDuct:ParallelPIU:Reheat", + "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction", + "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", + "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", + "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat", + "AirTerminal:SingleDuct:ConstantVolume:CooledBeam", + "AirTerminal:DualDuct:VAV:OutdoorAir", + "AirLoopHVACReturnAir"}; + } // namespace DataHVACGlobals } // namespace EnergyPlus diff --git a/src/EnergyPlus/DataHVACGlobals.hh b/src/EnergyPlus/DataHVACGlobals.hh index ceba5d4e247..fa5f8b0a040 100644 --- a/src/EnergyPlus/DataHVACGlobals.hh +++ b/src/EnergyPlus/DataHVACGlobals.hh @@ -373,45 +373,60 @@ namespace DataHVACGlobals { // Parameters for HVACSystemRootFindingAlgorithm int constexpr Bisection(2); - int constexpr NumZoneHVACTerminalTypes = 38; - int constexpr ZoneEquipTypeOf_VariableRefrigerantFlow(1); - int constexpr ZoneEquipTypeOf_EnergyRecoveryVentilator(2); - int constexpr ZoneEquipTypeOf_FourPipeFanCoil(3); - int constexpr ZoneEquipTypeOf_OutdoorAirUnit(4); - int constexpr ZoneEquipTypeOf_PackagedTerminalAirConditioner(5); - int constexpr ZoneEquipTypeOf_PackagedTerminalHeatPump(6); - int constexpr ZoneEquipTypeOf_UnitHeater(7); - int constexpr ZoneEquipTypeOf_UnitVentilator(8); - int constexpr ZoneEquipTypeOf_VentilatedSlab(9); - int constexpr ZoneEquipTypeOf_WaterToAirHeatPump(10); - int constexpr ZoneEquipTypeOf_WindowAirConditioner(11); - int constexpr ZoneEquipTypeOf_BaseboardRadiantConvectiveElectric(12); - int constexpr ZoneEquipTypeOf_BaseboardRadiantConvectiveWater(13); - int constexpr ZoneEquipTypeOf_BaseboardRadiantConvectiveSteam(14); - int constexpr ZoneEquipTypeOf_BaseboardConvectiveElectric(15); - int constexpr ZoneEquipTypeOf_BaseboardConvectiveWater(16); - int constexpr ZoneEquipTypeOf_HighTemperatureRadiant(17); - int constexpr ZoneEquipTypeOf_DehumidifierDX(18); - int constexpr ZoneEquipTypeOf_IdealLoadsAirSystem(19); - int constexpr ZoneEquipTypeOf_RefrigerationChillerSet(20); - int constexpr ZoneEquipTypeOf_HybridUnitaryAirConditioners(21); - int constexpr ZoneEquipTypeOf_FanZoneExhaust(22); - int constexpr ZoneEquipTypeOf_WaterHeaterHeatPump(23); - int constexpr ZoneEquipTypeOf_AirTerminalDualDuctConstantVolume(24); - int constexpr ZoneEquipTypeOf_AirTerminalDualDuctVAV(25); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctConstantVolumeReheat(26); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctConstantVolumeNoReheat(27); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctVAVReheat(28); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctVAVNoReheat(29); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctSeriesPIUReheat(30); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctParallelPIUReheat(31); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctCAVFourPipeInduction(32); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctVAVReheatVariableSpeedFan(33); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctVAVHeatAndCoolReheat(34); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctVAVHeatAndCoolNoReheat(35); - int constexpr ZoneEquipTypeOf_AirTerminalSingleDuctConstantVolumeCooledBeam(36); - int constexpr ZoneEquipTypeOf_AirTerminalDualDuctVAVOutdoorAir(37); - int constexpr ZoneEquipTypeOf_AirLoopHVACReturnAir(38); + enum class ZoneEquipType { + Invalid = -1, + DUMMY, // There is some back and forth with AFN enumerations here that I just don't want to mess with + VariableRefrigerantFlow, // VRFTerminalUnit + EnergyRecoveryVentilator, // ERVStandAlone + FourPipeFanCoil, // FanCoil4Pipe + OutdoorAirUnit, // OutdoorAirUnit + PackagedTerminalAirConditioner, // PkgTermACAirToAir + PackagedTerminalHeatPump, // PkgTermHPAirToAir + UnitHeater, // UnitHeater + UnitVentilator, // UnitVentilator + VentilatedSlab, // VentilatedSlab + WaterToAirHeatPump, // PkgTermHPWaterToAir + WindowAirConditioner, // WindowAC + BaseboardRadiantConvectiveElectric, // BBElectric + BaseboardRadiantConvectiveWater, // BBWater + BaseboardRadiantConvectiveSteam, // BBSteam + BaseboardConvectiveElectric, // BBElectricConvective + BaseboardConvectiveWater, // BBWaterConvective + HighTemperatureRadiant, // HiTempRadiant + DehumidifierDX, // ZoneDXDehumidifier + IdealLoadsAirSystem, // PurchasedAir + RefrigerationChillerSet, // RefrigerationAirChillerSet + HybridUnitaryAirConditioners, + FanZoneExhaust, // FanZoneExhaust + WaterHeaterHeatPump, // HPWaterHeater + AirTerminalDualDuctConstantVolume, + AirTerminalDualDuctVAV, + AirTerminalSingleDuctConstantVolumeReheat, + AirTerminalSingleDuctConstantVolumeNoReheat, + AirTerminalSingleDuctVAVReheat, + AirTerminalSingleDuctVAVNoReheat, + AirTerminalSingleDuctSeriesPIUReheat, + AirTerminalSingleDuctParallelPIUReheat, + AirTerminalSingleDuctCAVFourPipeInduction, + AirTerminalSingleDuctVAVReheatVariableSpeedFan, + AirTerminalSingleDuctVAVHeatAndCoolReheat, + AirTerminalSingleDuctVAVHeatAndCoolNoReheat, + AirTerminalSingleDuctConstantVolumeCooledBeam, + AirTerminalDualDuctVAVOutdoorAir, + AirLoopHVACReturnAir, + Num + }; + + // ZoneEvaporativeCoolerUnit + // ZoneHybridEvaporativeCooler + // AirDistUnit + // LoTempRadiant + // HeatExchanger + // UserDefinedZoneHVACForcedAir + // CoolingPanel + // ZoneUnitarySys + extern const std::array zoneEquipTypeNames; + extern const std::array zoneEquipTypeNamesUC; int constexpr MaxSpeedLevels = 10; @@ -419,8 +434,6 @@ namespace DataHVACGlobals { extern Array1D_string const cAllCoilTypes; extern Array1D_string const cCoolingCoilTypes; extern Array1D_string const cHeatingCoilTypes; - extern Array1D_string const ccZoneHVACTerminalTypes; - extern Array1D_string const ZoneHVACTerminalTypes; extern Array1D_string const cATMixerTypes; extern Array1D_string const cVRFTUTypes; extern Array1D_string const cVRFHeatingPerformanceOATTypes; @@ -575,7 +588,7 @@ struct HVACGlobalsData : BaseGlobalStruct void clear_state() override { - *this = HVACGlobalsData(); + new (this) HVACGlobalsData(); } }; diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index 92c6a914877..47f88781bc0 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -55,6 +55,7 @@ // EnergyPlus Headers #include #include +#include #include #include @@ -82,8 +83,9 @@ namespace DataRoomAirModel { AirflowNetwork, // RoomAirModel_AirflowNetwork interior zone model Num }; - constexpr const char *ChAirModel[] = { - "*Invalid*", "UserDefined", "Mixing", "Mundt", "UCSD_DV", "UCSD_CV", "UCSD_UFI", "UCSD_UFE", "AirflowNetwork"}; + + extern const std::array roomAirModelNames; + extern const std::array roomAirModelNamesUC; // Parameters to indicate air temperature coupling scheme enum class CouplingScheme @@ -98,18 +100,20 @@ namespace DataRoomAirModel { enum class AirNodeType { Invalid = -1, - InletAir, // air node at inlet (for Mundt and Rees&Haves Models) - FloorAir, // air node at floor (for Mundt and Rees&Haves Models) - ControlAir, // air node at control point (for Mundt Model) - CeilingAir, // air node at ceiling (for Mundt Model) - MundtRoomAir, // air node for vertical walls (for Mundt Model) - ReturnAir, // air node for return (for Mundt and Rees&Haves Models) - AirflowNetworkRoomAir, // air node for airflow network based room air model - PlumeAir, // air node for plume load (for Rees&Haves Model) - RoomAir, // air node for vertical walls (for Rees&Haves Model) + Inlet, // air node at inlet (for Mundt and Rees&Haves Models) + Floor, // air node at floor (for Mundt and Rees&Haves Models) + Control, // air node at control point (for Mundt Model) + Ceiling, // air node at ceiling (for Mundt Model) + Mundt, // air node for vertical walls (for Mundt Model) + Return, // air node for return (for Mundt and Rees&Haves Models) + AFN, // air node for airflow network based room air model + Plume, // air node for plume load (for Rees&Haves Model) + Rees, // air node for vertical walls (for Rees&Haves Model) Num }; + extern const std::array airNodeTypeNamesUC; + // user-defined pattern two gradient interpolation modes enum class UserDefinedPatternMode { @@ -122,6 +126,8 @@ namespace DataRoomAirModel { Num }; + extern const std::array userDefinedPatternModeNamesUC; + // user defined temperature pattern types enum class UserDefinedPatternType { @@ -133,6 +139,8 @@ namespace DataRoomAirModel { Num }; + extern const std::array userDefinedPatternNamesUC; + // parameters to indicate diffuser type enum class Diffuser { @@ -145,6 +153,8 @@ namespace DataRoomAirModel { Num }; + extern const std::array diffuserNamesUC; + enum class Comfort { Invalid = -1, @@ -153,185 +163,140 @@ namespace DataRoomAirModel { Num }; + extern const std::array comfortNamesUC; + struct AirModelData { // Members - std::string AirModelName; - std::string ZoneName; - int ZonePtr; // Pointer to the zone number for this statement - RoomAirModel AirModelType; // 1 = Mixing, 2 = Mundt, 3 = Rees and Haves, + std::string Name = ""; + std::string ZoneName = ""; + int ZonePtr = 0; // Pointer to the zone number for this statement + RoomAirModel AirModel = RoomAirModel::Mixing; // 1 = Mixing, 2 = Mundt, 3 = Rees and Haves, // 4 = UCSDDV, 5 = UCSDCV, -1 = user defined // 6 = UCSDUFI, 7 = UCSDUFE, 8 = AirflowNetwork - CouplingScheme TempCoupleScheme; // 1 = absolute (direct), + CouplingScheme TempCoupleScheme = CouplingScheme::Direct; // 1 = absolute (direct), // 2 = relative air model temperature passing scheme (indirect) - bool SimAirModel; // FALSE if Mixing air model is currently used and + bool SimAirModel = false; // FALSE if Mixing air model is currently used and // TRUE if other air models are currently used - - // Default Constructor - AirModelData() : ZonePtr(0), AirModelType(RoomAirModel::Mixing), TempCoupleScheme(CouplingScheme::Direct), SimAirModel(false) - { - } }; struct AirNodeData { // Members - std::string Name; // name - std::string ZoneName; - int ZonePtr; // Pointer to the zone number for this statement - AirNodeType ClassType; // depending on type of model - Real64 Height; // height - Real64 ZoneVolumeFraction; // portion of zone air volume associated with this node + std::string Name = ""; // name + std::string ZoneName = ""; + int ZonePtr = 0; // Pointer to the zone number for this statement + AirNodeType ClassType = AirNodeType::Invalid; // depending on type of model + Real64 Height = 0.0; // height + Real64 ZoneVolumeFraction = 0.0; // portion of zone air volume associated with this node Array1D_bool SurfMask; // limit of 60 surfaces at current sizing - bool IsZone; // TRUE if this node is zone node - - // Default Constructor - AirNodeData() : ZonePtr(0), ClassType(AirNodeType::Invalid), Height(0.0), ZoneVolumeFraction(0), IsZone(false) - { - } + bool IsZone = false; // TRUE if this node is zone node }; struct DVData { // Members - std::string ZoneName; // Name of zone - int ZonePtr; // Pointer to the zone number for this statement - int SchedGainsPtr; // Schedule for internal gain fraction to occupied zone - std::string SchedGainsName; // Gains Schedule name - Real64 NumPlumesPerOcc; // Effective number of plumes per occupant - Real64 ThermostatHeight; // Height of thermostat/ temperature control sensor - Real64 ComfortHeight; // Height at which air temperature is measured for comfort purposes - Real64 TempTrigger; // Minimum temperature difference between TOC TMX for stratification - - // Default Constructor - DVData() : ZonePtr(0), SchedGainsPtr(-1), NumPlumesPerOcc(1.0), ThermostatHeight(0.0), ComfortHeight(0.0), TempTrigger(0.0) - { - } + std::string ZoneName = ""; // Name of zone + int ZonePtr = 0; // Pointer to the zone number for this statement + int SchedGainsPtr = -1; // Schedule for internal gain fraction to occupied zone + std::string SchedGainsName = ""; // Gains Schedule name + Real64 NumPlumesPerOcc = 0.0; // Effective number of plumes per occupant + Real64 ThermostatHeight = 0.0; // Height of thermostat/ temperature control sensor + Real64 ComfortHeight = 0.0; // Height at which air temperature is measured for comfort purposes + Real64 TempTrigger = 0.0; // Minimum temperature difference between TOC TMX for stratification }; struct CVData { // Members - std::string ZoneName; // Name of zone - int ZonePtr; // Pointer to the zone number for this statement - int SchedGainsPtr; // Schedule for internal gain fraction to occupied zone - std::string SchedGainsName; // Gains Schedule name - Comfort VforComfort; // Use Recirculation or Jet velocity and temperatures + std::string ZoneName = ""; // Name of zone + int ZonePtr = 0; // Pointer to the zone number for this statement + int SchedGainsPtr = 0; // Schedule for internal gain fraction to occupied zone + std::string SchedGainsName = ""; // Gains Schedule name + Comfort VforComfort = Comfort::Invalid; // Use Recirculation or Jet velocity and temperatures // for comfort models - - // Default Constructor - CVData() : ZonePtr(-1), SchedGainsPtr(-1), VforComfort(Comfort::Invalid) - { - } }; struct CVFlow { // Members - int FlowFlag; // Equal to 1 if the opening has inflow, else equal to 0. - Real64 Width; // Width of the opening [m] - Real64 Area; // Area of the opening [m2] - Real64 Fin; // Inflow volume flux through the opening [m3/s] - Real64 Uin; // Inflow air velocity through the opening [m/s] - Real64 Vjet; // Average maximum jet velocity for the opening [m/s] - Real64 Yjet; // Y in "Y = aX + b" formula - Real64 Ujet; // Volume average jet region velocity [m/s] - Real64 Yrec; // Y in "Y = aX + b" formula - Real64 Urec; // Area-averaged velocity in the y-z plane with maximum flow [m/s] - Real64 YQrec; // Y in "Y = aX + b" formula - Real64 Qrec; // Total flow rate for the recirculation regions in the plane of maximum flow [m3/s] - - // Default Constructor - CVFlow() - : FlowFlag(0), Width(0.0), Area(0.0), Fin(0.0), Uin(0.0), Vjet(0.0), Yjet(0.0), Ujet(0.0), Yrec(0.0), Urec(0.0), YQrec(0.0), Qrec(0.0) - { - } + int FlowFlag = 0; // Equal to 1 if the opening has inflow, else equal to 0. + Real64 Width = 0.0; // Width of the opening [m] + Real64 Area = 0.0; // Area of the opening [m2] + Real64 Fin = 0.0; // Inflow volume flux through the opening [m3/s] + Real64 Uin = 0.0; // Inflow air velocity through the opening [m/s] + Real64 Vjet = 0.0; // Average maximum jet velocity for the opening [m/s] + Real64 Yjet = 0.0; // Y in "Y = aX + b" formula + Real64 Ujet = 0.0; // Volume average jet region velocity [m/s] + Real64 Yrec = 0.0; // Y in "Y = aX + b" formula + Real64 Urec = 0.0; // Area-averaged velocity in the y-z plane with maximum flow [m/s] + Real64 YQrec = 0.0; // Y in "Y = aX + b" formula + Real64 Qrec = 0.0; // Total flow rate for the recirculation regions in the plane of maximum flow [m3/s] }; struct CVDVParameters { // Members - Real64 Width; - Real64 Height; - int Shadow; - Real64 Zmin; - Real64 Zmax; - - // Default Constructor - CVDVParameters() : Width(0.0), Height(0.0), Shadow(0), Zmin(0.0), Zmax(0.0) - { - } + Real64 Width = 0.0; + Real64 Height = 0.0; + int Shadow = 0; + Real64 Zmin = 0.0; + Real64 Zmax = 0.0; }; struct UFIData { // Members - std::string ZoneName; // Name of zone - int ZonePtr; // Pointer to the zone number for this statement - int ZoneEquipPtr; // Pointer to zone equip for this UFAD zone - Real64 DiffusersPerZone; // Number of diffusers in this zone - Real64 PowerPerPlume; // Power in each plume [W] - Real64 DiffArea; // Effective area of a diffuser [m2] - Real64 DiffAngle; // angle between diffuser slots and vertical (degrees) - Real64 HeatSrcHeight; // height of heat source above floor [m] - Real64 ThermostatHeight; // Height of thermostat/ temperature control sensor [m] - Real64 ComfortHeight; // Height at which air temperature is measured for + std::string ZoneName = ""; // Name of zone + int ZonePtr = 0; // Pointer to the zone number for this statement + int ZoneEquipPtr = 0; // Pointer to zone equip for this UFAD zone + Real64 DiffusersPerZone = 0.0; // Number of diffusers in this zone + Real64 PowerPerPlume = 0.0; // Power in each plume [W] + Real64 DiffArea = 0.0; // Effective area of a diffuser [m2] + Real64 DiffAngle = 0.0; // angle between diffuser slots and vertical (degrees) + Real64 HeatSrcHeight = 0.0; // height of heat source above floor [m] + Real64 ThermostatHeight = 0.0; // Height of thermostat/ temperature control sensor [m] + Real64 ComfortHeight = 0.0; // Height at which air temperature is measured for // comfort purposes [m] - Real64 TempTrigger; // Minimum temperature difference between TOC TMX + Real64 TempTrigger = 0.0; // Minimum temperature difference between TOC TMX // for stratification [deltaC] - Diffuser DiffuserType; // 1=Swirl, 2=variable area, 3=displacement, 4=linear bar grille, 5=custom - Real64 TransHeight; // user specified transition height [m] + Diffuser DiffuserType = Diffuser::Invalid; // 1=Swirl, 2=variable area, 3=displacement, 4=linear bar grille, 5=custom + Real64 TransHeight = 0.0; // user specified transition height [m] bool CalcTransHeight; // flag to calc trans height or use user specified input - Real64 A_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 B_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 C_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 D_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 E_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - - // Default Constructor - UFIData() - : ZonePtr(0), ZoneEquipPtr(0), DiffusersPerZone(0.0), PowerPerPlume(0.0), DiffArea(0.0), DiffAngle(0.0), HeatSrcHeight(0.0), - ThermostatHeight(0.0), ComfortHeight(0.0), TempTrigger(0.0), DiffuserType(Diffuser::Invalid), TransHeight(0.0), CalcTransHeight(false), - A_Kc(0.0), B_Kc(0.0), C_Kc(0.0), D_Kc(0.0), E_Kc(0.0) - { - } + Real64 A_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 B_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 C_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 D_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 E_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 }; struct UFEData { // Members - std::string ZoneName; // Name of zone - int ZonePtr; // Pointer to the zone number for this statement - int ZoneEquipPtr; // Pointer to zone equip for this UFAD zone - Real64 DiffusersPerZone; // Number of diffusers in this zone - Real64 PowerPerPlume; // Power in each plume [W] - Real64 DiffArea; // Effective area of a diffuser [m2] - Real64 DiffAngle; // angle between diffuser slots and vertical (degrees) - Real64 HeatSrcHeight; // height of heat source above floor [m] - Real64 ThermostatHeight; // Height of thermostat/ temperature control sensor [m] - Real64 ComfortHeight; // Height at which air temperature is measured for + std::string ZoneName = ""; // Name of zone + int ZonePtr = 0; // Pointer to the zone number for this statement + int ZoneEquipPtr = 0; // Pointer to zone equip for this UFAD zone + Real64 DiffusersPerZone = 0.0; // Number of diffusers in this zone + Real64 PowerPerPlume = 0.0; // Power in each plume [W] + Real64 DiffArea = 0.0; // Effective area of a diffuser [m2] + Real64 DiffAngle = 0.0; // angle between diffuser slots and vertical (degrees) + Real64 HeatSrcHeight = 0.0; // height of heat source above floor [m] + Real64 ThermostatHeight = 0.0; // Height of thermostat/ temperature control sensor [m] + Real64 ComfortHeight = 0.0; // Height at which air temperature is measured for // comfort purposes [m] - Real64 TempTrigger; // Minimum temperature difference between TOC TMX + Real64 TempTrigger = 0.0; // Minimum temperature difference between TOC TMX // for stratification [deltaC] - Diffuser DiffuserType; // 1=Swirl, 2=variable area, 3=displacement, 4=linear bar grille, 5=custom - Real64 TransHeight; // user specified transition height [m] - bool CalcTransHeight; // flag to calc trans height or use user specified input - Real64 A_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 B_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 C_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 D_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 E_Kc; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 WinWidth; // sum of widths of exterior windows in zone - Real64 NumExtWin; // number of exterior windows in the zone - bool ShadeDown; // signals shade up or down - - // Default Constructor - UFEData() - : ZonePtr(0), ZoneEquipPtr(0), DiffusersPerZone(0.0), PowerPerPlume(0.0), DiffArea(0.0), DiffAngle(0.0), HeatSrcHeight(0.0), - ThermostatHeight(0.0), ComfortHeight(0.0), TempTrigger(0.0), DiffuserType(Diffuser::Invalid), TransHeight(0.0), CalcTransHeight(false), - A_Kc(0.0), B_Kc(0.0), C_Kc(0.0), D_Kc(0.0), E_Kc(0.0), WinWidth(0.0), NumExtWin(0.0), ShadeDown(true) - { - } + Diffuser DiffuserType = Diffuser::Invalid; // 1=Swirl, 2=variable area, 3=displacement, 4=linear bar grille, 5=custom + Real64 TransHeight = 0.0; // user specified transition height [m] + bool CalcTransHeight = false; // flag to calc trans height or use user specified input + Real64 A_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 B_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 C_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 D_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 E_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 WinWidth = 0.0; // sum of widths of exterior windows in zone + Real64 NumExtWin = 0.0; // number of exterior windows in the zone + bool ShadeDown = false; // signals shade up or down }; struct SurfMapPattern // nested structure in RoomAirPattern @@ -340,52 +305,34 @@ namespace DataRoomAirModel { // user variables Array1D_string SurfName; // user defined name Array1D DeltaTai; // (Tai - MAT ) offset from mean air temp - int NumSurfs; // number of surfaces in this pattern + int NumSurfs = 0; // number of surfaces in this pattern // calculated and from elsewhere Array1D_int SurfID; // index in HB surface structure array - - // Default Constructor - SurfMapPattern() : NumSurfs(0) - { - } }; struct ConstGradPattern // nested structure in RoomAirPattern { // Members // user variables - std::string Name; // name - Real64 Gradient; // value of vertical gradient [C/m] - - // Default Constructor - ConstGradPattern() : Gradient(0.0) - { - } + std::string Name = ""; // name + Real64 Gradient = 0.0; // value of vertical gradient [C/m] }; struct TwoVertGradInterpolPattern // nested structure in RoomAirPattern { // Members // user variables - std::string Name; // name - Real64 TstatHeight; // Height of thermostat/ temperature control sensor - Real64 TleavingHeight; // height of return air node where leaving zone - Real64 TexhaustHeight; // height of exhaust air node where leaving zone - Real64 LowGradient; // lower value of vertical gradient [C/m] - Real64 HiGradient; // upper value of vertical gradient [C/m] - DataRoomAirModel::UserDefinedPatternMode InterpolationMode; // control for interpolation mode - Real64 UpperBoundTempScale; // temperature value for HiGradient - Real64 LowerBoundTempScale; // temperature value for LowGradient - Real64 UpperBoundHeatRateScale; // load value for HiGradient - Real64 LowerBoundHeatRateScale; // load value for lowGradient - - // Default Constructor - TwoVertGradInterpolPattern() - : TstatHeight(0.0), TleavingHeight(0.0), TexhaustHeight(0.0), LowGradient(0.0), HiGradient(0.0), - InterpolationMode(DataRoomAirModel::UserDefinedPatternMode::Invalid), UpperBoundTempScale(0.0), LowerBoundTempScale(0.0), - UpperBoundHeatRateScale(0.0), LowerBoundHeatRateScale(0.0) - { - } + std::string Name = ""; // name + Real64 TstatHeight = 0.0; // Height of thermostat/ temperature control sensor + Real64 TleavingHeight = 0.0; // height of return air node where leaving zone + Real64 TexhaustHeight = 0.0; // height of exhaust air node where leaving zone + Real64 LowGradient = 0.0; // lower value of vertical gradient [C/m] + Real64 HiGradient = 0.0; // upper value of vertical gradient [C/m] + UserDefinedPatternMode InterpolationMode = UserDefinedPatternMode::Invalid; // control for interpolation mode + Real64 UpperBoundTempScale = 0.0; // temperature value for HiGradient + Real64 LowerBoundTempScale = 0.0; // temperature value for LowGradient + Real64 UpperBoundHeatRateScale = 0.0; // load value for HiGradient + Real64 LowerBoundHeatRateScale = 0.0; // load value for lowGradient }; struct TempVsHeightPattern // to be used as nested structure in RoomAirPattern @@ -393,312 +340,201 @@ namespace DataRoomAirModel { // Members Array1D ZetaPatrn; // non dimensional height from floor, Array1D DeltaTaiPatrn; // Tai- MAT (TODO, check sign) - - // Default Constructor - TempVsHeightPattern() - { - } }; - struct TemperaturePatternStruct // RoomAirPattern + struct TemperaturePattern // RoomAirPattern { // Members - std::string Name; // unique identifier - int PatrnID; // control ID for referencing in Schedules - UserDefinedPatternType PatternMode; // Control for what type of calcs in this pattern + std::string Name = ""; // unique identifier + int PatrnID = 0; // control ID for referencing in Schedules + UserDefinedPatternType PatternMode = UserDefinedPatternType::Invalid; // Control for what type of calcs in this pattern ConstGradPattern GradPatrn; // Constant gradient pattern TwoVertGradInterpolPattern TwoGradPatrn; // Two gradient interpolation pattern TempVsHeightPattern VertPatrn; // Vertical gradient profile pattern SurfMapPattern MapPatrn; // Generic Surface map pattern - Real64 DeltaTstat; // (Tstat - MAT) offset deg C - Real64 DeltaTleaving; // (Tleaving - MAT) deg C - Real64 DeltaTexhaust; // (Texhaust - MAT) deg C - - // Default Constructor - TemperaturePatternStruct() : PatrnID(0), PatternMode(UserDefinedPatternType::Invalid), DeltaTstat(0.0), DeltaTleaving(0.0), DeltaTexhaust(0.0) - { - } + Real64 DeltaTstat = 0.0; // (Tstat - MAT) offset deg C + Real64 DeltaTleaving = 0.0; // (Tleaving - MAT) deg C + Real64 DeltaTexhaust = 0.0; // (Texhaust - MAT) deg C }; - struct SurfaceAssocNestedStruct + struct SurfaceAssocNested { // Members - std::string Name; // unique identifier - int SurfID; // id in HB surface structs - Real64 TadjacentAir; // place to put resulting temperature value - Real64 Zeta; // non-dimensional height in zone ot - - // Default Constructor - SurfaceAssocNestedStruct() : SurfID(0), TadjacentAir(23.0), Zeta(0.0) - { - } + std::string Name = ""; // unique identifier + int SurfID = 0; // id in HB surface structs + Real64 TadjacentAir = 23.0; // place to put resulting temperature value + Real64 Zeta = 0.0; // non-dimensional height in zone ot }; - struct AirPatternInfobyZoneStruct // becomes AirPatternZoneInfo + struct AirPatternInfobyZone // becomes AirPatternZoneInfo { // Members // user variables - bool IsUsed; // .TRUE. if user-defined patterns used in zone - std::string Name; // Name - std::string ZoneName; // Zone name in building - int ZoneID; // Index of Zone in Heat Balance - std::string AvailSched; // Name of availability schedule - int AvailSchedID; // index of availability schedule - std::string PatternCntrlSched; // name of schedule that selects pattern - int PatternSchedID; // index of pattern selecting schedule + bool IsUsed = false; // .TRUE. if user-defined patterns used in zone + std::string Name = ""; // Name + std::string ZoneName = ""; // Zone name in building + int ZoneID = 0; // Index of Zone in Heat Balance + std::string AvailSched = ""; // Name of availability schedule + int AvailSchedID = 0; // index of availability schedule + std::string PatternCntrlSched = ""; // name of schedule that selects pattern + int PatternSchedID = 0; // index of pattern selecting schedule // calculated and from elsewhere - Real64 ZoneHeight; // in meters, from Zone%CeilingHeight - int ZoneNodeID; // index in Node array for this zone + Real64 ZoneHeight = 0.0; // in meters, from Zone%CeilingHeight + int ZoneNodeID = 0; // index in Node array for this zone Array1D_int ExhaustAirNodeID; // indexes in Node array - Real64 TairMean; // comes from MAT - Real64 Tstat; // temperature for thermostat - Real64 Tleaving; // temperature for return air node - Real64 Texhaust; // temperature for exhaust air node - Array1D Surf; // nested struct w/ surface info - int totNumSurfs; // total surfs for this zone - int firstSurfID; // Index of first surface + // Is 23.0 a constexpr somewhere + Real64 TairMean = 23.0; // comes from MAT + Real64 Tstat = 23.0; // temperature for thermostat + Real64 Tleaving = 23.0; // temperature for return air node + Real64 Texhaust = 23.0; // temperature for exhaust air node + Array1D Surf; // nested struct w/ surface info + int totNumSurfs = 0; // total surfs for this zone + int firstSurfID = 0; // Index of first surface // report - Real64 Gradient; // result for modeled gradient if using two-gradient interpolation - - // Default Constructor - AirPatternInfobyZoneStruct() - : IsUsed(false), ZoneID(0), AvailSchedID(0), PatternSchedID(0), ZoneHeight(0.0), ZoneNodeID(0), TairMean(23.0), Tstat(23.0), - Tleaving(23.0), Texhaust(23.0), totNumSurfs(0), firstSurfID(0), Gradient(0.0) - { - } + Real64 Gradient = 0.0; // result for modeled gradient if using two-gradient interpolation }; - struct AirflowLinkagesInfoNestedStruct // becomes link + struct AFNLinkagesInfoNested // becomes link { // Members // user variables - int AirflowNetworkLinkSimuID; // point to this linkage in AirflowNetworkLinkSimu structure - int AirflowNetworkLinkageDataID; // point to this linkage in AirflowNetworkLinkageData structure - int AirflowNetworkLinkReportID; // point to this linkage in AirflowNetworkLinkReport structure - Real64 MdotIn; // mass flow rate of air into control volume(neg means leaving control volume) (kg / s) - Real64 TempIn; // drybulb temperature of air into control volume - Real64 HumRatIn; // humidity ratio of air into control volume - - // Default Constructor - AirflowLinkagesInfoNestedStruct() - : AirflowNetworkLinkSimuID(0), AirflowNetworkLinkageDataID(0), AirflowNetworkLinkReportID(0), MdotIn(0.0), TempIn(0.0), HumRatIn(0.0) - { - } + int AirflowNetworkLinkSimuID = 0; // point to this linkage in AirflowNetworkLinkSimu structure + int AirflowNetworkLinkageDataID = 0; // point to this linkage in AirflowNetworkLinkageData structure + int AirflowNetworkLinkReportID = 0; // point to this linkage in AirflowNetworkLinkReport structure + Real64 MdotIn = 0.0; // mass flow rate of air into control volume(neg means leaving control volume) (kg / s) + Real64 TempIn = 0.0; // drybulb temperature of air into control volume + Real64 HumRatIn = 0.0; // humidity ratio of air into control volume }; - struct RoomAirflowNetworkNodeInternalGainsStruct // becomes IntGain + struct RoomAFNNodeInternalGains // becomes IntGain { // Members // user variables - DataHeatBalance::IntGainType Type; // Internal type - std::string Name; // Intenral gain name - bool UseRoomAirModelTempForGains; // TRUE if user inputs temp for gains - bool FractionCheck; // TRUE if a fraction of internal gain for each object is checked - - // Default Constructor - RoomAirflowNetworkNodeInternalGainsStruct() - : Type(DataHeatBalance::IntGainType::Invalid), UseRoomAirModelTempForGains(false), FractionCheck(false) - { - } + DataHeatBalance::IntGainType type = DataHeatBalance::IntGainType::Invalid; // Internal type + std::string Name = ""; // Intenral gain name + bool UseRoomAirModelTempForGains = false; // TRUE if user inputs temp for gains + bool FractionCheck = false; // TRUE if a fraction of internal gain for each object is checked }; - struct RoomAirflowNetworkHVACStruct // becomes HVAC + struct RoomAFNHVAC // becomes HVAC { // Members // user variables - std::string Name; // HVAC system name - std::string ObjectTypeName; // HVAC object type name - std::string SupplyNodeName; // HVAC system supply node name - std::string ReturnNodeName; // HVAC system return node name - int TypeOfNum; // HVAC type num - Real64 SupplyFraction; // Supply flow fraction - Real64 ReturnFraction; // Return flow fraction - int EquipConfigIndex; // HVAC equipment configuration index - int SupNodeNum; // HVAC supply node number - int RetNodeNum; // HVAC return node number - int CompIndex; // Component index - - // Default Constructor - RoomAirflowNetworkHVACStruct() - : TypeOfNum(0), // HVAC type num - SupplyFraction(0), // Supply flow fraction - ReturnFraction(0), // Return flow fraction - EquipConfigIndex(0), // HVAC equipment configuration index - SupNodeNum(0), // HVAC supply node number - RetNodeNum(0), // HVAC return node number - CompIndex(0) // Component index - { - } + std::string Name = ""; // HVAC system name + std::string ObjectTypeName = ""; // HVAC object type name + std::string SupplyNodeName = ""; // HVAC system supply node name + std::string ReturnNodeName = ""; // HVAC system return node name + DataHVACGlobals::ZoneEquipType zoneEquipType = DataHVACGlobals::ZoneEquipType::Invalid; // HVAC type num + Real64 SupplyFraction = 0.0; // Supply flow fraction + Real64 ReturnFraction = 0.0; // Return flow fraction + int EquipConfigIndex = 0; // HVAC equipment configuration index + int SupNodeNum = 0; // HVAC supply node number + int RetNodeNum = 0; // HVAC return node number + int CompIndex = 0; // Component index }; - - struct RoomAirflowNetworkAirNodeNestedStruct // becomes Node + + struct RoomAFNAirNodeNested // becomes Node { // Members // user variables - std::string Name; // name of the node itself - Real64 ZoneVolumeFraction; // Zone volume fraction applied to this specific node - std::string NodeSurfListName; // name of nodes' adjacent surface list - bool HasSurfacesAssigned; // True if this node has surfaces assigned + std::string Name = ""; // name of the node itself + Real64 ZoneVolumeFraction = 0.0; // Zone volume fraction applied to this specific node + std::string NodeSurfListName = ""; // name of nodes' adjacent surface list + bool HasSurfacesAssigned = false; // True if this node has surfaces assigned Array1D SurfMask; // Sized to num of surfs in Zone, true if surface is associated with this node - std::string NodeIntGainsListName; // name of node's internal gains list - bool HasIntGainsAssigned; // True if this node has internal gain assigned - int NumIntGains; // Number of matching internal gain objects for all spaces in the zone + std::string NodeIntGainsListName = ""; // name of node's internal gains list + bool HasIntGainsAssigned = false; // True if this node has internal gain assigned + int NumIntGains = 0; // Number of matching internal gain objects for all spaces in the zone Array1D intGainsDeviceSpaces; // index pointers to space struct Array1D IntGainsDeviceIndices; // index pointers to internal gains struct Array1D IntGainsFractions; // gain fractions to this node - Array1D IntGain; // Internal gain struct - std::string NodeHVACListName; // name of node's HVAC list - bool HasHVACAssigned; // True if HVAC systems are assigned to this node - int NumHVACs; // Number of HVAC systems - Array1D HVAC; // HVAC struct - int AirflowNetworkNodeID; // pointer to AirflowNetworkNodeData structure - int NumOfAirflowLinks; // Number of intra zone links - Array1D Link; // Linkage struct - Real64 AirVolume; // air volume in control volume associated with this node(m3 / s) - Real64 RhoAir; // current density of air for nodal control volume - Real64 CpAir; // current heat capacity of air for nodal control volume - - Real64 AirTemp; // node air temperature - Real64 AirTempX1; // node air temperature at t minus 1 zone timestep - Real64 AirTempX2; // node air temperature at t minus 2 zone timestep - Real64 AirTempX3; // node air temperature at t minus 3 zone timestep - Real64 AirTempX4; // node air temperature at t minus 4 zone timestep - Real64 AirTempDSX1; // node air temperature at t minus 1 system timestep - Real64 AirTempDSX2; // node air temperature at t minus 2 system timestep - Real64 AirTempDSX3; // node air temperature at t minus 3 system timestep - Real64 AirTempDSX4; // node air temperature at t minus 4 system timestep - Real64 AirTempT1; // node air temperature at the previous time step used in Exact and Euler method - Real64 AirTempTMX; // temporary node air temperature to test convergence used in Exact and Euler method - Real64 AirTempTM2; // node air temperature at time step t-2 used in Exact and Euler method - - Real64 HumRat; // node air humidity ratio - Real64 HumRatX1; // node air humidity ratio at t minus 1 zone timestep - Real64 HumRatX2; // node air humidity ratio at t minus 2 zone timestep - Real64 HumRatX3; // node air humidity ratio at t minus 3 zone timestep - Real64 HumRatX4; // node air humidity ratio at t minus 4 zone timestep - Real64 HumRatDSX1; // node air humidity ratio at t minus 1 system timestep - Real64 HumRatDSX2; // node air humidity ratio at t minus 2 system timestep - Real64 HumRatDSX3; // node air humidity ratio at t minus 3 system timestep - Real64 HumRatDSX4; // node air humidity ratio at t minus 4 system timestep - Real64 HumRatW1; // node air humidity ratio at the previous time step used in Exact and Euler method - Real64 HumRatWMX; // temporary node air humidity ratio to test convergence used in Exact and Euler method - Real64 HumRatWM2; // node air humidity ratio at time step t-2 used in Exact and Euler method - - Real64 RelHumidity; // node air relative humidity + Array1D IntGain; // Internal gain struct + std::string NodeHVACListName = ""; // name of node's HVAC list + bool HasHVACAssigned = false; // True if HVAC systems are assigned to this node + int NumHVACs = 0; // Number of HVAC systems + Array1D HVAC; // HVAC struct + int AirflowNetworkNodeID = 0; // pointer to AirflowNetworkNodeData structure + int NumOfAirflowLinks = 0; // Number of intra zone links + Array1D Link; // Linkage struct + Real64 AirVolume = 0.0; // air volume in control volume associated with this node(m3 / s) + Real64 RhoAir = 0.0; // current density of air for nodal control volume + Real64 CpAir = 0.0; // current heat capacity of air for nodal control volume + + Real64 AirTemp = 0.0; // node air temperature + Real64 AirTempX1 = 0.0; // node air temperature at t minus 1 zone timestep + Real64 AirTempX2 = 0.0; // node air temperature at t minus 2 zone timestep + Real64 AirTempX3 = 0.0; // node air temperature at t minus 3 zone timestep + Real64 AirTempX4 = 0.0; // node air temperature at t minus 4 zone timestep + Real64 AirTempDSX1 = 0.0; // node air temperature at t minus 1 system timestep + Real64 AirTempDSX2 = 0.0; // node air temperature at t minus 2 system timestep + Real64 AirTempDSX3 = 0.0; // node air temperature at t minus 3 system timestep + Real64 AirTempDSX4 = 0.0; // node air temperature at t minus 4 system timestep + Real64 AirTempT1 = 0.0; // node air temperature at the previous time step used in Exact and Euler method + Real64 AirTempTMX = 0.0; // temporary node air temperature to test convergence used in Exact and Euler method + Real64 AirTempTM2 = 0.0; // node air temperature at time step t-2 used in Exact and Euler method + + Real64 HumRat = 0.0; // node air humidity ratio + Real64 HumRatX1 = 0.0; // node air humidity ratio at t minus 1 zone timestep + Real64 HumRatX2 = 0.0; // node air humidity ratio at t minus 2 zone timestep + Real64 HumRatX3 = 0.0; // node air humidity ratio at t minus 3 zone timestep + Real64 HumRatX4 = 0.0; // node air humidity ratio at t minus 4 zone timestep + Real64 HumRatDSX1 = 0.0; // node air humidity ratio at t minus 1 system timestep + Real64 HumRatDSX2 = 0.0; // node air humidity ratio at t minus 2 system timestep + Real64 HumRatDSX3 = 0.0; // node air humidity ratio at t minus 3 system timestep + Real64 HumRatDSX4 = 0.0; // node air humidity ratio at t minus 4 system timestep + Real64 HumRatW1 = 0.0; // node air humidity ratio at the previous time step used in Exact and Euler method + Real64 HumRatWMX = 0.0; // temporary node air humidity ratio to test convergence used in Exact and Euler method + Real64 HumRatWM2 = 0.0; // node air humidity ratio at time step t-2 used in Exact and Euler method + + Real64 RelHumidity = 0.0; // node air relative humidity // sensible heat balance terms for node - Real64 SumIntSensibleGain; // rate of heat gain from internal sensible gains(after fraction) - Real64 SumHA; // sum of Hc * Area for surfaces associated with this node(surface convection sensible gain term) - Real64 SumHATsurf; // sum of Hc * Area * Temp for surfaces associated with this node for convective heat transfer - Real64 SumHATref; // sum of Hc * Area * Temp for surfaces associated with this node for radiation exchange - Real64 SumLinkMCp; // sum of mdor*Cp for incoming airflows for this node derived from the AirflowNetwork model - Real64 SumLinkMCpT; // sum of mdor*Cp*T for incoming airflows and source temperature for this node derived from the AirflowNetwork model - Real64 SumSysMCp; // sum of mdor*Cp for incoming supply airflows for this node - Real64 SumSysMCpT; // sum of mdor*Cp*T for incoming supply airflows and temperature for this node - Real64 SumSysM; // sum of mdot for incoming supply airflows for this node - Real64 SumSysMW; // sum of mdot*W for incoming supply airflows and temperature for this node - Real64 NonAirSystemResponse; // sum of convective system load - Real64 SysDepZoneLoadsLagged; // sum of system lagged load - Real64 SysDepZoneLoadsLaggedOld; // sum of system lagged load - Real64 AirCap; // Air storage term for energy balalce at each node - Real64 AirHumRat; // Air storage term for moisture balalce at each node + Real64 SumIntSensibleGain = 0.0; // rate of heat gain from internal sensible gains(after fraction) + Real64 SumHA = 0.0; // sum of Hc * Area for surfaces associated with this node(surface convection sensible gain term) + Real64 SumHATsurf = 0.0; // sum of Hc * Area * Temp for surfaces associated with this node for convective heat transfer + Real64 SumHATref = 0.0; // sum of Hc * Area * Temp for surfaces associated with this node for radiation exchange + Real64 SumLinkMCp = 0.0; // sum of mdor*Cp for incoming airflows for this node derived from the AirflowNetwork model + Real64 SumLinkMCpT = 0.0; // sum of mdor*Cp*T for incoming airflows and source temperature for this node derived from the AirflowNetwork model + Real64 SumSysMCp = 0.0; // sum of mdor*Cp for incoming supply airflows for this node + Real64 SumSysMCpT = 0.0; // sum of mdor*Cp*T for incoming supply airflows and temperature for this node + Real64 SumSysM = 0.0; // sum of mdot for incoming supply airflows for this node + Real64 SumSysMW = 0.0; // sum of mdot*W for incoming supply airflows and temperature for this node + Real64 NonAirSystemResponse = 0.0; // sum of convective system load + Real64 SysDepZoneLoadsLagged = 0.0; // sum of system lagged load + Real64 SysDepZoneLoadsLaggedOld = 0.0; // sum of system lagged load + Real64 AirCap = 0.0; // Air storage term for energy balalce at each node + Real64 AirHumRat = 0.0; // Air storage term for moisture balalce at each node // latent moisture balance terms for node - Real64 SumIntLatentGain; // rate of heat gain form internal latent gains(after fraction) - Real64 SumHmAW; // sum of AREA*Moist CONVECTION COEFF*INSIDE Humidity Ratio - Real64 SumHmARa; // SUM OF ZONE AREA*Moist CONVECTION COEFF*Rho Air - Real64 SumHmARaW; // SUM OF ZONE AREA*Moist CONVECTION COEFF*Rho Air* Inside Humidity Ratio - Real64 SumLinkM; // sum of mdor for incoming airflows for this node derived from the AirflowNetwork model - Real64 SumLinkMW; // sum of mdor*Cp*T for incoming airflows and source humidity ratio for this node derived from the AirflowNetwork model - - // Default Constructor - RoomAirflowNetworkAirNodeNestedStruct() - : ZoneVolumeFraction(0.0), HasSurfacesAssigned(false), HasIntGainsAssigned(false), NumIntGains(0), HasHVACAssigned(false), NumHVACs(0), - AirflowNetworkNodeID(0), // pointer to AirflowNetworkNodeData structure - NumOfAirflowLinks(0), AirVolume(0.0), // air volume in control volume associated with this node(m3 / s) - RhoAir(0.0), // current density of air for nodal control volume - CpAir(0.0), // current heat capacity of air for nodal control volume - AirTemp(0.0), // node air temperature - AirTempX1(0.0), // node air temperature at t minus 1 zone timestep - AirTempX2(0.0), // node air temperature at t minus 2 zone timestep - AirTempX3(0.0), // node air temperature at t minus 3 zone timestep - AirTempX4(0.0), // node air temperature at t minus 4 zone timestep - AirTempDSX1(0.0), // node air temperature at t minus 1 system timestep - AirTempDSX2(0.0), // node air temperature at t minus 2 system timestep - AirTempDSX3(0.0), // node air temperature at t minus 3 system timestep - AirTempDSX4(0.0), // node air temperature at t minus 4 system timestep - AirTempT1(0.0), // node air temperature at the previous time step used in Exact and Euler method - AirTempTMX(0.0), // temporary node air temperature to test convergence used in Exact and Euler method - AirTempTM2(0.0), // node air temperature at time step t-2 used in Exact and Euler method - HumRat(0.0), // node air humidity ratio - HumRatX1(0.0), // node air humidity ratio at t minus 1 zone timestep - HumRatX2(0.0), // node air humidity ratio at t minus 2 zone timestep - HumRatX3(0.0), // node air humidity ratio at t minus 3 zone timestep - HumRatX4(0.0), // node air humidity ratio at t minus 4 zone timestep - HumRatDSX1(0.0), // node air humidity ratio at t minus 1 system timestep - HumRatDSX2(0.0), // node air humidity ratio at t minus 2 system timestep - HumRatDSX3(0.0), // node air humidity ratio at t minus 3 system timestep - HumRatDSX4(0.0), // node air humidity ratio at t minus 4 system timestep - HumRatW1(0.0), // node air humidity ratio at the previous time step used in Exact and Euler method - HumRatWMX(0.0), // temporary node air humidity ratio to test convergence used in Exact and Euler method - HumRatWM2(0.0), // node air humidity ratio at time step t-2 used in Exact and Euler method - RelHumidity(0.0), // node air relative humidity - // sensible heat balance terms for node - SumIntSensibleGain(0.0), // rate of heat gain from internal sensible gains(after fraction) - SumHA(0.0), // sum of Hc * Area for surfaces associated with this node(surface convection sensible gain term) - SumHATsurf(0.0), SumHATref(0.0), // sum of Hc * Area * Temp for surfaces associated with this node - SumLinkMCp(0.0), SumLinkMCpT(0.0), SumSysMCp(0.0), SumSysMCpT(0.0), SumSysM(0.0), SumSysMW(0.0), NonAirSystemResponse(0.0), - SysDepZoneLoadsLagged(0.0), SysDepZoneLoadsLaggedOld(0.0), AirCap(0.0), AirHumRat(0.0), - // latent moisture balance terms for node - SumIntLatentGain(0.0), // rate of heat gain form internal latent gains(after fraction) - SumHmAW(0.0), // sum of AREA*Moist CONVECTION COEFF*INSIDE Humidity Ratio - SumHmARa(0.0), // SUM OF ZONE AREA*Moist CONVECTION COEFF*Rho Air - SumHmARaW(0.0), // SUM OF ZONE AREA*Moist CONVECTION COEFF*Rho Air* Inside Humidity Ratio - SumLinkM(0.0), SumLinkMW(0.0) - { - } + Real64 SumIntLatentGain = 0.0; // rate of heat gain form internal latent gains(after fraction) + Real64 SumHmAW = 0.0; // sum of AREA*Moist CONVECTION COEFF*INSIDE Humidity Ratio + Real64 SumHmARa = 0.0; // SUM OF ZONE AREA*Moist CONVECTION COEFF*Rho Air + Real64 SumHmARaW = 0.0; // SUM OF ZONE AREA*Moist CONVECTION COEFF*Rho Air* Inside Humidity Ratio + Real64 SumLinkM = 0.0; // sum of mdor for incoming airflows for this node derived from the AirflowNetwork model + Real64 SumLinkMW = 0.0; // sum of mdor*Cp*T for incoming airflows and source humidity ratio for this node derived from the AirflowNetwork model }; - struct RoomAirflowNetworkInfoByZoneStruct // becomes RoomAirflowNetworkZoneInfo + struct RoomAFNInfoByZone // becomes RoomAirflowNetworkZoneInfo { // Members // user variables - bool IsUsed; // true. if RoomAirflowNetwork model used in zone - std::string Name; // Name - std::string ZoneName; // Zone name in building - int ZoneID; // Index of Zone in Heat Balance - int ActualZoneID; // Index of controlled zones in ZoneCOnfigure - std::string AvailSched; // Name of availability schedule - int AvailSchedID; // index of availability schedule - int ControlAirNodeID; // index of roomair node that is HVAC control sensor location - int NumOfAirNodes; // Number of air nodes - Array1D Node; // Node struct - int ZoneNodeID; // index in system Node array for this zone - Real64 TairMean; // comes from MAT - Real64 Tstat; // temperature for thermostat - Real64 Tleaving; // temperature for return air node - Real64 Texhaust; // temperature for exhaust air node - int totNumSurfs; // total surfs for this zone - int firstSurfID; // Index of first surface - int RAFNNum; // RAFN number - - // Default Constructor - RoomAirflowNetworkInfoByZoneStruct() - : IsUsed(false), // true. if RoomAirflowNetwork model used in zone - ZoneID(0), // Index of Zone in Heat Balance - ActualZoneID(0), // Index of controlled zones in ZoneCOnfigure - AvailSchedID(0), // index of availability schedule - ControlAirNodeID(0), // index of roomair node that is HVAC control sensor location - NumOfAirNodes(0), // Number of air nodes - ZoneNodeID(0), // index in system Node array for this zone - TairMean(23.0), // comes from MAT - Tstat(23.0), // temperature for thermostat - Tleaving(23.0), // temperature for return air node - Texhaust(23.0), // temperature for exhaust air node - totNumSurfs(0), // total surfs for this zone - firstSurfID(0), // Index of first surface - RAFNNum(0) // RAFN number - { - } + bool IsUsed = false; // true. if RoomAirflowNetwork model used in zone + std::string Name = ""; // Name + std::string ZoneName = ""; // Zone name in building + int ZoneID = 0; // Index of Zone in Heat Balance + int ActualZoneID = 0; // Index of controlled zones in ZoneCOnfigure + std::string AvailSched = ""; // Name of availability schedule + int AvailSchedID = 0; // index of availability schedule + int ControlAirNodeID = 0; // index of roomair node that is HVAC control sensor location + int NumOfAirNodes = 0; // Number of air nodes + Array1D Node; // Node struct + int ZoneNodeID = 0; // index in system Node array for this zone + Real64 TairMean = 0.0; // comes from MAT + Real64 Tstat = 0.0; // temperature for thermostat + Real64 Tleaving = 0.0; // temperature for return air node + Real64 Texhaust = 0.0; // temperature for exhaust air node + int totNumSurfs = 0; // total surfs for this zone + int firstSurfID = 0; // Index of first surface + int RAFNNum = 0; // RAFN number }; } // namespace DataRoomAirModel @@ -840,9 +676,9 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ZoneUCSDUE; Array2D CVJetRecFlows; // Jet and recirculation zone flows and properties Array1D SurfParametersCVDV; // Surface parameters - Array1D RoomAirPattern; // user defined patterns ,various types - Array1D AirPatternZoneInfo; // added zone information for user defined patterns - Array1D RoomAirflowNetworkZoneInfo; // added zone info + Array1D RoomAirPattern; // user defined patterns ,various types + Array1D AirPatternZoneInfo; // added zone information for user defined patterns + Array1D RoomAirflowNetworkZoneInfo; // added zone info void clear_state() override { diff --git a/src/EnergyPlus/DataSurfaceColors.cc b/src/EnergyPlus/DataSurfaceColors.cc index 512bd66dae5..9cfa6c4733a 100644 --- a/src/EnergyPlus/DataSurfaceColors.cc +++ b/src/EnergyPlus/DataSurfaceColors.cc @@ -101,7 +101,7 @@ bool MatchAndSetColorTextString(EnergyPlusData &state, if (ColorType != "DXF") return false; // try to find enum value - int foundIdx = getEnumerationValue(colorkeys, UtilityRoutines::MakeUPPERCase(String)); + int foundIdx = getEnumValue(colorkeys, UtilityRoutines::makeUPPER(String)); if (foundIdx == -1) return false; // if we've made it here, we found the value diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index e5210507b9e..ff93222f3fe 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -393,7 +393,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) std::string loadDistName = ip->getAlphaFieldValue(epListFields, objectSchemaProps, "load_distribution_scheme"); thisZoneEquipList.LoadDistScheme = static_cast( - getEnumerationValue(DataZoneEquipment::LoadDistNamesUC, UtilityRoutines::MakeUPPERCase(loadDistName))); + getEnumValue(DataZoneEquipment::LoadDistNamesUC, UtilityRoutines::makeUPPER(loadDistName))); if (thisZoneEquipList.LoadDistScheme == DataZoneEquipment::LoadDist::Invalid) { ShowSevereError(state, format("{}{} = \"{}, Invalid choice\".", RoutineName, CurrentModuleObject, thisZoneEquipList.Name)); ShowContinueError(state, format("...load_distribution_scheme=\"{}\".", loadDistName)); @@ -521,7 +521,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) } thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) = static_cast( - getEnumerationValue(ZoneEquipTypeNamesUC, UtilityRoutines::MakeUPPERCase(thisZoneEquipList.EquipType(ZoneEquipTypeNum)))); + getEnumValue(ZoneEquipTypeNamesUC, UtilityRoutines::makeUPPER(thisZoneEquipList.EquipType(ZoneEquipTypeNum)))); if (thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) == ZoneEquip::ZoneUnitarySys || thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) == ZoneEquip::PkgTermACAirToAir || @@ -853,7 +853,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) state.dataZoneEquip->SupplyAirPath(PathNum).SplitterIndex(CompNum) = 0; state.dataZoneEquip->SupplyAirPath(PathNum).PlenumIndex(CompNum) = 0; state.dataZoneEquip->SupplyAirPath(PathNum).ComponentTypeEnum(CompNum) = - (AirLoopHVACZone)getEnumerationValue(AirLoopHVACTypeNamesUC, AlphArray(Counter)); + (AirLoopHVACZone)getEnumValue(AirLoopHVACTypeNamesUC, AlphArray(Counter)); } else { ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, cAlphaFields(1), state.dataZoneEquip->SupplyAirPath(PathNum).Name)); ShowContinueError(state, format("Unhandled component type =\"{}\".", AlphArray(Counter))); @@ -922,7 +922,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; } state.dataZoneEquip->ReturnAirPath(PathNum).ComponentTypeEnum(CompNum) = - static_cast(getEnumerationValue(AirLoopHVACTypeNamesUC, AlphArray(Counter))); + static_cast(getEnumValue(AirLoopHVACTypeNamesUC, AlphArray(Counter))); } else { ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, cAlphaFields(1), state.dataZoneEquip->ReturnAirPath(PathNum).Name)); ShowContinueError(state, format("Unhandled component type =\"{}\".", AlphArray(Counter))); diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 9524aaec365..6539ca64b3a 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -4849,7 +4849,7 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) daylightControl.AvailSchedNum = ScheduleManager::ScheduleAlwaysOn; } - int typeNum = getEnumerationValue(DataDaylighting::LtgCtrlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(5))); + int typeNum = getEnumValue(DataDaylighting::LtgCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5))); daylightControl.LightControlType = static_cast(typeNum); if (daylightControl.LightControlType == DataDaylighting::LtgCtrlType::Invalid) { ShowWarningError(state, diff --git a/src/EnergyPlus/DemandManager.cc b/src/EnergyPlus/DemandManager.cc index fbde2642d1c..c156da52d5b 100644 --- a/src/EnergyPlus/DemandManager.cc +++ b/src/EnergyPlus/DemandManager.cc @@ -427,7 +427,7 @@ void GetDemandManagerListInput(EnergyPlusData &state) // Validate Demand Manager Priority thisDemandMgrList.ManagerPriority = static_cast( - getEnumerationValue(ManagePriorityNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(6)))); + getEnumValue(ManagePriorityNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); ErrorsFound = ErrorsFound || (thisDemandMgrList.ManagerPriority == ManagePriorityType::Invalid); // Get DEMAND MANAGER Type and Name pairs @@ -440,7 +440,7 @@ void GetDemandManagerListInput(EnergyPlusData &state) auto &thisManager = thisDemandMgrList.Manager(MgrNum); // Validate DEMAND MANAGER Type ManagerType MgrType = static_cast( - getEnumerationValue(ManagerNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(MgrNum * 2 + 5)))); + getEnumValue(ManagerNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(MgrNum * 2 + 5)))); if (MgrType != ManagerType::Invalid) { thisManager = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(MgrNum * 2 + 6), state.dataDemandManager->DemandMgr); @@ -677,7 +677,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Limiting Control demandMgr.LimitControl = - static_cast(getEnumerationValue(ManagerLimitNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(3)))); + static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -689,7 +689,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Selection Control demandMgr.SelectionControl = - static_cast(getEnumerationValue(ManagerSelectionNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4)))); + static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) @@ -776,7 +776,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Limiting Control demandMgr.LimitControl = - static_cast(getEnumerationValue(ManagerLimitNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(3)))); + static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -788,7 +788,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Selection Control demandMgr.SelectionControl = - static_cast(getEnumerationValue(ManagerSelectionNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4)))); + static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) @@ -896,7 +896,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Limiting Control demandMgr.LimitControl = - static_cast(getEnumerationValue(ManagerLimitNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(3)))); + static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -908,7 +908,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Selection Control demandMgr.SelectionControl = - static_cast(getEnumerationValue(ManagerSelectionNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4)))); + static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(4) == 0.0) @@ -1017,7 +1017,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Limiting Control demandMgr.LimitControl = - static_cast(getEnumerationValue(ManagerLimitNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(3)))); + static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -1044,7 +1044,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Selection Control demandMgr.SelectionControl = - static_cast(getEnumerationValue(ManagerSelectionNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4)))); + static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(5) == 0.0) @@ -1150,7 +1150,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Limiting Control demandMgr.LimitControl = - static_cast(getEnumerationValue(ManagerLimitVentNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(3)))); + static_cast(getEnumValue(ManagerLimitVentNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -1165,7 +1165,7 @@ void GetDemandManagerInput(EnergyPlusData &state) // Validate Selection Control demandMgr.SelectionControl = - static_cast(getEnumerationValue(ManagerSelectionNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4)))); + static_cast(getEnumValue(ManagerSelectionNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); ErrorsFound = ErrorsFound || (demandMgr.SelectionControl == ManagerSelection::Invalid); if (NumArray(5) == 0.0) diff --git a/src/EnergyPlus/DualDuct.cc b/src/EnergyPlus/DualDuct.cc index 1be5639e5d5..67aa57ce4a1 100644 --- a/src/EnergyPlus/DualDuct.cc +++ b/src/EnergyPlus/DualDuct.cc @@ -606,7 +606,7 @@ namespace DualDuct { state, CurrentModuleObject + ":RecirculatedAir", thisDD.Name, AlphArray(5), AlphArray(3), "Air Nodes"); } - thisDD.OAPerPersonMode = static_cast(getEnumerationValue(modeStrings, AlphArray(7))); + thisDD.OAPerPersonMode = static_cast(getEnumValue(modeStrings, AlphArray(7))); if (thisDD.OAPerPersonMode == PerPersonMode::Invalid) { thisDD.OAPerPersonMode = PerPersonMode::ModeNotSet; } diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index 06fb2cfb9a3..c89233ef4ec 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -856,7 +856,7 @@ namespace EMSManager { state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).Name = cAlphaArgs(1); state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).CallingPoint = - static_cast(getEnumerationValue(EMSCallFromNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(2)))); + static_cast(getEnumValue(EMSCallFromNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(2)))); ErrorsFound = ErrorsFound || (state.dataRuntimeLang->EMSProgramCallManager(CallManagerNum).CallingPoint == EMSCallFrom::Invalid); int NumErlProgramsThisManager = NumAlphas - 2; // temporary size of Erl programs in EMSProgramCallManager @@ -2100,9 +2100,9 @@ void SetupEMSActuator(EnergyPlusData &state, // push size of ActuatorVariable and add a new one. // check for duplicates. - std::string const UpperCaseObjectType(UtilityRoutines::MakeUPPERCase(cComponentTypeName)); - std::string const UpperCaseObjectName(UtilityRoutines::MakeUPPERCase(cUniqueIDName)); - std::string const UpperCaseActuatorName(UtilityRoutines::MakeUPPERCase(cControlTypeName)); + std::string const UpperCaseObjectType(UtilityRoutines::makeUPPER(cComponentTypeName)); + std::string const UpperCaseObjectName(UtilityRoutines::makeUPPER(cUniqueIDName)); + std::string const UpperCaseActuatorName(UtilityRoutines::makeUPPER(cControlTypeName)); DataRuntimeLanguage::EMSActuatorKey const key(UpperCaseObjectType, UpperCaseObjectName, UpperCaseActuatorName); @@ -2151,9 +2151,9 @@ void SetupEMSActuator(EnergyPlusData &state, // push size of ActuatorVariable and add a new one. // check for duplicates. - std::string const UpperCaseObjectType(UtilityRoutines::MakeUPPERCase(cComponentTypeName)); - std::string const UpperCaseObjectName(UtilityRoutines::MakeUPPERCase(cUniqueIDName)); - std::string const UpperCaseActuatorName(UtilityRoutines::MakeUPPERCase(cControlTypeName)); + std::string const UpperCaseObjectType(UtilityRoutines::makeUPPER(cComponentTypeName)); + std::string const UpperCaseObjectName(UtilityRoutines::makeUPPER(cUniqueIDName)); + std::string const UpperCaseActuatorName(UtilityRoutines::makeUPPER(cControlTypeName)); DataRuntimeLanguage::EMSActuatorKey const key(UpperCaseObjectType, UpperCaseObjectName, UpperCaseActuatorName); @@ -2202,9 +2202,9 @@ void SetupEMSActuator(EnergyPlusData &state, // push size of ActuatorVariable and add a new one. // check for duplicates. - std::string const UpperCaseObjectType(UtilityRoutines::MakeUPPERCase(cComponentTypeName)); - std::string const UpperCaseObjectName(UtilityRoutines::MakeUPPERCase(cUniqueIDName)); - std::string const UpperCaseActuatorName(UtilityRoutines::MakeUPPERCase(cControlTypeName)); + std::string const UpperCaseObjectType(UtilityRoutines::makeUPPER(cComponentTypeName)); + std::string const UpperCaseObjectName(UtilityRoutines::makeUPPER(cUniqueIDName)); + std::string const UpperCaseActuatorName(UtilityRoutines::makeUPPER(cControlTypeName)); DataRuntimeLanguage::EMSActuatorKey const key(UpperCaseObjectType, UpperCaseObjectName, UpperCaseActuatorName); diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index b3da1a74d05..e7d3ef62e98 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -83,7 +83,7 @@ namespace EnergyPlus::EarthTube { // Cambridge Massachusetts, MIT Press, 1989, pp 206-212 // This is an interesting one. The actual members of the enum are never explicitly used -// The enum is used in a getEnumerationValue call to determine what was found in GetInput +// The enum is used in a getEnumValue call to determine what was found in GetInput // The value is then used as an array index to lookup thermal conductivity and such from some std::arrays // So the IDE thinks these are unused, and I'm not sure the best way to hint that they sorta aren't enum class SoilType @@ -238,7 +238,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i if (state.dataIPShortCut->cAlphaArgs(3).empty()) { thisEarthTube.FanType = Ventilation::Natural; } else { - thisEarthTube.FanType = static_cast(getEnumerationValue(ventilationNamesUC, state.dataIPShortCut->cAlphaArgs(3))); + thisEarthTube.FanType = static_cast(getEnumValue(ventilationNamesUC, state.dataIPShortCut->cAlphaArgs(3))); if (thisEarthTube.FanType == Ventilation::Invalid) { ShowSevereError(state, format("{}: {}={}, {} invalid={}", @@ -350,7 +350,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i ErrorsFound = true; } - SoilType soilType = static_cast(getEnumerationValue(soilTypeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); + SoilType soilType = static_cast(getEnumValue(soilTypeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); constexpr std::array(SoilType::Num)> thermalDiffusivity = {0.0781056, 0.055728, 0.0445824, 0.024192}; constexpr std::array(SoilType::Num)> thermalConductivity = {2.42, 1.3, 0.865, 0.346}; if (soilType == SoilType::Invalid) { diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index 253ef0910a3..3218175af2f 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.cc +++ b/src/EnergyPlus/EconomicLifeCycleCost.cc @@ -210,7 +210,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key MidYear // \key BeginningOfYear // \default EndOfYear - elcc->discountConvention = static_cast(getEnumerationValue(DiscConvNamesUC, UtilityRoutines::MakeUPPERCase(AlphaArray(2)))); + elcc->discountConvention = static_cast(getEnumValue(DiscConvNamesUC, UtilityRoutines::makeUPPER(AlphaArray(2)))); if (elcc->discountConvention == DiscConv::Invalid) { elcc->discountConvention = DiscConv::EndOfYear; ShowWarningError( @@ -223,7 +223,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key ConstantDollar // \key CurrentDollar // \default ConstantDollar - elcc->inflationApproach = static_cast(getEnumerationValue(InflApprNamesUC, UtilityRoutines::MakeUPPERCase(AlphaArray(3)))); + elcc->inflationApproach = static_cast(getEnumValue(InflApprNamesUC, UtilityRoutines::makeUPPER(AlphaArray(3)))); if (elcc->inflationApproach == InflAppr::Invalid) { elcc->inflationApproach = InflAppr::ConstantDollar; ShowWarningError(state, @@ -295,7 +295,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key November // \key December // \default January - elcc->baseDateMonth = getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase(AlphaArray(4))); + elcc->baseDateMonth = getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER(AlphaArray(4))); if (elcc->baseDateMonth == -1) { elcc->baseDateMonth = 0; ShowWarningError(state, @@ -336,7 +336,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key November // \key December // \default January - elcc->serviceDateMonth = getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase(AlphaArray(5))); + elcc->serviceDateMonth = getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER(AlphaArray(5))); if (elcc->serviceDateMonth == -1) { elcc->serviceDateMonth = 0; ShowWarningError(state, @@ -404,7 +404,7 @@ void GetInputLifeCycleCostParameters(EnergyPlusData &state) // \key StraightLine-40year // \key None // \default None - elcc->depreciationMethod = static_cast(getEnumerationValue(DeprMethodNamesUC, UtilityRoutines::MakeUPPERCase(AlphaArray(6)))); + elcc->depreciationMethod = static_cast(getEnumValue(DeprMethodNamesUC, UtilityRoutines::makeUPPER(AlphaArray(6)))); if (elcc->depreciationMethod == DeprMethod::Invalid) { elcc->depreciationMethod = DeprMethod::None; if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { @@ -497,7 +497,7 @@ void GetInputLifeCycleCostRecurringCosts(EnergyPlusData &state) // \key OtherOperational // \default Maintenance elcc->RecurringCosts[iInObj].category = - static_cast(getEnumerationValue(CostCategoryNamesUCNoSpace, UtilityRoutines::MakeUPPERCase(AlphaArray(2)))); + static_cast(getEnumValue(CostCategoryNamesUCNoSpace, UtilityRoutines::makeUPPER(AlphaArray(2)))); bool isNotRecurringCost = (elcc->RecurringCosts[iInObj].category != CostCategory::Maintenance && elcc->RecurringCosts[iInObj].category != CostCategory::Repair && elcc->RecurringCosts[iInObj].category != CostCategory::Operation && elcc->RecurringCosts[iInObj].category != CostCategory::Replacement && @@ -521,7 +521,7 @@ void GetInputLifeCycleCostRecurringCosts(EnergyPlusData &state) // \key BasePeriod // \default ServicePeriod elcc->RecurringCosts[iInObj].startOfCosts = - static_cast(getEnumerationValue(StartCostNamesUC, UtilityRoutines::MakeUPPERCase(AlphaArray(3)))); + static_cast(getEnumValue(StartCostNamesUC, UtilityRoutines::makeUPPER(AlphaArray(3)))); if (elcc->RecurringCosts[iInObj].startOfCosts == StartCosts::Invalid) { elcc->RecurringCosts[iInObj].startOfCosts = StartCosts::ServicePeriod; ShowWarningError(state, @@ -708,7 +708,7 @@ void GetInputLifeCycleCostNonrecurringCost(EnergyPlusData &state) // \key OtherCapital // \default Construction elcc->NonrecurringCost[iInObj].category = - static_cast(getEnumerationValue(CostCategoryNamesUCNoSpace, UtilityRoutines::MakeUPPERCase(AlphaArray(2)))); + static_cast(getEnumValue(CostCategoryNamesUCNoSpace, UtilityRoutines::makeUPPER(AlphaArray(2)))); bool isNotNonRecurringCost = (elcc->NonrecurringCost[iInObj].category != CostCategory::Construction && elcc->NonrecurringCost[iInObj].category != CostCategory::Salvage && elcc->NonrecurringCost[iInObj].category != CostCategory::OtherCapital); @@ -729,7 +729,7 @@ void GetInputLifeCycleCostNonrecurringCost(EnergyPlusData &state) // \key BasePeriod // \default ServicePeriod elcc->NonrecurringCost[iInObj].startOfCosts = - static_cast(getEnumerationValue(StartCostNamesUC, UtilityRoutines::MakeUPPERCase(AlphaArray(3)))); + static_cast(getEnumValue(StartCostNamesUC, UtilityRoutines::makeUPPER(AlphaArray(3)))); if (elcc->NonrecurringCost[iInObj].startOfCosts == StartCosts::Invalid) { elcc->NonrecurringCost[iInObj].startOfCosts = StartCosts::ServicePeriod; ShowWarningError(state, @@ -858,7 +858,7 @@ void GetInputLifeCycleCostUsePriceEscalation(EnergyPlusData &state) // \key OtherFuel1 // \key OtherFuel2 elcc->UsePriceEscalation(iInObj).resource = - static_cast(getEnumerationValue(Constant::eResourceNamesUC, AlphaArray(2))); + static_cast(getEnumValue(Constant::eResourceNamesUC, AlphaArray(2))); if (NumAlphas > 3) { ShowWarningError(state, format("In {} contains more alpha fields than expected.", CurrentModuleObject)); } @@ -895,7 +895,7 @@ void GetInputLifeCycleCostUsePriceEscalation(EnergyPlusData &state) // \key December // \default January elcc->UsePriceEscalation(iInObj).escalationStartMonth = - getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase(AlphaArray(3))); + getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER(AlphaArray(3))); if (elcc->UsePriceEscalation(iInObj).escalationStartMonth == -1) { elcc->UsePriceEscalation(iInObj).escalationStartMonth = 0; ShowWarningError(state, @@ -1008,7 +1008,7 @@ void GetInputLifeCycleCostUseAdjustment(EnergyPlusData &state) // \key Water // \key OtherFuel1 // \key OtherFuel2 - elcc->UseAdjustment(iInObj).resource = static_cast(getEnumerationValue(Constant::eResourceNamesUC, AlphaArray(2))); + elcc->UseAdjustment(iInObj).resource = static_cast(getEnumValue(Constant::eResourceNamesUC, AlphaArray(2))); if (NumAlphas > 2) { ShowWarningError(state, format("In {} contains more alpha fields than expected.", CurrentModuleObject)); } diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index c12c086258d..8bbc8146788 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -227,7 +227,7 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i if (tariff(iInObj).reportMeterIndx != 0) { std::string const &SELECT_CASE_var( - UtilityRoutines::MakeUPPERCase(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType)); + UtilityRoutines::makeUPPER(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType)); // Various types of electricity meters if (SELECT_CASE_var == "ELECTRICITY") { @@ -664,9 +664,9 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i } // associate the resource number with each tariff if (tariff(iInObj).reportMeterIndx >= 1) { - tariff(iInObj).resource = static_cast(getEnumerationValue( + tariff(iInObj).resource = static_cast(getEnumValue( Constant::eResourceNamesUC, - UtilityRoutines::MakeUPPERCase(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType))); + UtilityRoutines::makeUPPER(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType))); } } } diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 484193018e6..2f5bf7a5703 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -779,7 +779,7 @@ ElectPowerLoadCenter::ElectPowerLoadCenter(EnergyPlusData &state, int const obje errorsFound = true; } - demandMeterName_ = UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(5)); + demandMeterName_ = UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)); // meters may not be "loaded" yet, defered check to later subroutine if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(6), "AlternatingCurrent")) { @@ -2182,7 +2182,7 @@ GeneratorController::GeneratorController(EnergyPlusData &state, name = objectName; - generatorType = static_cast(getEnumerationValue(GeneratorTypeNamesUC, UtilityRoutines::MakeUPPERCase(objectType))); + generatorType = static_cast(getEnumValue(GeneratorTypeNamesUC, UtilityRoutines::makeUPPER(objectType))); switch (generatorType) { case GeneratorType::ICEngine: { compPlantType = DataPlant::PlantEquipmentType::Generator_ICEngine; @@ -2208,7 +2208,7 @@ GeneratorController::GeneratorController(EnergyPlusData &state, compPlantType = DataPlant::PlantEquipmentType::Invalid; int ObjNum = - state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Generator:PVWatts", UtilityRoutines::MakeUPPERCase(objectName)); + state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Generator:PVWatts", UtilityRoutines::makeUPPER(objectName)); assert(ObjNum >= 0); if (ObjNum == 0) { ShowFatalError(state, format("Cannot find Generator:PVWatts {}", objectName)); @@ -2264,7 +2264,7 @@ GeneratorController::GeneratorController(EnergyPlusData &state, // Note: you can't use state.dataIPShortCut->cAlphaArgs etc or it'll override what will still need to be processed in // ElectPowerLoadCenter::ElectPowerLoadCenter after this function is called int PVNum = - state.dataInputProcessing->inputProcessor->getObjectItemNum(state, objectType, UtilityRoutines::MakeUPPERCase(objectName)); + state.dataInputProcessing->inputProcessor->getObjectItemNum(state, objectType, UtilityRoutines::makeUPPER(objectName)); int NumAlphas; // Number of PV Array parameter alpha names being passed int NumNums; // Number of PV Array numeric parameters are being passed int IOStat; @@ -4814,7 +4814,7 @@ ElectricTransformer::ElectricTransformer(EnergyPlusData &state, std::string cons // Meter check deferred because they may have not been "loaded" yet, for (int loopCount = 0; loopCount < numWiredMeters; ++loopCount) { - wiredMeterNames_[loopCount] = UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(loopCount + numAlphaBeforeMeter + 1)); + wiredMeterNames_[loopCount] = UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(loopCount + numAlphaBeforeMeter + 1)); // Assign SpecialMeter as TRUE if the meter name is Electricity:Facility or Electricity:HVAC if (UtilityRoutines::SameString(wiredMeterNames_[loopCount], "Electricity:Facility") || UtilityRoutines::SameString(wiredMeterNames_[loopCount], "Electricity:HVAC")) { diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index c2933789aae..80db5a7262d 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -3521,7 +3521,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) thisZoneEvapUnit.DesignAirVolumeFlowRate = Numbers(1); constexpr std::array(FanPlacement::Num)> fanPlacementNamesUC = {"BLOWTHROUGH", "DRAWTHROUGH"}; - thisZoneEvapUnit.FanLocation = static_cast(getEnumerationValue(fanPlacementNamesUC, Alphas(9))); + thisZoneEvapUnit.FanLocation = static_cast(getEnumValue(fanPlacementNamesUC, Alphas(9))); if (thisZoneEvapUnit.FanLocation == FanPlacement::Invalid) { ShowSevereError(state, format("{}=\"{}\" invalid data.", CurrentModuleObject, thisZoneEvapUnit.Name)); ShowContinueError(state, format("invalid choice found {}=\"{}\".", cAlphaFields(9), Alphas(9))); @@ -3541,7 +3541,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) constexpr std::array(ControlType::Num)> controlTypeNamesUC = { "ZONETEMPERATUREDEADBANDONOFFCYCLING", "ZONECOOLINGLOADONOFFCYCLING", "ZONECOOLINGLOADVARIABLESPEEDFAN"}; - thisZoneEvapUnit.ControlSchemeType = static_cast(getEnumerationValue(controlTypeNamesUC, Alphas(10))); + thisZoneEvapUnit.ControlSchemeType = static_cast(getEnumValue(controlTypeNamesUC, Alphas(10))); if (thisZoneEvapUnit.ControlSchemeType == ControlType::Invalid) { ShowSevereError(state, format("{}=\"{}\" invalid data.", CurrentModuleObject, thisZoneEvapUnit.Name)); ShowContinueError(state, format("invalid choice found {}=\"{}\".", cAlphaFields(10), Alphas(10))); @@ -3551,7 +3551,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) thisZoneEvapUnit.ThrottlingRange = Numbers(2); thisZoneEvapUnit.ThresholdCoolingLoad = Numbers(3); - thisZoneEvapUnit.EvapCooler_1_Type_Num = static_cast(getEnumerationValue(evapCoolerTypeNamesUC, Alphas(11))); + thisZoneEvapUnit.EvapCooler_1_Type_Num = static_cast(getEnumValue(evapCoolerTypeNamesUC, Alphas(11))); if (thisZoneEvapUnit.EvapCooler_1_Type_Num != EvapCoolerType::Invalid) { thisZoneEvapUnit.EvapCooler_1_ObjectClassName = evapCoolerTypeNames[static_cast(thisZoneEvapUnit.EvapCooler_1_Type_Num)]; } else { @@ -3569,7 +3569,7 @@ void GetInputZoneEvaporativeCoolerUnit(EnergyPlusData &state) } if (!lAlphaBlanks(13)) { - thisZoneEvapUnit.EvapCooler_2_Type_Num = static_cast(getEnumerationValue(evapCoolerTypeNamesUC, Alphas(13))); + thisZoneEvapUnit.EvapCooler_2_Type_Num = static_cast(getEnumValue(evapCoolerTypeNamesUC, Alphas(13))); if (thisZoneEvapUnit.EvapCooler_2_Type_Num != EvapCoolerType::Invalid) { thisZoneEvapUnit.EvapCooler_2_ObjectClassName = evapCoolerTypeNames[static_cast(thisZoneEvapUnit.EvapCooler_2_Type_Num)]; } else { diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index ef8d38a096f..39d7ba6c77a 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -277,7 +277,7 @@ namespace EvaporativeFluidCoolers { thisEFC.capacityControl = CapacityControl::FanCycling; // FanCycling } else { thisEFC.capacityControl = - static_cast(getEnumerationValue(controlNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(6)))); + static_cast(getEnumValue(controlNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); if (thisEFC.capacityControl == CapacityControl::Invalid) { thisEFC.capacityControl = CapacityControl::FanCycling; ShowWarningError(state, @@ -293,7 +293,7 @@ namespace EvaporativeFluidCoolers { if (AlphArray(7).empty()) { thisEFC.EvapLossMode = EvapLoss::ByMoistTheory; } else { - thisEFC.EvapLossMode = static_cast(getEnumerationValue(evapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(7)))); + thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(7)))); if (thisEFC.EvapLossMode == EvapLoss::Invalid) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(7), AlphArray(7))); ShowContinueError(state, format("Entered in {} = {}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); @@ -328,7 +328,7 @@ namespace EvaporativeFluidCoolers { thisEFC.ConcentrationRatio = 3.0; } } else { - thisEFC.BlowdownMode = static_cast(getEnumerationValue(blowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(8)))); + thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(8)))); if (thisEFC.BlowdownMode == Blowdown::Invalid) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(8), AlphArray(8))); ShowContinueError(state, format("Entered in {} ={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); @@ -634,7 +634,7 @@ namespace EvaporativeFluidCoolers { if (state.dataIPShortCut->lAlphaFieldBlanks(6)) { thisEFC.EvapLossMode = EvapLoss::ByMoistTheory; } else { - thisEFC.EvapLossMode = static_cast(getEnumerationValue(evapLossNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(6)))); + thisEFC.EvapLossMode = static_cast(getEnumValue(evapLossNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); if (thisEFC.EvapLossMode == EvapLoss::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(6), AlphArray(6))); ShowContinueError(state, format("Entered in {} = {}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); @@ -668,7 +668,7 @@ namespace EvaporativeFluidCoolers { thisEFC.ConcentrationRatio = 3.0; } } else { - thisEFC.BlowdownMode = static_cast(getEnumerationValue(blowDownNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(7)))); + thisEFC.BlowdownMode = static_cast(getEnumValue(blowDownNamesUC, UtilityRoutines::makeUPPER(AlphArray(7)))); if (thisEFC.BlowdownMode == Blowdown::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(7), AlphArray(7))); ShowContinueError(state, format("Entered in {} = {}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); diff --git a/src/EnergyPlus/ExhaustAirSystemManager.cc b/src/EnergyPlus/ExhaustAirSystemManager.cc index befb9c49b39..5f53f8ffbf5 100644 --- a/src/EnergyPlus/ExhaustAirSystemManager.cc +++ b/src/EnergyPlus/ExhaustAirSystemManager.cc @@ -124,7 +124,7 @@ namespace ExhaustAirSystemManager { ++exhSysNum; auto const &objectFields = instance.value(); auto &thisExhSys = state.dataZoneEquip->ExhaustAirSystem(exhSysNum); - thisExhSys.Name = UtilityRoutines::MakeUPPERCase(instance.key()); + thisExhSys.Name = UtilityRoutines::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); std::string zoneMixerName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_mixer_name"); @@ -156,7 +156,7 @@ namespace ExhaustAirSystemManager { std::string centralFanType = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "fan_object_type"); int centralFanTypeNum = 0; - // getEnumerationValue()? + // getEnumValue()? if (UtilityRoutines::SameString(centralFanType, "Fan:SystemModel")) { centralFanTypeNum = DataHVACGlobals::FanType_SystemModelObject; @@ -474,7 +474,7 @@ namespace ExhaustAirSystemManager { ++exhCtrlNum; auto const &objectFields = instance.value(); auto &thisExhCtrl = state.dataZoneEquip->ZoneExhaustControlSystem(exhCtrlNum); - thisExhCtrl.Name = UtilityRoutines::MakeUPPERCase(instance.key()); + thisExhCtrl.Name = UtilityRoutines::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); std::string availSchName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "availability_schedule_name"); @@ -533,10 +533,10 @@ namespace ExhaustAirSystemManager { thisExhCtrl.DesignExhaustFlowRate = designExhaustFlowRate; std::string flowControlTypeName = - UtilityRoutines::MakeUPPERCase(ip->getAlphaFieldValue(objectFields, objectSchemaProps, "flow_control_type")); - // std::string flowControlTypeName = UtilityRoutines::MakeUPPERCase(fields.at("flow_control_type").get()); + UtilityRoutines::makeUPPER(ip->getAlphaFieldValue(objectFields, objectSchemaProps, "flow_control_type")); + // std::string flowControlTypeName = UtilityRoutines::makeUPPER(fields.at("flow_control_type").get()); thisExhCtrl.FlowControlOption = - static_cast(getEnumerationValue(flowControlTypeNamesUC, flowControlTypeName)); + static_cast(getEnumValue(flowControlTypeNamesUC, flowControlTypeName)); std::string exhaustFlowFractionScheduleName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "exhaust_flow_fraction_schedule_name"); diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index be79ade2339..af16e54fde7 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -363,7 +363,7 @@ void ParseString(std::string const &str, // The string, with all elements separa } else { // Use rest of string iEnd = lenStr; } - ele(i) = UtilityRoutines::MakeUPPERCase(str.substr(iSta, iEnd - iSta - 1)); + ele(i) = UtilityRoutines::makeUPPER(str.substr(iSta, iEnd - iSta - 1)); } } diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index b138dbad863..8ca917b6fa9 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -288,7 +288,7 @@ namespace FanCoilUnits { "MULTISPEEDFAN", "ASHRAE90VARIABLEFAN"}; std::string capCtrlMeth = Alphas(3); - fanCoil.CapCtrlMeth_Num = static_cast(getEnumerationValue(CapCtrlMethUC, capCtrlMeth)); + fanCoil.CapCtrlMeth_Num = static_cast(getEnumValue(CapCtrlMethUC, capCtrlMeth)); if (fanCoil.CapCtrlMeth_Num == CCM::ASHRAE) { fanCoil.DesZoneCoolingLoad = DataSizing::AutoSize; fanCoil.DesZoneHeatingLoad = DataSizing::AutoSize; diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 2bfbbd25c8d..678a02be6ec 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -570,7 +570,7 @@ void GetFanInput(EnergyPlusData &state) } if (NumAlphas > 6 && !lAlphaFieldBlanks(7)) { - thisFan.AvailManagerMode = static_cast(getEnumerationValue(couplingsUC, cAlphaArgs(7))); + thisFan.AvailManagerMode = static_cast(getEnumValue(couplingsUC, cAlphaArgs(7))); if (thisFan.AvailManagerMode == AvailabilityManagerCoupling::Invalid) { ShowSevereError(state, format("{}{}: invalid {} entered ={} for {}={}", diff --git a/src/EnergyPlus/FaultsManager.cc b/src/EnergyPlus/FaultsManager.cc index 97f0e75dea2..13501c89f73 100644 --- a/src/EnergyPlus/FaultsManager.cc +++ b/src/EnergyPlus/FaultsManager.cc @@ -485,7 +485,7 @@ namespace FaultsManager { // Chiller check int ChillerNum; ChillerType ChillerTypeCheck = - static_cast(getEnumerationValue(ChillerTypeNamesUC, UtilityRoutines::MakeUPPERCase(faultsChillerFouling.ChillerType))); + static_cast(getEnumValue(ChillerTypeNamesUC, UtilityRoutines::makeUPPER(faultsChillerFouling.ChillerType))); switch (ChillerTypeCheck) { case ChillerType::ChillerElectric: { // Check whether the chiller name and chiller type match each other @@ -855,7 +855,7 @@ namespace FaultsManager { // Coil check and link CoilType CoilTypeCheck = - static_cast(getEnumerationValue(CoilTypeNamesUC, UtilityRoutines::MakeUPPERCase(faultsCoilSATFouling.CoilType))); + static_cast(getEnumValue(CoilTypeNamesUC, UtilityRoutines::makeUPPER(faultsCoilSATFouling.CoilType))); switch (CoilTypeCheck) { case CoilType::CoilHeatingElectric: case CoilType::CoilHeatingFuel: @@ -1316,7 +1316,7 @@ namespace FaultsManager { // Chiller check int ChillerNum; ChillerType ChillerTypeCheck = - static_cast(getEnumerationValue(ChillerTypeNamesUC, UtilityRoutines::MakeUPPERCase(faultsChillerSWT.ChillerType))); + static_cast(getEnumValue(ChillerTypeNamesUC, UtilityRoutines::makeUPPER(faultsChillerSWT.ChillerType))); switch (ChillerTypeCheck) { case ChillerType::ChillerElectric: { // Check whether the chiller name and chiller type match each other @@ -1773,7 +1773,7 @@ namespace FaultsManager { } faultsFoulCoil.FoulingInputMethod = - static_cast(getEnumerationValue(FouledCoilNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(5)))); + static_cast(getEnumValue(FouledCoilNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(5)))); if (faultsFoulCoil.FoulingInputMethod == FouledCoil::Invalid) { faultsFoulCoil.FoulingInputMethod = FouledCoil::UARated; } @@ -1958,7 +1958,7 @@ namespace FaultsManager { format("{} = \"{}\" invalid {} = \"{}\" blank.", cFaultCurrentObject, cAlphaArgs(1), cAlphaFieldNames(4), cAlphaArgs(4))); state.dataFaultsMgr->ErrorsFound = true; } else { - if (UtilityRoutines::MakeUPPERCase(cAlphaArgs(4)) == "CONTROLLER:OUTDOORAIR") { + if (UtilityRoutines::makeUPPER(cAlphaArgs(4)) == "CONTROLLER:OUTDOORAIR") { state.dataFaultsMgr->FaultsEconomizer(j).ControllerTypeEnum = iController_AirEconomizer; // CASE ... diff --git a/src/EnergyPlus/FileSystem.cc b/src/EnergyPlus/FileSystem.cc index 7e145bf9c48..00228fff45e 100644 --- a/src/EnergyPlus/FileSystem.cc +++ b/src/EnergyPlus/FileSystem.cc @@ -235,7 +235,7 @@ namespace FileSystem { extension.remove_prefix(extension.find_last_of('.') + 1); std::string stringExtension = std::string(extension); - return static_cast(getEnumerationValue(FileTypesExtUC, UtilityRoutines::MakeUPPERCase(stringExtension))); + return static_cast(getEnumValue(FileTypesExtUC, UtilityRoutines::makeUPPER(stringExtension))); } // TODO: remove for fs::path::replace_extension directly? Note that replace_extension mutates the object diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 58074db984c..dda61c497d1 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -7746,7 +7746,7 @@ namespace FluidProperties { } // Check to see if this glycol shows up in the glycol data - int Found = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase(Refrigerant), state.dataFluidProps->RefrigData); + int Found = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER(Refrigerant), state.dataFluidProps->RefrigData); if (Found > 0) { FindRefrigerant = Found; @@ -7788,7 +7788,7 @@ namespace FluidProperties { } // Check to see if this glycol shows up in the glycol data - int Found = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase(Glycol), + int Found = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER(Glycol), state.dataFluidProps->GlycolData, state.dataFluidProps->NumOfGlycols); // GlycolData is allocated to NumOfGlyConcs @@ -8232,7 +8232,7 @@ namespace FluidProperties { GlycolAPI::GlycolAPI(EnergyPlusData &state, std::string const &glycolName) { - this->glycolName = EnergyPlus::UtilityRoutines::MakeUPPERCase(glycolName); + this->glycolName = EnergyPlus::UtilityRoutines::makeUPPER(glycolName); this->glycolIndex = 0; this->cf = "GlycolAPI:Instance"; if (this->glycolName != "WATER") { @@ -8258,7 +8258,7 @@ namespace FluidProperties { RefrigerantAPI::RefrigerantAPI(EnergyPlusData &state, std::string const &refrigName) { - this->rName = EnergyPlus::UtilityRoutines::MakeUPPERCase(refrigName); + this->rName = EnergyPlus::UtilityRoutines::makeUPPER(refrigName); this->rIndex = 0; this->cf = "RefrigerantAPI:Instance"; if (this->rName != "STEAM") { diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index c4d4cddf73a..d0fecd04c3b 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -127,7 +127,7 @@ namespace FuelCellElectricGenerator { // Now look for this object for (auto &thisFC : state.dataFuelCellElectGen->FuelCell) { - if (UtilityRoutines::MakeUPPERCase(thisFC.NameExhaustHX) == UtilityRoutines::MakeUPPERCase(objectName)) { + if (UtilityRoutines::makeUPPER(thisFC.NameExhaustHX) == UtilityRoutines::makeUPPER(objectName)) { return &thisFC; } } diff --git a/src/EnergyPlus/General.cc b/src/EnergyPlus/General.cc index 170cf152994..b9cd9f90000 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -1133,7 +1133,7 @@ void ScanForReports(EnergyPlusData &state, state.dataIPShortCut->cNumericFieldNames); ReportType checkReportType = - static_cast(getEnumerationValue(ReportTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(1)))); + static_cast(getEnumValue(ReportTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); switch (checkReportType) { case ReportType::DXF: { @@ -1232,17 +1232,17 @@ void ScanForReports(EnergyPlusData &state, state.dataGeneral->EMSoutput = true; AvailRpt CheckAvailRpt = - static_cast(getEnumerationValue(AvailRptNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(1)))); + static_cast(getEnumValue(AvailRptNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); state.dataRuntimeLang->OutputEMSActuatorAvailSmall = (CheckAvailRpt == AvailRpt::NotByUniqueKeyNames); state.dataRuntimeLang->OutputEMSActuatorAvailFull = (CheckAvailRpt == AvailRpt::Verbose); CheckAvailRpt = - static_cast(getEnumerationValue(AvailRptNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2)))); + static_cast(getEnumValue(AvailRptNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); state.dataRuntimeLang->OutputEMSInternalVarsSmall = (CheckAvailRpt == AvailRpt::NotByUniqueKeyNames); state.dataRuntimeLang->OutputEMSInternalVarsFull = (CheckAvailRpt == AvailRpt::Verbose); ERLdebugOutputLevel CheckERLlevel = static_cast( - getEnumerationValue(ERLdebugOutputLevelNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(3)))); + getEnumValue(ERLdebugOutputLevelNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); state.dataRuntimeLang->OutputEMSErrors = (CheckERLlevel == ERLdebugOutputLevel::ErrorsOnly || CheckERLlevel == ERLdebugOutputLevel::Verbose); state.dataRuntimeLang->OutputFullEMSTrace = (CheckERLlevel == ERLdebugOutputLevel::Verbose); @@ -1255,7 +1255,7 @@ void ScanForReports(EnergyPlusData &state, DoReport = false; ReportName rptName = - static_cast(getEnumerationValue(ReportNamesUC, UtilityRoutines::MakeUPPERCase(UtilityRoutines::MakeUPPERCase(reportName)))); + static_cast(getEnumValue(ReportNamesUC, UtilityRoutines::makeUPPER(UtilityRoutines::makeUPPER(reportName)))); switch (rptName) { case ReportName::Constructions: { if (present(ReportKey)) { @@ -1276,7 +1276,7 @@ void ScanForReports(EnergyPlusData &state, // IF (PRESENT(Option1)) Option1=SchRptOption } break; case ReportName::Surfaces: { - RptKey rptKey = static_cast(getEnumerationValue(RptKeyNamesUC, UtilityRoutines::MakeUPPERCase(ReportKey()))); + RptKey rptKey = static_cast(getEnumValue(RptKeyNamesUC, UtilityRoutines::makeUPPER(ReportKey()))); switch (rptKey) { // Autodesk:OPTIONAL ReportKey used without PRESENT check case RptKey::Costinfo: { DoReport = state.dataGeneral->CostInfo; diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 86bebd5b5a2..5b77b80f20e 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -968,8 +968,8 @@ void TestSupplyAirPathIntegrity(EnergyPlusData &state, bool &ErrFound) state.dataZoneEquip->SupplyAirPath(BCount).ComponentName(Count), PrimaryAirLoopName); - AirLoopHVACCompType CompType = static_cast(getEnumerationValue( - AirLoopHVACCompTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataZoneEquip->SupplyAirPath(BCount).ComponentType(Count)))); + AirLoopHVACCompType CompType = static_cast(getEnumValue( + AirLoopHVACCompTypeNamesUC, UtilityRoutines::makeUPPER(state.dataZoneEquip->SupplyAirPath(BCount).ComponentType(Count)))); switch (CompType) { case AirLoopHVACCompType::SupplyPlenum: { @@ -1277,8 +1277,8 @@ void TestReturnAirPathIntegrity(EnergyPlusData &state, bool &ErrFound, Array2S_i if (NumComp > 0) { - AirLoopHVACCompType CompType = static_cast(getEnumerationValue( - AirLoopHVACCompTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(NumComp)))); + AirLoopHVACCompType CompType = static_cast(getEnumValue( + AirLoopHVACCompTypeNamesUC, UtilityRoutines::makeUPPER(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(NumComp)))); switch (CompType) { case AirLoopHVACCompType::ZoneMixer: { @@ -1364,8 +1364,8 @@ void TestReturnAirPathIntegrity(EnergyPlusData &state, bool &ErrFound, Array2S_i if (NumComp > 1) { for (int Count3 = 1; Count3 <= NumComp - 1; ++Count3) { - AirLoopHVACCompType CompType = static_cast(getEnumerationValue( - AirLoopHVACCompTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(Count3)))); + AirLoopHVACCompType CompType = static_cast(getEnumValue( + AirLoopHVACCompTypeNamesUC, UtilityRoutines::makeUPPER(state.dataZoneEquip->ReturnAirPath(BCount).ComponentType(Count3)))); switch (CompType) { case AirLoopHVACCompType::ZoneMixer: { diff --git a/src/EnergyPlus/GlobalNames.cc b/src/EnergyPlus/GlobalNames.cc index 97d56f79407..2ffae0d2c81 100644 --- a/src/EnergyPlus/GlobalNames.cc +++ b/src/EnergyPlus/GlobalNames.cc @@ -155,7 +155,7 @@ void VerifyUniqueChillerName( ShowContinueError(state, format("...Current entry is Chiller Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->ChillerNames.emplace(NameToVerify, UtilityRoutines::MakeUPPERCase(TypeToVerify)); + state.dataGlobalNames->ChillerNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); state.dataGlobalNames->NumChillers = static_cast(state.dataGlobalNames->ChillerNames.size()); } } @@ -183,7 +183,7 @@ void VerifyUniqueBaseboardName(EnergyPlusData &state, ShowContinueError(state, format("...Current entry is Baseboard Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->BaseboardNames.emplace(NameToVerify, UtilityRoutines::MakeUPPERCase(TypeToVerify)); + state.dataGlobalNames->BaseboardNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); state.dataGlobalNames->NumBaseboards = static_cast(state.dataGlobalNames->BaseboardNames.size()); } } @@ -208,7 +208,7 @@ void VerifyUniqueBoilerName( ShowContinueError(state, format("...Current entry is Boiler Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->BoilerNames.emplace(NameToVerify, UtilityRoutines::MakeUPPERCase(TypeToVerify)); + state.dataGlobalNames->BoilerNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); state.dataGlobalNames->NumBoilers = static_cast(state.dataGlobalNames->BoilerNames.size()); } } @@ -240,7 +240,7 @@ void VerifyUniqueCoilName( ShowContinueError(state, format("...Current entry is Coil Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->CoilNames.emplace(NameToVerify, UtilityRoutines::MakeUPPERCase(TypeToVerify)); + state.dataGlobalNames->CoilNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); state.dataGlobalNames->NumCoils = static_cast(state.dataGlobalNames->CoilNames.size()); } } @@ -254,7 +254,7 @@ void VerifyUniqueADUName( ShowContinueError(state, format("...Current entry is Air Distribution Unit Type=\"{}\".", TypeToVerify)); ErrorsFound = true; } else { - state.dataGlobalNames->aDUNames.emplace(NameToVerify, UtilityRoutines::MakeUPPERCase(TypeToVerify)); + state.dataGlobalNames->aDUNames.emplace(NameToVerify, UtilityRoutines::makeUPPER(TypeToVerify)); state.dataGlobalNames->numAirDistUnits = static_cast(state.dataGlobalNames->aDUNames.size()); } } diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index f220b001320..1c38f08255b 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -134,8 +134,8 @@ GLHESlinky::GLHESlinky(EnergyPlusData &state, std::string const &objName, nlohma this->name = objName; - std::string inletNodeName = UtilityRoutines::MakeUPPERCase(j["inlet_node_name"].get()); - std::string outletNodeName = UtilityRoutines::MakeUPPERCase(j["outlet_node_name"].get()); + std::string inletNodeName = UtilityRoutines::makeUPPER(j["inlet_node_name"].get()); + std::string outletNodeName = UtilityRoutines::makeUPPER(j["outlet_node_name"].get()); // get inlet node num this->inletNodeNum = NodeInputManager::GetOnlySingleNode(state, @@ -179,7 +179,7 @@ GLHESlinky::GLHESlinky(EnergyPlusData &state, std::string const &objName, nlohma this->pipe.outRadius = this->pipe.outDia / 2.0; this->pipe.thickness = j["pipe_thickness"].get(); - std::string const hxConfig = UtilityRoutines::MakeUPPERCase(j["heat_exchanger_configuration"].get()); + std::string const hxConfig = UtilityRoutines::makeUPPER(j["heat_exchanger_configuration"].get()); if (UtilityRoutines::SameString(hxConfig, "VERTICAL")) { this->verticalConfig = true; } else if (UtilityRoutines::SameString(hxConfig, "HORIZONTAL")) { @@ -246,8 +246,8 @@ GLHESlinky::GLHESlinky(EnergyPlusData &state, std::string const &objName, nlohma } // Initialize ground temperature model and get pointer reference - std::string const gtmType = UtilityRoutines::MakeUPPERCase(j["undisturbed_ground_temperature_model_type"].get()); - std::string const gtmName = UtilityRoutines::MakeUPPERCase(j["undisturbed_ground_temperature_model_name"].get()); + std::string const gtmType = UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()); + std::string const gtmName = UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_name"].get()); this->groundTempModel = GetGroundTempModelAndInit(state, gtmType, gtmName); // Check for Errors @@ -272,7 +272,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: this->name = objName; // get inlet node num - std::string const inletNodeName = UtilityRoutines::MakeUPPERCase(j["inlet_node_name"].get()); + std::string const inletNodeName = UtilityRoutines::makeUPPER(j["inlet_node_name"].get()); this->inletNodeNum = NodeInputManager::GetOnlySingleNode(state, inletNodeName, errorsFound, @@ -284,7 +284,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: DataLoopNode::ObjectIsNotParent); // get outlet node num - std::string const outletNodeName = UtilityRoutines::MakeUPPERCase(j["outlet_node_name"].get()); + std::string const outletNodeName = UtilityRoutines::makeUPPER(j["outlet_node_name"].get()); this->outletNodeNum = NodeInputManager::GetOnlySingleNode(state, outletNodeName, errorsFound, @@ -308,7 +308,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: if (j.find("ghe_vertical_responsefactors_object_name") != j.end()) { // Response factors come from IDF object this->myRespFactors = - GetResponseFactor(state, UtilityRoutines::MakeUPPERCase(j["ghe_vertical_responsefactors_object_name"].get())); + GetResponseFactor(state, UtilityRoutines::makeUPPER(j["ghe_vertical_responsefactors_object_name"].get())); this->gFunctionsExist = true; } @@ -317,7 +317,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: // g-function calculation method if (j.find("g_function_calculation_method") != j.end()) { - std::string gFunctionMethodStr = UtilityRoutines::MakeUPPERCase(j["g_function_calculation_method"].get()); + std::string gFunctionMethodStr = UtilityRoutines::makeUPPER(j["g_function_calculation_method"].get()); if (gFunctionMethodStr == "UHFCALC") { this->gFuncCalcMethod = GFuncCalcMethod::UniformHeatFlux; } else if (gFunctionMethodStr == "UBHWTCALC") { @@ -332,7 +332,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: if (j.find("ghe_vertical_array_object_name") != j.end()) { // Response factors come from array object this->myRespFactors = BuildAndGetResponseFactorObjectFromArray( - state, GetVertArray(state, UtilityRoutines::MakeUPPERCase(j["ghe_vertical_array_object_name"].get()))); + state, GetVertArray(state, UtilityRoutines::makeUPPER(j["ghe_vertical_array_object_name"].get()))); } else { if (j.find("vertical_well_locations") == j.end()) { // No ResponseFactors, GHEArray, or SingleBH object are referenced @@ -348,7 +348,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: for (auto const &var : vars) { if (!var.at("ghe_vertical_single_object_name").empty()) { std::shared_ptr tempBHptr = - GetSingleBH(state, UtilityRoutines::MakeUPPERCase(var.at("ghe_vertical_single_object_name").get())); + GetSingleBH(state, UtilityRoutines::makeUPPER(var.at("ghe_vertical_single_object_name").get())); tempVectOfBHObjects.push_back(tempBHptr); } else { break; @@ -413,8 +413,8 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: // Initialize ground temperature model and get pointer reference this->groundTempModel = GetGroundTempModelAndInit(state, - UtilityRoutines::MakeUPPERCase(j["undisturbed_ground_temperature_model_type"].get()), - UtilityRoutines::MakeUPPERCase(j["undisturbed_ground_temperature_model_name"].get())); + UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()), + UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_name"].get())); // Check for Errors if (errorsFound) { @@ -434,7 +434,7 @@ GLHEVertSingle::GLHEVertSingle(EnergyPlusData &state, std::string const &objName } this->name = objName; - this->props = GetVertProps(state, UtilityRoutines::MakeUPPERCase(j["ghe_vertical_properties_object_name"].get())); + this->props = GetVertProps(state, UtilityRoutines::makeUPPER(j["ghe_vertical_properties_object_name"].get())); this->xLoc = j["x_location"].get(); this->yLoc = j["y_location"].get(); this->dl_i = 0.0; @@ -454,7 +454,7 @@ GLHEVertArray::GLHEVertArray(EnergyPlusData &state, std::string const &objName, } this->name = objName; - this->props = GetVertProps(state, UtilityRoutines::MakeUPPERCase(j["ghe_vertical_properties_object_name"].get())); + this->props = GetVertProps(state, UtilityRoutines::makeUPPER(j["ghe_vertical_properties_object_name"].get())); this->numBHinXDirection = j["number_of_boreholes_in_x_direction"].get(); this->numBHinYDirection = j["number_of_boreholes_in_y_direction"].get(); this->bhSpacing = j["borehole_spacing"].get(); @@ -473,7 +473,7 @@ GLHEResponseFactors::GLHEResponseFactors(EnergyPlusData &state, std::string cons } this->name = objName; - this->props = GetVertProps(state, UtilityRoutines::MakeUPPERCase(j["ghe_vertical_properties_object_name"].get())); + this->props = GetVertProps(state, UtilityRoutines::makeUPPER(j["ghe_vertical_properties_object_name"].get())); this->numBoreholes = j["number_of_boreholes"].get(); this->gRefRatio = j["g_function_reference_ratio"].get(); this->maxSimYears = state.dataEnvrn->MaxNumberSimYears; @@ -2405,7 +2405,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::MakeUPPERCase(objName); + std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); std::shared_ptr thisObj(new GLHEVertProps(state, objNameUC, instance)); state.dataGroundHeatExchanger->vertPropsVector.push_back(thisObj); @@ -2425,7 +2425,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::MakeUPPERCase(objName); + std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); std::shared_ptr thisObj(new GLHEResponseFactors(state, objNameUC, instance)); state.dataGroundHeatExchanger->responseFactorsVector.push_back(thisObj); @@ -2445,7 +2445,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::MakeUPPERCase(objName); + std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); std::shared_ptr thisObj(new GLHEVertArray(state, objNameUC, instance)); state.dataGroundHeatExchanger->vertArraysVector.push_back(thisObj); @@ -2465,7 +2465,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::MakeUPPERCase(objName); + std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); std::shared_ptr thisObj(new GLHEVertSingle(state, objNameUC, instance)); state.dataGroundHeatExchanger->singleBoreholesVector.push_back(thisObj); @@ -2485,7 +2485,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::MakeUPPERCase(objName); + std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); state.dataGroundHeatExchanger->verticalGLHE.emplace_back(state, objNameUC, instance); } @@ -2505,7 +2505,7 @@ void GetGroundHeatExchangerInput(EnergyPlusData &state) for (auto it = instancesValue.begin(); it != instancesValue.end(); ++it) { auto const &instance = it.value(); std::string const &objName = it.key(); - std::string const &objNameUC = UtilityRoutines::MakeUPPERCase(objName); + std::string const &objNameUC = UtilityRoutines::makeUPPER(objName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(currObj, objName); state.dataGroundHeatExchanger->slinkyGLHE.emplace_back(state, objNameUC, instance); } diff --git a/src/EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.cc b/src/EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.cc index 1bea8c6026b..2d349746751 100644 --- a/src/EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.cc +++ b/src/EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.cc @@ -97,7 +97,7 @@ namespace GroundTemperatureManager { // Set object type GroundTempObjType objectType = - static_cast(getEnumerationValue(groundTempModelNamesUC, UtilityRoutines::MakeUPPERCase(objectType_str))); + static_cast(getEnumValue(groundTempModelNamesUC, UtilityRoutines::makeUPPER(objectType_str))); assert(objectType != GroundTempObjType::Invalid); diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index 7a454da8e63..299e64cb6a1 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -479,7 +479,7 @@ void GetControllerInput(EnergyPlusData &state) controllerProps.ControllerName = AlphArray(1); controllerProps.ControllerType = CurrentModuleObject; - controllerProps.ControlVar = static_cast(getEnumerationValue(ctrlVarNamesUC, AlphArray(2))); + controllerProps.ControlVar = static_cast(getEnumValue(ctrlVarNamesUC, AlphArray(2))); if (controllerProps.ControlVar == HVACControllers::CtrlVarType::Invalid) { ShowSevereError(state, format("{}{}=\"{}\".", RoutineName, CurrentModuleObject, AlphArray(1))); ShowSevereError(state, @@ -489,7 +489,7 @@ void GetControllerInput(EnergyPlusData &state) ErrorsFound = true; } - controllerProps.Action = static_cast(getEnumerationValue(actionNamesUC, AlphArray(3))); + controllerProps.Action = static_cast(getEnumValue(actionNamesUC, AlphArray(3))); if (controllerProps.Action == ControllerAction::Invalid) { ShowSevereError(state, format("{}{}=\"{}\".", RoutineName, CurrentModuleObject, AlphArray(1))); ShowSevereError(state, format("...Invalid {}=\"{}{}", cAlphaFields(3), AlphArray(3), R"(", must be "Normal", "Reverse" or blank.)")); diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 9c870c3fd63..70728a84104 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -602,7 +602,7 @@ namespace HVACUnitaryBypassVAV { // required field must be Key=Fan:ConstantVolume, Fan:OnOff or Fan:SystemModel and read in as upper case std::string fanTypeString = Alphas(10); - thisCBVAV.FanType = static_cast(getEnumerationValue(DataHVACGlobals::fanTypeNamesUC, fanTypeString)); + thisCBVAV.FanType = static_cast(getEnumValue(DataHVACGlobals::fanTypeNamesUC, fanTypeString)); thisCBVAV.FanName = Alphas(11); int fanOutletNode(0); @@ -630,7 +630,7 @@ namespace HVACUnitaryBypassVAV { } // required field must be Key=BlowThrough or DrawThrough and read in as BLOWTHROUGH or DRAWTHROUGH - thisCBVAV.FanPlace = static_cast(getEnumerationValue(DataHVACGlobals::fanLocNamesUC, Alphas(12))); + thisCBVAV.FanPlace = static_cast(getEnumValue(DataHVACGlobals::fanLocNamesUC, Alphas(12))); if (thisCBVAV.FanPlace == DataHVACGlobals::FanLoc::DrawThrough) { if (thisCBVAV.SplitterOutletAirNode != fanOutletNode) { @@ -693,7 +693,7 @@ namespace HVACUnitaryBypassVAV { } std::string thisCoolCoilType = Alphas(14); - thisCBVAV.CoolCoilType = static_cast(getEnumerationValue(DataHVACGlobals::coilTypeNamesUC, thisCoolCoilType)); + thisCBVAV.CoolCoilType = static_cast(getEnumValue(DataHVACGlobals::coilTypeNamesUC, thisCoolCoilType)); thisCBVAV.DXCoolCoilName = Alphas(15); if (thisCBVAV.CoolCoilType == DataHVACGlobals::CoilType::DXCoolingSingleSpeed) { @@ -850,7 +850,7 @@ namespace HVACUnitaryBypassVAV { } std::string thisHeatCoilType = Alphas(16); - thisCBVAV.HeatCoilType = static_cast(getEnumerationValue(DataHVACGlobals::coilTypeNamesUC, thisHeatCoilType)); + thisCBVAV.HeatCoilType = static_cast(getEnumValue(DataHVACGlobals::coilTypeNamesUC, thisHeatCoilType)); thisCBVAV.HeatCoilName = Alphas(17); DXCoilErrFlag = false; diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index dfe294ef434..6b7c11fe023 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -2036,7 +2036,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) thisVrfSys.MasterZonePtr = UtilityRoutines::FindItemInList(cAlphaArgs(24), state.dataHeatBal->Zone); - thisVrfSys.ThermostatPriority = static_cast(getEnumerationValue(ThermostatCtrlTypeUC, cAlphaArgs(25))); + thisVrfSys.ThermostatPriority = static_cast(getEnumValue(ThermostatCtrlTypeUC, cAlphaArgs(25))); if (thisVrfSys.ThermostatPriority == ThermostatCtrlType::MasterThermostatPriority) { if (thisVrfSys.MasterZonePtr == 0) { @@ -2117,7 +2117,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) if (!lAlphaFieldBlanks(31)) { thisVrfSys.DefrostStrategy = - static_cast(getEnumerationValue(StandardRatings::DefrostStratUC, cAlphaArgs(31))); + static_cast(getEnumValue(StandardRatings::DefrostStratUC, cAlphaArgs(31))); if (thisVrfSys.DefrostStrategy == StandardRatings::DefrostStrat::Invalid) { ShowSevereError(state, format("{}, \"{}\" {} not found: {}", cCurrentModuleObject, thisVrfSys.Name, cAlphaFieldNames(31), cAlphaArgs(31))); @@ -2129,7 +2129,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) if (!lAlphaFieldBlanks(32)) { thisVrfSys.DefrostControl = - static_cast(getEnumerationValue(StandardRatings::HPdefrostControlUC, cAlphaArgs(32))); + static_cast(getEnumValue(StandardRatings::HPdefrostControlUC, cAlphaArgs(32))); if (thisVrfSys.DefrostControl == StandardRatings::HPdefrostControl::Invalid) { ShowSevereError(state, @@ -2322,7 +2322,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) if (!lAlphaFieldBlanks(39)) { // A39; \field Fuel type, Validate fuel type input - thisVrfSys.fuel = static_cast(getEnumerationValue(Constant::eFuelNamesUC, cAlphaArgs(39))); + thisVrfSys.fuel = static_cast(getEnumValue(Constant::eFuelNamesUC, cAlphaArgs(39))); if (thisVrfSys.fuel == Constant::eFuel::Invalid) { ShowSevereError( state, diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index 8f3eb40103d..010a1abb109 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -304,7 +304,7 @@ namespace HWBaseboardRadiator { // Determine HW radiant baseboard heating design capacity sizing method thisHWBaseboardDesign.HeatingCapMethod = static_cast( - getEnumerationValue(DataSizing::DesignSizingTypeNamesUC, state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum))); + getEnumValue(DataSizing::DesignSizingTypeNamesUC, state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum))); if (thisHWBaseboardDesign.HeatingCapMethod == DataSizing::DesignSizingType::CapacityPerFloorArea) { if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) { thisHWBaseboardDesign.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum); diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index defd2c66776..febe9c5657d 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -172,7 +172,7 @@ namespace HeatBalFiniteDiffManager { if (!state.dataIPShortCut->lAlphaFieldBlanks(1)) { { state.dataHeatBalFiniteDiffMgr->CondFDSchemeType = static_cast( - getEnumerationValue(CondFDSchemeTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(1)))); + getEnumValue(CondFDSchemeTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1)))); if (state.dataHeatBalFiniteDiffMgr->CondFDSchemeType == CondFDScheme::Invalid) { ShowSevereError(state, format("{}: invalid {} entered={}, must match CrankNicholsonSecondOrder or FullyImplicitFirstOrder.", diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 980ffe85dc7..d4f19ce1368 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -485,8 +485,8 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err { thisZoneAirBalance.BalanceMethod = static_cast( - getEnumerationValue(DataHeatBalance::AirBalanceTypeNamesUC, - UtilityRoutines::MakeUPPERCase(cAlphaArgs(3)))); // Air balance method type character input-->convert to enum + getEnumValue(DataHeatBalance::AirBalanceTypeNamesUC, + UtilityRoutines::makeUPPER(cAlphaArgs(3)))); // Air balance method type character input-->convert to enum if (thisZoneAirBalance.BalanceMethod == DataHeatBalance::AirBalance::Invalid) { thisZoneAirBalance.BalanceMethod = DataHeatBalance::AirBalance::None; ShowWarningError(state, @@ -747,7 +747,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err // Set space flow fractions // Infiltration equipment design level calculation method. AirflowSpecAlt flow = - static_cast(getEnumerationValue(airflowAltNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) + static_cast(getEnumValue(airflowAltNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) switch (flow) { case AirflowSpecAlt::Flow: case AirflowSpecAlt::FlowPerZone: @@ -1399,7 +1399,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } // Ventilation equipment design level calculation method - AirflowSpec flow = static_cast(getEnumerationValue(airflowNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) + AirflowSpec flow = static_cast(getEnumValue(airflowNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) switch (flow) { case AirflowSpec::Flow: case AirflowSpec::FlowPerZone: @@ -1530,7 +1530,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err thisVentilation.FanType = DataHeatBalance::VentilationType::Natural; } else { thisVentilation.FanType = - static_cast(getEnumerationValue(ventilationTypeNamesUC, cAlphaArgs(5))); + static_cast(getEnumValue(ventilationTypeNamesUC, cAlphaArgs(5))); if (thisVentilation.FanType == DataHeatBalance::VentilationType::Invalid) { ShowSevereError(state, format(R"({}{}="{}". invalid {}="{}".)", @@ -2579,7 +2579,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } // Mixing equipment design level calculation method - AirflowSpec flow = static_cast(getEnumerationValue(airflowNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) + AirflowSpec flow = static_cast(getEnumValue(airflowNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) switch (flow) { case AirflowSpec::Flow: case AirflowSpec::FlowPerZone: @@ -3198,7 +3198,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } // Mixing equipment design level calculation method. - AirflowSpec flow = static_cast(getEnumerationValue(airflowNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) + AirflowSpec flow = static_cast(getEnumValue(airflowNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) switch (flow) { case AirflowSpec::Flow: case AirflowSpec::FlowPerZone: @@ -4595,7 +4595,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if state.dataIPShortCut->cNumericFieldNames); ZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); if (ZoneNum != 0) { - if (!state.dataRoomAirMod->AirModel(ZoneNum).AirModelName.empty()) { + if (!state.dataRoomAirMod->AirModel(ZoneNum).Name.empty()) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, "Duplicate zone name, only one type of roomair model is allowed per zone"); @@ -4603,19 +4603,19 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if format("Zone {} was already assigned a roomair model by {} = {}", state.dataIPShortCut->cAlphaArgs(2), cCurrentModuleObject, - state.dataRoomAirMod->AirModel(ZoneNum).AirModelName)); + roomAirModelNamesUC[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel])); ShowContinueError(state, format("Air Model Type for zone already set to {}", - DataRoomAirModel::ChAirModel[static_cast(state.dataRoomAirMod->AirModel(ZoneNum).AirModelType)])); + roomAirModelNamesUC[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel])); ShowContinueError(state, format("Trying to overwrite with model type = {}", state.dataIPShortCut->cAlphaArgs(3))); ErrorsFound = true; } - state.dataRoomAirMod->AirModel(ZoneNum).AirModelName = state.dataIPShortCut->cAlphaArgs(1); state.dataRoomAirMod->AirModel(ZoneNum).ZoneName = state.dataIPShortCut->cAlphaArgs(2); - state.dataRoomAirMod->AirModel(ZoneNum).AirModelType = - static_cast(getEnumerationValue(roomAirModelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); - switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModelType) { + // state.dataRoomAirMod->AirModel(ZoneNum).AirModelName = state.dataIPShortCut->cAlphaArgs(1); + state.dataRoomAirMod->AirModel(ZoneNum).AirModel = + static_cast(getEnumValue(roomAirModelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); // is this arg1 or arg3? + switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModel) { case DataRoomAirModel::RoomAirModel::Mixing: // nothing to do here actually break; @@ -4723,11 +4723,11 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if ShowWarningError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("The mixing air model will be used for Zone ={}", state.dataIPShortCut->cAlphaArgs(2))); - state.dataRoomAirMod->AirModel(ZoneNum).AirModelType = DataRoomAirModel::RoomAirModel::Mixing; + state.dataRoomAirMod->AirModel(ZoneNum).AirModel = DataRoomAirModel::RoomAirModel::Mixing; } state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme = - static_cast(getEnumerationValue(couplingSchemeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); + static_cast(getEnumValue(couplingSchemeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); if (state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme == DataRoomAirModel::CouplingScheme::Invalid) { ShowWarningError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -4744,10 +4744,10 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { // this used to be an if (NumOfAirModels == 0) block, but both the IF and the ELSE had the same content, these two lines: - state.dataRoomAirMod->AirModel(ZoneNum).AirModelName = "MIXING AIR MODEL FOR " + state.dataHeatBal->Zone(ZoneNum).Name; + state.dataRoomAirMod->AirModel(ZoneNum).Name = "MIXING AIR MODEL FOR " + state.dataHeatBal->Zone(ZoneNum).Name; state.dataRoomAirMod->AirModel(ZoneNum).ZoneName = state.dataHeatBal->Zone(ZoneNum).Name; // set global flag for non-mixing model - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModelType != DataRoomAirModel::RoomAirModel::Mixing) { + if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != DataRoomAirModel::RoomAirModel::Mixing) { state.dataRoomAirMod->anyNonMixingRoomAirModel = true; } } @@ -4766,7 +4766,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if { static constexpr std::string_view RoomAirZoneFmt("RoomAir Model,{},{}\n"); - switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModelType) { + switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModel) { case DataRoomAirModel::RoomAirModel::Mixing: { print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "Mixing/Well-Stirred"); } break; diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 84eed19b153..4a75eb6d29f 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -1121,7 +1121,7 @@ namespace HeatBalanceIntRadExchange { for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); std::string const thisSpaceOrSpaceListName = - UtilityRoutines::MakeUPPERCase(fields.at("zone_or_zonelist_or_space_or_spacelist_name").get()); + UtilityRoutines::makeUPPER(fields.at("zone_or_zonelist_or_space_or_spacelist_name").get()); // do not mark object as used here - let GetInputViewFactorsbyName do that // Look for matching radiant enclosure name (solar enclosures have the same names) diff --git a/src/EnergyPlus/HeatBalanceInternalHeatGains.cc b/src/EnergyPlus/HeatBalanceInternalHeatGains.cc index e9339c6e036..8c0a41d9d7b 100644 --- a/src/EnergyPlus/HeatBalanceInternalHeatGains.cc +++ b/src/EnergyPlus/HeatBalanceInternalHeatGains.cc @@ -122,7 +122,7 @@ void SetupSpaceInternalGain(EnergyPlusData &state, int constexpr DeviceAllocInc(100); bool FoundDuplicate = false; - std::string UpperCaseObjectName = UtilityRoutines::MakeUPPERCase(cComponentName); + std::string UpperCaseObjectName = UtilityRoutines::makeUPPER(cComponentName); auto &thisIntGain = state.dataHeatBal->spaceIntGainDevices(spaceNum); for (int IntGainsNum = 1; IntGainsNum <= thisIntGain.numberOfDevices; ++IntGainsNum) { diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index ef9d2e59370..be91359f2d6 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -502,7 +502,7 @@ void KivaManager::readWeatherData(EnergyPlusData &state) } if (Pos != std::string::npos) LineResult.data.erase(0, Pos + 1); - if (UtilityRoutines::MakeUPPERCase(Header(HdLine)) == "DATA PERIODS") { + if (UtilityRoutines::makeUPPER(Header(HdLine)) == "DATA PERIODS") { bool IOStatus; uppercase(LineResult.data); int NumHdArgs = 2; diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 63772a7c60c..14e45c42546 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -730,7 +730,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - Convect::HcInt hcIn = static_cast(getEnumerationValue(Convect::HcIntNamesUC, AlphaName(1))); + Convect::HcInt hcIn = static_cast(getEnumValue(Convect::HcIntNamesUC, AlphaName(1))); if (hcIn == Convect::HcInt::TrombeWall) { ShowSevereError(state, @@ -770,7 +770,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - Convect::HcExt hcOut = static_cast(getEnumerationValue(Convect::HcExtNamesUC, AlphaName(1))); + Convect::HcExt hcOut = static_cast(getEnumValue(Convect::HcExtNamesUC, AlphaName(1))); if (hcOut != Convect::HcExt::ASHRAESimple && hcOut != Convect::HcExt::ASHRAETARP && hcOut != Convect::HcExt::MoWiTTHcOutside && hcOut != Convect::HcExt::DOE2HcOutside && hcOut != Convect::HcExt::AdaptiveConvectionAlgorithm) { @@ -1110,7 +1110,7 @@ namespace HeatBalanceManager { state.dataIPShortCut->cNumericFieldNames); if (NumAlpha > 0) { { - int FlowTypeNum = getEnumerationValue(DataHeatBalance::AdjustmentTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphaName(1))); + int FlowTypeNum = getEnumValue(DataHeatBalance::AdjustmentTypeNamesUC, UtilityRoutines::makeUPPER(AlphaName(1))); state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment = static_cast(FlowTypeNum); AlphaName(1) = DataHeatBalance::AdjustmentTypeNamesCC[FlowTypeNum]; DataHeatBalance::AdjustmentType ZoneFlowAdjustment = state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment; @@ -1134,7 +1134,7 @@ namespace HeatBalanceManager { } if (NumAlpha > 1) { { - int FlowTypeNum = getEnumerationValue(DataHeatBalance::InfiltrationFlowTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphaName(2))); + int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationFlowTypeNamesUC, UtilityRoutines::makeUPPER(AlphaName(2))); state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment = static_cast(FlowTypeNum); AlphaName(2) = DataHeatBalance::InfiltrationFlowTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationTreatment == DataHeatBalance::InfiltrationFlow::Add || @@ -1163,7 +1163,7 @@ namespace HeatBalanceManager { if (NumAlpha > 2) { { int FlowTypeNum = - getEnumerationValue(DataHeatBalance::InfiltrationZoneTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphaName(3))); + getEnumValue(DataHeatBalance::InfiltrationZoneTypeNamesUC, UtilityRoutines::makeUPPER(AlphaName(3))); state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones = static_cast(FlowTypeNum); AlphaName(3) = DataHeatBalance::InfiltrationZoneTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones == DataHeatBalance::InfiltrationZoneType::Invalid) { @@ -1703,9 +1703,9 @@ namespace HeatBalanceManager { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - std::string const thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const thisObjectName = UtilityRoutines::makeUPPER(instance.key()); - std::string construction_name = UtilityRoutines::MakeUPPERCase(fields.at("construction_name").get()); + std::string construction_name = UtilityRoutines::makeUPPER(fields.at("construction_name").get()); int source_after_layer_number = fields.at("thermal_source_present_after_layer_number").get(); int calculation_after_layer_number = fields.at("temperature_calculation_requested_after_layer_number").get(); int ctf_dimensions = fields.at("dimensions_for_the_ctf_calculation").get(); @@ -2469,7 +2469,7 @@ namespace HeatBalanceManager { if (NumNumbers >= 9) state.dataHeatBal->Zone(ZoneLoop).UserEnteredFloorArea = rNumericArgs(9); if (NumAlphas > 1 && !state.dataIPShortCut->lAlphaFieldBlanks(2)) { - Convect::HcInt hcIn = static_cast(getEnumerationValue(Convect::HcIntNamesUC, cAlphaArgs(2))); + Convect::HcInt hcIn = static_cast(getEnumValue(Convect::HcIntNamesUC, cAlphaArgs(2))); if (hcIn != Convect::HcInt::ASHRAESimple && hcIn != Convect::HcInt::ASHRAETARP && hcIn != Convect::HcInt::CeilingDiffuser && hcIn != Convect::HcInt::TrombeWall && hcIn != Convect::HcInt::AdaptiveConvectionAlgorithm && hcIn != Convect::HcInt::ASTMC1340) { @@ -2486,7 +2486,7 @@ namespace HeatBalanceManager { if (NumAlphas > 2 && !state.dataIPShortCut->lAlphaFieldBlanks(3)) { - Convect::HcExt hcOut = static_cast(getEnumerationValue(Convect::HcExtNamesUC, cAlphaArgs(3))); + Convect::HcExt hcOut = static_cast(getEnumValue(Convect::HcExtNamesUC, cAlphaArgs(3))); if (hcOut != Convect::HcExt::ASHRAESimple && hcOut != Convect::HcExt::ASHRAETARP && hcOut != Convect::HcExt::MoWiTTHcOutside && hcOut != Convect::HcExt::DOE2HcOutside && hcOut != Convect::HcExt::AdaptiveConvectionAlgorithm) { @@ -2567,7 +2567,7 @@ namespace HeatBalanceManager { ++spaceNum; auto const &objectFields = instance.value(); auto &thisSpace = state.dataHeatBal->space(spaceNum); - thisSpace.Name = UtilityRoutines::MakeUPPERCase(instance.key()); + thisSpace.Name = UtilityRoutines::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); std::string zoneName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_name"); thisSpace.CeilingHeight = ip->getRealFieldValue(objectFields, objectSchemaProps, "ceiling_height"); @@ -2626,7 +2626,7 @@ namespace HeatBalanceManager { ++spaceListNum; auto const &objectFields = instance.value(); auto &thisSpaceList = state.dataHeatBal->spaceList(spaceListNum); - thisSpaceList.Name = UtilityRoutines::MakeUPPERCase(instance.key()); + thisSpaceList.Name = UtilityRoutines::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); if (UtilityRoutines::FindItemInList(thisSpaceList.Name, state.dataHeatBal->Zone) > 0) { @@ -3647,7 +3647,7 @@ namespace HeatBalanceManager { frameDivider.FrameEmis = FrameDividerProps(8); DataSurfaces::FrameDividerType currentDividerType = - DataSurfaces::FrameDividerType(getEnumerationValue(FrameDividerTypeNamesUC, FrameDividerAlphas(2))); + DataSurfaces::FrameDividerType(getEnumValue(FrameDividerTypeNamesUC, FrameDividerAlphas(2))); if (currentDividerType == DataSurfaces::FrameDividerType::Invalid) { ShowWarningError(state, fmt::format("{}={}, Invalid {}", @@ -3678,7 +3678,7 @@ namespace HeatBalanceManager { frameDivider.DividerEmis = FrameDividerProps(18); // look up the NFRC Product Type for Assembly Calculations using the DataSurfaces::NfrcProductName - frameDivider.NfrcProductType = DataSurfaces::NfrcProductOptions(getEnumerationValue(NfrcProductNamesUC, FrameDividerAlphas(3))); + frameDivider.NfrcProductType = DataSurfaces::NfrcProductOptions(getEnumValue(NfrcProductNamesUC, FrameDividerAlphas(3))); if (frameDivider.NfrcProductType == DataSurfaces::NfrcProductOptions::Invalid) { frameDivider.NfrcProductType = DataSurfaces::NfrcProductOptions::CurtainWall; } @@ -3902,7 +3902,7 @@ namespace HeatBalanceManager { // Get window name and check for match W5Name = std::string{DataLine(4).substr(19)}; - WindowNameInW5DataFile = UtilityRoutines::MakeUPPERCase(W5Name); + WindowNameInW5DataFile = UtilityRoutines::makeUPPER(W5Name); if (DesiredConstructionName != WindowNameInW5DataFile) { // Doesn't match; read through file until next window entry is found Label20:; @@ -4988,7 +4988,7 @@ namespace HeatBalanceManager { ++constrNum; auto &thisConstruct = state.dataConstruction->Construct(constrNum); - thisConstruct.Name = UtilityRoutines::MakeUPPERCase(thisObjectName); + thisConstruct.Name = UtilityRoutines::makeUPPER(thisObjectName); thisConstruct.TypeIsAirBoundary = true; thisConstruct.IsUsedCTF = false; @@ -5009,7 +5009,7 @@ namespace HeatBalanceManager { } if (fields.find("simple_mixing_schedule_name") != fields.end()) { const std::string &schedName = fields.at("simple_mixing_schedule_name").get(); - thisConstruct.AirBoundaryMixingSched = ScheduleManager::GetScheduleIndex(state, UtilityRoutines::MakeUPPERCase(schedName)); + thisConstruct.AirBoundaryMixingSched = ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(schedName)); if (thisConstruct.AirBoundaryMixingSched == 0) { ShowSevereError(state, format("{}{}=\"{}\", invalid (not found) Simple Mixing Schedule Name=\"{}\".", diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 40d0c76f286..200fffc21b3 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -298,7 +298,7 @@ namespace HeatRecovery { constexpr std::array(HXConfiguration::Num)> hxConfigurationNamesUC = { "COUNTERFLOW", "PARALLELFLOW", "CROSSFLOWBOTHUNMIXED", "CROSS_FLOW_OTHER_NOT_USED"}; - thisExchanger.FlowArr = static_cast(getEnumerationValue(hxConfigurationNamesUC, state.dataIPShortCut->cAlphaArgs(3))); + thisExchanger.FlowArr = static_cast(getEnumValue(hxConfigurationNamesUC, state.dataIPShortCut->cAlphaArgs(3))); if (thisExchanger.FlowArr == HXConfiguration::Invalid) { ShowSevereError(state, format("{}: incorrect flow arrangement: {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(3))); ErrorsFound = true; @@ -510,7 +510,7 @@ namespace HeatRecovery { // Added additional inputs for frost control thisExchanger.FrostControlType = - static_cast(getEnumerationValue(frostControlNamesUC, state.dataIPShortCut->cAlphaArgs(9))); + static_cast(getEnumValue(frostControlNamesUC, state.dataIPShortCut->cAlphaArgs(9))); if (thisExchanger.FrostControlType == FrostControlOption::Invalid) { ShowSevereError(state, format("Invalid Frost Control method for {} = {}", thisExchanger.Name, state.dataIPShortCut->cAlphaArgs(9))); ErrorsFound = true; diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index c199a9bf08b..f621d3fcb6c 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -642,7 +642,7 @@ namespace HeatingCoils { heatingCoil.HeatingCoilModel = "Fuel"; heatingCoil.HCoilType_Num = DataHVACGlobals::Coil_HeatingGasOrOtherFuel; - heatingCoil.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, Alphas(3))); + heatingCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(3))); if (!(heatingCoil.FuelType == Constant::eFuel::NaturalGas || heatingCoil.FuelType == Constant::eFuel::Propane || heatingCoil.FuelType == Constant::eFuel::Diesel || heatingCoil.FuelType == Constant::eFuel::Gasoline || heatingCoil.FuelType == Constant::eFuel::FuelOilNo1 || heatingCoil.FuelType == Constant::eFuel::FuelOilNo2 || diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index 6bf5ff056d8..5f2b60e1eed 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -287,7 +287,7 @@ namespace HighTempRadiantSystem { // Determine High Temp Radiant heating design capacity sizing method highTempRadSys.HeatingCapMethod = static_cast( - getEnumerationValue(DataSizing::DesignSizingTypeNamesUC, state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum))); + getEnumValue(DataSizing::DesignSizingTypeNamesUC, state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum))); if (highTempRadSys.HeatingCapMethod == DataSizing::DesignSizingType::HeatingDesignCapacity) { if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatDesignCapacityNumericNum)) { highTempRadSys.ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum); @@ -369,7 +369,7 @@ namespace HighTempRadiantSystem { } highTempRadSys.HeaterType = - static_cast(getEnumerationValue(Constant::eResourceNamesUC, state.dataIPShortCut->cAlphaArgs(5))); + static_cast(getEnumValue(Constant::eResourceNamesUC, state.dataIPShortCut->cAlphaArgs(5))); if (highTempRadSys.HeaterType == Constant::eResource::NaturalGas) { highTempRadSys.CombustionEffic = state.dataIPShortCut->rNumericArgs(4); @@ -447,7 +447,7 @@ namespace HighTempRadiantSystem { } // Process the temperature control type - highTempRadSys.ControlType = static_cast(getEnumerationValue(radControlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(6))); + highTempRadSys.ControlType = static_cast(getEnumValue(radControlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(6))); highTempRadSys.ThrottlRange = state.dataIPShortCut->rNumericArgs(8); if (highTempRadSys.ThrottlRange < MinThrottlingRange) { diff --git a/src/EnergyPlus/HybridModel.cc b/src/EnergyPlus/HybridModel.cc index bd2dac2322a..65f5b7bf26a 100644 --- a/src/EnergyPlus/HybridModel.cc +++ b/src/EnergyPlus/HybridModel.cc @@ -495,8 +495,8 @@ namespace HybridModel { for (ZonePtr = 1; ZonePtr <= state.dataGlobal->NumOfZones; ZonePtr++) { if ((state.dataHybridModel->HybridModelZone(ZonePtr).InternalThermalMassCalc_T || state.dataHybridModel->HybridModelZone(ZonePtr).InfiltrationCalc_T) && - (state.dataRoomAirMod->AirModel(ZonePtr).AirModelType != DataRoomAirModel::RoomAirModel::Mixing)) { - state.dataRoomAirMod->AirModel(ZonePtr).AirModelType = DataRoomAirModel::RoomAirModel::Mixing; + (state.dataRoomAirMod->AirModel(ZonePtr).AirModel != DataRoomAirModel::RoomAirModel::Mixing)) { + state.dataRoomAirMod->AirModel(ZonePtr).AirModel = DataRoomAirModel::RoomAirModel::Mixing; ShowWarningError(state, "Room Air Model Type should be Mixing if Hybrid Modeling is performed for the zone."); } } diff --git a/src/EnergyPlus/ICEngineElectricGenerator.cc b/src/EnergyPlus/ICEngineElectricGenerator.cc index b9d16a866bb..0afb251f2a8 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.cc +++ b/src/EnergyPlus/ICEngineElectricGenerator.cc @@ -292,7 +292,7 @@ namespace ICEngineElectricGenerator { // Validate fuel type input state.dataICEngElectGen->ICEngineGenerator(genNum).FuelType = - static_cast(getEnumerationValue(Constant::eFuelNamesUC, AlphArray(10))); + static_cast(getEnumValue(Constant::eFuelNamesUC, AlphArray(10))); if (state.dataICEngElectGen->ICEngineGenerator(genNum).FuelType == Constant::eFuel::Invalid) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(10), AlphArray(10))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); diff --git a/src/EnergyPlus/IOFiles.cc b/src/EnergyPlus/IOFiles.cc index 48849a6d569..7f851524bae 100644 --- a/src/EnergyPlus/IOFiles.cc +++ b/src/EnergyPlus/IOFiles.cc @@ -326,7 +326,7 @@ void IOFiles::OutputControl::getInput(EnergyPlusData &state) auto found = fields.find(field_name); if (found != fields.end()) { input = found.value().get(); - input = UtilityRoutines::MakeUPPERCase(input); + input = UtilityRoutines::makeUPPER(input); } else { state.dataInputProcessing->inputProcessor->getDefaultValue(state, "OutputControl:Files", field_name, input); } diff --git a/src/EnergyPlus/InputProcessing/InputProcessor.cc b/src/EnergyPlus/InputProcessing/InputProcessor.cc index 72b2abd144c..a667aaec37e 100644 --- a/src/EnergyPlus/InputProcessing/InputProcessor.cc +++ b/src/EnergyPlus/InputProcessing/InputProcessor.cc @@ -144,7 +144,7 @@ json const &InputProcessor::getFields(EnergyPlusData &state, std::string const & if (it2 == objs.end()) { // HACK: this is not ideal and should be removed once everything is case sensitive internally for (auto it3 = objs.begin(); it3 != objs.end(); ++it3) { - if (UtilityRoutines::MakeUPPERCase(it3.key()) == objectName) { + if (UtilityRoutines::makeUPPER(it3.key()) == objectName) { return it3.value(); } } @@ -556,7 +556,7 @@ bool InputProcessor::findDefault(std::string &default_value, json const &schema_ default_value = s; } if (schema_field_obj.find("retaincase") == schema_field_obj.end()) { - default_value = UtilityRoutines::MakeUPPERCase(default_value); + default_value = UtilityRoutines::makeUPPER(default_value); } return true; } @@ -736,7 +736,7 @@ std::pair InputProcessor::getObjectItemValue(std::string cons output.second = false; } if (schema_field_obj.find("retaincase") == schema_field_obj.end()) { - output.first = UtilityRoutines::MakeUPPERCase(output.first); + output.first = UtilityRoutines::makeUPPER(output.first); } return output; } @@ -1041,7 +1041,7 @@ void InputProcessor::getObjectItem(EnergyPlusData &state, if (name_iter.find("retaincase") != name_iter.end()) { Alphas(alpha_index) = objectInfo.objectName; } else { - Alphas(alpha_index) = UtilityRoutines::MakeUPPERCase(objectInfo.objectName); + Alphas(alpha_index) = UtilityRoutines::makeUPPER(objectInfo.objectName); } if (is_AlphaBlank) AlphaBlank()(alpha_index) = objectInfo.objectName.empty(); if (is_AlphaFieldNames) { @@ -1224,9 +1224,9 @@ int InputProcessor::getObjectItemNum(EnergyPlusData &state, int object_item_num = 1; bool found = false; - std::string const upperObjName = UtilityRoutines::MakeUPPERCase(ObjName); + std::string const upperObjName = UtilityRoutines::makeUPPER(ObjName); for (auto it = obj->begin(); it != obj->end(); ++it) { - if (UtilityRoutines::MakeUPPERCase(it.key()) == upperObjName) { + if (UtilityRoutines::makeUPPER(it.key()) == upperObjName) { found = true; break; } @@ -1262,11 +1262,11 @@ int InputProcessor::getObjectItemNum(EnergyPlusData &state, int object_item_num = 1; bool found = false; - std::string const upperObjName = UtilityRoutines::MakeUPPERCase(ObjName); + std::string const upperObjName = UtilityRoutines::makeUPPER(ObjName); for (auto it = obj->begin(); it != obj->end(); ++it) { auto it2 = it.value().find(NameTypeVal); - if ((it2 != it.value().end()) && (UtilityRoutines::MakeUPPERCase(it2.value().get()) == upperObjName)) { + if ((it2 != it.value().end()) && (UtilityRoutines::makeUPPER(it2.value().get()) == upperObjName)) { found = true; break; } @@ -2115,7 +2115,7 @@ void InputProcessor::preScanReportingVariables(EnergyPlusData &state) json const &fields = obj.value(); for (auto const &extensions : fields[extension_key]) { try { - std::string const report_name = UtilityRoutines::MakeUPPERCase(extensions.at("report_name").get()); + std::string const report_name = UtilityRoutines::makeUPPER(extensions.at("report_name").get()); if (report_name == "ALLMONTHLY" || report_name == "ALLSUMMARYANDMONTHLY") { for (int i = 1; i <= DataOutputs::NumMonthlyReports; ++i) { addVariablesForMonthlyReport(state, DataOutputs::MonthlyNamedReports(i)); diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index cd78d1eee1c..d0e8927a048 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -878,7 +878,7 @@ namespace InternalHeatGains { } if (!IHGAlphaFieldBlanks(10) || !IHGAlphas(10).empty()) { - thisPeople.clothingType = static_cast(getEnumerationValue(clothingTypeNamesUC, IHGAlphas(10))); + thisPeople.clothingType = static_cast(getEnumValue(clothingTypeNamesUC, IHGAlphas(10))); if (thisPeople.clothingType == ClothingType::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", invalid {}, value ={}", @@ -3197,12 +3197,12 @@ namespace InternalHeatGains { // Environmental class thisZoneITEq.Class = - static_cast(getEnumerationValue(ITEClassNamesUC, UtilityRoutines::MakeUPPERCase(IHGAlphas(10)))); + static_cast(getEnumValue(ITEClassNamesUC, UtilityRoutines::makeUPPER(IHGAlphas(10)))); ErrorsFound = ErrorsFound || (thisZoneITEq.Class == ITEClass::Invalid); // Air and supply inlet connections thisZoneITEq.AirConnectionType = static_cast( - getEnumerationValue(ITEInletConnectionNamesUC, UtilityRoutines::MakeUPPERCase(IHGAlphas(11)))); + getEnumValue(ITEInletConnectionNamesUC, UtilityRoutines::makeUPPER(IHGAlphas(11)))); if (thisZoneITEq.AirConnectionType == ITEInletConnection::RoomAirModel) { // ZoneITEq(Loop).AirConnectionType = ITEInletConnection::RoomAirModel; ShowWarningError(state, @@ -4161,7 +4161,7 @@ namespace InternalHeatGains { int counter = 0; for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - std::string const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); ip->markObjectAsUsed(objectType, instance.key()); // For incoming idf, maintain object order diff --git a/src/EnergyPlus/Material.cc b/src/EnergyPlus/Material.cc index 7a310ed25fb..fd0ab68199d 100644 --- a/src/EnergyPlus/Material.cc +++ b/src/EnergyPlus/Material.cc @@ -245,7 +245,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - std::string const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); ip->markObjectAsUsed(state.dataHeatBalMgr->CurrentModuleObject, instance.key()); std::string materialName = thisObjectName; @@ -269,7 +269,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if std::string roughness = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "roughness"); thisMaterial->Roughness = - static_cast(getEnumerationValue(SurfaceRoughnessUC, UtilityRoutines::MakeUPPERCase(roughness))); + static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(roughness))); thisMaterial->Thickness = ip->getRealFieldValue(objectFields, objectSchemaProps, "thickness"); thisMaterial->Conductivity = ip->getRealFieldValue(objectFields, objectSchemaProps, "conductivity"); @@ -347,7 +347,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = MaterialNames(1); thisMaterial->Roughness = - static_cast(getEnumerationValue(SurfaceRoughnessUC, UtilityRoutines::MakeUPPERCase(MaterialNames(2)))); + static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(MaterialNames(2)))); thisMaterial->Resistance = MaterialProps(1); thisMaterial->ROnly = true; @@ -1173,7 +1173,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = MaterialNames(1); thisMaterial->NumberOfGasesInMixture = 1; - thisMaterial->gasTypes(1) = static_cast(getEnumerationValue(GasTypeUC, UtilityRoutines::MakeUPPERCase(MaterialNames(2)))); + thisMaterial->gasTypes(1) = static_cast(getEnumValue(GasTypeUC, UtilityRoutines::makeUPPER(MaterialNames(2)))); thisMaterial->Roughness = SurfaceRoughness::MediumRough; @@ -1280,7 +1280,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = MaterialNames(1); thisMaterial->NumberOfGasesInMixture = 1; - thisMaterial->gasTypes(1) = static_cast(getEnumerationValue(GasTypeUC, UtilityRoutines::MakeUPPERCase(MaterialNames(2)))); + thisMaterial->gasTypes(1) = static_cast(getEnumValue(GasTypeUC, UtilityRoutines::makeUPPER(MaterialNames(2)))); thisMaterial->Roughness = SurfaceRoughness::MediumRough; @@ -1301,7 +1301,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { // Get gap vent type thisMaterial->gapVentType = - static_cast(getEnumerationValue(GapVentTypeUC, UtilityRoutines::MakeUPPERCase(MaterialNames(3)))); + static_cast(getEnumValue(GapVentTypeUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); } if (gasType == GasType::Custom) { @@ -1385,7 +1385,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->NumberOfGasesInMixture = NumGases; for (NumGas = 1; NumGas <= NumGases; ++NumGas) { thisMaterial->gasTypes(NumGas) = - static_cast(getEnumerationValue(GasTypeUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(1 + NumGas)))); + static_cast(getEnumValue(GasTypeUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1 + NumGas)))); } thisMaterial->Roughness = SurfaceRoughness::MediumRough; // Unused @@ -2395,7 +2395,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->slatAngleType = SlatAngleType::FixedSlatAngle; if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { thisMaterial->slatAngleType = - static_cast(getEnumerationValue(SlatAngleTypeUC, UtilityRoutines::MakeUPPERCase(MaterialNames(3)))); + static_cast(getEnumValue(SlatAngleTypeUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); } if (thisMaterial->SlatWidth < thisMaterial->SlatSeparation) { ShowWarningError(state, format("{}=\"{}\", Slat Seperation/Width", state.dataHeatBalMgr->CurrentModuleObject, MaterialNames(1))); @@ -2525,7 +2525,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // need to treat the A2 with is just the name of the soil(it is // not important) thisMaterial->Roughness = - static_cast(getEnumerationValue(SurfaceRoughnessUC, UtilityRoutines::MakeUPPERCase(MaterialNames(3)))); + static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); if (UtilityRoutines::SameString(MaterialNames(4), "Simple")) { thisMaterial->EcoRoofCalculationMethod = 1; } else if (UtilityRoutines::SameString(MaterialNames(4), "Advanced") || state.dataIPShortCut->lAlphaFieldBlanks(4)) { @@ -2844,7 +2844,7 @@ void GetVariableAbsorptanceInput(EnergyPlusData &state, bool &errorsFound) thisMaterial->absorpVarCtrlSignal = VariableAbsCtrlSignal::SurfaceTemperature; // default value thisMaterial->absorpVarCtrlSignal = - static_cast(getEnumerationValue(VariableAbsCtrlSignalUC, UtilityRoutines::MakeUPPERCase(alphas(3)))); + static_cast(getEnumValue(VariableAbsCtrlSignalUC, UtilityRoutines::makeUPPER(alphas(3)))); // init to 0 as GetScheduleIndex returns 0 for not-found schedule thisMaterial->absorpThermalVarFuncIdx = Curve::GetCurveIndex(state, alphas(4)); thisMaterial->absorpThermalVarSchedIdx = ScheduleManager::GetScheduleIndex(state, alphas(5)); diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index dba119c5f74..2aeff6fd7f6 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -348,7 +348,7 @@ void GetMTGeneratorInput(EnergyPlusData &state) // Validate fuel type input state.dataMircoturbElectGen->MTGenerator(GeneratorNum).FuelType = - static_cast(getEnumerationValue(Constant::eFuelNamesUC, AlphArray(5))); + static_cast(getEnumValue(Constant::eFuelNamesUC, AlphArray(5))); if (state.dataMircoturbElectGen->MTGenerator(GeneratorNum).FuelType == Constant::eFuel::Invalid) { ShowSevereError( state, format("{} \"{}\"", state.dataIPShortCut->cCurrentModuleObject, state.dataMircoturbElectGen->MTGenerator(GeneratorNum).Name)); diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index 25dfb0a480b..aad37d016e8 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -898,7 +898,7 @@ void GetOutsideAirSysInputs(EnergyPlusData &state) for (int CompNum = 1; CompNum <= thisControllerList.NumControllers; ++CompNum) { // Json will catch any object types that are not the correct key choice of Controller:OutdoorAir or Controller:WaterCoil thisControllerList.ControllerType(CompNum) = - static_cast(getEnumerationValue(ControllerKindNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(AlphaNum)))); + static_cast(getEnumValue(ControllerKindNamesUC, UtilityRoutines::makeUPPER(AlphArray(AlphaNum)))); thisControllerList.ControllerName(CompNum) = AlphArray(AlphaNum + 1); // loop over all previous controller lists to check if this controllers is also present on previous controllers for (int previousListNum = 1; previousListNum < Item; ++previousListNum) { @@ -1010,7 +1010,7 @@ void GetOutsideAirSysInputs(EnergyPlusData &state) OASys.ControllerName(InListNum) = AlphArray(InListNum * 2 + 1); OASys.ControllerType(InListNum) = AlphArray(InListNum * 2); OASys.controllerTypeEnum(InListNum) = - static_cast(getEnumerationValue(ControllerKindNamesUC, OASys.ControllerType(InListNum))); + static_cast(getEnumValue(ControllerKindNamesUC, OASys.ControllerType(InListNum))); // only count Controller:OutdoorAir types as valid simple controllers if (OASys.controllerTypeEnum(InListNum) != DataAirLoop::ControllerKind::OutdoorAir) { ++NumSimpControllers; @@ -1042,7 +1042,7 @@ void GetOutsideAirSysInputs(EnergyPlusData &state) auto &OASys = state.dataAirLoop->OutsideAirSys(OASysNum); for (int CompNum = 1; CompNum <= OASys.NumComponents; ++CompNum) { OASys.ComponentTypeEnum(CompNum) = - static_cast(getEnumerationValue(CompTypeNamesUC, OASys.ComponentType(CompNum))); + static_cast(getEnumValue(CompTypeNamesUC, OASys.ComponentType(CompNum))); if (OASys.ComponentTypeEnum(CompNum) == SimAirServingZones::CompType::Fan_System_Object) { // construct fan object state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(state, OASys.ComponentName(CompNum))); @@ -1289,7 +1289,7 @@ void GetOAControllerInputs(EnergyPlusData &state) // System outdoor air method thisVentilationMechanical.SystemOAMethod = - static_cast(getEnumerationValue(SOAMNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(4)))); + static_cast(getEnumValue(SOAMNamesUC, UtilityRoutines::makeUPPER(AlphArray(4)))); if (thisVentilationMechanical.SystemOAMethod == DataSizing::SysOAMethod::IAQP || thisVentilationMechanical.SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlSchOcc || diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index 4362926eb1a..9d18a4d8ca0 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -190,7 +190,7 @@ namespace MundtSimMgr { ErrorsFound = false; for (ZoneIndex = 1; ZoneIndex <= state.dataGlobal->NumOfZones; ++ZoneIndex) { auto &thisZone = state.dataHeatBal->Zone(ZoneIndex); - if (state.dataRoomAirMod->AirModel(ZoneIndex).AirModelType == DataRoomAirModel::RoomAirModel::Mundt) { + if (state.dataRoomAirMod->AirModel(ZoneIndex).AirModel == DataRoomAirModel::RoomAirModel::Mundt) { // find number of zones using the Mundt model ++NumOfMundtZones; // find maximum number of surfaces in zones using the Mundt model @@ -292,12 +292,12 @@ namespace MundtSimMgr { } // count air nodes connected to walls in each zone - if (state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType == DataRoomAirModel::AirNodeType::MundtRoomAir) { + if (state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType == DataRoomAirModel::AirNodeType::Mundt) { ++RoomNodesCount; } // count floors in each zone - if (state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType == DataRoomAirModel::AirNodeType::FloorAir) { + if (state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType == DataRoomAirModel::AirNodeType::Floor) { FloorSurfCount += count(state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).SurfMask); } } @@ -472,23 +472,23 @@ namespace MundtSimMgr { state.dataMundtSimMgr->NumRoomNodes = 0; for (NodeNum = 1; NodeNum <= state.dataRoomAirMod->TotNumOfZoneAirNodes(ZoneNum); ++NodeNum) { switch (state.dataMundtSimMgr->LineNode(NodeNum, state.dataMundtSimMgr->MundtZoneNum).ClassType) { - case AirNodeType::InletAir: { // inlet + case AirNodeType::Inlet: { // inlet state.dataMundtSimMgr->SupplyNodeID = NodeNum; } break; - case AirNodeType::FloorAir: { // floor + case AirNodeType::Floor: { // floor state.dataMundtSimMgr->MundtFootAirID = NodeNum; } break; - case AirNodeType::ControlAir: { // thermostat + case AirNodeType::Control: { // thermostat state.dataMundtSimMgr->TstatNodeID = NodeNum; } break; - case AirNodeType::CeilingAir: { // ceiling + case AirNodeType::Ceiling: { // ceiling state.dataMundtSimMgr->MundtCeilAirID = NodeNum; } break; - case AirNodeType::MundtRoomAir: { // wall + case AirNodeType::Mundt: { // wall ++state.dataMundtSimMgr->NumRoomNodes; state.dataMundtSimMgr->RoomNodeIDs(state.dataMundtSimMgr->NumRoomNodes) = NodeNum; } break; - case AirNodeType::ReturnAir: { // return + case AirNodeType::Return: { // return state.dataMundtSimMgr->ReturnNodeID = NodeNum; } break; default: { diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index b907d41c7a2..1d40e8d2eb0 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -511,7 +511,7 @@ namespace OutdoorAirUnit { constexpr std::array(OAUnitCtrlType::Num)> ctrlTypeNamesUC = { "NEUTRALCONTROL", "INVALID-UNCONDITIONED", "TEMPERATURECONTROL"}; OAUnitCtrlType const tmpCtrlType = - static_cast(getEnumerationValue(ctrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); + static_cast(getEnumValue(ctrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); switch (tmpCtrlType) { case OAUnitCtrlType::Neutral: case OAUnitCtrlType::Temperature: @@ -664,7 +664,7 @@ namespace OutdoorAirUnit { thisOutAirUnit.OAEquip(InListNum).ComponentName = AlphArray(InListNum * 2 + 1); thisOutAirUnit.OAEquip(InListNum).Type = - static_cast(getEnumerationValue(CompTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(InListNum * 2)))); + static_cast(getEnumValue(CompTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(InListNum * 2)))); int const CompNum = InListNum; diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 4c1c225f196..0af70d89a6e 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -462,7 +462,7 @@ namespace OutputProcessor { ReportingFrequency ReportFreq(ReportingFrequency::Hourly); // Default // TODO: I think it's supposed to be upper case already, but tests aren't doing that at least... - const std::string FreqStringUpper = UtilityRoutines::MakeUPPERCase(FreqString); + const std::string FreqStringUpper = UtilityRoutines::makeUPPER(FreqString); std::string::size_type const LenString = min(len(FreqString), static_cast(4u)); if (LenString < 4u) { @@ -914,7 +914,7 @@ namespace OutputProcessor { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - namesOfMeterCustom.emplace(UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(1))); + namesOfMeterCustom.emplace(UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(1))); } for (Loop = 1; Loop <= NumCustomMeters; ++Loop) { @@ -949,7 +949,7 @@ namespace OutputProcessor { // check if any fields reference another Meter:Custom int found = 0; for (fldIndex = 4; fldIndex <= NumAlpha; fldIndex += 2) { - if (namesOfMeterCustom.find(UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(fldIndex))) != namesOfMeterCustom.end()) { + if (namesOfMeterCustom.find(UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(fldIndex))) != namesOfMeterCustom.end()) { found = fldIndex; break; } @@ -1006,7 +1006,7 @@ namespace OutputProcessor { // Can't use resource type in AddMeter cause it will confuse it with other meters. So, now: GetStandardMeterResourceType(state, op->EnergyMeters(op->NumEnergyMeters).ResourceType, - UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2)), + UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)), errFlag); if (errFlag) { ShowContinueError(state, format("..on {}=\"{}\".", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -1261,7 +1261,7 @@ namespace OutputProcessor { // Can't use resource type in AddMeter cause it will confuse it with other meters. So, now: GetStandardMeterResourceType(state, op->EnergyMeters(op->NumEnergyMeters).ResourceType, - UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2)), + UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)), errFlag); if (errFlag) { ShowContinueError(state, format("..on {}=\"{}\".", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -1445,9 +1445,9 @@ namespace OutputProcessor { // the standard resource type. ErrorsFound = false; - std::string const meterType = UtilityRoutines::MakeUPPERCase(UserInputResourceType); + std::string const meterType = UtilityRoutines::makeUPPER(UserInputResourceType); - int eMeterResource = getEnumerationValue(Constant::eResourceNamesUC, meterType); + int eMeterResource = getEnumValue(Constant::eResourceNamesUC, meterType); if (eMeterResource == static_cast(Constant::eResource::Invalid)) { ShowSevereError(state, format("GetStandardMeterResourceType: Illegal OutResourceType (for Meters) Entered={}", UserInputResourceType)); @@ -1753,7 +1753,7 @@ namespace OutputProcessor { auto &op = state.dataOutputProcessor; // Basic ResourceType Meters - GetStandardMeterResourceType(state, ResourceType, UtilityRoutines::MakeUPPERCase(ResourceType), LocalErrorsFound); + GetStandardMeterResourceType(state, ResourceType, UtilityRoutines::makeUPPER(ResourceType), LocalErrorsFound); if (!LocalErrorsFound) { if (op->NumEnergyMeters > 0) { @@ -2068,7 +2068,7 @@ namespace OutputProcessor { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: ErrorsFound = false; - std::string UC_ResourceType = UtilityRoutines::MakeUPPERCase(ResourceType); + std::string UC_ResourceType = UtilityRoutines::makeUPPER(ResourceType); CodeForIPUnits = RT_IPUnits::OtherJ; if (has(UC_ResourceType, "ELEC")) { @@ -4234,7 +4234,7 @@ namespace OutputProcessor { OutputProcessor::Unit unitStringToEnum(std::string const &unitIn) { // J.Glazer - August/September 2017 - std::string unitUpper = UtilityRoutines::MakeUPPERCase(unitIn); + std::string unitUpper = UtilityRoutines::makeUPPER(unitIn); if (unitUpper == "J") { return OutputProcessor::Unit::J; } else if (unitUpper == "DELTAC") { @@ -4438,7 +4438,7 @@ void SetupOutputVariable(EnergyPlusData &state, } else { EndUseSub = ""; if (!EndUseKey.empty()) { - if (std::find(endUseCategoryNames.begin(), endUseCategoryNames.end(), UtilityRoutines::MakeUPPERCase(std::string{EndUseKey})) != + if (std::find(endUseCategoryNames.begin(), endUseCategoryNames.end(), UtilityRoutines::makeUPPER(std::string{EndUseKey})) != endUseCategoryNames.end()) { EndUseSub = "General"; } @@ -4488,9 +4488,9 @@ void SetupOutputVariable(EnergyPlusData &state, thisRvar.storeType = VariableType; thisRvar.VarName = fmt::format("{}:{}", KeyedValue, VarName); thisRvar.VarNameOnly = VarName; - thisRvar.VarNameOnlyUC = UtilityRoutines::MakeUPPERCase(VarName); - thisRvar.VarNameUC = UtilityRoutines::MakeUPPERCase(thisRvar.VarName); - thisRvar.KeyNameOnlyUC = UtilityRoutines::MakeUPPERCase(KeyedValue); + thisRvar.VarNameOnlyUC = UtilityRoutines::makeUPPER(VarName); + thisRvar.VarNameUC = UtilityRoutines::makeUPPER(thisRvar.VarName); + thisRvar.KeyNameOnlyUC = UtilityRoutines::makeUPPER(KeyedValue); thisRvar.units = VariableUnit; if (VariableUnit == OutputProcessor::Unit::customEMS) { thisRvar.unitNameCustomEMS = customUnitName; @@ -4667,9 +4667,9 @@ void SetupOutputVariable(EnergyPlusData &state, thisIVar.storeType = VariableType; thisIVar.VarName = fmt::format("{}:{}", KeyedValue, VarName); thisIVar.VarNameOnly = VarName; - thisIVar.VarNameOnlyUC = UtilityRoutines::MakeUPPERCase(VarName); - thisIVar.VarNameUC = UtilityRoutines::MakeUPPERCase(thisIVar.VarName); - thisIVar.KeyNameOnlyUC = UtilityRoutines::MakeUPPERCase(KeyedValue); + thisIVar.VarNameOnlyUC = UtilityRoutines::makeUPPER(VarName); + thisIVar.VarNameUC = UtilityRoutines::makeUPPER(thisIVar.VarName); + thisIVar.KeyNameOnlyUC = UtilityRoutines::makeUPPER(KeyedValue); thisIVar.units = VariableUnit; AssignReportNumber(state, op->CurrentReportNumber); std::string const IDOut = fmt::to_string(op->CurrentReportNumber); @@ -6202,7 +6202,7 @@ int GetMeterIndex(EnergyPlusData &state, std::string const &MeterName) state.dataOutputProcessor->NumValidMeters = op->NumEnergyMeters; state.dataOutputProcessor->ValidMeterNames.allocate(state.dataOutputProcessor->NumValidMeters); for (Found = 1; Found <= state.dataOutputProcessor->NumValidMeters; ++Found) { - state.dataOutputProcessor->ValidMeterNames(Found) = UtilityRoutines::MakeUPPERCase(op->EnergyMeters(Found).Name); + state.dataOutputProcessor->ValidMeterNames(Found) = UtilityRoutines::makeUPPER(op->EnergyMeters(Found).Name); } state.dataOutputProcessor->iValidMeterNames.allocate(state.dataOutputProcessor->NumValidMeters); SetupAndSort(state.dataOutputProcessor->ValidMeterNames, state.dataOutputProcessor->iValidMeterNames); @@ -6753,14 +6753,14 @@ void GetMeteredVariables(EnergyPlusData &state, unitsForVar(NumVariables) = op->RVariableTypes(Loop).units; ResourceTypes(NumVariables) = static_cast( - getEnumerationValue(Constant::eResourceNamesUC, UtilityRoutines::MakeUPPERCase(op->EnergyMeters(MeterPtr).ResourceType))); + getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).ResourceType))); Names(NumVariables) = op->RVariableTypes(Loop).VarNameUC; for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = op->VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); if (!op->EnergyMeters(MeterPtr).EndUse.empty()) { - EndUses(NumVariables) = UtilityRoutines::MakeUPPERCase(op->EnergyMeters(MeterPtr).EndUse); + EndUses(NumVariables) = UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).EndUse); break; } } @@ -6768,7 +6768,7 @@ void GetMeteredVariables(EnergyPlusData &state, for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = op->VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); if (!op->EnergyMeters(MeterPtr).Group.empty()) { - Groups(NumVariables) = UtilityRoutines::MakeUPPERCase(op->EnergyMeters(MeterPtr).Group); + Groups(NumVariables) = UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).Group); break; } } @@ -6836,13 +6836,13 @@ void GetMeteredVariables(EnergyPlusData &state, unitsForVar(NumVariables) = op->RVariableTypes(Loop).units; ResourceTypes(NumVariables) = static_cast( - getEnumerationValue(Constant::eResourceNamesUC, UtilityRoutines::MakeUPPERCase(op->EnergyMeters(MeterPtr).ResourceType))); + getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).ResourceType))); Names(NumVariables) = op->RVariableTypes(Loop).VarNameUC; for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = op->VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); if (!op->EnergyMeters(MeterPtr).EndUse.empty()) { - EndUses(NumVariables) = UtilityRoutines::MakeUPPERCase(op->EnergyMeters(MeterPtr).EndUse); + EndUses(NumVariables) = UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).EndUse); break; } } @@ -6850,7 +6850,7 @@ void GetMeteredVariables(EnergyPlusData &state, for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = op->VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); if (!op->EnergyMeters(MeterPtr).Group.empty()) { - Groups(NumVariables) = UtilityRoutines::MakeUPPERCase(op->EnergyMeters(MeterPtr).Group); + Groups(NumVariables) = UtilityRoutines::makeUPPER(op->EnergyMeters(MeterPtr).Group); break; } } @@ -6935,7 +6935,7 @@ void GetVariableKeyCountandType(EnergyPlusData &state, op->numVarNames = op->NumVariablesForOutput; op->varNames.allocate(op->numVarNames); for (Loop = 1; Loop <= op->NumVariablesForOutput; ++Loop) { - op->varNames(Loop) = UtilityRoutines::MakeUPPERCase(op->DDVariableTypes(Loop).VarNameOnly); + op->varNames(Loop) = UtilityRoutines::makeUPPER(op->DDVariableTypes(Loop).VarNameOnly); } op->ivarNames.allocate(op->numVarNames); SetupAndSort(op->varNames, op->ivarNames); @@ -6946,7 +6946,7 @@ void GetVariableKeyCountandType(EnergyPlusData &state, op->numVarNames = op->NumVariablesForOutput; op->varNames.allocate(op->numVarNames); for (Loop = 1; Loop <= op->NumVariablesForOutput; ++Loop) { - op->varNames(Loop) = UtilityRoutines::MakeUPPERCase(op->DDVariableTypes(Loop).VarNameOnly); + op->varNames(Loop) = UtilityRoutines::makeUPPER(op->DDVariableTypes(Loop).VarNameOnly); } op->ivarNames.allocate(op->numVarNames); SetupAndSort(op->varNames, op->ivarNames); @@ -7105,7 +7105,7 @@ void GetVariableKeys(EnergyPlusData &state, Duplicate = false; maxKeyNames = size(keyNames); maxkeyVarIndexes = size(keyVarIndexes); - varNameUpper = UtilityRoutines::MakeUPPERCase(varName); + varNameUpper = UtilityRoutines::makeUPPER(varName); auto &op = state.dataOutputProcessor; // Select based on variable type: integer, real, or meter diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 0d3c2ede721..016353b4647 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -613,7 +613,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // #ifdef ITM_KEYCACHE // Noel comment: First time in this TabNum/ColNum loop, let's save the results // of GetVariableKeyCountandType & GetVariableKeys. - std::string const &curVariMeter = UtilityRoutines::MakeUPPERCase(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeter); + std::string const &curVariMeter = UtilityRoutines::makeUPPER(ort->MonthlyFieldSetInput(FirstColumn + colNum - 1).variMeter); // call the key count function but only need count during this pass int KeyCount = 0; GetVariableKeyCountandType(state, curVariMeter, KeyCount, TypeVar, AvgSumVar, StepTypeVar, UnitsVar); @@ -650,7 +650,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) = IndexesForKeyVar(iKey) !noel // ENDDO // #else - // curVariMeter = UtilityRoutines::MakeUPPERCase(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) + // curVariMeter = UtilityRoutines::makeUPPER(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) // ! call the key count function but only need count during this pass // CALL GetVariableKeyCountandType(state, curVariMeter,KeyCount,TypeVar,AvgSumVar,StepTypeVar,UnitsVar) // ALLOCATE(NamesOfKeys(KeyCount)) @@ -743,7 +743,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // IndexesForKeyVar(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) !noel // ENDDO // #else - // curVariMeter = UtilityRoutines::MakeUPPERCase(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) + // curVariMeter = UtilityRoutines::makeUPPER(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) // ! call the key count function but only need count during this pass // CALL GetVariableKeyCountandType(state, curVariMeter,KeyCount,TypeVar,AvgSumVar,StepTypeVar,UnitsVar) // ALLOCATE(NamesOfKeys(KeyCount)) @@ -839,7 +839,7 @@ void InitializeTabularMonthly(EnergyPlusData &state) // IndexesForKeyVar(iKey) = MonthlyFieldSetInput(FirstColumn + ColNum - 1)%IndexesForKeyVar(iKey) !noel // ENDDO // #else - // curVariMeter = UtilityRoutines::MakeUPPERCase(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) + // curVariMeter = UtilityRoutines::makeUPPER(MonthlyFieldSetInput(FirstColumn + ColNum - 1)%variMeter) // ! call the key count function but only need count during this pass // CALL GetVariableKeyCountandType(state, curVariMeter,KeyCount,TypeVar,AvgSumVar,StepTypeVar,UnitsVar) // ALLOCATE(NamesOfKeys(KeyCount)) @@ -18575,7 +18575,7 @@ void LookupSItoIP(EnergyPlusData &state, std::string const &stringInWithSI, int int constexpr misParen(2); int constexpr misBrce(3); int constexpr misNoHint(4); - std::string const stringInUpper(UtilityRoutines::MakeUPPERCase(stringInWithSI)); + std::string const stringInUpper(UtilityRoutines::makeUPPER(stringInWithSI)); auto &ort = state.dataOutRptTab; stringOutWithIP = ""; diff --git a/src/EnergyPlus/PackagedThermalStorageCoil.cc b/src/EnergyPlus/PackagedThermalStorageCoil.cc index 8220ae14b3c..8a09ba1f885 100644 --- a/src/EnergyPlus/PackagedThermalStorageCoil.cc +++ b/src/EnergyPlus/PackagedThermalStorageCoil.cc @@ -256,7 +256,7 @@ void GetTESCoilInput(EnergyPlusData &state) ErrorsFound = true; } } - thisTESCoil.ModeControlType = static_cast(getEnumerationValue(modeControlStrings, state.dataIPShortCut->cAlphaArgs(3))); + thisTESCoil.ModeControlType = static_cast(getEnumValue(modeControlStrings, state.dataIPShortCut->cAlphaArgs(3))); if (thisTESCoil.ModeControlType == PTSCCtrlType::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, cCurrentModuleObject, thisTESCoil.Name)); ShowContinueError(state, format("...{}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); @@ -278,7 +278,7 @@ void GetTESCoilInput(EnergyPlusData &state) } } - thisTESCoil.StorageMedia = static_cast(getEnumerationValue(mediaStrings, state.dataIPShortCut->cAlphaArgs(5))); + thisTESCoil.StorageMedia = static_cast(getEnumValue(mediaStrings, state.dataIPShortCut->cAlphaArgs(5))); switch (thisTESCoil.StorageMedia) { case MediaType::Ice: case MediaType::UserDefindFluid: @@ -1449,7 +1449,7 @@ void GetTESCoilInput(EnergyPlusData &state) thisTESCoil.CondenserAirVolumeFlow = state.dataIPShortCut->rNumericArgs(34); thisTESCoil.CondenserAirFlowSizingFactor = state.dataIPShortCut->rNumericArgs(35); - thisTESCoil.CondenserType = static_cast(getEnumerationValue(condenserTypesUC, state.dataIPShortCut->cAlphaArgs(58))); + thisTESCoil.CondenserType = static_cast(getEnumValue(condenserTypesUC, state.dataIPShortCut->cAlphaArgs(58))); if (thisTESCoil.CondenserType == TESCondenserType::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", invalid", RoutineName, cCurrentModuleObject, thisTESCoil.Name)); ShowContinueError(state, format("{}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(58), state.dataIPShortCut->cAlphaArgs(58))); diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index f00fb5b4949..71a912ef988 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -209,7 +209,7 @@ namespace PhotovoltaicThermalCollectors { auto &thisTmpSimplePVTperf = tmpSimplePVTperf(Item); thisTmpSimplePVTperf.Name = state.dataIPShortCut->cAlphaArgs(1); thisTmpSimplePVTperf.ThermEfficMode = static_cast( - getEnumerationValue(ThermEfficTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2)))); + getEnumValue(ThermEfficTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); thisTmpSimplePVTperf.ThermalActiveFract = state.dataIPShortCut->rNumericArgs(1); thisTmpSimplePVTperf.ThermEffic = state.dataIPShortCut->rNumericArgs(2); thisTmpSimplePVTperf.ThermEffSchedNum = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(3)); diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index 2c2c7f50fc2..9af113f4042 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -327,7 +327,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state) if (state.dataIPShortCut->lAlphaFieldBlanks(5)) state.dataIPShortCut->cAlphaArgs(5) = "ZONE"; PipeIndoorBoundaryType indoorType = - static_cast(getEnumerationValue(pipeIndoorBoundaryTypeNamesUC, state.dataIPShortCut->cAlphaArgs(5))); + static_cast(getEnumValue(pipeIndoorBoundaryTypeNamesUC, state.dataIPShortCut->cAlphaArgs(5))); switch (indoorType) { case PipeIndoorBoundaryType::Zone: state.dataPipeHT->PipeHT(Item).EnvironmentPtr = EnvrnPtr::ZoneEnv; diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 13009b2c158..b45b410966f 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -598,7 +598,7 @@ void GetPlantLoopData(EnergyPlusData &state) MatchedPressureString = false; this_loop.PressureSimType = static_cast( - getEnumerationValue(PressureSimTypeNamesUC, UtilityRoutines::MakeUPPERCase(Alpha(PressSimAlphaIndex)))); + getEnumValue(PressureSimTypeNamesUC, UtilityRoutines::makeUPPER(Alpha(PressSimAlphaIndex)))); switch (this_loop.PressureSimType) { // Check all types case DataPlant::PressSimType::NoPressure: @@ -876,7 +876,7 @@ void GetPlantInput(EnergyPlusData &state) this_comp.location = EnergyPlus::PlantLocation(LoopNum, LoopSideNum, BranchNum, CompNum); this_comp.Type = - static_cast(getEnumerationValue(PlantEquipTypeNamesUC, UtilityRoutines::MakeUPPERCase(this_comp_type))); + static_cast(getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_comp_type))); switch (this_comp.Type) { case PlantEquipmentType::Pipe: { diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index a4820864d1f..08868a882e9 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -150,7 +150,7 @@ namespace PlantChillers { state.dataPlantChillers->GetElectricInput = false; } for (auto &thisChiller : state.dataPlantChillers->ElectricChiller) { - if (UtilityRoutines::MakeUPPERCase(thisChiller.Name) == chillerName) { + if (UtilityRoutines::makeUPPER(thisChiller.Name) == chillerName) { return &thisChiller; } } @@ -218,7 +218,7 @@ namespace PlantChillers { thisChiller.ChillerType = DataPlant::PlantEquipmentType::Chiller_Electric; thisChiller.CondenserType = static_cast( - getEnumerationValue(DataPlant::CondenserTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2)))); + getEnumValue(DataPlant::CondenserTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); switch (thisChiller.CondenserType) { case DataPlant::CondenserType::AirCooled: case DataPlant::CondenserType::WaterCooled: @@ -433,7 +433,7 @@ namespace PlantChillers { if (thisChiller.SizFac <= 0.0) thisChiller.SizFac = 1.0; thisChiller.FlowMode = - static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(7))); + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(7))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -2072,7 +2072,7 @@ namespace PlantChillers { state.dataPlantChillers->GetEngineDrivenInput = false; } for (auto &thisChiller : state.dataPlantChillers->EngineDrivenChiller) { - if (UtilityRoutines::MakeUPPERCase(thisChiller.Name) == chillerName) { + if (UtilityRoutines::makeUPPER(thisChiller.Name) == chillerName) { return &thisChiller; } } @@ -2430,7 +2430,7 @@ namespace PlantChillers { thisChiller.DesignMinExitGasTemp = state.dataIPShortCut->rNumericArgs(24); // Validate fuel type input - thisChiller.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(12))); + thisChiller.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(12))); thisChiller.FuelHeatingValue = state.dataIPShortCut->rNumericArgs(25); @@ -2515,7 +2515,7 @@ namespace PlantChillers { } thisChiller.FlowMode = - static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(15))); + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(15))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -4075,7 +4075,7 @@ namespace PlantChillers { state.dataPlantChillers->GetGasTurbineInput = false; } for (auto &thisChiller : state.dataPlantChillers->GTChiller) { - if (UtilityRoutines::MakeUPPERCase(thisChiller.Name) == chillerName) { + if (UtilityRoutines::makeUPPER(thisChiller.Name) == chillerName) { return &thisChiller; } } @@ -4472,7 +4472,7 @@ namespace PlantChillers { } thisChiller.FlowMode = - static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -4483,7 +4483,7 @@ namespace PlantChillers { } // Fuel Type Case Statement - thisChiller.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + thisChiller.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (thisChiller.FuelType == Constant::eFuel::Invalid) { ShowSevereError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(10), state.dataIPShortCut->cAlphaArgs(10))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -6002,7 +6002,7 @@ namespace PlantChillers { state.dataPlantChillers->GetConstCOPInput = false; } for (auto &thisChiller : state.dataPlantChillers->ConstCOPChiller) { - if (UtilityRoutines::MakeUPPERCase(thisChiller.Name) == chillerName) { + if (UtilityRoutines::makeUPPER(thisChiller.Name) == chillerName) { return &thisChiller; } } @@ -6293,7 +6293,7 @@ namespace PlantChillers { } thisChiller.FlowMode = - static_cast(getEnumerationValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(7))); + static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(7))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 31000a22606..6492aac3700 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -1395,7 +1395,7 @@ void FindCompSPInput(EnergyPlusData &state, SchemeNameFound = true; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::MakeUPPERCase(CurrentModuleObject))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(CurrentModuleObject))); if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { LoopOpSchemeObj = "PlantEquipmentOperationSchemes"; @@ -2064,7 +2064,7 @@ void InitLoadDistribution(EnergyPlusData &state, bool const FirstHVACIteration) for (int EquipNum = 1, EquipNum_end = this_equip_list.NumComps; EquipNum <= EquipNum_end; ++EquipNum) { auto &this_equip = this_equip_list.Comp(EquipNum); Type = static_cast( - getEnumerationValue(PlantEquipTypeNamesUC, UtilityRoutines::MakeUPPERCase(this_equip.TypeOf))); + getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_equip.TypeOf))); errFlag1 = false; PlantUtilities::ScanPlantLoopsForObject(state, this_equip.Name, Type, plantLoc, errFlag1, _, _, NumSearchResults, _, LoopNum); diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index f088262fdee..6b735186ac7 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -816,7 +816,7 @@ PlantComponent *EIRPlantLoopHeatPump::factory(EnergyPlusData &state, DataPlant:: } for (auto &plhp : state.dataEIRPlantLoopHeatPump->heatPumps) { - if (plhp.name == UtilityRoutines::MakeUPPERCase(hp_name) && plhp.EIRHPType == hp_type) { + if (plhp.name == UtilityRoutines::makeUPPER(hp_name) && plhp.EIRHPType == hp_type) { return &plhp; } } @@ -829,12 +829,12 @@ void EIRPlantLoopHeatPump::pairUpCompanionCoils(EnergyPlusData &state) { for (auto &thisHP : state.dataEIRPlantLoopHeatPump->heatPumps) { if (!thisHP.companionCoilName.empty()) { - std::string const thisCoilName = UtilityRoutines::MakeUPPERCase(thisHP.name); + std::string const thisCoilName = UtilityRoutines::makeUPPER(thisHP.name); DataPlant::PlantEquipmentType thisCoilType = thisHP.EIRHPType; - std::string const targetCompanionName = UtilityRoutines::MakeUPPERCase(thisHP.companionCoilName); + std::string const targetCompanionName = UtilityRoutines::makeUPPER(thisHP.companionCoilName); for (auto &potentialCompanionCoil : state.dataEIRPlantLoopHeatPump->heatPumps) { DataPlant::PlantEquipmentType potentialCompanionType = potentialCompanionCoil.EIRHPType; - std::string potentialCompanionName = UtilityRoutines::MakeUPPERCase(potentialCompanionCoil.name); + std::string potentialCompanionName = UtilityRoutines::makeUPPER(potentialCompanionCoil.name); if (potentialCompanionName == thisCoilName) { // skip the current coil continue; @@ -896,7 +896,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) for (auto const &classToInput : classesToInput) { cCurrentModuleObject = DataPlant::PlantEquipTypeNames[static_cast(classToInput.thisType)]; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::MakeUPPERCase(cCurrentModuleObject))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(cCurrentModuleObject))); auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject); if (instances == state.dataInputProcessing->inputProcessor->epJSON.end()) continue; auto &instancesValue = instances.value(); @@ -907,16 +907,16 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) EIRPlantLoopHeatPump thisPLHP; thisPLHP.EIRHPType = classToInput.thisType; - thisPLHP.name = UtilityRoutines::MakeUPPERCase(thisObjectName); - std::string loadSideInletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("load_side_inlet_node_name").get()); - std::string loadSideOutletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("load_side_outlet_node_name").get()); - std::string condenserType = UtilityRoutines::MakeUPPERCase(fields.at("condenser_type").get()); - std::string sourceSideInletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("source_side_inlet_node_name").get()); - std::string sourceSideOutletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("source_side_outlet_node_name").get()); + thisPLHP.name = UtilityRoutines::makeUPPER(thisObjectName); + std::string loadSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("load_side_inlet_node_name").get()); + std::string loadSideOutletNodeName = UtilityRoutines::makeUPPER(fields.at("load_side_outlet_node_name").get()); + std::string condenserType = UtilityRoutines::makeUPPER(fields.at("condenser_type").get()); + std::string sourceSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("source_side_inlet_node_name").get()); + std::string sourceSideOutletNodeName = UtilityRoutines::makeUPPER(fields.at("source_side_outlet_node_name").get()); auto compHPFound = fields.find("companion_heat_pump_name"); if (compHPFound != fields.end()) { // optional field - thisPLHP.companionCoilName = UtilityRoutines::MakeUPPERCase(compHPFound.value().get()); + thisPLHP.companionCoilName = UtilityRoutines::makeUPPER(compHPFound.value().get()); } auto &tmpFlowRate = fields.at("load_side_reference_flow_rate"); if (tmpFlowRate == "Autosize") { @@ -978,14 +978,14 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } std::string const &capFtName = - UtilityRoutines::MakeUPPERCase(fields.at("capacity_modifier_function_of_temperature_curve_name").get()); + UtilityRoutines::makeUPPER(fields.at("capacity_modifier_function_of_temperature_curve_name").get()); thisPLHP.capFuncTempCurveIndex = Curve::GetCurveIndex(state, capFtName); if (thisPLHP.capFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLHP (name={}; entered curve name: {}", thisPLHP.name, capFtName)); errorsFound = true; } - std::string const &eirFtName = UtilityRoutines::MakeUPPERCase( + std::string const &eirFtName = UtilityRoutines::makeUPPER( fields.at("electric_input_to_output_ratio_modifier_function_of_temperature_curve_name").get()); thisPLHP.powerRatioFuncTempCurveIndex = Curve::GetCurveIndex(state, eirFtName); if (thisPLHP.capFuncTempCurveIndex == 0) { @@ -993,7 +993,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) errorsFound = true; } - std::string const &eirFplrName = UtilityRoutines::MakeUPPERCase( + std::string const &eirFplrName = UtilityRoutines::makeUPPER( fields.at("electric_input_to_output_ratio_modifier_function_of_part_load_ratio_curve_name").get()); thisPLHP.powerRatioFuncPLRCurveIndex = Curve::GetCurveIndex(state, eirFplrName); if (thisPLHP.capFuncTempCurveIndex == 0) { @@ -1818,7 +1818,7 @@ PlantComponent *EIRFuelFiredHeatPump::factory(EnergyPlusData &state, DataPlant:: } for (auto &plhp : state.dataEIRFuelFiredHeatPump->heatPumps) { - if (plhp.name == UtilityRoutines::MakeUPPERCase(hp_name) && plhp.EIRHPType == hp_type) { + if (plhp.name == UtilityRoutines::makeUPPER(hp_name) && plhp.EIRHPType == hp_type) { return &plhp; } } @@ -1831,12 +1831,12 @@ void EIRFuelFiredHeatPump::pairUpCompanionCoils(EnergyPlusData &state) { for (auto &thisHP : state.dataEIRFuelFiredHeatPump->heatPumps) { if (!thisHP.companionCoilName.empty()) { - std::string thisCoilName = UtilityRoutines::MakeUPPERCase(thisHP.name); + std::string thisCoilName = UtilityRoutines::makeUPPER(thisHP.name); DataPlant::PlantEquipmentType thisCoilType = thisHP.EIRHPType; - std::string targetCompanionName = UtilityRoutines::MakeUPPERCase(thisHP.companionCoilName); + std::string targetCompanionName = UtilityRoutines::makeUPPER(thisHP.companionCoilName); for (auto &potentialCompanionCoil : state.dataEIRFuelFiredHeatPump->heatPumps) { DataPlant::PlantEquipmentType potentialCompanionType = potentialCompanionCoil.EIRHPType; - std::string potentialCompanionName = UtilityRoutines::MakeUPPERCase(potentialCompanionCoil.name); + std::string potentialCompanionName = UtilityRoutines::makeUPPER(potentialCompanionCoil.name); if (potentialCompanionName == thisCoilName) { // skip the current coil continue; @@ -1901,7 +1901,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) cCurrentModuleObject = DataPlant::PlantEquipTypeNames[static_cast(classToInput.thisType)]; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::MakeUPPERCase(cCurrentModuleObject))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(cCurrentModuleObject))); auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject); if (instances == state.dataInputProcessing->inputProcessor->epJSON.end()) continue; @@ -1922,28 +1922,28 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } // A1-A3 - thisPLHP.name = UtilityRoutines::MakeUPPERCase(thisObjectName); - std::string loadSideInletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("water_inlet_node_name").get()); - std::string loadSideOutletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("water_outlet_node_name").get()); + thisPLHP.name = UtilityRoutines::makeUPPER(thisObjectName); + std::string loadSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("water_inlet_node_name").get()); + std::string loadSideOutletNodeName = UtilityRoutines::makeUPPER(fields.at("water_outlet_node_name").get()); // Implicit - // std::string condenserType = "AIRSOURCE"; // UtilityRoutines::MakeUPPERCase(fields.at("condenser_type").get()); + // std::string condenserType = "AIRSOURCE"; // UtilityRoutines::makeUPPER(fields.at("condenser_type").get()); thisPLHP.airSource = true; thisPLHP.waterSource = false; // A4 - std::string sourceSideInletNodeName = UtilityRoutines::MakeUPPERCase(fields.at("air_source_node_name").get()); - // UtilityRoutines::MakeUPPERCase(fields.at("source_side_outlet_node_name").get()); + std::string sourceSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("air_source_node_name").get()); + // UtilityRoutines::makeUPPER(fields.at("source_side_outlet_node_name").get()); std::string sourceSideOutletNodeName = format("{}_SOURCE_SIDE_OUTLET_NODE", thisPLHP.name); // A5 auto compCoilFound = fields.find(companionCoilFieldTag); if (compCoilFound != fields.end()) { // optional field - thisPLHP.companionCoilName = UtilityRoutines::MakeUPPERCase(compCoilFound.value().get()); + thisPLHP.companionCoilName = UtilityRoutines::makeUPPER(compCoilFound.value().get()); } // A6 Fuel Type - std::string tempRsrStr = UtilityRoutines::MakeUPPERCase(fields.at("fuel_type").get()); - thisPLHP.fuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, tempRsrStr)); + std::string tempRsrStr = UtilityRoutines::makeUPPER(fields.at("fuel_type").get()); + thisPLHP.fuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, tempRsrStr)); // Validate fuel type input static constexpr std::string_view RoutineName("processInputForEIRPLHP: "); if (thisPLHP.fuelType == Constant::eFuel::Invalid) { @@ -1955,7 +1955,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } // A7 End use category - thisPLHP.endUseSubcat = UtilityRoutines::MakeUPPERCase(fields.at("end_use_subcategory").get()); + thisPLHP.endUseSubcat = UtilityRoutines::makeUPPER(fields.at("end_use_subcategory").get()); if (thisPLHP.endUseSubcat == "") { thisPLHP.endUseSubcat = "Heat Pump Fuel Fired"; // or "General"? } @@ -2021,21 +2021,21 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A8 flow mode thisPLHP.flowMode = static_cast( - getEnumerationValue(DataPlant::FlowModeNamesUC, UtilityRoutines::MakeUPPERCase(fields.at("flow_mode").get()))); + getEnumValue(DataPlant::FlowModeNamesUC, UtilityRoutines::makeUPPER(fields.at("flow_mode").get()))); // A9 outdoor_air_temperature_curve_input_variable std::string oaTempCurveInputVar = - UtilityRoutines::MakeUPPERCase(fields.at("outdoor_air_temperature_curve_input_variable").get()); - thisPLHP.oaTempCurveInputVar = static_cast(getEnumerationValue(OATempCurveVarNamesUC, oaTempCurveInputVar)); + UtilityRoutines::makeUPPER(fields.at("outdoor_air_temperature_curve_input_variable").get()); + thisPLHP.oaTempCurveInputVar = static_cast(getEnumValue(OATempCurveVarNamesUC, oaTempCurveInputVar)); // A10 water_temperature_curve_input_variable std::string waterTempCurveInputVar = - UtilityRoutines::MakeUPPERCase(fields.at("water_temperature_curve_input_variable").get()); - thisPLHP.waterTempCurveInputVar = static_cast(getEnumerationValue(WaterTempCurveVarNamesUC, waterTempCurveInputVar)); + UtilityRoutines::makeUPPER(fields.at("water_temperature_curve_input_variable").get()); + thisPLHP.waterTempCurveInputVar = static_cast(getEnumValue(WaterTempCurveVarNamesUC, waterTempCurveInputVar)); // A11 normalized_capacity_function_of_temperature_curve_name std::string const &capFtName = - UtilityRoutines::MakeUPPERCase(fields.at("normalized_capacity_function_of_temperature_curve_name").get()); + UtilityRoutines::makeUPPER(fields.at("normalized_capacity_function_of_temperature_curve_name").get()); thisPLHP.capFuncTempCurveIndex = Curve::GetCurveIndex(state, capFtName); if (thisPLHP.capFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLFFHP (name={}; entered curve name: {}", thisPLHP.name, capFtName)); @@ -2044,7 +2044,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A12 fuel_energy_input_ratio_function_of_temperature_curve_name std::string const &eirFtName = - UtilityRoutines::MakeUPPERCase(fields.at("fuel_energy_input_ratio_function_of_temperature_curve_name").get()); + UtilityRoutines::makeUPPER(fields.at("fuel_energy_input_ratio_function_of_temperature_curve_name").get()); thisPLHP.powerRatioFuncTempCurveIndex = Curve::GetCurveIndex(state, eirFtName); if (thisPLHP.capFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLFFHP (name={}; entered curve name: {}", thisPLHP.name, eirFtName)); @@ -2052,7 +2052,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } // A13 fuel_energy_input_ratio_function_of_plr_curve_name std::string const &eirFplrName = - UtilityRoutines::MakeUPPERCase(fields.at("fuel_energy_input_ratio_function_of_plr_curve_name").get()); + UtilityRoutines::makeUPPER(fields.at("fuel_energy_input_ratio_function_of_plr_curve_name").get()); thisPLHP.powerRatioFuncPLRCurveIndex = Curve::GetCurveIndex(state, eirFplrName); if (thisPLHP.capFuncTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR PLFFHP (name={}; entered curve name: {}", thisPLHP.name, eirFplrName)); @@ -2093,7 +2093,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } else { auto eirDefrostCurveFound = fields.find("fuel_energy_input_ratio_defrost_adjustment_curve_name"); if (eirDefrostCurveFound != fields.end()) { - std::string const eirDefrostCurveName = UtilityRoutines::MakeUPPERCase(eirDefrostCurveFound.value().get()); + std::string const eirDefrostCurveName = UtilityRoutines::makeUPPER(eirDefrostCurveFound.value().get()); thisPLHP.defrostEIRCurveIndex = Curve::GetCurveIndex(state, eirDefrostCurveName); if (thisPLHP.defrostEIRCurveIndex == 0) { ShowSevereError( @@ -2110,7 +2110,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) thisPLHP.defrostType = DefrostType::Invalid; } else { thisPLHP.defrostType = static_cast( - getEnumerationValue(DefrostTypeNamesUC, UtilityRoutines::MakeUPPERCase(fields.at("defrost_control_type").get()))); + getEnumValue(DefrostTypeNamesUC, UtilityRoutines::makeUPPER(fields.at("defrost_control_type").get()))); if (thisPLHP.defrostType == DefrostType::Invalid) { thisPLHP.defrostType = DefrostType::OnDemand; // set to default thisPLHP.defrostOpTimeFrac = 0.0; @@ -2180,7 +2180,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A16 cycling_ratio_factor_curve_name auto crfCurveFound = fields.find("cycling_ratio_factor_curve_name"); if (crfCurveFound != fields.end()) { - std::string const cycRatioCurveName = UtilityRoutines::MakeUPPERCase(crfCurveFound.value().get()); + std::string const cycRatioCurveName = UtilityRoutines::makeUPPER(crfCurveFound.value().get()); thisPLHP.cycRatioCurveIndex = Curve::GetCurveIndex(state, cycRatioCurveName); if (thisPLHP.cycRatioCurveIndex == 0) { ShowSevereError(state, @@ -2209,7 +2209,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A17 auxiliary_electric_energy_input_ratio_function_of_temperature_curve_name auto auxElecEIRFTCurveFound = fields.find("auxiliary_electric_energy_input_ratio_function_of_temperature_curve_name"); if (auxElecEIRFTCurveFound != fields.end()) { - std::string const &auxEIRFTName = UtilityRoutines::MakeUPPERCase(auxElecEIRFTCurveFound.value().get()); + std::string const &auxEIRFTName = UtilityRoutines::makeUPPER(auxElecEIRFTCurveFound.value().get()); thisPLHP.auxElecEIRFoTempCurveIndex = Curve::GetCurveIndex(state, auxEIRFTName); if (thisPLHP.auxElecEIRFoTempCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR FFHP (name={}; entered curve name: {}", thisPLHP.name, auxEIRFTName)); @@ -2222,7 +2222,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) // A18 auxiliary_electric_energy_input_ratio_function_of_plr_curve_name auto auxElecEIRFPLRCurveFound = fields.find("auxiliary_electric_energy_input_ratio_function_of_plr_curve_name"); if (auxElecEIRFPLRCurveFound != fields.end()) { - std::string const &auxEIRFPLRName = UtilityRoutines::MakeUPPERCase(auxElecEIRFPLRCurveFound.value().get()); + std::string const &auxEIRFPLRName = UtilityRoutines::makeUPPER(auxElecEIRFPLRCurveFound.value().get()); thisPLHP.auxElecEIRFoPLRCurveIndex = Curve::GetCurveIndex(state, auxEIRFPLRName); if (thisPLHP.auxElecEIRFoPLRCurveIndex == 0) { ShowSevereError(state, format("Invalid curve name for EIR FFHP (name={}; entered curve name: {}", thisPLHP.name, auxEIRFPLRName)); diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index 4e2490e11fd..24a32be8f9d 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -1774,7 +1774,7 @@ namespace PlantPipingSystemsManager { // Read in the flow direction thisSegment.FlowDirection = - static_cast(getEnumerationValue(flowDirectionNamesUC, stripped(state.dataIPShortCut->cAlphaArgs(2)))); + static_cast(getEnumValue(flowDirectionNamesUC, stripped(state.dataIPShortCut->cAlphaArgs(2)))); if (thisSegment.FlowDirection == SegmentFlow::Invalid) { CurIndex = 2; IssueSevereInputFieldError(state, diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 31df3dd96e5..31f236099c4 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -143,12 +143,12 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); std::string const &thisObjectName = instance.key(); - std::string const objNameUC = UtilityRoutines::MakeUPPERCase(thisObjectName); + std::string const objNameUC = UtilityRoutines::makeUPPER(thisObjectName); // no need to validate name, the JSON will validate that. state.dataInputProcessing->inputProcessor->markObjectAsUsed(sOutputVariable, thisObjectName); std::string varName = fields.at("python_plugin_variable_name").get(); - std::string avgOrSum = UtilityRoutines::MakeUPPERCase(fields.at("type_of_data_in_variable").get()); - std::string updateFreq = UtilityRoutines::MakeUPPERCase(fields.at("update_frequency").get()); + std::string avgOrSum = UtilityRoutines::makeUPPER(fields.at("type_of_data_in_variable").get()); + std::string updateFreq = UtilityRoutines::makeUPPER(fields.at("update_frequency").get()); std::string units; if (fields.find("units") != fields.end()) { units = fields.at("units").get(); @@ -221,7 +221,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) "For metered variables, the resource type, group type, and end use category must be defined"); EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } - std::string const resourceType = EnergyPlus::UtilityRoutines::MakeUPPERCase(fields.at("resource_type").get()); + std::string const resourceType = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("resource_type").get()); std::string sResourceType; if (resourceType == "ELECTRICITY") { sResourceType = "Electricity"; @@ -282,7 +282,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) "For metered variables, the resource type, group type, and end use category must be defined"); EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } - std::string const groupType = EnergyPlus::UtilityRoutines::MakeUPPERCase(fields.at("group_type").get()); + std::string const groupType = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("group_type").get()); std::string sGroupType; if (groupType == "BUILDING") { sGroupType = "Building"; @@ -305,7 +305,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) "For metered variables, the resource type, group type, and end use category must be defined"); EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } - std::string const endUse = EnergyPlus::UtilityRoutines::MakeUPPERCase(fields.at("end_use_category").get()); + std::string const endUse = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("end_use_category").get()); std::string sEndUse; if (endUse == "HEATING") { sEndUse = "Heating"; @@ -489,7 +489,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s std::string workingDirFlagUC = "YES"; try { workingDirFlagUC = - EnergyPlus::UtilityRoutines::MakeUPPERCase(fields.at("add_current_working_directory_to_search_path").get()); + EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_current_working_directory_to_search_path").get()); } catch (nlohmann::json::out_of_range &e) { // defaulted to YES } @@ -499,7 +499,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s std::string inputFileDirFlagUC = "YES"; try { inputFileDirFlagUC = - EnergyPlus::UtilityRoutines::MakeUPPERCase(fields.at("add_input_file_directory_to_search_path").get()); + EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_input_file_directory_to_search_path").get()); } catch (nlohmann::json::out_of_range &e) { // defaulted to YES } @@ -511,7 +511,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s std::string epInDirFlagUC = "YES"; try { epInDirFlagUC = - EnergyPlus::UtilityRoutines::MakeUPPERCase(fields.at("add_epin_environment_variable_to_search_path").get()); + EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_epin_environment_variable_to_search_path").get()); } catch (nlohmann::json::out_of_range &e) { // defaulted to YES } @@ -582,7 +582,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s state.dataInputProcessing->inputProcessor->markObjectAsUsed(sPlugins, thisObjectName); fs::path modulePath(fields.at("python_module_name").get()); std::string className = fields.at("plugin_class_name").get(); - std::string sWarmup = EnergyPlus::UtilityRoutines::MakeUPPERCase(fields.at("run_during_warmup_days").get()); + std::string sWarmup = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("run_during_warmup_days").get()); bool warmup = false; if (sWarmup == "YES") { warmup = true; @@ -647,7 +647,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - std::string const &thisObjectName = EnergyPlus::UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const &thisObjectName = EnergyPlus::UtilityRoutines::makeUPPER(instance.key()); state.dataInputProcessing->inputProcessor->markObjectAsUsed(sGlobals, thisObjectName); std::string variableName = fields.at("name_of_a_python_plugin_variable").get(); int variableIndex = EnergyPlus::PluginManagement::PluginManager::getGlobalVariableHandle(state, variableName); @@ -1181,7 +1181,7 @@ void PluginManager::addToPythonPath([[maybe_unused]] EnergyPlusData &state, #if LINK_WITH_PYTHON void PluginManager::addGlobalVariable(EnergyPlusData &state, const std::string &name) { - std::string const varNameUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(name); + std::string const varNameUC = EnergyPlus::UtilityRoutines::makeUPPER(name); state.dataPluginManager->globalVariableNames.push_back(varNameUC); state.dataPluginManager->globalVariableValues.push_back(Real64()); this->maxGlobalVariableIndex++; @@ -1195,7 +1195,7 @@ void PluginManager::addGlobalVariable([[maybe_unused]] EnergyPlusData &state, [[ #if LINK_WITH_PYTHON int PluginManager::getGlobalVariableHandle(EnergyPlusData &state, const std::string &name, bool const suppress_warning) { // note zero is a valid handle - std::string const varNameUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(name); + std::string const varNameUC = EnergyPlus::UtilityRoutines::makeUPPER(name); auto const it = std::find(state.dataPluginManager->globalVariableNames.begin(), state.dataPluginManager->globalVariableNames.end(), varNameUC); if (it != state.dataPluginManager->globalVariableNames.end()) { return std::distance(state.dataPluginManager->globalVariableNames.begin(), it); @@ -1225,7 +1225,7 @@ int PluginManager::getGlobalVariableHandle([[maybe_unused]] EnergyPlusData &stat #if LINK_WITH_PYTHON int PluginManager::getTrendVariableHandle(EnergyPlusData &state, const std::string &name) { - std::string const varNameUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(name); + std::string const varNameUC = EnergyPlus::UtilityRoutines::makeUPPER(name); for (size_t i = 0; i < state.dataPluginManager->trends.size(); i++) { auto &thisTrend = state.dataPluginManager->trends[i]; if (thisTrend.name == varNameUC) { @@ -1422,7 +1422,7 @@ int PluginManager::getLocationOfUserDefinedPlugin(EnergyPlusData &state, std::st { for (size_t handle = 0; handle < state.dataPluginManager->plugins.size(); handle++) { auto const &thisPlugin = state.dataPluginManager->plugins[handle]; - if (UtilityRoutines::MakeUPPERCase(thisPlugin.emsAlias) == UtilityRoutines::MakeUPPERCase(_programName)) { + if (UtilityRoutines::makeUPPER(thisPlugin.emsAlias) == UtilityRoutines::makeUPPER(_programName)) { return handle; } } diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 58b94cd8500..99e813ac623 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -318,7 +318,7 @@ void GetPIUs(EnergyPlusData &state) thisPIU.MinPriAirFlowFrac = state.dataIPShortCut->rNumericArgs(3); thisPIU.HCoilType = - static_cast(getEnumerationValue(HCoilNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(9)))); + static_cast(getEnumValue(HCoilNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); switch (thisPIU.HCoilType) { case HtgCoilType::SimpleHeating: { thisPIU.HCoil_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 3274a60052a..96af8356ce2 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -320,7 +320,7 @@ void GetPumpInput(EnergyPlusData &state) TestCompSet(state, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaArgs(2), thisInput->cAlphaArgs(3), "Water Nodes"); thisPump.PumpControl = static_cast( - getEnumerationValue(pumpCtrlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(4)))); + getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(4))); @@ -408,7 +408,7 @@ void GetPumpInput(EnergyPlusData &state) } else { thisPump.HasVFD = true; thisPump.VFD.VFDControlType = static_cast( - getEnumerationValue(controlTypeVFDNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(7)))); + getEnumValue(controlTypeVFDNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(7)))); switch (thisPump.VFD.VFDControlType) { case ControlTypeVFD::VFDManual: { thisPump.VFD.ManualRPMSchedIndex = GetScheduleIndex(state, thisInput->cAlphaArgs(8)); @@ -487,7 +487,7 @@ void GetPumpInput(EnergyPlusData &state) if (!thisInput->lAlphaFieldBlanks(14)) { thisPump.powerSizingMethod = static_cast( - getEnumerationValue(powerSizingMethodNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(14)))); + getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(14)))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", @@ -588,7 +588,7 @@ void GetPumpInput(EnergyPlusData &state) thisPump.Power = 0.0; thisPump.PumpControl = static_cast( - getEnumerationValue(pumpCtrlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(4)))); + getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(4))); @@ -656,7 +656,7 @@ void GetPumpInput(EnergyPlusData &state) if (!thisInput->lAlphaFieldBlanks(8)) { thisPump.powerSizingMethod = static_cast( - getEnumerationValue(powerSizingMethodNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(8)))); + getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", @@ -789,7 +789,7 @@ void GetPumpInput(EnergyPlusData &state) if (!thisInput->lAlphaFieldBlanks(6)) { thisPump.powerSizingMethod = static_cast( - getEnumerationValue(powerSizingMethodNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(6)))); + getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", @@ -876,7 +876,7 @@ void GetPumpInput(EnergyPlusData &state) } thisPump.PumpControl = static_cast( - getEnumerationValue(pumpCtrlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(5)))); + getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(5))); @@ -935,7 +935,7 @@ void GetPumpInput(EnergyPlusData &state) if (!thisInput->lAlphaFieldBlanks(8)) { thisPump.powerSizingMethod = static_cast( - getEnumerationValue(powerSizingMethodNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(8)))); + getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", @@ -1022,7 +1022,7 @@ void GetPumpInput(EnergyPlusData &state) } thisPump.PumpControl = static_cast( - getEnumerationValue(pumpCtrlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(5)))); + getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, @@ -1079,7 +1079,7 @@ void GetPumpInput(EnergyPlusData &state) } if (!thisInput->lAlphaFieldBlanks(8)) { thisPump.powerSizingMethod = static_cast( - getEnumerationValue(powerSizingMethodNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(8)))); + getEnumValue(powerSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (thisPump.powerSizingMethod == PowerSizingMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\", sizing method type entered is invalid. Use one of the key choice entries.", diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index fe3fae6ed43..b2ac04f2b17 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -606,6 +606,7 @@ void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVec c->zoneHVACTypeNum = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(1); c->zoneHVACIndex = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipIndex(1); } else if (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes > 1) { +#ifdef GET_OUT_FOR_NOW bool foundOne(false); for (int equipLoop = 1; equipLoop <= state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes; ++equipLoop) { // go with the first ZoneHVAC device in the list @@ -638,8 +639,10 @@ void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVec c->typeHVACname += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(equipLoop); c->userNameforHVACsystem += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(equipLoop); } + } } +#endif // } } } @@ -661,6 +664,7 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) c->userNameforHVACsystem = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(1); c->coilLocation = "Zone Equipment"; } else if (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes > 1) { +#ifdef GET_OUT_FOR_NOW bool foundOne(false); for (int equipLoop = 1; equipLoop <= state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes; ++equipLoop) { // go with the first ZoneHVAC device in the list @@ -697,7 +701,8 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) c->userNameforHVACsystem += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(equipLoop); } } - } + } // for (loop) +#endif // } } diff --git a/src/EnergyPlus/ReturnAirPathManager.cc b/src/EnergyPlus/ReturnAirPathManager.cc index e06cdab1cd4..1687ca7d4cb 100644 --- a/src/EnergyPlus/ReturnAirPathManager.cc +++ b/src/EnergyPlus/ReturnAirPathManager.cc @@ -189,7 +189,7 @@ namespace ReturnAirPathManager { ErrorsFound = true; } state.dataZoneEquip->ReturnAirPath(PathNum).ComponentTypeEnum(CompNum) = static_cast( - getEnumerationValue(DataZoneEquipment::AirLoopHVACTypeNamesCC, state.dataIPShortCut->cAlphaArgs(Counter))); + getEnumValue(DataZoneEquipment::AirLoopHVACTypeNamesCC, state.dataIPShortCut->cAlphaArgs(Counter))); } else { ShowSevereError( diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 08f552608ed..931caab4dfb 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -1281,15 +1281,9 @@ namespace RoomAirModelAirflowNetwork { // na // USE STATEMENTS: + using DataHVACGlobals::ZoneEquipType; using BaseboardElectric::SimElectricBaseboard; using BaseboardRadiator::SimBaseboard; - using DataHVACGlobals::ZoneEquipTypeOf_BaseboardConvectiveElectric; - using DataHVACGlobals::ZoneEquipTypeOf_BaseboardConvectiveWater; - using DataHVACGlobals::ZoneEquipTypeOf_BaseboardRadiantConvectiveElectric; - using DataHVACGlobals::ZoneEquipTypeOf_BaseboardRadiantConvectiveSteam; - using DataHVACGlobals::ZoneEquipTypeOf_BaseboardRadiantConvectiveWater; - using DataHVACGlobals::ZoneEquipTypeOf_HighTemperatureRadiant; - using DataHVACGlobals::ZoneEquipTypeOf_RefrigerationChillerSet; using ElectricBaseboardRadiator::SimElecBaseboard; using HighTempRadiantSystem::SimHighTempRadiantSystem; using HWBaseboardRadiator::SimHWBaseboard; @@ -1297,68 +1291,73 @@ namespace RoomAirModelAirflowNetwork { using SteamBaseboardRadiator::SimSteamBaseboard; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int I; Real64 SysOutputProvided; Real64 LatOutputProvided; // TODO - auto &ThisRAFNNode(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum)); + auto &roomAFNNode = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum); - ThisRAFNNode.NonAirSystemResponse = 0.0; + roomAFNNode.NonAirSystemResponse = 0.0; if (!allocated(state.dataZoneEquip->ZoneEquipConfig)) return; - for (I = 1; I <= ThisRAFNNode.NumHVACs; ++I) { + for (int I = 1; I <= roomAFNNode.NumHVACs; ++I) { + auto &roomAFNNodeHVAC = roomAFNNode.HVAC(I); + switch (roomAFNNodeHVAC.zoneEquipType) { - if (ThisRAFNNode.HVAC(I).TypeOfNum == ZoneEquipTypeOf_BaseboardRadiantConvectiveWater) { + case ZoneEquipType::BaseboardRadiantConvectiveWater: { //'ZoneHVAC:Baseboard:RadiantConvective:Water' 13 - SimHWBaseboard(state, ThisRAFNNode.HVAC(I).Name, ZoneNum, false, SysOutputProvided, ThisRAFNNode.HVAC(I).CompIndex); - ThisRAFNNode.NonAirSystemResponse += ThisRAFNNode.HVAC(I).SupplyFraction * SysOutputProvided; + SimHWBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); + roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat - } + } break; - if (ThisRAFNNode.HVAC(I).TypeOfNum == ZoneEquipTypeOf_BaseboardRadiantConvectiveSteam) { + case ZoneEquipType::BaseboardRadiantConvectiveSteam: { // CASE(BBSteam_Num) !'ZoneHVAC:Baseboard:RadiantConvective:Steam' 14 - SimSteamBaseboard(state, ThisRAFNNode.HVAC(I).Name, ZoneNum, false, SysOutputProvided, ThisRAFNNode.HVAC(I).CompIndex); + SimSteamBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); - ThisRAFNNode.NonAirSystemResponse += ThisRAFNNode.HVAC(I).SupplyFraction * SysOutputProvided; + roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat - } + } break; - if (ThisRAFNNode.HVAC(I).TypeOfNum == ZoneEquipTypeOf_BaseboardConvectiveWater) { + case ZoneEquipType::BaseboardConvectiveWater: { // CASE(BBWaterConvective_Num) !'ZoneHVAC:Baseboard:Convective:Water' 16 - SimBaseboard(state, ThisRAFNNode.HVAC(I).Name, ZoneNum, false, SysOutputProvided, ThisRAFNNode.HVAC(I).CompIndex); - ThisRAFNNode.NonAirSystemResponse += ThisRAFNNode.HVAC(I).SupplyFraction * SysOutputProvided; + SimBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); + roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat - } + } break; - if (ThisRAFNNode.HVAC(I).TypeOfNum == ZoneEquipTypeOf_BaseboardConvectiveElectric) { + case ZoneEquipType::BaseboardConvectiveElectric: { // CASE(BBElectricConvective_Num) !'ZoneHVAC:Baseboard:Convective:Electric' 15 - SimElectricBaseboard(state, ThisRAFNNode.HVAC(I).Name, ZoneNum, SysOutputProvided, ThisRAFNNode.HVAC(I).CompIndex); - ThisRAFNNode.NonAirSystemResponse += ThisRAFNNode.HVAC(I).SupplyFraction * SysOutputProvided; + SimElectricBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, SysOutputProvided, roomAFNNodeHVAC.CompIndex); + roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat - } + } break; - if (ThisRAFNNode.HVAC(I).TypeOfNum == ZoneEquipTypeOf_RefrigerationChillerSet) { + case ZoneEquipType::RefrigerationChillerSet: { // CASE(RefrigerationAirChillerSet_Num) !'ZoneHVAC:RefrigerationChillerSet' 20 SimAirChillerSet( - state, ThisRAFNNode.HVAC(I).Name, ZoneNum, false, SysOutputProvided, LatOutputProvided, ThisRAFNNode.HVAC(I).CompIndex); - ThisRAFNNode.NonAirSystemResponse += ThisRAFNNode.HVAC(I).SupplyFraction * SysOutputProvided; - } + state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, LatOutputProvided, roomAFNNodeHVAC.CompIndex); + roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; + } break; - if (ThisRAFNNode.HVAC(I).TypeOfNum == ZoneEquipTypeOf_BaseboardRadiantConvectiveElectric) { + case ZoneEquipType::BaseboardRadiantConvectiveElectric: { // CASE(BBElectric_Num) !'ZoneHVAC:Baseboard:RadiantConvective:Electric' 12 - SimElecBaseboard(state, ThisRAFNNode.HVAC(I).Name, ZoneNum, false, SysOutputProvided, ThisRAFNNode.HVAC(I).CompIndex); - ThisRAFNNode.NonAirSystemResponse += ThisRAFNNode.HVAC(I).SupplyFraction * SysOutputProvided; + SimElecBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); + roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat - } + } break; - if (ThisRAFNNode.HVAC(I).TypeOfNum == ZoneEquipTypeOf_HighTemperatureRadiant) { + case ZoneEquipType::HighTemperatureRadiant: { // CASE(BBElectric_Num) !'ZoneHVAC:HighTemperatureRadiant' 17 - SimHighTempRadiantSystem(state, ThisRAFNNode.HVAC(I).Name, false, SysOutputProvided, ThisRAFNNode.HVAC(I).CompIndex); - ThisRAFNNode.NonAirSystemResponse += ThisRAFNNode.HVAC(I).SupplyFraction * SysOutputProvided; + SimHighTempRadiantSystem(state, roomAFNNodeHVAC.Name, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); + roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat - } + } break; + + default: { + } break; + } // switch // Zone sum of system convective gains, collected via NonAirSystemResponse } @@ -1385,7 +1384,7 @@ namespace RoomAirModelAirflowNetwork { // na // USE STATEMENTS: - using DataHVACGlobals::ZoneEquipTypeOf_DehumidifierDX; + using DataHVACGlobals::ZoneEquipType; using ZoneDehumidifier::SimZoneDehumidifier; // Return value @@ -1406,7 +1405,7 @@ namespace RoomAirModelAirflowNetwork { for (RoomAirNode = 1; RoomAirNode <= ThisRAFNZone.NumOfAirNodes; ++RoomAirNode) { ThisRAFNZone.Node(RoomAirNode).SysDepZoneLoadsLaggedOld = 0.0; for (I = 1; I <= ThisRAFNZone.Node(RoomAirNode).NumHVACs; ++I) { - if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).TypeOfNum == ZoneEquipTypeOf_DehumidifierDX) { + if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).zoneEquipType == ZoneEquipType::DehumidifierDX) { if (SysOutputProvided == 0.0) SimZoneDehumidifier(state, ThisRAFNZone.Node(RoomAirNode).HVAC(I).Name, @@ -1423,7 +1422,7 @@ namespace RoomAirModelAirflowNetwork { if (SysOutputProvided > 0.0) { for (RoomAirNode = 1; RoomAirNode <= ThisRAFNZone.NumOfAirNodes; ++RoomAirNode) { for (I = 1; I <= ThisRAFNZone.Node(RoomAirNode).NumHVACs; ++I) { - if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).TypeOfNum == ZoneEquipTypeOf_DehumidifierDX) { + if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).zoneEquipType == ZoneEquipType::DehumidifierDX) { ThisRAFNZone.Node(RoomAirNode).SysDepZoneLoadsLaggedOld += ThisRAFNZone.Node(RoomAirNode).HVAC(I).SupplyFraction * SysOutputProvided; } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 36c7fba9112..197aa714cce 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -104,7 +104,22 @@ namespace RoomAirModelManager { // Using/Aliasing using namespace DataRoomAirModel; - void ManageAirModel(EnergyPlusData &state, int const ZoneNum) + constexpr std::array roomAirModelNamesUC = + { "USERDEFINED", "MIXING", "MUNDT", "UCSD_DV", "UCSD_CV", "UCSD_UFI", "UCSD_UFE", "AIRFLOWNETWORK"}; + + constexpr std::array airNodeTypeNamesUC = + {"INLET", "FLOOR", "CONTROL", "CEILING", "MUNDTROOM", "RETURN", "AIRFLOWNETWORK", "PLUME", "REESROOM"}; + + constexpr std::array comfortNamesUC = + {"JET", "RECIRCULATION"}; + + constexpr std::array diffuserNamesUC = + {"SWIRL", "VARIABLEAREA", "HORIZONTALSWIRL", "LINEARBARGRILLE", "CUSTOM"}; + + constexpr std::array userDefinedPatternModeNamesUC = + {"OUTDOORDRYBULBTEMPERATURE", "SENSIBLECOOLINGLOAD", "SENSIBLEHEATINGLOAD", "ZONEDRYBULBTEMPERATURE", "ZONEANDOUTDOORTEMPERATUREDIFFERENCE"}; + + void ManageAirModel(EnergyPlusData &state, int const ZoneNum) { // SUBROUTINE INFORMATION: @@ -128,40 +143,40 @@ namespace RoomAirModelManager { SharedDVCVUFDataInit(state, ZoneNum); } - switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModelType) { - case DataRoomAirModel::RoomAirModel::UserDefined: + switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModel) { + case RoomAirModel::UserDefined: RoomAirModelUserTempPattern::ManageUserDefinedPatterns(state, ZoneNum); break; - case DataRoomAirModel::RoomAirModel::Mixing: // Mixing air model + case RoomAirModel::Mixing: // Mixing air model break; // do nothing - case DataRoomAirModel::RoomAirModel::Mundt: // Mundt air model + case RoomAirModel::Mundt: // Mundt air model // simulate room airflow using Mundt model MundtSimMgr::ManageMundtModel(state, ZoneNum); break; - case DataRoomAirModel::RoomAirModel::UCSDDV: // UCDV Displacement Ventilation model + case RoomAirModel::UCSDDV: // UCDV Displacement Ventilation model // simulate room airflow using UCSDDV model DisplacementVentMgr::ManageUCSDDVModel(state, ZoneNum); break; - case DataRoomAirModel::RoomAirModel::UCSDCV: // UCSD Cross Ventilation model + case RoomAirModel::UCSDCV: // UCSD Cross Ventilation model // simulate room airflow using UCSDDV model CrossVentMgr::ManageUCSDCVModel(state, ZoneNum); break; - case DataRoomAirModel::RoomAirModel::UCSDUFI: // UCSD UFAD interior zone model + case RoomAirModel::UCSDUFI: // UCSD UFAD interior zone model // simulate room airflow using the UCSDUFI model - UFADManager::ManageUCSDUFModels(state, ZoneNum, DataRoomAirModel::RoomAirModel::UCSDUFI); + UFADManager::ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UCSDUFI); break; - case DataRoomAirModel::RoomAirModel::UCSDUFE: // UCSD UFAD exterior zone model + case RoomAirModel::UCSDUFE: // UCSD UFAD exterior zone model // simulate room airflow using the UCSDUFE model - UFADManager::ManageUCSDUFModels(state, ZoneNum, DataRoomAirModel::RoomAirModel::UCSDUFE); + UFADManager::ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UCSDUFE); break; - case DataRoomAirModel::RoomAirModel::AirflowNetwork: // RoomAirflowNetwork zone model + case RoomAirModel::AirflowNetwork: // RoomAirflowNetwork zone model // simulate room airflow using the AirflowNetwork - based model RoomAirModelAirflowNetwork::SimRoomAirModelAirflowNetwork(state, ZoneNum); break; @@ -240,7 +255,7 @@ namespace RoomAirModelManager { using ScheduleManager::GetScheduleIndex; // SUBROUTINE PARAMETER DEFINITIONS: - static constexpr std::string_view RoutineName("GetUserDefinedPatternData: "); + static constexpr std::string_view routineName = "GetUserDefinedPatternData: "; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // number of alphas @@ -248,14 +263,12 @@ namespace RoomAirModelManager { int Status; // Notes if there was an error in processing the input int thisSurfinZone; // working variable for indexing surfaces within a ZoneRadiantInfo structure - int thisPattern; - int i; // do loop indexer int NumPairs; // number of zeta/deltaTai pairs - int ObjNum; // loop indexer of input objects if the same type - int ZoneNum; // zone number in heat balance domain int found; // test for UtilityRoutines::FindItemInList( + auto &ipsc = state.dataIPShortCut; + // access input file and setup state.dataRoomAirMod->numTempDistContrldZones = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cUserDefinedControlObject); @@ -270,11 +283,10 @@ namespace RoomAirModelManager { state.dataRoomAirMod->NumAirTempPatterns = state.dataRoomAirMod->NumConstantGradient + state.dataRoomAirMod->NumTwoGradientInterp + state.dataRoomAirMod->NumNonDimensionalHeight + state.dataRoomAirMod->NumSurfaceMapping; - auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; - cCurrentModuleObject = cUserDefinedControlObject; + ipsc->cCurrentModuleObject = cUserDefinedControlObject; if (state.dataRoomAirMod->numTempDistContrldZones == 0) { if (state.dataRoomAirMod->NumAirTempPatterns != 0) { // user may have missed control object - ShowWarningError(state, format("Missing {} object needed to use roomair temperature patterns", cCurrentModuleObject)); + ShowWarningError(state, format("Missing {} object needed to use roomair temperature patterns", ipsc->cCurrentModuleObject)); // ErrorsFound = .TRUE. } return; @@ -285,68 +297,64 @@ namespace RoomAirModelManager { state.dataRoomAirMod->AirPatternZoneInfo.allocate(state.dataGlobal->NumOfZones); } - for (ObjNum = 1; ObjNum <= state.dataRoomAirMod->numTempDistContrldZones; ++ObjNum) { + for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->numTempDistContrldZones; ++ObjNum) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, ObjNum, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, Status, _, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // first get zone ID - ZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); + int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); if (ZoneNum == 0) { // throw error - ShowSevereError(state, format("{}{}=\"{}\", invalid data.", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError( - state, format("Invalid-not found {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; return; // halt to avoid hard crash } - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).IsUsed = true; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Name = state.dataIPShortCut->cAlphaArgs(1); // Name of this Control Object - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneName = state.dataIPShortCut->cAlphaArgs(2); // Zone Name - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).AvailSched = state.dataIPShortCut->cAlphaArgs(3); - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).AvailSchedID = ScheduleManager::ScheduleAlwaysOn; + auto &airPatternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); + airPatternZoneInfo.IsUsed = true; + airPatternZoneInfo.Name = ipsc->cAlphaArgs(1); // Name of this Control Object + airPatternZoneInfo.ZoneName = ipsc->cAlphaArgs(2); // Zone Name + + airPatternZoneInfo.AvailSched = ipsc->cAlphaArgs(3); + if (ipsc->lAlphaFieldBlanks(3)) { + airPatternZoneInfo.AvailSchedID = ScheduleManager::ScheduleAlwaysOn; } else { - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).AvailSchedID = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(3)); - if (state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).AvailSchedID == 0) { - ShowSevereError(state, - format("{}{}=\"{}\", invalid data.", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError( - state, - format("Invalid-not found {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); + airPatternZoneInfo.AvailSchedID = GetScheduleIndex(state, ipsc->cAlphaArgs(3)); + if (airPatternZoneInfo.AvailSchedID == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } } - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).PatternCntrlSched = - state.dataIPShortCut->cAlphaArgs(4); // Schedule Name for Leading Pattern Control for this Zone - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).PatternSchedID = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(4)); - if (state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).PatternSchedID == 0) { - ShowSevereError(state, format("{}{}=\"{}\", invalid data.", RoutineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError( - state, format("Invalid-not found {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4))); + airPatternZoneInfo.PatternCntrlSched = + ipsc->cAlphaArgs(4); // Schedule Name for Leading Pattern Control for this Zone + airPatternZoneInfo.PatternSchedID = GetScheduleIndex(state, ipsc->cAlphaArgs(4)); + if (airPatternZoneInfo.PatternSchedID == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4)); ErrorsFound = true; } - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneID = ZoneNum; + airPatternZoneInfo.ZoneID = ZoneNum; // figure number of surfaces for this zone - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).totNumSurfs = 0; + airPatternZoneInfo.totNumSurfs = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).totNumSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; + airPatternZoneInfo.totNumSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; } // allocate nested derived type for surface info - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf.allocate(state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).totNumSurfs); + airPatternZoneInfo.Surf.allocate(airPatternZoneInfo.totNumSurfs); // Fill in what we know for nested structure for surfaces thisSurfinZone = 0; @@ -355,26 +363,26 @@ namespace RoomAirModelManager { for (int thisHBsurfID = thisSpace.HTSurfaceFirst; thisHBsurfID <= thisSpace.HTSurfaceLast; ++thisHBsurfID) { ++thisSurfinZone; if (state.dataSurface->Surface(thisHBsurfID).Class == DataSurfaces::SurfaceClass::IntMass) { - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(thisSurfinZone).SurfID = thisHBsurfID; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(thisSurfinZone).Zeta = 0.5; + airPatternZoneInfo.Surf(thisSurfinZone).SurfID = thisHBsurfID; + airPatternZoneInfo.Surf(thisSurfinZone).Zeta = 0.5; continue; } - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(thisSurfinZone).SurfID = thisHBsurfID; + airPatternZoneInfo.Surf(thisSurfinZone).SurfID = thisHBsurfID; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(thisSurfinZone).Zeta = FigureNDheightInZone(state, thisHBsurfID); + airPatternZoneInfo.Surf(thisSurfinZone).Zeta = FigureNDheightInZone(state, thisHBsurfID); } } // loop through surfaces in this zone } // loop through number of 'RoomAir:TemperaturePattern:UserDefined' objects // Check against AirModel. Make sure there is a match here. - for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModelType != DataRoomAirModel::RoomAirModel::UserDefined) continue; - if (state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).IsUsed) continue; // There is a Room Air Temperatures object for this zone + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UserDefined) continue; + if (state.dataRoomAirMod->AirPatternZoneInfo(iZone).IsUsed) continue; // There is a Room Air Temperatures object for this zone ShowSevereError(state, - format("{}AirModel for Zone=[{}] is indicated as \"User Defined\".", RoutineName, state.dataHeatBal->Zone(ZoneNum).Name)); - ShowContinueError(state, format("...but missing a {} object for control.", cCurrentModuleObject)); + format("{}AirModel for Zone=[{}] is indicated as \"User Defined\".", routineName, state.dataHeatBal->Zone(iZone).Name)); + ShowContinueError(state, format("...but missing a {} object for control.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } @@ -384,216 +392,203 @@ namespace RoomAirModelManager { } // Four different objects to get - cCurrentModuleObject = cTempPatternConstGradientObject; - for (ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumConstantGradient; ++ObjNum) { - thisPattern = ObjNum; + ipsc->cCurrentModuleObject = cTempPatternConstGradientObject; + for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumConstantGradient; ++ObjNum) { + int thisPattern = ObjNum; state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, ObjNum, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, Status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - - state.dataRoomAirMod->RoomAirPattern(thisPattern).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).PatrnID = state.dataIPShortCut->rNumericArgs(1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).PatternMode = DataRoomAirModel::UserDefinedPatternType::ConstGradTemp; - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTstat = state.dataIPShortCut->rNumericArgs(2); - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTleaving = state.dataIPShortCut->rNumericArgs(3); - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTexhaust = state.dataIPShortCut->rNumericArgs(4); - state.dataRoomAirMod->RoomAirPattern(thisPattern).GradPatrn.Gradient = state.dataIPShortCut->rNumericArgs(5); + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + auto &roomAirPattern = state.dataRoomAirMod->RoomAirPattern(thisPattern); + roomAirPattern.Name = ipsc->cAlphaArgs(1); + roomAirPattern.PatrnID = ipsc->rNumericArgs(1); + roomAirPattern.PatternMode = UserDefinedPatternType::ConstGradTemp; + roomAirPattern.DeltaTstat = ipsc->rNumericArgs(2); + roomAirPattern.DeltaTleaving = ipsc->rNumericArgs(3); + roomAirPattern.DeltaTexhaust = ipsc->rNumericArgs(4); + roomAirPattern.GradPatrn.Gradient = ipsc->rNumericArgs(5); } - cCurrentModuleObject = cTempPatternTwoGradientObject; - for (ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumTwoGradientInterp; ++ObjNum) { - thisPattern = state.dataRoomAirMod->NumConstantGradient + ObjNum; + ipsc->cCurrentModuleObject = cTempPatternTwoGradientObject; + for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumTwoGradientInterp; ++ObjNum) { + int thisPattern = state.dataRoomAirMod->NumConstantGradient + ObjNum; state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, ObjNum, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, Status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - state.dataRoomAirMod->RoomAirPattern(thisPattern).PatternMode = DataRoomAirModel::UserDefinedPatternType::TwoGradInterp; - state.dataRoomAirMod->RoomAirPattern(thisPattern).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).PatrnID = state.dataIPShortCut->rNumericArgs(1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.TstatHeight = state.dataIPShortCut->rNumericArgs(2); - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.TleavingHeight = state.dataIPShortCut->rNumericArgs(3); - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.TexhaustHeight = state.dataIPShortCut->rNumericArgs(4); - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.LowGradient = state.dataIPShortCut->rNumericArgs(5); - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.HiGradient = state.dataIPShortCut->rNumericArgs(6); - - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "OutdoorDryBulbTemperature")) { - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode = - DataRoomAirModel::UserDefinedPatternMode::OutdoorDryBulb; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "ZoneDryBulbTemperature")) { - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode = - DataRoomAirModel::UserDefinedPatternMode::ZoneAirTemp; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "ZoneAndOutdoorTemperatureDifference")) { - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode = - DataRoomAirModel::UserDefinedPatternMode::DeltaOutdoorZone; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "SensibleCoolingLoad")) { - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode = - DataRoomAirModel::UserDefinedPatternMode::SensibleCooling; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "SensibleHeatingLoad")) { - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode = - DataRoomAirModel::UserDefinedPatternMode::SensibleHeating; - } else { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + + auto &roomAirPattern = state.dataRoomAirMod->RoomAirPattern(thisPattern); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + roomAirPattern.PatternMode = UserDefinedPatternType::TwoGradInterp; + roomAirPattern.Name = ipsc->cAlphaArgs(1); + roomAirPattern.PatrnID = ipsc->rNumericArgs(1); + roomAirPattern.TwoGradPatrn.TstatHeight = ipsc->rNumericArgs(2); + roomAirPattern.TwoGradPatrn.TleavingHeight = ipsc->rNumericArgs(3); + roomAirPattern.TwoGradPatrn.TexhaustHeight = ipsc->rNumericArgs(4); + roomAirPattern.TwoGradPatrn.LowGradient = ipsc->rNumericArgs(5); + roomAirPattern.TwoGradPatrn.HiGradient = ipsc->rNumericArgs(6); + + roomAirPattern.TwoGradPatrn.InterpolationMode = + static_cast(getEnumValue(userDefinedPatternModeNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + if (roomAirPattern.TwoGradPatrn.InterpolationMode == UserDefinedPatternMode::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.UpperBoundTempScale = state.dataIPShortCut->rNumericArgs(7); - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.LowerBoundTempScale = state.dataIPShortCut->rNumericArgs(8); + roomAirPattern.TwoGradPatrn.UpperBoundTempScale = ipsc->rNumericArgs(7); + roomAirPattern.TwoGradPatrn.LowerBoundTempScale = ipsc->rNumericArgs(8); - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.UpperBoundHeatRateScale = state.dataIPShortCut->rNumericArgs(9); - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.LowerBoundHeatRateScale = state.dataIPShortCut->rNumericArgs(10); + roomAirPattern.TwoGradPatrn.UpperBoundHeatRateScale = ipsc->rNumericArgs(9); + roomAirPattern.TwoGradPatrn.LowerBoundHeatRateScale = ipsc->rNumericArgs(10); // now test the input some - if (state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.HiGradient == - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.LowGradient) { + if (roomAirPattern.TwoGradPatrn.HiGradient == + roomAirPattern.TwoGradPatrn.LowGradient) { ShowWarningError(state, format("Upper and lower gradients equal, use {} instead ", cTempPatternConstGradientObject)); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); } - if ((state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.UpperBoundTempScale == - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.LowerBoundTempScale) && - ((state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode == - DataRoomAirModel::UserDefinedPatternMode::OutdoorDryBulb) || - (state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode == - DataRoomAirModel::UserDefinedPatternMode::ZoneAirTemp) || - (state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode == - DataRoomAirModel::UserDefinedPatternMode::DeltaOutdoorZone))) { + if ((roomAirPattern.TwoGradPatrn.UpperBoundTempScale == roomAirPattern.TwoGradPatrn.LowerBoundTempScale) && + ((roomAirPattern.TwoGradPatrn.InterpolationMode == UserDefinedPatternMode::OutdoorDryBulb) || + (roomAirPattern.TwoGradPatrn.InterpolationMode == UserDefinedPatternMode::ZoneAirTemp) || + (roomAirPattern.TwoGradPatrn.InterpolationMode == UserDefinedPatternMode::DeltaOutdoorZone))) { // throw error, will cause divide by zero when used for scaling - ShowSevereError(state, format("Error in temperature scale in {}: {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ShowSevereError(state, format("Error in temperature scale in {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ErrorsFound = true; } - if ((state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.HiGradient == - state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.LowGradient) && - ((state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode == - DataRoomAirModel::UserDefinedPatternMode::SensibleCooling) || - (state.dataRoomAirMod->RoomAirPattern(thisPattern).TwoGradPatrn.InterpolationMode == - DataRoomAirModel::UserDefinedPatternMode::SensibleHeating))) { + if ((roomAirPattern.TwoGradPatrn.HiGradient == roomAirPattern.TwoGradPatrn.LowGradient) && + ((roomAirPattern.TwoGradPatrn.InterpolationMode == UserDefinedPatternMode::SensibleCooling) || + (roomAirPattern.TwoGradPatrn.InterpolationMode == UserDefinedPatternMode::SensibleHeating))) { // throw error, will cause divide by zero when used for scaling - ShowSevereError(state, format("Error in load scale in {}: {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ShowSevereError(state, format("Error in load scale in {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ErrorsFound = true; } } - cCurrentModuleObject = cTempPatternNDHeightObject; - for (ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumNonDimensionalHeight; ++ObjNum) { - thisPattern = state.dataRoomAirMod->NumConstantGradient + state.dataRoomAirMod->NumTwoGradientInterp + ObjNum; - state.dataRoomAirMod->RoomAirPattern(thisPattern).PatternMode = DataRoomAirModel::UserDefinedPatternType::NonDimenHeight; - + ipsc->cCurrentModuleObject = cTempPatternNDHeightObject; + for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumNonDimensionalHeight; ++ObjNum) { + int thisPattern = state.dataRoomAirMod->NumConstantGradient + state.dataRoomAirMod->NumTwoGradientInterp + ObjNum; state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, ObjNum, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, Status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - state.dataRoomAirMod->RoomAirPattern(thisPattern).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).PatrnID = state.dataIPShortCut->rNumericArgs(1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTstat = state.dataIPShortCut->rNumericArgs(2); - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTleaving = state.dataIPShortCut->rNumericArgs(3); - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTexhaust = state.dataIPShortCut->rNumericArgs(4); + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + auto &roomAirPattern = state.dataRoomAirMod->RoomAirPattern(thisPattern); + roomAirPattern.PatternMode = UserDefinedPatternType::NonDimenHeight; + + roomAirPattern.Name = ipsc->cAlphaArgs(1); + roomAirPattern.PatrnID = ipsc->rNumericArgs(1); + roomAirPattern.DeltaTstat = ipsc->rNumericArgs(2); + roomAirPattern.DeltaTleaving = ipsc->rNumericArgs(3); + roomAirPattern.DeltaTexhaust = ipsc->rNumericArgs(4); NumPairs = std::floor((double(NumNumbers) - 4.0) / 2.0); // TODO error checking - state.dataRoomAirMod->RoomAirPattern(thisPattern).VertPatrn.ZetaPatrn.allocate(NumPairs); - state.dataRoomAirMod->RoomAirPattern(thisPattern).VertPatrn.DeltaTaiPatrn.allocate(NumPairs); + roomAirPattern.VertPatrn.ZetaPatrn.allocate(NumPairs); + roomAirPattern.VertPatrn.DeltaTaiPatrn.allocate(NumPairs); // init these since they can't be in derived type - state.dataRoomAirMod->RoomAirPattern(thisPattern).VertPatrn.ZetaPatrn = 0.0; - state.dataRoomAirMod->RoomAirPattern(thisPattern).VertPatrn.DeltaTaiPatrn = 0.0; + roomAirPattern.VertPatrn.ZetaPatrn = 0.0; + roomAirPattern.VertPatrn.DeltaTaiPatrn = 0.0; - for (i = 0; i <= NumPairs - 1; ++i) { + for (int i = 0; i <= NumPairs - 1; ++i) { - state.dataRoomAirMod->RoomAirPattern(thisPattern).VertPatrn.ZetaPatrn(i + 1) = state.dataIPShortCut->rNumericArgs(2 * i + 5); - state.dataRoomAirMod->RoomAirPattern(thisPattern).VertPatrn.DeltaTaiPatrn(i + 1) = state.dataIPShortCut->rNumericArgs(2 * i + 6); + roomAirPattern.VertPatrn.ZetaPatrn(i + 1) = ipsc->rNumericArgs(2 * i + 5); + roomAirPattern.VertPatrn.DeltaTaiPatrn(i + 1) = ipsc->rNumericArgs(2 * i + 6); } // TODO check order (TODO sort ? ) - for (i = 2; i <= NumPairs; ++i) { - if (state.dataRoomAirMod->RoomAirPattern(thisPattern).VertPatrn.ZetaPatrn(i) < - state.dataRoomAirMod->RoomAirPattern(thisPattern).VertPatrn.ZetaPatrn(i - 1)) { + for (int i = 2; i <= NumPairs; ++i) { + if (roomAirPattern.VertPatrn.ZetaPatrn(i) < roomAirPattern.VertPatrn.ZetaPatrn(i - 1)) { ShowSevereError( - state, format("Zeta values not in increasing order in {}: {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + state, format("Zeta values not in increasing order in {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ErrorsFound = true; } } } - cCurrentModuleObject = cTempPatternSurfMapObject; - for (ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumSurfaceMapping; ++ObjNum) { - thisPattern = state.dataRoomAirMod->NumConstantGradient + state.dataRoomAirMod->NumTwoGradientInterp + + ipsc->cCurrentModuleObject = cTempPatternSurfMapObject; + for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumSurfaceMapping; ++ObjNum) { + int thisPattern = state.dataRoomAirMod->NumConstantGradient + state.dataRoomAirMod->NumTwoGradientInterp + state.dataRoomAirMod->NumNonDimensionalHeight + ObjNum; - state.dataRoomAirMod->RoomAirPattern(thisPattern).PatternMode = DataRoomAirModel::UserDefinedPatternType::SurfMapTemp; state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, ObjNum, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, Status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - state.dataRoomAirMod->RoomAirPattern(thisPattern).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).PatrnID = state.dataIPShortCut->rNumericArgs(1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTstat = state.dataIPShortCut->rNumericArgs(2); - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTleaving = state.dataIPShortCut->rNumericArgs(3); - state.dataRoomAirMod->RoomAirPattern(thisPattern).DeltaTexhaust = state.dataIPShortCut->rNumericArgs(4); + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + auto &roomAirPattern = state.dataRoomAirMod->RoomAirPattern(thisPattern); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + + roomAirPattern.PatternMode = UserDefinedPatternType::SurfMapTemp; + roomAirPattern.Name = ipsc->cAlphaArgs(1); + roomAirPattern.PatrnID = ipsc->rNumericArgs(1); + roomAirPattern.DeltaTstat = ipsc->rNumericArgs(2); + roomAirPattern.DeltaTleaving = ipsc->rNumericArgs(3); + roomAirPattern.DeltaTexhaust = ipsc->rNumericArgs(4); NumPairs = NumNumbers - 4; if (NumPairs != (NumAlphas - 1)) { ShowSevereError(state, - format("Error in number of entries in {} object: {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + format("Error in number of entries in {} object: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ErrorsFound = true; } - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.SurfName.allocate(NumPairs); - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.DeltaTai.allocate(NumPairs); - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.SurfID.allocate(NumPairs); + roomAirPattern.MapPatrn.SurfName.allocate(NumPairs); + roomAirPattern.MapPatrn.DeltaTai.allocate(NumPairs); + roomAirPattern.MapPatrn.SurfID.allocate(NumPairs); // init just allocated - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.SurfName = ""; - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.DeltaTai = 0.0; - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.SurfID = 0; - - for (i = 1; i <= NumPairs; ++i) { - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.SurfName(i) = state.dataIPShortCut->cAlphaArgs(i + 1); - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.DeltaTai(i) = state.dataIPShortCut->rNumericArgs(i + 4); - found = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(i + 1), state.dataSurface->Surface); + roomAirPattern.MapPatrn.SurfName = ""; + roomAirPattern.MapPatrn.DeltaTai = 0.0; + roomAirPattern.MapPatrn.SurfID = 0; + + for (int i = 1; i <= NumPairs; ++i) { + roomAirPattern.MapPatrn.SurfName(i) = ipsc->cAlphaArgs(i + 1); + roomAirPattern.MapPatrn.DeltaTai(i) = ipsc->rNumericArgs(i + 4); + found = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataSurface->Surface); if (found != 0) { - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.SurfID(i) = found; + roomAirPattern.MapPatrn.SurfID(i) = found; } else { - ShowSevereError(state, - format("Surface name not found in {} object: {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i+1), ipsc->cAlphaArgs(i+1)); ErrorsFound = true; } } - state.dataRoomAirMod->RoomAirPattern(thisPattern).MapPatrn.NumSurfs = NumPairs; + roomAirPattern.MapPatrn.NumSurfs = NumPairs; } if (state.dataErrTracking->TotalRoomAirPatternTooLow > 0) { @@ -617,7 +612,7 @@ namespace RoomAirModelManager { // Find and set return and exhaust node ids - for (i = 1; i <= state.dataGlobal->NumOfZones; ++i) { + for (int i = 1; i <= state.dataGlobal->NumOfZones; ++i) { if (state.dataRoomAirMod->AirPatternZoneInfo(i).IsUsed) { // first get return and exhaust air node index found = UtilityRoutines::FindItemInList( @@ -652,38 +647,33 @@ namespace RoomAirModelManager { // PURPOSE OF THIS SUBROUTINE: // Get AirNode data for all zones at once - // METHODOLOGY EMPLOYED: - // Use input processer to get input from idf file - - // Using/Aliasing - + constexpr std::string_view routineName = "GetAirNodeData"; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // States which alpha value to read from a // "Number" line int NumNumbers; // Number of numbers encountered int Status; // Notes if there was an error in processing the input - int AirNodeNum; // Index number for air nodes int ZoneNum; // Index number for zones int NumSurfsInvolved; // Number of surfaces involved with air nodes - int SurfCount; // Number of surfaces involved with air nodes // (used for checking error) int NumOfSurfs; // Index number for last surface of zones bool SurfNeeded; if (!state.dataRoomAirMod->MundtModelUsed) return; + auto &ipsc = state.dataIPShortCut; + // Initialize default values for air nodes state.dataRoomAirMod->TotNumOfZoneAirNodes.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->TotNumOfAirNodes = 0; state.dataRoomAirMod->TotNumOfZoneAirNodes = 0; - auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; - cCurrentModuleObject = "RoomAir:Node"; - state.dataRoomAirMod->TotNumOfAirNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + ipsc->cCurrentModuleObject = "RoomAir:Node"; + state.dataRoomAirMod->TotNumOfAirNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (state.dataRoomAirMod->TotNumOfAirNodes <= 0) { // no air node object is found, terminate the program - ShowSevereError(state, format("No {} objects found in input.", cCurrentModuleObject)); - ShowContinueError(state, format("The OneNodeDisplacementVentilation model requires {} objects", cCurrentModuleObject)); + ShowSevereError(state, format("No {} objects found in input.", ipsc->cCurrentModuleObject)); + ShowContinueError(state, format("The OneNodeDisplacementVentilation model requires {} objects", ipsc->cCurrentModuleObject)); ErrorsFound = true; return; } else { @@ -691,89 +681,66 @@ namespace RoomAirModelManager { state.dataRoomAirMod->AirNode.allocate(state.dataRoomAirMod->TotNumOfAirNodes); } - for (AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { + for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { // get air node objects state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, AirNodeNum, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, Status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - UtilityRoutines::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - - state.dataRoomAirMod->AirNode(AirNodeNum).Name = state.dataIPShortCut->cAlphaArgs(1); - - state.dataRoomAirMod->AirNode(AirNodeNum).ZoneName = state.dataIPShortCut->cAlphaArgs(3); // Zone name - state.dataRoomAirMod->AirNode(AirNodeNum).ZonePtr = - UtilityRoutines::FindItemInList(state.dataRoomAirMod->AirNode(AirNodeNum).ZoneName, state.dataHeatBal->Zone); - if (state.dataRoomAirMod->AirNode(AirNodeNum).ZonePtr == 0) { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + auto &airNode = state.dataRoomAirMod->AirNode(AirNodeNum); + airNode.Name = ipsc->cAlphaArgs(1); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, airNode.Name}; + + airNode.ZoneName = ipsc->cAlphaArgs(3); // Zone name + airNode.ZonePtr = UtilityRoutines::FindItemInList(airNode.ZoneName, state.dataHeatBal->Zone); + if (airNode.ZonePtr == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } else { - ZoneNum = state.dataRoomAirMod->AirNode(AirNodeNum).ZonePtr; + ZoneNum = airNode.ZonePtr; NumOfSurfs = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); NumOfSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; } - state.dataRoomAirMod->AirNode(AirNodeNum).SurfMask.allocate(NumOfSurfs); + airNode.SurfMask.allocate(NumOfSurfs); } - { - std::string const &nodeType = state.dataIPShortCut->cAlphaArgs(2); - if (nodeType == "INLET") { - state.dataRoomAirMod->AirNode(AirNodeNum).ClassType = AirNodeType::InletAir; - } else if (nodeType == "FLOOR") { - state.dataRoomAirMod->AirNode(AirNodeNum).ClassType = AirNodeType::FloorAir; - } else if (nodeType == "CONTROL") { - state.dataRoomAirMod->AirNode(AirNodeNum).ClassType = AirNodeType::ControlAir; - } else if (nodeType == "CEILING") { - state.dataRoomAirMod->AirNode(AirNodeNum).ClassType = AirNodeType::CeilingAir; - } else if (nodeType == "MUNDTROOM") { - state.dataRoomAirMod->AirNode(AirNodeNum).ClassType = AirNodeType::MundtRoomAir; - } else if (nodeType == "RETURN") { - state.dataRoomAirMod->AirNode(AirNodeNum).ClassType = AirNodeType::ReturnAir; - } else { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ErrorsFound = true; - } + airNode.ClassType = static_cast(getEnumValue(airNodeTypeNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + if (airNode.ClassType == AirNodeType::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); + ErrorsFound = true; } - state.dataRoomAirMod->AirNode(AirNodeNum).Height = state.dataIPShortCut->rNumericArgs(1); // Air node height + airNode.Height = ipsc->rNumericArgs(1); // Air node height NumSurfsInvolved = NumAlphas - 3; // Number of surfaces involved with air nodes // Initialize - state.dataRoomAirMod->AirNode(AirNodeNum).SurfMask = false; + airNode.SurfMask = false; if (NumSurfsInvolved <= 0) { // report severe error since the following air nodes require surfaces associated with them - { - std::string const &nodeType = state.dataIPShortCut->cAlphaArgs(2); - if (nodeType == "FLOOR" || nodeType == "CEILING" || nodeType == "MUNDTROOM" || nodeType == "PLUME4" || nodeType == "REESROOM1" || - nodeType == "REESROOM2" || nodeType == "REESROOM3" || nodeType == "REESROOM4") { - // terminate the program due to a severe error in the specified input - ShowSevereError(state, - format("GetAirNodeData: {}=\"{}\" invalid air node specification.", - cCurrentModuleObject, - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError( - state, - format("Mundt Room Air Model: No surface names specified. Air node=\"{} requires name of surfaces associated with it.", - state.dataRoomAirMod->AirNode(AirNodeNum).Name)); - ErrorsFound = true; - } else { - } - } + if (airNode.ClassType == AirNodeType::Floor || airNode.ClassType == AirNodeType::Ceiling || + airNode.ClassType == AirNodeType::Mundt || airNode.ClassType == AirNodeType::Plume || + airNode.ClassType == AirNodeType::Rees) { // Are there really Rees 1-4? + // terminate the program due to a severe error in the specified input + ShowSevereError(state, format("GetAirNodeData: {}=\"{}\" invalid air node specification.", ipsc->cCurrentModuleObject, airNode.Name)); + ShowContinueError(state, format("Mundt Room Air Model: No surface names specified. Air node=\"{} requires surfaces associated with it.", + airNode.Name)); + ErrorsFound = true; + } } else { @@ -782,24 +749,18 @@ namespace RoomAirModelManager { // report warning error since the following air nodes do not require surfaces associated with them // and assign .FALSE. to 'SurfNeeded' - { - std::string const &nodeType = state.dataIPShortCut->cAlphaArgs(2); - if (nodeType == "INLET" || nodeType == "CONTROL" || nodeType == "RETURN" || nodeType == "PLUME1" || nodeType == "PLUME2" || - nodeType == "PLUME3") { - ShowWarningError( - state, format("GetAirNodeData: {}=\"{}\" invalid linkage", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, - format("Mundt Room Air Model: No surface names needed. Air node=\"{} does not relate to any surfaces.", - state.dataRoomAirMod->AirNode(AirNodeNum).Name)); - SurfNeeded = false; - } else { - } - } + if (airNode.ClassType == AirNodeType::Inlet || airNode.ClassType == AirNodeType::Control || + airNode.ClassType == AirNodeType::Return || airNode.ClassType == AirNodeType::Plume) { + ShowWarningError(state, format("GetAirNodeData: {}=\"{}\" invalid linkage", ipsc->cCurrentModuleObject, airNode.Name)); + ShowContinueError(state, format("Mundt Room Air Model: No surface names needed. Air node=\"{} does not relate to any surfaces.", + airNode.Name)); + SurfNeeded = false; + } if (SurfNeeded) { // this air node is in this zone; hence, first get name of all surfaces in this zone - ZoneNum = state.dataRoomAirMod->AirNode(AirNodeNum).ZonePtr; + ZoneNum = airNode.ZonePtr; NumOfSurfs = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); @@ -807,34 +768,31 @@ namespace RoomAirModelManager { } // terminate the program due to a severe error in the specified input - if ((NumSurfsInvolved) > NumOfSurfs) { + if (NumSurfsInvolved > NumOfSurfs) { ShowFatalError( state, format( "GetAirNodeData: Mundt Room Air Model: Number of surfaces connected to {} is greater than number of surfaces in {}", - state.dataRoomAirMod->AirNode(AirNodeNum).Name, + airNode.Name, state.dataHeatBal->Zone(ZoneNum).Name)); return; } // relate surfaces to this air node and check to see whether surface names are specified correctly or not - SurfCount = 0; + int SurfCount = 0; for (int ListSurfNum = 4; ListSurfNum <= NumAlphas; ++ListSurfNum) { int thisSurfinZone = 0; - bool surfaceFound = false; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { ++thisSurfinZone; - if (state.dataIPShortCut->cAlphaArgs(ListSurfNum) == state.dataSurface->Surface(SurfNum).Name) { - ; - state.dataRoomAirMod->AirNode(AirNodeNum).SurfMask(thisSurfinZone) = true; + if (ipsc->cAlphaArgs(ListSurfNum) == state.dataSurface->Surface(SurfNum).Name) { + airNode.SurfMask(thisSurfinZone) = true; ++SurfCount; - surfaceFound = true; break; } } - if (surfaceFound) break; + if (SurfCount > 0) break; } } @@ -842,7 +800,7 @@ namespace RoomAirModelManager { if ((NumSurfsInvolved) != SurfCount) { ShowWarningError(state, format("GetAirNodeData: Mundt Room Air Model: Some surface names specified for {} are not in {}", - state.dataRoomAirMod->AirNode(AirNodeNum).Name, + airNode.Name, state.dataHeatBal->Zone(ZoneNum).Name)); } } @@ -850,14 +808,14 @@ namespace RoomAirModelManager { } // get number of air nodes in each zone - for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { // this zone uses other air model so skip the rest - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModelType != DataRoomAirModel::RoomAirModel::Mundt) continue; + if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAirModel::Mundt) continue; // this zone uses a nodal air model so get number of air nodes in each zone - for (AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { - if (state.dataRoomAirMod->AirNode(AirNodeNum).ZonePtr == ZoneNum) { + for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { + if (state.dataRoomAirMod->AirNode(AirNodeNum).ZonePtr == ZoneNum) { ++state.dataRoomAirMod->TotNumOfZoneAirNodes(ZoneNum); } } @@ -883,15 +841,16 @@ namespace RoomAirModelManager { // Use input processer to get input from idf file // Using/Aliasing - + constexpr std::string_view routineName = "GetMundtData"; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; int NumNumbers; // Number of numbers encountered int Status; // Notes if there was an error in processing the input - int ControlNum; // Index number int NumOfMundtContrl; // Number of Mundt Model Controls int ZoneNum; // Index number for zones + auto &ipsc = state.dataIPShortCut; + if (!state.dataRoomAirMod->MundtModelUsed) return; // Initialize default values for Mundt model controls @@ -899,7 +858,7 @@ namespace RoomAirModelManager { state.dataRoomAirMod->InfiltratFloorSplit.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->ConvectiveFloorSplit = 0.0; state.dataRoomAirMod->InfiltratFloorSplit = 0.0; - auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; + auto &cCurrentModuleObject = ipsc->cCurrentModuleObject; cCurrentModuleObject = "RoomAirSettings:OneNodeDisplacementVentilation"; NumOfMundtContrl = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); if (NumOfMundtContrl > state.dataGlobal->NumOfZones) { @@ -916,38 +875,39 @@ namespace RoomAirModelManager { // this zone uses Mundt model so get Mundt Model Control // loop through all 'RoomAirSettings:OneNodeDisplacementVentilation' objects - for (ControlNum = 1; ControlNum <= NumOfMundtContrl; ++ControlNum) { + for (int ControlNum = 1; ControlNum <= NumOfMundtContrl; ++ControlNum) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, ControlNum, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, Status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - ZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBal->Zone); + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ""}; + ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); if (ZoneNum == 0) { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(1), state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Not a valid zone name."); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; continue; } - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModelType != DataRoomAirModel::RoomAirModel::Mundt) { + if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAirModel::Mundt) { ShowSevereError( state, - format("Zone specified=\"{}\", Air Model type is not OneNodeDisplacementVentilation.", state.dataIPShortCut->cAlphaArgs(1))); + format("Zone specified=\"{}\", Air Model type is not OneNodeDisplacementVentilation.", ipsc->cAlphaArgs(1))); ShowContinueError( - state, format("Air Model Type for zone={}", ChAirModel[static_cast(state.dataRoomAirMod->AirModel(ZoneNum).AirModelType)])); + state, format("Air Model Type for zone={}", roomAirModelNamesUC[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel])); ErrorsFound = true; continue; } - state.dataRoomAirMod->ConvectiveFloorSplit(ZoneNum) = state.dataIPShortCut->rNumericArgs(1); - state.dataRoomAirMod->InfiltratFloorSplit(ZoneNum) = state.dataIPShortCut->rNumericArgs(2); + state.dataRoomAirMod->ConvectiveFloorSplit(ZoneNum) = ipsc->rNumericArgs(1); + state.dataRoomAirMod->InfiltratFloorSplit(ZoneNum) = ipsc->rNumericArgs(2); } } @@ -957,8 +917,6 @@ namespace RoomAirModelManager { // SUBROUTINE INFORMATION: // AUTHOR G. Carrilho da Graca // DATE WRITTEN January 2004 - // MODIFIED - // RE-ENGINEERED // PURPOSE OF THIS SUBROUTINE: // Get UCSD Displacement ventilation model controls for all zones at once @@ -970,66 +928,61 @@ namespace RoomAirModelManager { using namespace ScheduleManager; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + constexpr std::string_view routineName = "GetDisplacementVentData"; int IOStat; int NumAlpha; int NumNumber; - int Loop; - auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; + + auto &ipsc = state.dataIPShortCut; + if (!state.dataRoomAirMod->UCSDModelUsed) return; - cCurrentModuleObject = "RoomAirSettings:ThreeNodeDisplacementVentilation"; - state.dataRoomAirMod->TotUCSDDV = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + ipsc->cCurrentModuleObject = "RoomAirSettings:ThreeNodeDisplacementVentilation"; + state.dataRoomAirMod->TotUCSDDV = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (state.dataRoomAirMod->TotUCSDDV <= 0) return; state.dataRoomAirMod->ZoneUCSDDV.allocate(state.dataRoomAirMod->TotUCSDDV); - for (Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDDV; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDDV; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumber, IOStat, _, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + auto &zoneUCSDDV = state.dataRoomAirMod->ZoneUCSDDV(Loop); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // First is Zone Name - state.dataRoomAirMod->ZoneUCSDDV(Loop).ZoneName = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->ZoneUCSDDV(Loop).ZonePtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBal->Zone); - if (state.dataRoomAirMod->ZoneUCSDDV(Loop).ZonePtr == 0) { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(1), state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Zone Name not found."); + // zoneUCSDDV.ZoneName = ipsc->cAlphaArgs(1); + zoneUCSDDV.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + if (zoneUCSDDV.ZonePtr == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneDV(state.dataRoomAirMod->ZoneUCSDDV(Loop).ZonePtr) = true; + state.dataRoomAirMod->IsZoneDV(zoneUCSDDV.ZonePtr) = true; } // Second Alpha is Schedule Name - state.dataRoomAirMod->ZoneUCSDDV(Loop).SchedGainsName = state.dataIPShortCut->cAlphaArgs(2); - state.dataRoomAirMod->ZoneUCSDDV(Loop).SchedGainsPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(2)); - if (state.dataRoomAirMod->ZoneUCSDDV(Loop).SchedGainsPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, " Schedule name must be input."); - ErrorsFound = true; - } else { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Schedule name was not found."); - ErrorsFound = true; - } - } + // zoneUCSDDV.SchedGainsName = ipsc->cAlphaArgs(2); + if (ipsc->lAlphaFieldBlanks(2)) { + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(2)); + ErrorsFound = true; + } else if ((zoneUCSDDV.SchedGainsPtr = GetScheduleIndex(state, ipsc->cAlphaArgs(2))) == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); + ErrorsFound = true; + } - state.dataRoomAirMod->ZoneUCSDDV(Loop).NumPlumesPerOcc = state.dataIPShortCut->rNumericArgs(1); - state.dataRoomAirMod->ZoneUCSDDV(Loop).ThermostatHeight = state.dataIPShortCut->rNumericArgs(2); - state.dataRoomAirMod->ZoneUCSDDV(Loop).ComfortHeight = state.dataIPShortCut->rNumericArgs(3); - state.dataRoomAirMod->ZoneUCSDDV(Loop).TempTrigger = state.dataIPShortCut->rNumericArgs(4); + zoneUCSDDV.NumPlumesPerOcc = ipsc->rNumericArgs(1); + zoneUCSDDV.ThermostatHeight = ipsc->rNumericArgs(2); + zoneUCSDDV.ComfortHeight = ipsc->rNumericArgs(3); + zoneUCSDDV.TempTrigger = ipsc->rNumericArgs(4); } } @@ -1039,8 +992,6 @@ namespace RoomAirModelManager { // SUBROUTINE INFORMATION: // AUTHOR G. Carrilho da Graca // DATE WRITTEN October 2004 - // MODIFIED - // RE-ENGINEERED // PURPOSE OF THIS SUBROUTINE: // Get UCSD Cross ventilation model controls for all zones at once @@ -1052,130 +1003,101 @@ namespace RoomAirModelManager { using namespace ScheduleManager; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + constexpr std::string_view routineName = "GetCrossVentData"; + int IOStat; int NumAlpha; int NumNumber; - int Loop; - int Loop2; int ThisZone; - auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; + + auto &ipsc = state.dataIPShortCut; if (!state.dataRoomAirMod->UCSDModelUsed) return; - cCurrentModuleObject = "RoomAirSettings:CrossVentilation"; - state.dataRoomAirMod->TotUCSDCV = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + ipsc->cCurrentModuleObject = "RoomAirSettings:CrossVentilation"; + state.dataRoomAirMod->TotUCSDCV = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (state.dataRoomAirMod->TotUCSDCV <= 0) return; state.dataRoomAirMod->ZoneUCSDCV.allocate(state.dataRoomAirMod->TotUCSDCV); - for (Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDCV; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDCV; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumber, IOStat, _, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + auto &zoneUCSDCV = state.dataRoomAirMod->ZoneUCSDCV(Loop); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // First is Zone Name - state.dataRoomAirMod->ZoneUCSDCV(Loop).ZoneName = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->ZoneUCSDCV(Loop).ZonePtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBal->Zone); - if (state.dataRoomAirMod->ZoneUCSDCV(Loop).ZonePtr == 0) { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(1), state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Zone name was not found."); + // state.dataRoomAirMod->ZoneUCSDCV(Loop).ZoneName = ipsc->cAlphaArgs(1); + if ((zoneUCSDCV.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone)) == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneCV(state.dataRoomAirMod->ZoneUCSDCV(Loop).ZonePtr) = true; + state.dataRoomAirMod->IsZoneCV(zoneUCSDCV.ZonePtr) = true; } // Second Alpha is Schedule Name - state.dataRoomAirMod->ZoneUCSDCV(Loop).SchedGainsName = state.dataIPShortCut->cAlphaArgs(2); - state.dataRoomAirMod->ZoneUCSDCV(Loop).SchedGainsPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(2)); - if (state.dataRoomAirMod->ZoneUCSDCV(Loop).SchedGainsPtr == 0) { - if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Schedule name field is blank."); - ErrorsFound = true; - } else { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Schedule name was not found."); - ErrorsFound = true; - } + // zoneUCSDCV.SchedGainsName = ipsc->cAlphaArgs(2); + if (ipsc->lAlphaFieldBlanks(2)) { + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(2)); + ErrorsFound = true; + } else if ((zoneUCSDCV.SchedGainsPtr = GetScheduleIndex(state, ipsc->cAlphaArgs(2))) == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); + ErrorsFound = true; } // Third Alpha is a string: JET or RECIRCULATION - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "Jet")) { - state.dataRoomAirMod->ZoneUCSDCV(Loop).VforComfort = Comfort::Jet; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), "Recirculation")) { - state.dataRoomAirMod->ZoneUCSDCV(Loop).VforComfort = Comfort::Recirculation; - } else { - state.dataRoomAirMod->ZoneUCSDCV(Loop).VforComfort = Comfort::Invalid; - } - - for (Loop2 = 1; Loop2 <= state.dataHeatBal->TotPeople; ++Loop2) { - if (state.dataHeatBal->People(Loop2).ZonePtr != state.dataRoomAirMod->ZoneUCSDCV(Loop).ZonePtr) continue; - if (state.dataHeatBal->People(Loop2).Fanger) { - if (state.dataRoomAirMod->ZoneUCSDCV(Loop).VforComfort == Comfort::Invalid) { - if (state.dataIPShortCut->lAlphaFieldBlanks(3)) { - ShowSevereError( - state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, - format("Airflow region used for thermal comfort evaluation is required for Zone={}", - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Field is blank, please choose Jet or Recirculation."); - ErrorsFound = true; - } else { - ShowSevereError( - state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, - format("Airflow region used for thermal comfort evaluation is required for Zone={}", - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Please choose Jet or Recirculation."); - ErrorsFound = true; - } - } + if (ipsc->lAlphaFieldBlanks(3)) { + for (int Loop2 = 1; Loop2 <= state.dataHeatBal->TotPeople; ++Loop2) { + if (state.dataHeatBal->People(Loop2).ZonePtr != zoneUCSDCV.ZonePtr) continue; + if (!state.dataHeatBal->People(Loop2).Fanger) continue; + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(3)); + ErrorsFound = true; } + } else if ((zoneUCSDCV.VforComfort = static_cast(getEnumValue(comfortNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(3))))) == + Comfort::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); + ErrorsFound = true; } - ThisZone = state.dataRoomAirMod->ZoneUCSDCV(Loop).ZonePtr; + ThisZone = zoneUCSDCV.ZonePtr; if (ThisZone == 0) continue; // Following depend on valid zone - Loop2 = UtilityRoutines::FindItemInList(state.dataHeatBal->Zone(state.dataRoomAirMod->ZoneUCSDCV(Loop).ZonePtr).Name, - state.afn->MultizoneZoneData, - &AirflowNetwork::MultizoneZoneProp::ZoneName); - if (Loop2 == 0) { - ShowSevereError(state, format("Problem with {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + if (UtilityRoutines::FindItemInList(state.dataHeatBal->Zone(zoneUCSDCV.ZonePtr).Name, + state.afn->MultizoneZoneData, + &AirflowNetwork::MultizoneZoneProp::ZoneName) == 0) { + ShowSevereError(state, format("Problem with {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, "AirflowNetwork airflow model must be active in this zone"); ErrorsFound = true; } // If a crack is used it must have an air flow coefficient = 0.5 - for (Loop2 = 1; Loop2 <= state.afn->NumOfLinksMultiZone; ++Loop2) { - state.dataRoomAirModelMgr->NodeNum1 = state.afn->MultizoneSurfaceData(Loop2).NodeNums[0]; - state.dataRoomAirModelMgr->NodeNum2 = state.afn->MultizoneSurfaceData(Loop2).NodeNums[1]; - if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(Loop2).SurfNum).Zone == ThisZone || + for (int iLink = 1; iLink <= state.afn->NumOfLinksMultiZone; ++iLink) { + auto const &mzSurfaceData = state.afn->MultizoneSurfaceData(iLink); + state.dataRoomAirModelMgr->NodeNum1 = mzSurfaceData.NodeNums[0]; + state.dataRoomAirModelMgr->NodeNum2 = mzSurfaceData.NodeNums[1]; + if (state.dataSurface->Surface(mzSurfaceData.SurfNum).Zone == ThisZone || (state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNum2).EPlusZoneNum == ThisZone && state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNum1).EPlusZoneNum > 0) || (state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNum2).EPlusZoneNum > 0 && state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNum1).EPlusZoneNum == ThisZone)) { - state.dataRoomAirModelMgr->CompNum = state.afn->AirflowNetworkLinkageData(Loop2).CompNum; + state.dataRoomAirModelMgr->CompNum = state.afn->AirflowNetworkLinkageData(iLink).CompNum; state.dataRoomAirModelMgr->TypeNum = state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNum).TypeNum; if (state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { if (state.afn->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNum).exponent != 0.50) { - state.dataRoomAirMod->AirModel(ThisZone).AirModelType = DataRoomAirModel::RoomAirModel::Mixing; - ShowWarningError(state, format("Problem with {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowWarningError(state, format("Roomair model will not be applied for Zone={}.", state.dataIPShortCut->cAlphaArgs(1))); + state.dataRoomAirMod->AirModel(ThisZone).AirModel = RoomAirModel::Mixing; + ShowWarningError(state, format("Problem with {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowWarningError(state, format("Roomair model will not be applied for Zone={}.", ipsc->cAlphaArgs(1))); ShowContinueError( state, format("AirflowNetwrok:Multizone:Surface crack object must have an air flow coefficient = 0.5, value was={:.2R}", @@ -1193,8 +1115,6 @@ namespace RoomAirModelManager { // SUBROUTINE INFORMATION: // AUTHOR Fred Buhl // DATE WRITTEN August 2005 - // MODIFIED - // RE-ENGINEERED // PURPOSE OF THIS SUBROUTINE: // Get UCSD UFAD interior zone model controls for all zones at once @@ -1206,21 +1126,24 @@ namespace RoomAirModelManager { using namespace ScheduleManager; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + constexpr std::string_view routineName = "GetUFADZoneData"; + int IOStat; int NumAlpha; int NumNumber; - int Loop; if (!state.dataRoomAirMod->UCSDModelUsed) { state.dataRoomAirMod->TotUCSDUI = 0; state.dataRoomAirMod->TotUCSDUE = 0; return; } - auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; - cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; - state.dataRoomAirMod->TotUCSDUI = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; - state.dataRoomAirMod->TotUCSDUE = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + + auto &ipsc = state.dataIPShortCut; + + ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; + state.dataRoomAirMod->TotUCSDUI = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; + state.dataRoomAirMod->TotUCSDUE = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (state.dataRoomAirMod->TotUCSDUI <= 0 && state.dataRoomAirMod->TotUCSDUE <= 0) return; @@ -1228,146 +1151,126 @@ namespace RoomAirModelManager { state.dataRoomAirMod->ZoneUCSDUE.allocate(state.dataRoomAirMod->TotUCSDUE); state.dataRoomAirMod->ZoneUFPtr.dimension(state.dataGlobal->NumOfZones, 0); - cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; - for (Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDUI; ++Loop) { + ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDUI; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumber, IOStat, _, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); // First is Zone Name - state.dataRoomAirMod->ZoneUCSDUI(Loop).ZoneName = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->ZoneUCSDUI(Loop).ZonePtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBal->Zone); - state.dataRoomAirMod->ZoneUFPtr(state.dataRoomAirMod->ZoneUCSDUI(Loop).ZonePtr) = Loop; - if (state.dataRoomAirMod->ZoneUCSDUI(Loop).ZonePtr == 0) { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(1), state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Zone name was not found."); + auto &zoneUCSDUI = state.dataRoomAirMod->ZoneUCSDUI(Loop); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + + zoneUCSDUI.ZoneName = ipsc->cAlphaArgs(1); + zoneUCSDUI.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + state.dataRoomAirMod->ZoneUFPtr(zoneUCSDUI.ZonePtr) = Loop; + if (zoneUCSDUI.ZonePtr == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneUI(state.dataRoomAirMod->ZoneUCSDUI(Loop).ZonePtr) = true; + state.dataRoomAirMod->IsZoneUI(zoneUCSDUI.ZonePtr) = true; } + // 2nd alpha is diffuser type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "Swirl")) { - state.dataRoomAirMod->ZoneUCSDUI(Loop).DiffuserType = Diffuser::Swirl; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "VariableArea")) { - state.dataRoomAirMod->ZoneUCSDUI(Loop).DiffuserType = Diffuser::VarArea; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "HorizontalSwirl")) { - state.dataRoomAirMod->ZoneUCSDUI(Loop).DiffuserType = Diffuser::DisplVent; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "Custom")) { - state.dataRoomAirMod->ZoneUCSDUI(Loop).DiffuserType = Diffuser::Custom; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "LinearBarGrille")) { - state.dataRoomAirMod->ZoneUCSDUI(Loop).DiffuserType = Diffuser::LinBarGrille; - } else { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + zoneUCSDUI.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + if (zoneUCSDUI.DiffuserType == Diffuser::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } // 1st number is Number of Diffusers per Zone - state.dataRoomAirMod->ZoneUCSDUI(Loop).DiffusersPerZone = state.dataIPShortCut->rNumericArgs(1); + zoneUCSDUI.DiffusersPerZone = ipsc->rNumericArgs(1); // 2nd number is Power per Plume - state.dataRoomAirMod->ZoneUCSDUI(Loop).PowerPerPlume = state.dataIPShortCut->rNumericArgs(2); + zoneUCSDUI.PowerPerPlume = ipsc->rNumericArgs(2); // 3rd number is Design Effective Area of Diffuser - state.dataRoomAirMod->ZoneUCSDUI(Loop).DiffArea = state.dataIPShortCut->rNumericArgs(3); + zoneUCSDUI.DiffArea = ipsc->rNumericArgs(3); // 4th number is Diffuser Slot Angle from Vertical - state.dataRoomAirMod->ZoneUCSDUI(Loop).DiffAngle = state.dataIPShortCut->rNumericArgs(4); + zoneUCSDUI.DiffAngle = ipsc->rNumericArgs(4); // 5th number is Thermostat Height - state.dataRoomAirMod->ZoneUCSDUI(Loop).ThermostatHeight = state.dataIPShortCut->rNumericArgs(5); + zoneUCSDUI.ThermostatHeight = ipsc->rNumericArgs(5); // 6th number is Comfort Height - state.dataRoomAirMod->ZoneUCSDUI(Loop).ComfortHeight = state.dataIPShortCut->rNumericArgs(6); + zoneUCSDUI.ComfortHeight = ipsc->rNumericArgs(6); // 7th number is Temperature Difference Threshold for Reporting - state.dataRoomAirMod->ZoneUCSDUI(Loop).TempTrigger = state.dataIPShortCut->rNumericArgs(7); + zoneUCSDUI.TempTrigger = ipsc->rNumericArgs(7); // 8th number user-specified transition height - state.dataRoomAirMod->ZoneUCSDUI(Loop).TransHeight = state.dataIPShortCut->rNumericArgs(8); + zoneUCSDUI.TransHeight = ipsc->rNumericArgs(8); // 9th number is Coefficient A in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUI(Loop).A_Kc = state.dataIPShortCut->rNumericArgs(9); + zoneUCSDUI.A_Kc = ipsc->rNumericArgs(9); // 10th number is Coefficient B in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUI(Loop).B_Kc = state.dataIPShortCut->rNumericArgs(10); + zoneUCSDUI.B_Kc = ipsc->rNumericArgs(10); // 11th number is Coefficient C in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUI(Loop).C_Kc = state.dataIPShortCut->rNumericArgs(11); + zoneUCSDUI.C_Kc = ipsc->rNumericArgs(11); // 12th number is Coefficient D in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUI(Loop).D_Kc = state.dataIPShortCut->rNumericArgs(12); + zoneUCSDUI.D_Kc = ipsc->rNumericArgs(12); // 13th number is Coefficient E in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUI(Loop).E_Kc = state.dataIPShortCut->rNumericArgs(13); + zoneUCSDUI.E_Kc = ipsc->rNumericArgs(13); } - cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; - for (Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDUE; ++Loop) { + ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDUE; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlpha, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumber, IOStat, _, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); // First is Zone Name - state.dataRoomAirMod->ZoneUCSDUE(Loop).ZoneName = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->ZoneUCSDUE(Loop).ZonePtr = - UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataHeatBal->Zone); - state.dataRoomAirMod->ZoneUFPtr(state.dataRoomAirMod->ZoneUCSDUE(Loop).ZonePtr) = Loop; - if (state.dataRoomAirMod->ZoneUCSDUE(Loop).ZonePtr == 0) { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(1), state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Zone name was not found."); + auto &zoneUCSDUE = state.dataRoomAirMod->ZoneUCSDUE(Loop); + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + zoneUCSDUE.ZoneName = ipsc->cAlphaArgs(1); + zoneUCSDUE.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + if (zoneUCSDUE.ZonePtr == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneUI(state.dataRoomAirMod->ZoneUCSDUE(Loop).ZonePtr) = true; + state.dataRoomAirMod->IsZoneUI(zoneUCSDUE.ZonePtr) = true; + state.dataRoomAirMod->ZoneUFPtr(zoneUCSDUE.ZonePtr) = Loop; } - // 2nd alpha is diffuser type - if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "Swirl")) { - state.dataRoomAirMod->ZoneUCSDUE(Loop).DiffuserType = Diffuser::Swirl; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "VariableArea")) { - state.dataRoomAirMod->ZoneUCSDUE(Loop).DiffuserType = Diffuser::VarArea; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "HorizontalSwirl")) { - state.dataRoomAirMod->ZoneUCSDUE(Loop).DiffuserType = Diffuser::DisplVent; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "Custom")) { - state.dataRoomAirMod->ZoneUCSDUE(Loop).DiffuserType = Diffuser::Custom; - } else if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), "LinearBarGrille")) { - state.dataRoomAirMod->ZoneUCSDUE(Loop).DiffuserType = Diffuser::LinBarGrille; - } else { - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + + zoneUCSDUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + if (zoneUCSDUE.DiffuserType == Diffuser::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } // 1st number is Number of Diffusers per Zone - state.dataRoomAirMod->ZoneUCSDUE(Loop).DiffusersPerZone = state.dataIPShortCut->rNumericArgs(1); + zoneUCSDUE.DiffusersPerZone = ipsc->rNumericArgs(1); // 2nd number is Power per Plume - state.dataRoomAirMod->ZoneUCSDUE(Loop).PowerPerPlume = state.dataIPShortCut->rNumericArgs(2); + zoneUCSDUE.PowerPerPlume = ipsc->rNumericArgs(2); // 3rd number is Design Effective Area of Diffuser - state.dataRoomAirMod->ZoneUCSDUE(Loop).DiffArea = state.dataIPShortCut->rNumericArgs(3); + zoneUCSDUE.DiffArea = ipsc->rNumericArgs(3); // 4th number is Diffuser Slot Angle from Vertical - state.dataRoomAirMod->ZoneUCSDUE(Loop).DiffAngle = state.dataIPShortCut->rNumericArgs(4); + zoneUCSDUE.DiffAngle = ipsc->rNumericArgs(4); // 5th number is Thermostat Height - state.dataRoomAirMod->ZoneUCSDUE(Loop).ThermostatHeight = state.dataIPShortCut->rNumericArgs(5); + zoneUCSDUE.ThermostatHeight = ipsc->rNumericArgs(5); // 6th number is Comfort Height - state.dataRoomAirMod->ZoneUCSDUE(Loop).ComfortHeight = state.dataIPShortCut->rNumericArgs(6); + zoneUCSDUE.ComfortHeight = ipsc->rNumericArgs(6); // 7th number is Temperature Difference Threshold for Reporting - state.dataRoomAirMod->ZoneUCSDUE(Loop).TempTrigger = state.dataIPShortCut->rNumericArgs(7); + zoneUCSDUE.TempTrigger = ipsc->rNumericArgs(7); // 8th number user-specified transition height - state.dataRoomAirMod->ZoneUCSDUE(Loop).TransHeight = state.dataIPShortCut->rNumericArgs(8); + zoneUCSDUE.TransHeight = ipsc->rNumericArgs(8); // 9th number is Coefficient A in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUE(Loop).A_Kc = state.dataIPShortCut->rNumericArgs(9); + zoneUCSDUE.A_Kc = ipsc->rNumericArgs(9); // 10th number is Coefficient B in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUE(Loop).B_Kc = state.dataIPShortCut->rNumericArgs(10); + zoneUCSDUE.B_Kc = ipsc->rNumericArgs(10); // 11th number is Coefficient C in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUE(Loop).C_Kc = state.dataIPShortCut->rNumericArgs(11); + zoneUCSDUE.C_Kc = ipsc->rNumericArgs(11); // 12th number is Coefficient D in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUE(Loop).D_Kc = state.dataIPShortCut->rNumericArgs(12); + zoneUCSDUE.D_Kc = ipsc->rNumericArgs(12); // 13th number is Coefficient E in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - state.dataRoomAirMod->ZoneUCSDUE(Loop).E_Kc = state.dataIPShortCut->rNumericArgs(13); + zoneUCSDUE.E_Kc = ipsc->rNumericArgs(13); } } @@ -1377,8 +1280,6 @@ namespace RoomAirModelManager { // SUBROUTINE INFORMATION: // AUTHOR Brent Griffith // DATE WRITTEN November 2009 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Get RoomAirflowNetwork data for all zones at once @@ -1387,44 +1288,31 @@ namespace RoomAirModelManager { // Use input processor to get input from idf file // Using/Aliasing - using DataHVACGlobals::NumZoneHVACTerminalTypes; - using DataHVACGlobals::ZoneHVACTerminalTypes; using InternalHeatGains::GetInternalGainDeviceIndex; using ScheduleManager::GetScheduleIndex; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; // local do loop index + constexpr std::string_view routineName = "GetRoomAirflowNetworkData"; int NumAlphas; int NumNumbers; int status; - int ZoneNum; - int thisAirNodeinZone; - int AlphaArgNum; - int AirCntrlNodeNum; int TotNumOfRAFNNodeSurfLists; int TotNumOfRAFNNodeGainsLists; int TotNumOfRAFNNodeHVACLists; - int RAFNNodeNum; bool foundList; int NumSurfsThisNode; int NumOfSurfs; - int gainsLoop; - int TypeNum; - int numEquip; - int EquipLoop; int TotNumEquip; bool IntEquipError; - Real64 SumFraction; std::string Name; - int GainNum; - int RAFNNum; - auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; - cCurrentModuleObject = "RoomAirSettings:AirflowNetwork"; - state.dataRoomAirMod->NumOfRoomAirflowNetControl = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + + auto &ipsc = state.dataIPShortCut; + ipsc->cCurrentModuleObject = "RoomAirSettings:AirflowNetwork"; + state.dataRoomAirMod->NumOfRoomAirflowNetControl = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); if (state.dataRoomAirMod->NumOfRoomAirflowNetControl == 0) return; if (state.dataRoomAirMod->NumOfRoomAirflowNetControl > state.dataGlobal->NumOfZones) { - ShowSevereError(state, format("Too many {} objects in input file", cCurrentModuleObject)); - ShowContinueError(state, format("There cannot be more {} objects than number of zones.", cCurrentModuleObject)); + ShowSevereError(state, format("Too many {} objects in input file", ipsc->cCurrentModuleObject)); + ShowContinueError(state, format("There cannot be more {} objects than number of zones.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } @@ -1432,546 +1320,508 @@ namespace RoomAirModelManager { state.dataRoomAirMod->RoomAirflowNetworkZoneInfo.allocate(state.dataGlobal->NumOfZones); } - for (Loop = 1; Loop <= state.dataRoomAirMod->NumOfRoomAirflowNetControl; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->NumOfRoomAirflowNetControl; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, status, _, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - ZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); if (ZoneNum == 0) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, "Not a valid zone name."); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; continue; } - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModelType != DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAirModel::AirflowNetwork) { ShowSevereError(state, format("GetRoomAirflowNetworkData: Zone specified='{}', Air Model type is not AirflowNetwork.", - state.dataIPShortCut->cAlphaArgs(1))); + ipsc->cAlphaArgs(1))); ShowContinueError( - state, format("Air Model Type for zone ={}", ChAirModel[static_cast(state.dataRoomAirMod->AirModel(ZoneNum).AirModelType)])); + state, format("Air Model Type for zone ={}", roomAirModelNamesUC[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel])); ErrorsFound = true; continue; } - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).ZoneID = ZoneNum; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).RAFNNum = Loop; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).IsUsed = true; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Name = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).ZoneName = state.dataIPShortCut->cAlphaArgs(2); // Zone Name - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes = (NumAlphas - 3); + auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum); + roomAFNZoneInfo.ZoneID = ZoneNum; + roomAFNZoneInfo.RAFNNum = Loop; + roomAFNZoneInfo.IsUsed = true; + roomAFNZoneInfo.Name = ipsc->cAlphaArgs(1); + roomAFNZoneInfo.ZoneName = ipsc->cAlphaArgs(2); // Zone Name + + roomAFNZoneInfo.NumOfAirNodes = (NumAlphas - 3); - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes > 0) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node.allocate( - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes); + if (roomAFNZoneInfo.NumOfAirNodes > 0) { + roomAFNZoneInfo.Node.allocate(roomAFNZoneInfo.NumOfAirNodes); } else { ShowSevereError( state, - format("GetRoomAirflowNetworkData: Incomplete input in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + format("GetRoomAirflowNetworkData: Incomplete input in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ErrorsFound = true; } - for (thisAirNodeinZone = 1; thisAirNodeinZone <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes; - ++thisAirNodeinZone) { - AlphaArgNum = thisAirNodeinZone + 3; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(thisAirNodeinZone).Name = - state.dataIPShortCut->cAlphaArgs(AlphaArgNum); + for (int iAirNode = 1; iAirNode <= roomAFNZoneInfo.NumOfAirNodes; ++iAirNode) { + roomAFNZoneInfo.Node(iAirNode).Name = ipsc->cAlphaArgs(iAirNode+3); } // control point node - AirCntrlNodeNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes); - if (AirCntrlNodeNum == 0) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(3), - state.dataIPShortCut->cAlphaArgs(3))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Not a valid RoomAir:Node:AirflowNetwork name for this zone."); + + roomAFNZoneInfo.ControlAirNodeID = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(3), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); + if (roomAFNZoneInfo.ControlAirNodeID == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; continue; - } else { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).ControlAirNodeID = AirCntrlNodeNum; } - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).totNumSurfs = 0; + + roomAFNZoneInfo.totNumSurfs = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).totNumSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; + roomAFNZoneInfo.totNumSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; } - } // loop thru NumOfRoomAirflowNetControl - - cCurrentModuleObject = "RoomAir:Node:AirflowNetwork"; - state.dataRoomAirMod->TotNumOfRoomAFNNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - for (Loop = 1; Loop <= state.dataRoomAirMod->TotNumOfRoomAFNNodes; ++Loop) { + } // for (Loop) + + ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork"; + state.dataRoomAirMod->TotNumOfRoomAFNNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotNumOfRoomAFNNodes; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, status, _, - state.dataIPShortCut->lAlphaFieldBlanks, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - ZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); + ipsc->lAlphaFieldBlanks, + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); if (ZoneNum == 0) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Not a valid zone name."); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; continue; } - RAFNNodeNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes); + auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum); + int RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); if (RAFNNodeNum == 0) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(2), - state.dataIPShortCut->cAlphaArgs(2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Not a valid RoomAir:Node:AirflowNetwork name."); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; continue; } - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).ZoneVolumeFraction = state.dataIPShortCut->rNumericArgs(1); - if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).NodeSurfListName = state.dataIPShortCut->cAlphaArgs(3); + auto &roomAFNZoneNode = roomAFNZoneInfo.Node(RAFNNodeNum); + roomAFNZoneNode.ZoneVolumeFraction = ipsc->rNumericArgs(1); + if (!ipsc->lAlphaFieldBlanks(3)) { + roomAFNZoneNode.NodeSurfListName = ipsc->cAlphaArgs(3); } else { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HasSurfacesAssigned = false; + roomAFNZoneNode.HasSurfacesAssigned = false; } - if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).NodeIntGainsListName = - state.dataIPShortCut->cAlphaArgs(4); + if (!ipsc->lAlphaFieldBlanks(4)) { + roomAFNZoneNode.NodeIntGainsListName = ipsc->cAlphaArgs(4); } else { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HasIntGainsAssigned = false; + roomAFNZoneNode.HasIntGainsAssigned = false; } - if (!state.dataIPShortCut->lAlphaFieldBlanks(5)) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).NodeHVACListName = state.dataIPShortCut->cAlphaArgs(5); + if (!ipsc->lAlphaFieldBlanks(5)) { + roomAFNZoneNode.NodeHVACListName = ipsc->cAlphaArgs(5); } else { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HasHVACAssigned = false; + roomAFNZoneNode.HasHVACAssigned = false; } } // loop thru TotNumOfRoomAFNNodes - cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:AdjacentSurfaceList"; - TotNumOfRAFNNodeSurfLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - for (Loop = 1; Loop <= TotNumOfRAFNNodeSurfLists; ++Loop) { + ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:AdjacentSurfaceList"; + TotNumOfRAFNNodeSurfLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + for (int Loop = 1; Loop <= TotNumOfRAFNNodeSurfLists; ++Loop) { foundList = false; state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); - for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { // find surface list - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node, - &RoomAirflowNetworkAirNodeNestedStruct::NodeSurfListName, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes); - } else { - RAFNNodeNum = 0; + int RAFNNodeNum = 0; + auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); + if (roomAFNZoneInfo.NumOfAirNodes > 0) { + RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), + roomAFNZoneInfo.Node, + &RoomAFNAirNodeNested::NodeSurfListName, + roomAFNZoneInfo.NumOfAirNodes); } - if (RAFNNodeNum > 0) { // found it - foundList = true; - NumSurfsThisNode = NumAlphas - 1; - NumOfSurfs = 0; - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + + if (RAFNNodeNum == 0) continue; + + // found it + foundList = true; + NumSurfsThisNode = NumAlphas - 1; + NumOfSurfs = 0; + for (int spaceNum : state.dataHeatBal->Zone(iZone).spaceIndexes) { + auto &thisSpace = state.dataHeatBal->space(spaceNum); + NumOfSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; + } + + auto &roomAFNZoneNode = roomAFNZoneInfo.Node(RAFNNodeNum); + if (allocated(roomAFNZoneNode.SurfMask)) { + // throw error found twice + ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1))); + ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowContinueError(state, "Duplicate RoomAir:Node:AirflowNetwork:AdjacentSurfaceList name."); + ErrorsFound = true; + continue; + } + + roomAFNZoneNode.SurfMask.allocate(roomAFNZoneInfo.totNumSurfs); + roomAFNZoneNode.SurfMask = false; // init + roomAFNZoneNode.HasSurfacesAssigned = true; + // relate surfaces to this air node and check to see whether surface names are specified correctly or not + int SurfCount = 0; + int thisSurfinZone = 0; + for (int ListSurfNum = 2; ListSurfNum <= NumAlphas; ++ListSurfNum) { + for (int spaceNum : state.dataHeatBal->Zone(iZone).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); - NumOfSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; - } - if (allocated(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).SurfMask)) { - // throw error found twice - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(1), - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Duplicate RoomAir:Node:AirflowNetwork:AdjacentSurfaceList name."); - ErrorsFound = true; - } else { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum) - .Node(RAFNNodeNum) - .SurfMask.allocate(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).totNumSurfs); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).SurfMask = false; // init - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HasSurfacesAssigned = true; - // relate surfaces to this air node and check to see whether surface names are specified correctly or not - int SurfCount = 0; - int thisSurfinZone = 0; - bool surfaceFound = false; - for (int ListSurfNum = 2; ListSurfNum <= NumAlphas; ++ListSurfNum) { - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { - auto &thisSpace = state.dataHeatBal->space(spaceNum); - for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { - ++thisSurfinZone; - if (state.dataIPShortCut->cAlphaArgs(ListSurfNum) == state.dataSurface->Surface(SurfNum).Name) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).SurfMask(thisSurfinZone) = true; - ++SurfCount; - surfaceFound = true; - break; - } - } - if (surfaceFound) break; + for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { + ++thisSurfinZone; + if (ipsc->cAlphaArgs(ListSurfNum) == state.dataSurface->Surface(SurfNum).Name) { + roomAFNZoneNode.SurfMask(thisSurfinZone) = true; + ++SurfCount; + break; } } - if (NumSurfsThisNode != SurfCount) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(1), - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Some surface names were not found in the zone"); - ErrorsFound = true; - } + if (SurfCount > 0) break; } - break; } - } // loop over zones + if (NumSurfsThisNode != SurfCount) { + ShowSevereError(state, + format("GetRoomAirflowNetworkData: Invalid {} = {}", + ipsc->cAlphaFieldNames(1), + ipsc->cAlphaArgs(1))); + ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowContinueError(state, "Some surface names were not found in the zone"); + ErrorsFound = true; + } + } // for (iZone) + if (!foundList) { // throw error ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(1), - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ipsc->cAlphaFieldNames(1), + ipsc->cAlphaArgs(1))); + ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, "Did not find a RoomAir:Node:AirflowNetwork object that references this object"); ErrorsFound = true; } } // loop thru TotNumOfRAFNNodeSurfLists - cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:InternalGains"; - TotNumOfRAFNNodeGainsLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - for (Loop = 1; Loop <= TotNumOfRAFNNodeGainsLists; ++Loop) { + ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:InternalGains"; + TotNumOfRAFNNodeGainsLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + for (int Loop = 1; Loop <= TotNumOfRAFNNodeGainsLists; ++Loop) { foundList = false; state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + if (mod((NumAlphas + NumNumbers - 1), 3) != 0) { - ShowSevereError(state, format("GetRoomAirflowNetworkData: For {}: {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ShowSevereError(state, format("GetRoomAirflowNetworkData: For {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Extensible field set are not evenly divisable by 3. Number of data entries = {}", - fmt::to_string(NumAlphas + NumNumbers - 1))); + NumAlphas + NumNumbers - 1)); ErrorsFound = true; break; } - for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); // find surface list - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node, - &RoomAirflowNetworkAirNodeNestedStruct::NodeIntGainsListName, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes); - } else { - RAFNNodeNum = 0; + int RAFNNodeNum = 0; + if (roomAFNZoneInfo.NumOfAirNodes > 0) { + RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), + roomAFNZoneInfo.Node, + &RoomAFNAirNodeNested::NodeIntGainsListName, + roomAFNZoneInfo.NumOfAirNodes); } - if (RAFNNodeNum > 0) { // found it - foundList = true; - int numInputGains = (NumAlphas + NumNumbers - 1) / 3; - int numSpacesInZone = state.dataHeatBal->Zone(ZoneNum).numSpaces; - int maxNumGains = numInputGains * numSpacesInZone; - if (allocated(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain)) { + if (RAFNNodeNum == 0) continue; + + // found it + foundList = true; + int numInputGains = (NumAlphas + NumNumbers - 1) / 3; + int numSpacesInZone = state.dataHeatBal->Zone(iZone).numSpaces; + int maxNumGains = numInputGains * numSpacesInZone; + auto &roomAFNZoneNode = roomAFNZoneInfo.Node(RAFNNodeNum); + if (allocated(roomAFNZoneNode.IntGain)) { + ShowSevereError(state, + format("GetRoomAirflowNetworkData: Invalid {} = {}", + ipsc->cAlphaFieldNames(1), + ipsc->cAlphaArgs(1))); + ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowContinueError(state, format("Duplicate {} name.", ipsc->cCurrentModuleObject)); + ErrorsFound = true; + continue; + } + + roomAFNZoneNode.IntGain.allocate(maxNumGains); + roomAFNZoneNode.IntGainsDeviceIndices.allocate(maxNumGains); + roomAFNZoneNode.intGainsDeviceSpaces.allocate(maxNumGains); + roomAFNZoneNode.IntGainsFractions.allocate(maxNumGains); + roomAFNZoneNode.HasIntGainsAssigned = true; + int numGainsFound = 0; + for (int gainsLoop = 1; gainsLoop <= numInputGains; ++gainsLoop) { + auto &intGain = roomAFNZoneNode.IntGain(gainsLoop); + intGain.type = static_cast(getEnumValue(DataHeatBalance::IntGainTypeNamesUC, + UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(gainsLoop * 2)))); + + if (intGain.type == DataHeatBalance::IntGainType::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(gainsLoop * 2), ipsc->cAlphaArgs(gainsLoop * 2)); + ErrorsFound = true; + continue; + } + intGain.Name = ipsc->cAlphaArgs(gainsLoop * 2 + 1); + + bool gainFound = false; + // check all spaces in this zone for matching gains + for (int spaceNum : state.dataHeatBal->Zone(iZone).spaceIndexes) { + // verify type and name and get pointer to device in internal gains structure array + int intGainIndex = GetInternalGainDeviceIndex(state, spaceNum, intGain.type, intGain.Name); + if (intGainIndex >= 0) { + gainFound = true; + ++numGainsFound; + roomAFNZoneNode.intGainsDeviceSpaces(numGainsFound) = spaceNum; + roomAFNZoneNode.IntGainsDeviceIndices(numGainsFound) = intGainIndex; + roomAFNZoneNode.IntGainsFractions(numGainsFound) = ipsc->rNumericArgs(gainsLoop); + } + } + if (gainFound) { + roomAFNZoneNode.NumIntGains = numGainsFound; + } else { ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(1), - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Duplicate {} name.", cCurrentModuleObject)); + ipsc->cAlphaFieldNames(gainsLoop * 2 + 1), + ipsc->cAlphaArgs(gainsLoop * 2 + 1))); + ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowContinueError(state, "Internal gain did not match correctly"); ErrorsFound = true; - } else { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain.allocate(maxNumGains); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices.allocate(maxNumGains); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).intGainsDeviceSpaces.allocate(maxNumGains); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsFractions.allocate(maxNumGains); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HasIntGainsAssigned = true; - int numGainsFound = 0; - for (gainsLoop = 1; gainsLoop <= numInputGains; ++gainsLoop) { - TypeNum = getEnumerationValue(DataHeatBalance::IntGainTypeNamesUC, - UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(gainsLoop * 2))); - if (TypeNum >= 0) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Type = - static_cast(TypeNum); - } else { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(gainsLoop * 2), - state.dataIPShortCut->cAlphaArgs(gainsLoop * 2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "incorrect type of internal gain"); - ErrorsFound = true; - continue; - } - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Name = - state.dataIPShortCut->cAlphaArgs(gainsLoop * 2 + 1); - - bool gainFound = false; - // check all spaces in this zone for matching gains - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { - // verify type and name and get pointer to device in internal gains structure array - int intGainIndex = GetInternalGainDeviceIndex( - state, - spaceNum, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Type, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Name); - if (intGainIndex >= 0) { - gainFound = true; - ++numGainsFound; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).intGainsDeviceSpaces(numGainsFound) = - spaceNum; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsDeviceIndices(numGainsFound) = - intGainIndex; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsFractions(numGainsFound) = - state.dataIPShortCut->rNumericArgs(gainsLoop); - } - } - if (gainFound) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).NumIntGains = numGainsFound; - } else { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(gainsLoop * 2 + 1), - state.dataIPShortCut->cAlphaArgs(gainsLoop * 2 + 1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Internal gain did not match correctly"); - ErrorsFound = true; - } - } } - } - } + } // for (gainsLoop) + } //for (iZone) } // loop thru TotNumOfRAFNNodeGainsLists // Get data of HVAC equipment - cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:HVACEquipment"; - TotNumOfRAFNNodeHVACLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - for (Loop = 1; Loop <= TotNumOfRAFNNodeHVACLists; ++Loop) { + ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:HVACEquipment"; + TotNumOfRAFNNodeHVACLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + for (int Loop = 1; Loop <= TotNumOfRAFNNodeHVACLists; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, - cCurrentModuleObject, + ipsc->cCurrentModuleObject, Loop, - state.dataIPShortCut->cAlphaArgs, + ipsc->cAlphaArgs, NumAlphas, - state.dataIPShortCut->rNumericArgs, + ipsc->rNumericArgs, NumNumbers, status, _, _, - state.dataIPShortCut->cAlphaFieldNames, - state.dataIPShortCut->cNumericFieldNames); + ipsc->cAlphaFieldNames, + ipsc->cNumericFieldNames); + + ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; + if (mod((NumAlphas + NumNumbers - 1), 4) != 0) { - ShowSevereError(state, format("GetRoomAirflowNetworkData: For {}: {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); + ShowSevereError(state, format("GetRoomAirflowNetworkData: For {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Extensible field set are not evenly divisable by 4. Number of data entries = {}", fmt::to_string(NumAlphas + NumNumbers - 1))); ErrorsFound = true; break; } - for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); // find surface list - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node, - &RoomAirflowNetworkAirNodeNestedStruct::NodeHVACListName, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes); - } else { - RAFNNodeNum = 0; + int RAFNNodeNum = 0; + if (roomAFNZoneInfo.NumOfAirNodes > 0) { + RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), + roomAFNZoneInfo.Node, + &RoomAFNAirNodeNested::NodeHVACListName, + roomAFNZoneInfo.NumOfAirNodes); } - if (RAFNNodeNum > 0) { // found it - foundList = true; - numEquip = (NumAlphas + NumNumbers - 1) / 4; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).NumHVACs = numEquip; - if (allocated(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC)) { + + if (RAFNNodeNum == 0) continue; + + // found it + auto &roomAFNNode = roomAFNZoneInfo.Node(RAFNNodeNum); + if (allocated(roomAFNNode.HVAC)) { + ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1))); + ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowContinueError(state, format("Duplicate {} name.", ipsc->cCurrentModuleObject)); + ErrorsFound = true; + continue; + } + + foundList = true; + roomAFNNode.NumHVACs = (NumAlphas + NumNumbers - 1) / 4; + roomAFNNode.HVAC.allocate(roomAFNNode.NumHVACs); + roomAFNNode.HasHVACAssigned = true; + for (int iEquip = 1; iEquip <= roomAFNNode.NumHVACs; ++iEquip) { + int iEquipArg = 2 + (iEquip - 1) * 2; + auto &roomAFNNodeHVAC = roomAFNNode.HVAC(iEquip); + roomAFNNodeHVAC.zoneEquipType = + static_cast(getEnumValue(DataHVACGlobals::zoneEquipTypeNamesUC, ipsc->cAlphaArgs(iEquipArg))); + if (roomAFNNodeHVAC.zoneEquipType == DataHVACGlobals::ZoneEquipType::Invalid) { + ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(iEquipArg), ipsc->cAlphaArgs(iEquipArg)); + ErrorsFound = true; + } + roomAFNNodeHVAC.Name = ipsc->cAlphaArgs(3 + (iEquip - 1) * 2); + + // verify type and name and get pointer to device in HVAC equipment type and name structure array + TotNumEquip = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cAlphaArgs(iEquipArg)); + if (TotNumEquip == 0) { + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(iEquipArg), ipsc->cAlphaArgs(iEquipArg)); + ErrorsFound = true; + } + roomAFNNodeHVAC.SupplyFraction = ipsc->rNumericArgs(iEquipArg); + roomAFNNodeHVAC.ReturnFraction = ipsc->rNumericArgs(iEquipArg); + + IntEquipError = CheckEquipName( + state, + roomAFNNodeHVAC.ObjectTypeName, + roomAFNNodeHVAC.Name, + roomAFNNodeHVAC.SupplyNodeName, + roomAFNNodeHVAC.ReturnNodeName, + TotNumEquip, + roomAFNNodeHVAC.zoneEquipType); + + if (!IntEquipError) { ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(1), - state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, format("Duplicate {} name.", cCurrentModuleObject)); + ipsc->cAlphaFieldNames(3 + (iEquip - 1) * 2), + ipsc->cAlphaArgs(2 + (iEquip - 1) * 2))); + ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowContinueError(state, "Internal gain did not match correctly"); ErrorsFound = true; - } else { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC.allocate(numEquip); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HasHVACAssigned = true; - for (EquipLoop = 1; EquipLoop <= numEquip; ++EquipLoop) { - TypeNum = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2 + (EquipLoop - 1) * 2), ZoneHVACTerminalTypes, NumZoneHVACTerminalTypes); - if (TypeNum > 0) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).TypeOfNum = TypeNum; - } else { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(2 + (EquipLoop - 1) * 2), - state.dataIPShortCut->cAlphaArgs(2 + (EquipLoop - 1) * 2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "incorrect type of HVACEquipment"); - ErrorsFound = true; - } - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).ObjectTypeName = - state.dataIPShortCut->cAlphaArgs(2 + (EquipLoop - 1) * 2); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).Name = - state.dataIPShortCut->cAlphaArgs(3 + (EquipLoop - 1) * 2); - - // verify type and name and get pointer to device in HVAC equipment type and name structure array - TotNumEquip = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ZoneHVACTerminalTypes(TypeNum)); - if (TotNumEquip == 0) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: No such {} = {}", - state.dataIPShortCut->cAlphaFieldNames(2 + (EquipLoop - 1) * 2), - state.dataIPShortCut->cAlphaArgs(2 + (EquipLoop - 1) * 2))); - ShowContinueError( - state, - format("is available in the input file in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ErrorsFound = true; - } - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).SupplyFraction = - state.dataIPShortCut->rNumericArgs(1 + (EquipLoop - 1) * 2); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).ReturnFraction = - state.dataIPShortCut->rNumericArgs(2 + (EquipLoop - 1) * 2); - - IntEquipError = CheckEquipName( - state, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).ObjectTypeName, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).Name, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).SupplyNodeName, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).HVAC(EquipLoop).ReturnNodeName, - TotNumEquip, - TypeNum); - - if (!IntEquipError) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - state.dataIPShortCut->cAlphaFieldNames(3 + (EquipLoop - 1) * 2), - state.dataIPShortCut->cAlphaArgs(2 + (EquipLoop - 1) * 2))); - ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowContinueError(state, "Internal gain did not match correctly"); - ErrorsFound = true; - } - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // TYPE RoomAirflowNetworkHVACStruct - // INTEGER::EquipConfigIndex = 0 - } } - } - } + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // TYPE RoomAirflowNetworkHVACStruct + // INTEGER::EquipConfigIndex = 0 + } // for (iEquip) + } // for (Zone) } // loop thru TotNumOfRAFNNodeHVACLists // do some checks on input data - for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes > 0) { - // Check zone volume fraction - SumFraction = 0.0; - for (RAFNNodeNum = 1; RAFNNodeNum <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes; ++RAFNNodeNum) { - SumFraction = SumFraction + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).ZoneVolumeFraction; - } - if (std::abs(SumFraction - 1.0) > 0.001) { - ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, zone volume fractions do not sum to 1.0"); - ShowContinueError(state, - format("Entered in RoomAir:Node:AirflowNetwork with Zone Name = {}", state.dataHeatBal->Zone(ZoneNum).Name)); - ShowContinueError(state, "The Fraction of Zone Air Volume values across all the nodes needs to sum to 1.0."); - ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SumFraction)); - ErrorsFound = true; - } - // Check internal gain fraction - for (RAFNNodeNum = 1; RAFNNodeNum <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes; ++RAFNNodeNum) { - for (gainsLoop = 1; gainsLoop <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).NumIntGains; - ++gainsLoop) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).FractionCheck) continue; - SumFraction = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGainsFractions(gainsLoop); - TypeNum = - static_cast(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Type); - Name = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).Name; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum).IntGain(gainsLoop).FractionCheck = true; - for (RAFNNum = 1; RAFNNum <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes; ++RAFNNum) { - for (GainNum = 1; GainNum <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNum).NumIntGains; - ++GainNum) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNum).IntGain(GainNum).FractionCheck) continue; - if (TypeNum == static_cast( - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNum).IntGain(GainNum).Type) && - UtilityRoutines::SameString( - Name, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNum).IntGain(GainNum).Name)) { - SumFraction += state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNum).IntGainsFractions(GainNum); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNum).IntGain(GainNum).FractionCheck = true; - } - } - } - if (std::abs(SumFraction - 1.0) > 0.001) { - ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, internal gain fractions do not sum to 1.0"); - ShowContinueError(state, - format("Entered in RoomAir:Node:AirflowNetwork with Zone Name = {}, Intrnal gain name = {}", - state.dataHeatBal->Zone(ZoneNum).Name, - Name)); - ShowContinueError(state, "The Fraction of internal gain across all the nodes needs to sum to 1.0."); - ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SumFraction)); - ErrorsFound = true; - } - } - } + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); + if (roomAFNZoneInfo.NumOfAirNodes == 0) + continue; + + // Check zone volume fraction + Real64 SumFraction = 0.0; + for (int iRoomAFNNode = 1; iRoomAFNNode <= roomAFNZoneInfo.NumOfAirNodes; ++iRoomAFNNode) { + SumFraction += roomAFNZoneInfo.Node(iRoomAFNNode).ZoneVolumeFraction; + } + if (std::abs(SumFraction - 1.0) > 0.001) { + ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, zone volume fractions do not sum to 1.0"); + ShowContinueError(state, + format("Entered in RoomAir:Node:AirflowNetwork with Zone Name = {}", state.dataHeatBal->Zone(iZone).Name)); + ShowContinueError(state, "The Fraction of Zone Air Volume values across all the nodes needs to sum to 1.0."); + ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SumFraction)); + ErrorsFound = true; } - } - if (!ErrorsFound) { - for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).IsUsed) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes > 0) { - for (Loop = 1; Loop <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes; ++Loop) { - SetupOutputVariable(state, - "RoomAirflowNetwork Node Temperature", - OutputProcessor::Unit::C, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(Loop).AirTemp, - OutputProcessor::SOVTimeStepType::HVAC, - OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(Loop).Name); - SetupOutputVariable(state, - "RoomAirflowNetwork Node Humidity Ratio", - OutputProcessor::Unit::kgWater_kgDryAir, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(Loop).HumRat, - OutputProcessor::SOVTimeStepType::HVAC, - OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(Loop).Name); - SetupOutputVariable(state, - "RoomAirflowNetwork Node Relative Humidity", - OutputProcessor::Unit::Perc, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(Loop).RelHumidity, - OutputProcessor::SOVTimeStepType::HVAC, - OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(Loop).Name); + // Check internal gain fraction + for (int iRoomAFNNode = 1; iRoomAFNNode <= roomAFNZoneInfo.NumOfAirNodes; ++iRoomAFNNode) { + auto &roomAFNNode = roomAFNZoneInfo.Node(iRoomAFNNode); + for (int iGain = 1; iGain <= roomAFNNode.NumIntGains; ++iGain) { + auto &intGain = roomAFNNode.IntGain(iGain); + if (intGain.FractionCheck) continue; + Real64 SumFraction = roomAFNNode.IntGainsFractions(iGain); + intGain.FractionCheck = true; + + for (int iRoomAFNNode2 = 1; iRoomAFNNode2 <= roomAFNZoneInfo.NumOfAirNodes; ++iRoomAFNNode2) { + auto &roomAFNNode2 = roomAFNZoneInfo.Node(iRoomAFNNode2); + for (int iGain2 = 1; iGain2 <= roomAFNNode2.NumIntGains; ++iGain2) { + auto &intGain2 = roomAFNNode2.IntGain(iGain2); + if (intGain2.FractionCheck) continue; + if (intGain.type == intGain2.type && UtilityRoutines::SameString(intGain.Name, intGain2.Name)) { + SumFraction += roomAFNNode2.IntGainsFractions(iGain2); + intGain2.FractionCheck = true; + } } } - } - } - } + if (std::abs(SumFraction - 1.0) > 0.001) { + ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, internal gain fractions do not sum to 1.0"); + ShowContinueError(state, + format("Entered in RoomAir:Node:AirflowNetwork with Zone Name = {}, Intrnal gain name = {}", + state.dataHeatBal->Zone(iZone).Name, + Name)); + ShowContinueError(state, "The Fraction of internal gain across all the nodes needs to sum to 1.0."); + ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SumFraction)); + ErrorsFound = true; + } + } // for (iGain) + } // for (iRoomAFNNode) + } // for (iZone) + + if (ErrorsFound) + return; + + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); + if (!roomAFNZoneInfo.IsUsed || roomAFNZoneInfo.NumOfAirNodes == 0) continue; + + for (int iAirNode = 1; iAirNode <= roomAFNZoneInfo.NumOfAirNodes; ++iAirNode) { + auto &roomAFNZoneNode = roomAFNZoneInfo.Node(iAirNode); + SetupOutputVariable(state, + "RoomAirflowNetwork Node Temperature", + OutputProcessor::Unit::C, + roomAFNZoneNode.AirTemp, + OutputProcessor::SOVTimeStepType::HVAC, + OutputProcessor::SOVStoreType::Average, + roomAFNZoneNode.Name); + SetupOutputVariable(state, + "RoomAirflowNetwork Node Humidity Ratio", + OutputProcessor::Unit::kgWater_kgDryAir, + roomAFNZoneNode.HumRat, + OutputProcessor::SOVTimeStepType::HVAC, + OutputProcessor::SOVStoreType::Average, + roomAFNZoneNode.Name); + SetupOutputVariable(state, + "RoomAirflowNetwork Node Relative Humidity", + OutputProcessor::Unit::Perc, + roomAFNZoneNode.RelHumidity, + OutputProcessor::SOVTimeStepType::HVAC, + OutputProcessor::SOVStoreType::Average, + roomAFNZoneNode.Name); + } // for (iAirNodE) + } // for (iZone) } void SharedDVCVUFDataInit(EnergyPlusData &state, int const ZoneNum) @@ -1981,18 +1831,11 @@ namespace RoomAirModelManager { // AUTHOR Linda Lawrie // DATE WRITTEN March 2005 // MODIFIED Aug, 2013, Sam Brunswick -- for RoomAirCrossCrossVent modifications - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This routine allocates and initializes(?) the data that is shared between the // UCSD models (DV and CV) - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - // Using/Aliasing using namespace DataEnvironment; using namespace DataSurfaces; @@ -2004,12 +1847,6 @@ namespace RoomAirModelManager { // SUBROUTINE PARAMETER DEFINITIONS: Real64 constexpr BaseDischargeCoef(0.62); - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool SetZoneAux; Array1D_int AuxSurf; @@ -2473,7 +2310,7 @@ namespace RoomAirModelManager { // Output variables and DV zone flag for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; ++state.dataRoomAirModelMgr->Loop) { - if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModelType != DataRoomAirModel::RoomAirModel::UCSDDV) + if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModel != RoomAirModel::UCSDDV) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:ThreeNodeDisplacementVentilation' SetupOutputVariable(state, @@ -2565,7 +2402,7 @@ namespace RoomAirModelManager { // Output variables and UF zone flag for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; ++state.dataRoomAirModelMgr->Loop) { - if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModelType != DataRoomAirModel::RoomAirModel::UCSDUFI) + if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModel != RoomAirModel::UCSDUFI) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:UnderFloorAirDistributionInterior' SetupOutputVariable(state, @@ -2645,7 +2482,7 @@ namespace RoomAirModelManager { } for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; ++state.dataRoomAirModelMgr->Loop) { - if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModelType != DataRoomAirModel::RoomAirModel::UCSDUFE) + if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModel != RoomAirModel::UCSDUFE) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:UnderFloorAirDistributionExterior' SetupOutputVariable(state, @@ -2777,7 +2614,7 @@ namespace RoomAirModelManager { for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; ++state.dataRoomAirModelMgr->Loop) { - if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModelType != DataRoomAirModel::RoomAirModel::UCSDCV) + if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModel != RoomAirModel::UCSDCV) continue; // don't set these up if they don't make sense ZoneEquipConfigNum = ZoneNum; // check whether this zone is a controlled zone or not @@ -3010,17 +2847,12 @@ namespace RoomAirModelManager { // FUNCTION INFORMATION: // AUTHOR Lixing Gu // DATE WRITTEN November 2014 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // This function looks up the given RoomAirNode name and returns the Zone number and RoomAir node // number. If incorrect name is given, errorsfound is returned as true and value is returned // as zero. - // FUNCTION LOCAL VARIABLE DECLARATIONS: - int I; // Zone index - // Obtains and Allocates RoomAirSettings : AirflowNetwork if (state.dataRoomAirModelMgr->GetAirModelData) { GetAirModelDatas(state); @@ -3029,7 +2861,7 @@ namespace RoomAirModelManager { Errorfound = false; RAFNNodeNum = 0; - for (I = 1; I <= state.dataGlobal->NumOfZones; ++I) { + for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(I).NumOfAirNodes > 0) { RAFNNodeNum = UtilityRoutines::FindItemInList(RAFNNodeName, state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(I).Node, @@ -3054,15 +2886,13 @@ namespace RoomAirModelManager { std::string &SupplyNodeName, // Supply node name std::string &ReturnNodeName, // Return node name int TotNumEquip, // how many of this equipment type - int TypeNum // equipment type number + DataHVACGlobals::ZoneEquipType zoneEquipType ) { // FUNCTION INFORMATION: // AUTHOR Lixing Gu // DATE WRITTEN March 2014 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // This function looks up the given RoomAirNode name and returns the Zone number and RoomAir node @@ -3093,9 +2923,10 @@ namespace RoomAirModelManager { SupplyNodeName = ""; - if (TypeNum == 0) return EquipFind; + if (zoneEquipType == DataHVACGlobals::ZoneEquipType::Invalid) return EquipFind; - state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, EquipType, TotalArgs, NumAlphas, NumNumbers); + std::string_view equipTypeName = DataHVACGlobals::zoneEquipTypeNamesUC[(int)zoneEquipType]; + state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, equipTypeName, TotalArgs, NumAlphas, NumNumbers); MaxNums = max(MaxNums, NumNumbers); MaxAlphas = max(MaxAlphas, NumAlphas); @@ -3114,136 +2945,175 @@ namespace RoomAirModelManager { Alphas.allocate(NumAlphas); } - for (I = 1; I <= TotNumEquip; ++I) { - state.dataInputProcessing->inputProcessor->getObjectItem(state, EquipType, I, Alphas, NumAlphas, Numbers, NumNumbers, Status); + for (int I = 1; I <= TotNumEquip; ++I) { + state.dataInputProcessing->inputProcessor->getObjectItem(state, equipTypeName, I, Alphas, NumAlphas, Numbers, NumNumbers, Status); if (UtilityRoutines::SameString(Alphas(1), EquipName)) { EquipFind = true; break; } } - if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_VariableRefrigerantFlow) { // ZoneHVAC:TerminalUnit : VariableRefrigerantFlow + switch (zoneEquipType) { + case DataHVACGlobals::ZoneEquipType::VariableRefrigerantFlow: { // ZoneHVAC:TerminalUnit : VariableRefrigerantFlow SupplyNodeName = Alphas(4); ReturnNodeName = ""; // Zone return node - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_EnergyRecoveryVentilator) { // ZoneHVAC : EnergyRecoveryVentilator + } break; + case DataHVACGlobals::ZoneEquipType::EnergyRecoveryVentilator: { // ZoneHVAC : EnergyRecoveryVentilator I = GetFanOutletNode(state, "Fan:OnOff", Alphas(4), errorfound); if (errorfound) { } SupplyNodeName = state.dataLoopNodes->NodeID(I); // ????? ReturnNodeName = ""; // Zone exhaust node - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_FourPipeFanCoil) { // ZoneHVAC : FourPipeFanCoil + } break; + case DataHVACGlobals::ZoneEquipType::FourPipeFanCoil: { // ZoneHVAC : FourPipeFanCoil SupplyNodeName = Alphas(6); ReturnNodeName = Alphas(5); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_OutdoorAirUnit) { // ZoneHVAC : OutdoorAirUnit + } break; + case DataHVACGlobals::ZoneEquipType::OutdoorAirUnit: { // ZoneHVAC : OutdoorAirUnit SupplyNodeName = Alphas(13); ReturnNodeName = Alphas(14); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_PackagedTerminalAirConditioner) { // ZoneHVAC : PackagedTerminalAirConditioner + } break; + case DataHVACGlobals::ZoneEquipType::PackagedTerminalAirConditioner: { // ZoneHVAC : PackagedTerminalAirConditioner SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_PackagedTerminalHeatPump) { // ZoneHVAC : PackagedTerminalHeatPump + } break; + case DataHVACGlobals::ZoneEquipType::PackagedTerminalHeatPump: { // ZoneHVAC : PackagedTerminalHeatPump SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_UnitHeater) { // ZoneHVAC : UnitHeater + } break; + case DataHVACGlobals::ZoneEquipType::UnitHeater: { // ZoneHVAC : UnitHeater SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_UnitVentilator) { // ZoneHVAC : UnitVentilator + } break; + case DataHVACGlobals::ZoneEquipType::UnitVentilator: { // ZoneHVAC : UnitVentilator SupplyNodeName = Alphas(7); ReturnNodeName = Alphas(6); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_VentilatedSlab) { // ZoneHVAC : VentilatedSlab + } break; + case DataHVACGlobals::ZoneEquipType::VentilatedSlab: { // ZoneHVAC : VentilatedSlab SupplyNodeName = Alphas(20); ReturnNodeName = Alphas(18); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_WaterToAirHeatPump) { // ZoneHVAC : WaterToAirHeatPump + } break; + case DataHVACGlobals::ZoneEquipType::WaterToAirHeatPump: { // ZoneHVAC : WaterToAirHeatPump SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_WindowAirConditioner) { // ZoneHVAC : WindowAirConditioner + } break; + case DataHVACGlobals::ZoneEquipType::WindowAirConditioner: { // ZoneHVAC : WindowAirConditioner SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); - } else if (TypeNum == - DataHVACGlobals::ZoneEquipTypeOf_BaseboardRadiantConvectiveElectric) { // ZoneHVAC : Baseboard : RadiantConvective : Electric + } break; + case DataHVACGlobals::ZoneEquipType::BaseboardRadiantConvectiveElectric: { // ZoneHVAC : Baseboard : RadiantConvective : Electric SupplyNodeName = ""; // convection only - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_BaseboardRadiantConvectiveWater) { // ZoneHVAC : Baseboard : RadiantConvective : Water + } break; + case DataHVACGlobals::ZoneEquipType::BaseboardRadiantConvectiveWater: { // ZoneHVAC : Baseboard : RadiantConvective : Water SupplyNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_BaseboardRadiantConvectiveSteam) { // ZoneHVAC : Baseboard : RadiantConvective : Steam + } break; + case DataHVACGlobals::ZoneEquipType::BaseboardRadiantConvectiveSteam: { // ZoneHVAC : Baseboard : RadiantConvective : Steam SupplyNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_BaseboardConvectiveElectric) { // ZoneHVAC : Baseboard : Convective : Electric + } break; + case DataHVACGlobals::ZoneEquipType::BaseboardConvectiveElectric: { // ZoneHVAC : Baseboard : Convective : Electric SupplyNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_BaseboardConvectiveWater) { // ZoneHVAC : Baseboard : Convective : Water + } break; + case DataHVACGlobals::ZoneEquipType::BaseboardConvectiveWater: { // ZoneHVAC : Baseboard : Convective : Water SupplyNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_HighTemperatureRadiant) { // ZoneHVAC : HighTemperatureRadiant + } break; + case DataHVACGlobals::ZoneEquipType::HighTemperatureRadiant: { // ZoneHVAC : HighTemperatureRadiant SupplyNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_DehumidifierDX) { // ZoneHVAC : Dehumidifier : DX + } break; + case DataHVACGlobals::ZoneEquipType::DehumidifierDX: { // ZoneHVAC : Dehumidifier : DX SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_IdealLoadsAirSystem) { // ZoneHVAC : IdealLoadsAirSystem + } break; + case DataHVACGlobals::ZoneEquipType::IdealLoadsAirSystem: { // ZoneHVAC : IdealLoadsAirSystem SupplyNodeName = Alphas(3); ReturnNodeName = Alphas(4); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_RefrigerationChillerSet) { // ZoneHVAC : RefrigerationChillerSet + } break; + case DataHVACGlobals::ZoneEquipType::RefrigerationChillerSet: { // ZoneHVAC : RefrigerationChillerSet SupplyNodeName = Alphas(5); ReturnNodeName = Alphas(4); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_HybridUnitaryAirConditioners) { // ZoneHVAC : HybridUnitaryAirConditioners + } break; + case DataHVACGlobals::ZoneEquipType::HybridUnitaryAirConditioners: { // ZoneHVAC : HybridUnitaryAirConditioners SupplyNodeName = Alphas(11); ReturnNodeName = Alphas(9); - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_FanZoneExhaust) { // Fan : ZoneExhaust + } break; + case DataHVACGlobals::ZoneEquipType::FanZoneExhaust: { // Fan : ZoneExhaust SupplyNodeName = ""; // ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? May not use - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_WaterHeaterHeatPump) { // WaterHeater : HeatPump + } break; + case DataHVACGlobals::ZoneEquipType::WaterHeaterHeatPump: { // WaterHeater : HeatPump SupplyNodeName = Alphas(8); ReturnNodeName = Alphas(7); // For AirTerminals, find matching return node later - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalDualDuctConstantVolume) { // AirTerminal : DualDuct : ConstantVolume + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalDualDuctConstantVolume: { // AirTerminal : DualDuct : ConstantVolume SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalDualDuctVAV) { // AirTerminal : DualDuct : VAV + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalDualDuctVAV: { // AirTerminal : DualDuct : VAV SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == - DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctConstantVolumeReheat) { // AirTerminal : SingleDuct : ConstantVolume : Reheat + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctConstantVolumeReheat: { // AirTerminal : SingleDuct : ConstantVolume : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctConstantVolumeNoReheat) { // AirTerminal : SingleDuct : + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctConstantVolumeNoReheat: { // AirTerminal : SingleDuct : // ConstantVolume : NoReheat SupplyNodeName = Alphas(4); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctVAVReheat) { // AirTerminal : SingleDuct : VAV : Reheat + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVReheat: { // AirTerminal : SingleDuct : VAV : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctVAVNoReheat) { // AirTerminal : SingleDuct : VAV : NoReheat + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVNoReheat: { // AirTerminal : SingleDuct : VAV : NoReheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == - DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctSeriesPIUReheat) { // AirTerminal : SingleDuct : SeriesPIU : Reheat + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctSeriesPIUReheat: { // AirTerminal : SingleDuct : SeriesPIU : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == - DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctParallelPIUReheat) { // AirTerminal : SingleDuct : ParallelPIU : Reheat + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctParallelPIUReheat: { // AirTerminal : SingleDuct : ParallelPIU : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctCAVFourPipeInduction) { // AirTerminal : SingleDuct : + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctCAVFourPipeInduction: { // AirTerminal : SingleDuct : // ConstantVolume : FourPipeInduction SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctVAVReheatVariableSpeedFan) { // AirTerminal : SingleDuct : VAV + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVReheatVariableSpeedFan: { // AirTerminal : SingleDuct : VAV // : Reheat : VariableSpeedFan SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctVAVHeatAndCoolReheat) { // AirTerminal : SingleDuct : VAV : + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVHeatAndCoolReheat: { // AirTerminal : SingleDuct : VAV : // HeatAndCool : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctVAVHeatAndCoolNoReheat) { // AirTerminal : SingleDuct : VAV : + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVHeatAndCoolNoReheat: { // AirTerminal : SingleDuct : VAV : // HeatAndCool : NoReheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalSingleDuctConstantVolumeCooledBeam) { // AirTerminal : SingleDuct : + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctConstantVolumeCooledBeam: { // AirTerminal : SingleDuct : // ConstantVolume : CooledBeam SupplyNodeName = Alphas(5); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirTerminalDualDuctVAVOutdoorAir) { // AirTerminal : DualDuct : VAV : OutdoorAir + } break; + case DataHVACGlobals::ZoneEquipType::AirTerminalDualDuctVAVOutdoorAir: { // AirTerminal : DualDuct : VAV : OutdoorAir SupplyNodeName = Alphas(3); ReturnNodeName = ""; - } else if (TypeNum == DataHVACGlobals::ZoneEquipTypeOf_AirLoopHVACReturnAir) { // AirLoopHVACReturnAir + } break; + case DataHVACGlobals::ZoneEquipType::AirLoopHVACReturnAir: { // AirLoopHVACReturnAir SupplyNodeName = Alphas(4); // ReturnNodeName = ""; // - } + } break; + default: { + assert(false); + } break; + + } // switch // Need to find a better to handle allocate and deallocate if (MaxAlphas > NumAlphas) { diff --git a/src/EnergyPlus/RoomAirModelManager.hh b/src/EnergyPlus/RoomAirModelManager.hh index 244995e2318..1ffef317104 100644 --- a/src/EnergyPlus/RoomAirModelManager.hh +++ b/src/EnergyPlus/RoomAirModelManager.hh @@ -91,7 +91,7 @@ namespace RoomAirModelManager { std::string &SupplyNodeName, // Supply node name std::string &ReturnNodeName, // Return node name int TotNumEquip, // how many of this equipment type - int TypeNum); // equipment type number + DataHVACGlobals::ZoneEquipType zeType); // equipment type number } // namespace RoomAirModelManager diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index e05e422e49c..e92b2b48fac 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -236,7 +236,7 @@ void CalcTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number CurntPatternKey = GetCurrentScheduleValue(state, state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).PatternSchedID); - CurPatrnID = FindNumberInList(CurntPatternKey, state.dataRoomAirMod->RoomAirPattern, &TemperaturePatternStruct::PatrnID); + CurPatrnID = FindNumberInList(CurntPatternKey, state.dataRoomAirMod->RoomAirPattern, &TemperaturePattern::PatrnID); if (CurPatrnID == 0) { // throw error here ? way to test schedules before getting to this point? diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index 8213bb3487b..132b9ac5978 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -422,7 +422,7 @@ void ParseStack(EnergyPlusData &state, int const StackNum) } else { Remainder = stripped(Line.substr(Pos + 1)); } - // Keyword = UtilityRoutines::MakeUPPERCase(Line(1:Pos-1)) + // Keyword = UtilityRoutines::makeUPPER(Line(1:Pos-1)) Keyword = Line.substr(0, Pos); // the functionality in each block of this parser structure is so different that a regular IF block seems reasonable @@ -468,7 +468,7 @@ void ParseStack(EnergyPlusData &state, int const StackNum) Pos = scan(Remainder, ' '); if (Pos == std::string::npos) Pos = Remainder.length(); Variable = - UtilityRoutines::MakeUPPERCase(stripped(Remainder.substr(0, Pos))); // really the subroutine, or reference to instruction set + UtilityRoutines::makeUPPER(stripped(Remainder.substr(0, Pos))); // really the subroutine, or reference to instruction set StackNum2 = UtilityRoutines::FindItemInList(Variable, state.dataRuntimeLang->ErlStack); if (StackNum2 == 0) { AddError(state, StackNum, LineNum, "Program or Subroutine name [" + Variable + "] not found for the RUN instruction."); @@ -4059,7 +4059,7 @@ int FindEMSVariable(EnergyPlusData &state, int TrendVarNum; Found = false; - std::string const UppercaseName = UtilityRoutines::MakeUPPERCase(VariableName); + std::string const UppercaseName = UtilityRoutines::makeUPPER(VariableName); // check in ErlVariables for (VariableNum = 1; VariableNum <= state.dataRuntimeLang->NumErlVariables; ++VariableNum) { @@ -4113,7 +4113,7 @@ int NewEMSVariable(EnergyPlusData &state, std::string const &VariableName, int c // Add the new variable VariableNum = state.dataRuntimeLang->NumErlVariables; - state.dataRuntimeLang->ErlVariable(VariableNum).Name = UtilityRoutines::MakeUPPERCase(VariableName); + state.dataRuntimeLang->ErlVariable(VariableNum).Name = UtilityRoutines::makeUPPER(VariableName); state.dataRuntimeLang->ErlVariable(VariableNum).StackNum = StackNum; state.dataRuntimeLang->ErlVariable(VariableNum).Value.Type = Value::Number; // ErlVariable values are numbers } diff --git a/src/EnergyPlus/SQLiteProcedures.cc b/src/EnergyPlus/SQLiteProcedures.cc index 2bbc70adc10..1403260ecbb 100644 --- a/src/EnergyPlus/SQLiteProcedures.cc +++ b/src/EnergyPlus/SQLiteProcedures.cc @@ -2509,7 +2509,7 @@ bool SQLite::RoomAirModel::insertIntoSQLite(sqlite3_stmt *insertStmt) { sqliteBindInteger(insertStmt, 1, number); sqliteBindText(insertStmt, 2, airModelName); - sqliteBindInteger(insertStmt, 3, static_cast(airModelType)); + sqliteBindInteger(insertStmt, 3, static_cast(airModel)); sqliteBindInteger(insertStmt, 4, static_cast(tempCoupleScheme)); sqliteBindLogical(insertStmt, 5, simAirModel); diff --git a/src/EnergyPlus/SQLiteProcedures.hh b/src/EnergyPlus/SQLiteProcedures.hh index bb7f1ed14e7..7d0b5304351 100644 --- a/src/EnergyPlus/SQLiteProcedures.hh +++ b/src/EnergyPlus/SQLiteProcedures.hh @@ -971,8 +971,8 @@ private: std::shared_ptr const &db, int const roomAirModelNumber, DataRoomAirModel::AirModelData const &roomAirModelData) - : SQLiteData(errorStream, db), number(roomAirModelNumber), airModelName(roomAirModelData.AirModelName), - airModelType(roomAirModelData.AirModelType), tempCoupleScheme(roomAirModelData.TempCoupleScheme), + : SQLiteData(errorStream, db), number(roomAirModelNumber), airModelName(roomAirModelData.Name), + airModel(roomAirModelData.AirModel), tempCoupleScheme(roomAirModelData.TempCoupleScheme), simAirModel(roomAirModelData.SimAirModel) { } @@ -982,7 +982,7 @@ private: private: int const number; std::string const &airModelName; - DataRoomAirModel::RoomAirModel const &airModelType; + DataRoomAirModel::RoomAirModel const &airModel; DataRoomAirModel::CouplingScheme const &tempCoupleScheme; bool const &simAirModel; }; diff --git a/src/EnergyPlus/ScheduleManager.cc b/src/EnergyPlus/ScheduleManager.cc index 0d1068d1b08..b13ba27c876 100644 --- a/src/EnergyPlus/ScheduleManager.cc +++ b/src/EnergyPlus/ScheduleManager.cc @@ -633,7 +633,7 @@ namespace ScheduleManager { } if (NumAlphas >= 3) { if (!lAlphaBlanks(3)) { - state.dataScheduleMgr->ScheduleType(LoopIndex).UnitType = getEnumerationValue(scheduleTypeLimitUnitTypes, Alphas(3)) + 1; + state.dataScheduleMgr->ScheduleType(LoopIndex).UnitType = getEnumValue(scheduleTypeLimitUnitTypes, Alphas(3)) + 1; if (state.dataScheduleMgr->ScheduleType(LoopIndex).UnitType == 0) { ShowWarningError( state, @@ -817,7 +817,7 @@ namespace ScheduleManager { // Depending on value of "Interpolate" field, the value for each time step in each hour gets processed: state.dataScheduleMgr->DaySchedule(Count).IntervalInterpolated = - static_cast(getEnumerationValue(interpolationTypesUC, Alphas(3))); + static_cast(getEnumValue(interpolationTypesUC, Alphas(3))); if (state.dataScheduleMgr->DaySchedule(Count).IntervalInterpolated == ScheduleInterpolation::Invalid) { ShowSevereError( state, @@ -2326,7 +2326,7 @@ namespace ScheduleManager { // IDD only allows Hourly or Timestep as valid values on the required field, anything else should be an error in the input processor OutputReportLevel reportLevel = - static_cast(getEnumerationValue(outputScheduleReportLevelNamesUC, Alphas(1))); // NOLINT(modernize-use-auto) + static_cast(getEnumValue(outputScheduleReportLevelNamesUC, Alphas(1))); // NOLINT(modernize-use-auto) if (reportLevel == OutputReportLevel::Invalid) { ShowWarningError(state, format("{}Report for Schedules should specify \"HOURLY\" or \"TIMESTEP\" (\"DETAILED\")", RoutineName)); ShowContinueError(state, "HOURLY report will be done"); diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 885ba97a6a7..c62868b275d 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -1677,8 +1677,8 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); // setup program flow control integers. - state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = static_cast(getEnumerationValue( - controlTypeNameUC, UtilityRoutines::MakeUPPERCase(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType))); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = static_cast(getEnumValue( + controlTypeNameUC, UtilityRoutines::makeUPPER(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType))); if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == CtrlVarType::Invalid) { // should not come here if idd type choice and key list is working ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -1872,7 +1872,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).MinSetTemp)); } - if (UtilityRoutines::MakeUPPERCase(cAlphaArgs(4)) == controlTypeNameUC[static_cast(CtrlVarType::MaxTemp)]) { + if (UtilityRoutines::makeUPPER(cAlphaArgs(4)) == controlTypeNameUC[static_cast(CtrlVarType::MaxTemp)]) { state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Strategy = SupplyFlowTempStrategy::MaxTemp; } else { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -1972,7 +1972,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).MinSetTemp)); } - if (UtilityRoutines::MakeUPPERCase(cAlphaArgs(4)) == controlTypeNameUC[static_cast(CtrlVarType::MinTemp)]) { + if (UtilityRoutines::makeUPPER(cAlphaArgs(4)) == controlTypeNameUC[static_cast(CtrlVarType::MinTemp)]) { state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Strategy = SupplyFlowTempStrategy::MinTemp; } else { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); @@ -2084,7 +2084,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) } state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Strategy = - static_cast(getEnumerationValue(strategyNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(4)))); + static_cast(getEnumValue(strategyNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); if (state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Strategy == ControlStrategy::Invalid) { ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); ShowContinueError(state, format("..invalid {}=\"{}\".", cAlphaFieldNames(4), cAlphaArgs(4))); @@ -3813,7 +3813,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) setpointManager.Name = cAlphaArgs(1); setpointManager.ctrlVarType = cAlphaArgs(2); - int typeNum = getEnumerationValue(SetPointManager::controlTypeNameUC, cAlphaArgs(2)); + int typeNum = getEnumValue(SetPointManager::controlTypeNameUC, cAlphaArgs(2)); setpointManager.CtrlTypeMode = static_cast(typeNum); if (setpointManager.CtrlTypeMode == SetPointManager::CtrlVarType::Invalid) { // should not come here if idd type choice and key list is working @@ -3935,7 +3935,7 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) setpointManager.Name = cAlphaArgs(1); setpointManager.ctrlVarType = cAlphaArgs(2); - int typeNum = getEnumerationValue(SetPointManager::controlTypeNameUC, cAlphaArgs(2)); + int typeNum = getEnumValue(SetPointManager::controlTypeNameUC, cAlphaArgs(2)); setpointManager.CtrlTypeMode = static_cast(typeNum); if (setpointManager.CtrlTypeMode == SetPointManager::CtrlVarType::Invalid) { // should not come here if idd type choice and key list is working diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index e30d78aea14..b863cfb80a1 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -1076,15 +1076,15 @@ namespace SimulationManager { state.dataInputProcessing->inputProcessor->markObjectAsUsed(CurrentModuleObject, thisObjectName); if (fields.find("use_coil_direct_solutions") != fields.end()) { state.dataGlobal->DoCoilDirectSolutions = - UtilityRoutines::MakeUPPERCase(fields.at("use_coil_direct_solutions").get()) == "YES"; + UtilityRoutines::makeUPPER(fields.at("use_coil_direct_solutions").get()) == "YES"; } if (fields.find("zone_radiant_exchange_algorithm") != fields.end()) { state.dataHeatBalIntRadExchg->CarrollMethod = - UtilityRoutines::MakeUPPERCase(fields.at("zone_radiant_exchange_algorithm").get()) == "CARROLLMRT"; + UtilityRoutines::makeUPPER(fields.at("zone_radiant_exchange_algorithm").get()) == "CARROLLMRT"; } if (fields.find("use_representative_surfaces_for_calculations") != fields.end()) { state.dataSurface->UseRepresentativeSurfaceCalculations = - UtilityRoutines::MakeUPPERCase(fields.at("use_representative_surfaces_for_calculations").get()) == "YES"; + UtilityRoutines::makeUPPER(fields.at("use_representative_surfaces_for_calculations").get()) == "YES"; } bool overrideTimestep(false); bool overrideZoneAirHeatBalAlg(false); @@ -1096,7 +1096,7 @@ namespace SimulationManager { bool overridePsychTsatFnPb(false); state.dataZoneTempPredictorCorrector->OscillationVariablesNeeded = true; if (fields.find("override_mode") != fields.end()) { - overrideModeValue = UtilityRoutines::MakeUPPERCase(fields.at("override_mode").get()); + overrideModeValue = UtilityRoutines::makeUPPER(fields.at("override_mode").get()); if (overrideModeValue == "NORMAL") { // no overrides } else if (overrideModeValue == "MODE01") { diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index f536dc4b2ad..8743c5d2bd5 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -2383,7 +2383,7 @@ void GetOARequirements(EnergyPlusData &state) auto const &objectFields = instance.value(); auto &thisOAReq = state.dataSize->OARequirements(oaIndex); ip->markObjectAsUsed(cCurrentModuleObject2, instance.key()); - std::string thisOAReqName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string thisOAReqName = UtilityRoutines::makeUPPER(instance.key()); if (UtilityRoutines::FindItemInList(thisOAReqName, state.dataSize->OARequirements) > 0) { ShowSevereError( @@ -2481,7 +2481,7 @@ void ProcessInputOARequirements(EnergyPlusData &state, if (NumAlphas > 1) { thisOARequirements.OAFlowMethod = - static_cast(getEnumerationValue(OAFlowCalcMethodNamesUC, UtilityRoutines::MakeUPPERCase(Alphas(2)))); + static_cast(getEnumValue(OAFlowCalcMethodNamesUC, UtilityRoutines::makeUPPER(Alphas(2)))); if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name)); ShowContinueError(state, format("...Invalid {}=\"{}\",", cAlphaFields(2), Alphas(2))); @@ -3399,10 +3399,10 @@ void GetZoneSizingInput(EnergyPlusData &state) constexpr static std::array(DataSizing::AirflowSizingMethod::Num)> AirflowSizingMethodNamesUC = { "DESIGNDAY", "FLOW/ZONE", "DESIGNDAYWITHLIMIT"}; state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod = static_cast( - getEnumerationValue(AirflowSizingMethodNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(5)))); + getEnumValue(AirflowSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod != AirflowSizingMethod::Invalid); state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod = static_cast( - getEnumerationValue(AirflowSizingMethodNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(6)))); + getEnumValue(AirflowSizingMethodNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod != AirflowSizingMethod::Invalid); BooleanSwitch accountForDOAS = getYesNoValue(state.dataIPShortCut->cAlphaArgs(8)); @@ -3412,7 +3412,7 @@ void GetZoneSizingInput(EnergyPlusData &state) constexpr static std::array(DataSizing::DOASControl::Num)> DOASControlNamesUC = { "NEUTRALSUPPLYAIR", "NEUTRALDEHUMIDIFIEDSUPPLYAIR", "COLDSUPPLYAIR"}; state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASControlStrategy = static_cast( - getEnumerationValue(DOASControlNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(9)))); + getEnumValue(DOASControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASLowSetpoint = state.dataIPShortCut->rNumericArgs(17); state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASHighSetpoint = state.dataIPShortCut->rNumericArgs(18); @@ -3424,7 +3424,7 @@ void GetZoneSizingInput(EnergyPlusData &state) } } zoneSizingIndex.zoneSizingMethod = static_cast( - getEnumerationValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (zoneSizingIndex.zoneSizingMethod != ZoneSizing::SensibleOnly) { zoneSizingIndex.zoneLatentSizing = true; state.dataHeatBal->DoLatentSizing = true; @@ -3703,7 +3703,7 @@ void GetSystemSizingInput(EnergyPlusData &state) constexpr std::array(DataSizing::LoadSizing::Num)> LoadSizingNamesUC{ "SENSIBLE", "LATENT", "TOTAL", "VENTILATIONREQUIREMENT"}; SysSizInput(SysSizIndex).loadSizingType = static_cast( - getEnumerationValue(LoadSizingNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum)))); + getEnumValue(LoadSizingNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum)))); // assign PeakLoad based on LoadSizing for now if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Sensible) { @@ -3717,7 +3717,7 @@ void GetSystemSizingInput(EnergyPlusData &state) // set the CoolCapControl input constexpr std::array(CapacityControl::Num)> CapacityControlNamesUC{"VAV", "BYPASS", "VT", "ONOFF"}; SysSizInput(SysSizIndex).CoolCapControl = static_cast( - getEnumerationValue(CapacityControlNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum)))); + getEnumValue(CapacityControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum)))); { std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum); @@ -4262,7 +4262,7 @@ void GetPlantSizingInput(EnergyPlusData &state) constexpr static std::array(DataSizing::TypeOfPlantLoop::Num)> TypeOfPlantLoopNamesUC = { "HEATING", "COOLING", "CONDENSER", "STEAM"}; state.dataSize->PlantSizData(PltSizIndex).LoopType = static_cast( - getEnumerationValue(TypeOfPlantLoopNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2)))); + getEnumValue(TypeOfPlantLoopNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); assert(state.dataSize->PlantSizData(PltSizIndex).LoopType != TypeOfPlantLoop::Invalid); if (NumAlphas > 2) { diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index 7e9233076a9..d38c027d8c8 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -237,7 +237,7 @@ namespace SolarCollectors { } std::string_view const key = state.dataIPShortCut->cAlphaArgs(3); - state.dataSolarCollectors->Parameters(ParametersNum).TestType = static_cast(getEnumerationValue(testTypesUC, key)); + state.dataSolarCollectors->Parameters(ParametersNum).TestType = static_cast(getEnumValue(testTypesUC, key)); if (state.dataSolarCollectors->Parameters(ParametersNum).TestType == TestTypeEnum::INVALID) { ShowSevereError(state, format("{} = {}: {} is not supported for {}", diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index 74ebb7d9870..bf72eaa1ff9 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -336,9 +336,9 @@ namespace SteamCoils { NodeInputManager::CompFluidStream::Primary, ObjectIsNotParent); - std::string controlMode = UtilityRoutines::MakeUPPERCase(AlphArray(7)); + std::string controlMode = UtilityRoutines::makeUPPER(AlphArray(7)); state.dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil = - static_cast(getEnumerationValue(coilControlTypeNames, controlMode)); + static_cast(getEnumValue(coilControlTypeNames, controlMode)); switch (state.dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil) { case CoilControlType::TemperatureSetPoint: state.dataSteamCoils->SteamCoil(CoilNum).TempSetPointNodeNum = GetOnlySingleNode(state, diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 7cd59afc8c3..7ff6f7325e1 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -8063,7 +8063,7 @@ namespace SurfaceGeometry { constexpr std::array(CalculationMethod::Num)> CalculationMethodUC = { "TOTALEXPOSEDPERIMETER", "EXPOSEDPERIMETERFRACTION", "BYSEGMENT"}; CalculationMethod calculationMethod = - static_cast(getEnumerationValue(CalculationMethodUC, state.dataIPShortCut->cAlphaArgs(alpF))); + static_cast(getEnumValue(CalculationMethodUC, state.dataIPShortCut->cAlphaArgs(alpF))); if (calculationMethod != CalculationMethod::TotalExposedPerimeter && calculationMethod != CalculationMethod::ExposedPerimeterFraction && calculationMethod != CalculationMethod::Bysegment) { ShowSevereError(state, @@ -8532,7 +8532,7 @@ namespace SurfaceGeometry { auto const &fields = instance.value(); std::string const &thisObjectName = instance.key(); GroundSurfacesProperty thisGndSurfsObj; - thisGndSurfsObj.Name = UtilityRoutines::MakeUPPERCase(thisObjectName); + thisGndSurfsObj.Name = UtilityRoutines::makeUPPER(thisObjectName); state.dataInputProcessing->inputProcessor->markObjectAsUsed(cCurrentModuleObject, thisObjectName); auto groundSurfaces = fields.find("ground_surfaces"); if (groundSurfaces != fields.end()) { @@ -8544,7 +8544,7 @@ namespace SurfaceGeometry { if (GndSurfName != groundSurface.end()) { std::string ground_surf_name = GndSurfName.value().get(); if (!ground_surf_name.empty()) { - thisGndSurf.Name = UtilityRoutines::MakeUPPERCase(ground_surf_name); + thisGndSurf.Name = UtilityRoutines::makeUPPER(ground_surf_name); } } auto groundSurfViewFactor = groundSurface.find("ground_surface_view_factor"); @@ -8557,7 +8557,7 @@ namespace SurfaceGeometry { std::string gnd_surf_TempSchName = TempSchName.value().get(); if (!gnd_surf_TempSchName.empty()) { thisGndSurf.TempSchPtr = - ScheduleManager::GetScheduleIndex(state, UtilityRoutines::MakeUPPERCase(gnd_surf_TempSchName)); + ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(gnd_surf_TempSchName)); } } auto ReflSchName = groundSurface.find("ground_surface_reflectance_schedule_name"); @@ -8565,7 +8565,7 @@ namespace SurfaceGeometry { std::string gnd_surf_ReflSchName = ReflSchName.value().get(); if (!gnd_surf_ReflSchName.empty()) { thisGndSurf.ReflSchPtr = - ScheduleManager::GetScheduleIndex(state, UtilityRoutines::MakeUPPERCase(gnd_surf_ReflSchName)); + ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(gnd_surf_ReflSchName)); } } thisGndSurfsObj.GndSurfs.push_back(thisGndSurf); @@ -10018,7 +10018,7 @@ namespace SurfaceGeometry { windowShadingControl.DaylightingControlName = state.dataIPShortCut->cAlphaArgs(12); windowShadingControl.multiSurfaceControl = static_cast( - getEnumerationValue(MultiSurfaceControlNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(13)))); + getEnumValue(MultiSurfaceControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(13)))); if (windowShadingControl.multiSurfaceControl == MultiSurfaceControl::Invalid) { windowShadingControl.multiSurfaceControl = MultiSurfaceControl::Sequential; @@ -10045,7 +10045,7 @@ namespace SurfaceGeometry { } windowShadingControl.shadingControlType = static_cast( - getEnumerationValue(WindowShadingControlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(5)))); + getEnumValue(WindowShadingControlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); if (windowShadingControl.ShadingDevice > 0) { if (state.dataMaterial->Material(windowShadingControl.ShadingDevice)->group == Material::Group::Screen && @@ -10138,7 +10138,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->cAlphaFieldNames(5))); } windowShadingControl.slatAngleControl = static_cast( - getEnumerationValue(SlatAngleNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(10)))); + getEnumValue(SlatAngleNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); // For upward compatibility change old "noninsulating" and "insulating" shade types to // INTERIORSHADE or EXTERIORSHADE @@ -10955,10 +10955,10 @@ namespace SurfaceGeometry { if (SurfNum > 0) { state.dataSurface->AirflowWindows = true; state.dataSurface->SurfWinAirflowSource(SurfNum) = - static_cast(getEnumerationValue(WindowAirFlowSourceNamesUC, state.dataIPShortCut->cAlphaArgs(2))); + static_cast(getEnumValue(WindowAirFlowSourceNamesUC, state.dataIPShortCut->cAlphaArgs(2))); state.dataSurface->SurfWinAirflowDestination(SurfNum) = - static_cast(getEnumerationValue(WindowAirFlowDestinationNamesUC, state.dataIPShortCut->cAlphaArgs(3))); + static_cast(getEnumValue(WindowAirFlowDestinationNamesUC, state.dataIPShortCut->cAlphaArgs(3))); if (state.dataSurface->SurfWinAirflowDestination(SurfNum) == WindowAirFlowDestination::Return) { int controlledZoneNum = DataZoneEquipment::GetControlledZoneIndex(state, state.dataSurface->Surface(SurfNum).ZoneName); @@ -12176,7 +12176,7 @@ namespace SurfaceGeometry { auto *thisMaterial = state.dataMaterial->Material(MaterNum); SchNum = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(4)); InsulationType insulationType = - static_cast(getEnumerationValue(insulationTypeNamesUC, state.dataIPShortCut->cAlphaArgs(1))); + static_cast(getEnumValue(insulationTypeNamesUC, state.dataIPShortCut->cAlphaArgs(1))); if (insulationType == InsulationType::Invalid) { ShowSevereError(state, format("{}, {}=\"{}\", invalid data.", diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index f99d8f850e5..cc49cbc0544 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -606,13 +606,13 @@ namespace SystemAvailabilityManager { } nightCycleMgr.nightCycleControlType = static_cast( - getEnumerationValue(NightCycleControlTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(4)))); + getEnumValue(NightCycleControlTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); assert(nightCycleMgr.nightCycleControlType != NightCycleControlType::Invalid); // Cycling Run Time Control Type nightCycleMgr.cyclingRunTimeControl = static_cast( - getEnumerationValue(CyclingRunTimeControlNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(5)))); + getEnumValue(CyclingRunTimeControlNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(5)))); assert(nightCycleMgr.cyclingRunTimeControl != CyclingRunTimeControl::Invalid); @@ -809,7 +809,7 @@ namespace SystemAvailabilityManager { optimumStartMgr.MaxOptStartTime = rNumericArgs(1); optimumStartMgr.optimumStartControlType = static_cast( - getEnumerationValue(OptimumStartControlTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(4)))); + getEnumValue(OptimumStartControlTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); if (optimumStartMgr.optimumStartControlType == OptimumStartControlType::Invalid) { optimumStartMgr.optimumStartControlType = OptimumStartControlType::ControlZone; @@ -848,7 +848,7 @@ namespace SystemAvailabilityManager { } optimumStartMgr.controlAlgorithm = - static_cast(getEnumerationValue(ControlAlgorithmNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(7)))); + static_cast(getEnumValue(ControlAlgorithmNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(7)))); assert(optimumStartMgr.controlAlgorithm != ControlAlgorithm::Invalid); @@ -1319,7 +1319,7 @@ namespace SystemAvailabilityManager { for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { ++Item; auto const &objectFields = instance.value(); - std::string const thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const thisObjectName = UtilityRoutines::makeUPPER(instance.key()); ip->markObjectAsUsed(cCurrentModuleObject, instance.key()); auto &mgrList = state.dataSystemAvailabilityManager->ListData(Item); mgrList.Name = thisObjectName; @@ -1345,7 +1345,7 @@ namespace SystemAvailabilityManager { std::string availManagerObjType = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "availability_manager_object_type"); mgrList.AvailManagerType(listItem) = static_cast( - getEnumerationValue(SystemAvailabilityTypeNamesUC, UtilityRoutines::MakeUPPERCase(availManagerObjType))); + getEnumValue(SystemAvailabilityTypeNamesUC, UtilityRoutines::makeUPPER(availManagerObjType))); if (mgrList.AvailManagerType(listItem) == DataPlant::SystemAvailabilityType::HybridVent) mgrList.AvailManagerType(listItem) = DataPlant::SystemAvailabilityType::Invalid; // these are validated individually in the GetPlant, GetSystem and GetZoneEq lists diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index 32fd4cee9e7..864ef7f2b54 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -2220,7 +2220,7 @@ void CreateEnergyReportStructure(EnergyPlusData &state) for (BranchNum = 1; BranchNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).NumBranches; ++BranchNum) { for (CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { DataLoopNode::ConnectionObjectType TypeOfComp = static_cast( - EnergyPlus::getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, + EnergyPlus::getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf)); std::string &NameOfComp = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name; // Get complete list of components for complex branches @@ -2278,7 +2278,7 @@ void CreateEnergyReportStructure(EnergyPlusData &state) // check for 'grandchildren' for (SubCompNum = 1; SubCompNum <= NumChildren; ++SubCompNum) { DataLoopNode::ConnectionObjectType TypeOfSubComp = - static_cast(EnergyPlus::getEnumerationValue( + static_cast(EnergyPlus::getEnumValue( BranchNodeConnections::ConnectionObjectTypeNamesUC, state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).SubComp(SubCompNum).TypeOf)); std::string &NameOfSubComp = @@ -2571,7 +2571,7 @@ void CreateEnergyReportStructure(EnergyPlusData &state) std::string &TypeOfComp = state.dataZoneEquip->ZoneEquipList(CtrlZoneNum).EquipType(CompNum); std::string &NameOfComp = state.dataZoneEquip->ZoneEquipList(CtrlZoneNum).EquipName(CompNum); DataLoopNode::ConnectionObjectType TypeOfCompNum = static_cast( - EnergyPlus::getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfComp)); + EnergyPlus::getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfComp)); BranchNodeConnections::GetComponentData(state, TypeOfCompNum, NameOfComp, @@ -2711,7 +2711,7 @@ void CreateEnergyReportStructure(EnergyPlusData &state) std::string &TypeOfSubComp = thisEquipData.SubEquipData(SubCompNum).TypeOf; std::string &NameOfSubComp = thisEquipData.SubEquipData(SubCompNum).Name; DataLoopNode::ConnectionObjectType TypeOfSubCompNum = static_cast( - EnergyPlus::getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfSubComp)); + EnergyPlus::getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfSubComp)); if (BranchNodeConnections::IsParentObject(state, TypeOfSubCompNum, NameOfSubComp)) { NumGrandChildren = BranchNodeConnections::GetNumChildren(state, TypeOfSubCompNum, NameOfSubComp); thisEquipData.SubEquipData(SubCompNum).NumSubSubEquip = NumGrandChildren; @@ -2935,7 +2935,7 @@ void CreateEnergyReportStructure(EnergyPlusData &state) std::string &TypeOfComp = thisComp.TypeOf; std::string &NameOfComp = thisComp.Name; DataLoopNode::ConnectionObjectType TypeOfCompNum = static_cast( - EnergyPlus::getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfComp)); + EnergyPlus::getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfComp)); // Get complete list of components for complex branches if (BranchNodeConnections::IsParentObject(state, TypeOfCompNum, NameOfComp)) { @@ -2988,7 +2988,7 @@ void CreateEnergyReportStructure(EnergyPlusData &state) std::string &TypeOfSubComp = thisComp.SubComp(SubCompNum).TypeOf; std::string NameOfSubComp = thisComp.SubComp(SubCompNum).Name; DataLoopNode::ConnectionObjectType TypeOfSubCompNum = static_cast( - EnergyPlus::getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfSubComp)); + EnergyPlus::getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfSubComp)); if (BranchNodeConnections::IsParentObject(state, TypeOfSubCompNum, NameOfSubComp)) { NumGrandChildren = BranchNodeConnections::GetNumChildren(state, TypeOfSubCompNum, NameOfSubComp); SubCompTypes.allocate(NumGrandChildren); diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index 4c0769c36e9..c71e222eb32 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -2539,7 +2539,7 @@ namespace ThermalComfort { testCooling = (state.dataHeatBalFanSys->TempControlType(iZone) != DataHVACGlobals::ThermostatType::SingleHeating); if (testHeating && (SensibleLoadPredictedNoAdj > 0)) { // heating - if (state.dataRoomAirMod->AirModel(iZone).AirModelType != DataRoomAirModel::RoomAirModel::Mixing) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != DataRoomAirModel::RoomAirModel::Mixing) { deltaT = state.dataHeatBalFanSys->TempTstatAir(iZone) - state.dataHeatBalFanSys->ZoneThermostatSetPointLo(iZone); } else { if (state.dataZoneTempPredictorCorrector->NumOnOffCtrZone > 0) { @@ -2565,7 +2565,7 @@ namespace ThermalComfort { } } } else if (testCooling && (SensibleLoadPredictedNoAdj < 0)) { // cooling - if (state.dataRoomAirMod->AirModel(iZone).AirModelType != DataRoomAirModel::RoomAirModel::Mixing) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != DataRoomAirModel::RoomAirModel::Mixing) { deltaT = state.dataHeatBalFanSys->TempTstatAir(iZone) - state.dataHeatBalFanSys->ZoneThermostatSetPointHi(iZone); } else { if (state.dataZoneTempPredictorCorrector->NumOnOffCtrZone > 0) { diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 349c2e454ae..488121df0a8 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -469,7 +469,7 @@ namespace UnitHeater { // Heating coil information: { state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type = - static_cast(getEnumerationValue(HCoilTypeNamesUC, UtilityRoutines::MakeUPPERCase(Alphas(7)))); + static_cast(getEnumValue(HCoilTypeNamesUC, UtilityRoutines::makeUPPER(Alphas(7)))); switch (state.dataUnitHeaters->UnitHeat(UnitHeatNum).Type) { case HCoilType::WaterHeatingCoil: state.dataUnitHeaters->UnitHeat(UnitHeatNum).HeatingCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index c19ecbb6840..6bcc0237f6d 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -306,7 +306,7 @@ namespace UnitVentilator { cHeatingCoilType = ""; { - unitVent.OAControlType = (OAControl)getEnumerationValue(OAControlNamesUC, Alphas(3)); + unitVent.OAControlType = (OAControl)getEnumValue(OAControlNamesUC, Alphas(3)); switch (unitVent.OAControlType) { case OAControl::VariablePercent: case OAControl::FixedAmount: { @@ -590,7 +590,7 @@ namespace UnitVentilator { } } - unitVent.CoilOption = (CoilsUsed)getEnumerationValue(CoilsUsedNamesUC, Alphas(13)); + unitVent.CoilOption = (CoilsUsed)getEnumValue(CoilsUsedNamesUC, Alphas(13)); unitVent.FanSchedPtr = ScheduleManager::GetScheduleIndex(state, Alphas(14)); // Default to cycling fan when fan mode schedule is not present @@ -624,8 +624,8 @@ namespace UnitVentilator { unitVent.HCoilPresent = true; cHeatingCoilType = Alphas(15); unitVent.HCoilTypeCh = cHeatingCoilType; - unitVent.HCoilType = (HeatCoilType)getEnumerationValue(HeatCoilTypeNamesUC, cHeatingCoilType); - unitVent.HeatingCoilType = (DataPlant::PlantEquipmentType)getEnumerationValue(DataPlant::PlantEquipTypeNamesUC, cHeatingCoilType); + unitVent.HCoilType = (HeatCoilType)getEnumValue(HeatCoilTypeNamesUC, cHeatingCoilType); + unitVent.HeatingCoilType = (DataPlant::PlantEquipmentType)getEnumValue(DataPlant::PlantEquipTypeNamesUC, cHeatingCoilType); unitVent.HCoilName = Alphas(16); ValidateComponent(state, cHeatingCoilType, unitVent.HCoilName, IsNotOK, CurrentModuleObject); @@ -673,8 +673,8 @@ namespace UnitVentilator { cCoolingCoilType = Alphas(17); unitVent.CCoilTypeCh = cCoolingCoilType; - unitVent.CCoilType = (CoolCoilType)getEnumerationValue(CoolCoilTypeNamesUC, cCoolingCoilType); - unitVent.CoolingCoilType = (DataPlant::PlantEquipmentType)getEnumerationValue(DataPlant::PlantEquipTypeNamesUC, cCoolingCoilType); + unitVent.CCoilType = (CoolCoilType)getEnumValue(CoolCoilTypeNamesUC, cCoolingCoilType); + unitVent.CoolingCoilType = (DataPlant::PlantEquipmentType)getEnumValue(DataPlant::PlantEquipTypeNamesUC, cCoolingCoilType); unitVent.CCoilPlantName = Alphas(18); if (cCoolingCoilType == "COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED") { diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index d53e94c0f73..96b01efb10a 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -260,14 +260,14 @@ namespace UnitarySystems { std::string const &thisObjectName = instance.key(); DesignSpecMSHP thisDesignSpec; - thisDesignSpec.name = UtilityRoutines::MakeUPPERCase(thisObjectName); + thisDesignSpec.name = UtilityRoutines::makeUPPER(thisObjectName); thisDesignSpec.numOfSpeedHeating = fields.at("number_of_speeds_for_heating").get(); // required field thisDesignSpec.numOfSpeedCooling = fields.at("number_of_speeds_for_cooling").get(); // required field int maxSpeeds = max(thisDesignSpec.numOfSpeedHeating, thisDesignSpec.numOfSpeedCooling); thisDesignSpec.m_DesignSpecMSHPType_Num = 1; // add global int value for factory if (fields.find("single_mode_operation") != fields.end()) { // not required field - std::string loc_m_SingleModeOp = UtilityRoutines::MakeUPPERCase(fields.at("single_mode_operation").get()); + std::string loc_m_SingleModeOp = UtilityRoutines::makeUPPER(fields.at("single_mode_operation").get()); if (UtilityRoutines::SameString(loc_m_SingleModeOp, "Yes")) thisDesignSpec.m_SingleModeFlag = true; } @@ -2166,7 +2166,7 @@ namespace UnitarySystems { state, this->m_CoolingCoilName, FirstHVACIteration, this->m_CoolingCoilIndex, QActual, this->m_FanOpMode, 1.0); EqSizing.DesCoolingLoad = WaterCoils::GetWaterCoilCapacity( state, - UtilityRoutines::MakeUPPERCase(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), + UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), this->m_CoolingCoilName, ErrFound); } @@ -2183,7 +2183,7 @@ namespace UnitarySystems { state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex, QActual, this->m_FanOpMode, 1.0); EqSizing.DesHeatingLoad = WaterCoils::GetWaterCoilCapacity( state, - UtilityRoutines::MakeUPPERCase(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), + UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), this->m_HeatingCoilName, ErrFound); } @@ -3025,7 +3025,7 @@ namespace UnitarySystems { state, this->m_CoolingCoilName, FirstHVACIteration, this->m_CoolingCoilIndex, QActual, this->m_FanOpMode, 1.0); state.dataSize->DataConstantUsedForSizing = WaterCoils::GetWaterCoilCapacity(state, - UtilityRoutines::MakeUPPERCase(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), + UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), this->m_CoolingCoilName, ErrFound); EqSizing.DesCoolingLoad = state.dataSize->DataConstantUsedForSizing; @@ -3040,7 +3040,7 @@ namespace UnitarySystems { HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil( state, blankString, true, DataHVACGlobals::CompressorOperation::On, 1.0, this->m_CoolingCoilIndex, 1, false, 1.0, false); state.dataSize->DataConstantUsedForSizing = WaterCoils::GetWaterCoilCapacity( - state, UtilityRoutines::MakeUPPERCase(DataHVACGlobals::cAllCoilTypes(ActualCoolCoilType)), HXCoilName, ErrFound); + state, UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(ActualCoolCoilType)), HXCoilName, ErrFound); EqSizing.DesCoolingLoad = state.dataSize->DataConstantUsedForSizing; state.dataSize->DataFractionUsedForSizing = 1.0; SizingMethod = DataHVACGlobals::AutoCalculateSizing; @@ -3123,7 +3123,7 @@ namespace UnitarySystems { state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex, QActual, this->m_FanOpMode, 1.0); state.dataSize->DataConstantUsedForSizing = WaterCoils::GetWaterCoilCapacity(state, - UtilityRoutines::MakeUPPERCase(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), + UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), this->m_HeatingCoilName, ErrFound); EqSizing.DesHeatingLoad = state.dataSize->DataConstantUsedForSizing; @@ -3421,9 +3421,9 @@ namespace UnitarySystems { std::string const &cCurrentModuleObject = input_data.system_type; DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::MakeUPPERCase(input_data.system_type))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(input_data.system_type))); std::string const &thisObjectName = input_data.name; - this->Name = UtilityRoutines::MakeUPPERCase(thisObjectName); + this->Name = UtilityRoutines::makeUPPER(thisObjectName); sysNum = getUnitarySystemIndex(state, thisObjectName); this->m_UnitarySysNum = sysNum; @@ -3624,7 +3624,7 @@ namespace UnitarySystems { constexpr static std::array(UnitarySysCtrlType::Num)> UnitarySysCtrlTypeNamesUC = { "NONE", "LOAD", "SETPOINT", "SINGLEZONEVAV"}; this->m_ControlType = - static_cast(getEnumerationValue(UnitarySysCtrlTypeNamesUC, UtilityRoutines::MakeUPPERCase(input_data.control_type))); + static_cast(getEnumValue(UnitarySysCtrlTypeNamesUC, UtilityRoutines::makeUPPER(input_data.control_type))); if (this->m_ControlType == UnitarySysCtrlType::CCMASHRAE) { this->m_ValidASHRAECoolCoil = true; this->m_ValidASHRAEHeatCoil = true; @@ -4045,7 +4045,7 @@ namespace UnitarySystems { if (!ZoneEquipment) BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, - UtilityRoutines::MakeUPPERCase(thisObjectName), + UtilityRoutines::makeUPPER(thisObjectName), input_data.air_inlet_node_name, input_data.air_outlet_node_name, "Air Nodes"); @@ -4139,7 +4139,7 @@ namespace UnitarySystems { } constexpr static std::array(FanPlace::Num)> FanPlaceNamesUC = {"NOTYETSET", "BLOWTHROUGH", "DRAWTHROUGH"}; - this->m_FanPlace = static_cast(getEnumerationValue(FanPlaceNamesUC, UtilityRoutines::MakeUPPERCase(input_data.fan_placement))); + this->m_FanPlace = static_cast(getEnumValue(FanPlaceNamesUC, UtilityRoutines::makeUPPER(input_data.fan_placement))); if ((this->m_FanPlace == FanPlace::NotYetSet || this->m_FanPlace == FanPlace::Invalid) && this->m_FanExists) { ShowSevereError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); ShowContinueError(state, format("Illegal Fan Placement = {}", input_data.fan_placement)); @@ -6876,7 +6876,7 @@ namespace UnitarySystems { int numCoilSystemDX = 0; for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { - std::string const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); // only get the current data once all data has been read in and vector unitarySys has been initialized // when UnitarySystems::getInputOnceFlag is true read all unitary systems, otherwise read just the curren object @@ -6898,38 +6898,38 @@ namespace UnitarySystems { thisSys.input_specs.system_type = cCurrentModuleObject; if (fields.find("availability_schedule_name") != fields.end()) { // not required field thisSys.input_specs.availability_schedule_name = - UtilityRoutines::MakeUPPERCase(fields.at("availability_schedule_name").get()); + UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); } thisSys.input_specs.air_inlet_node_name = - UtilityRoutines::MakeUPPERCase(fields.at("dx_cooling_coil_system_inlet_node_name").get()); // required field + UtilityRoutines::makeUPPER(fields.at("dx_cooling_coil_system_inlet_node_name").get()); // required field thisSys.input_specs.air_outlet_node_name = - UtilityRoutines::MakeUPPERCase(fields.at("dx_cooling_coil_system_outlet_node_name").get()); // required field + UtilityRoutines::makeUPPER(fields.at("dx_cooling_coil_system_outlet_node_name").get()); // required field thisSys.input_specs.dx_cooling_coil_system_sensor_node_name = - UtilityRoutines::MakeUPPERCase(fields.at("dx_cooling_coil_system_sensor_node_name").get()); // required field + UtilityRoutines::makeUPPER(fields.at("dx_cooling_coil_system_sensor_node_name").get()); // required field thisSys.input_specs.cooling_coil_object_type = - UtilityRoutines::MakeUPPERCase(fields.at("cooling_coil_object_type").get()); // required field + UtilityRoutines::makeUPPER(fields.at("cooling_coil_object_type").get()); // required field thisSys.input_specs.cooling_coil_name = - UtilityRoutines::MakeUPPERCase(fields.at("cooling_coil_name").get()); // required field + UtilityRoutines::makeUPPER(fields.at("cooling_coil_name").get()); // required field // min-fields = 7, begin optional inputs if (fields.find("dehumidification_control_type") != fields.end()) { // not required field thisSys.input_specs.dehumidification_control_type = - UtilityRoutines::MakeUPPERCase(fields.at("dehumidification_control_type").get()); + UtilityRoutines::makeUPPER(fields.at("dehumidification_control_type").get()); } else { // find default value thisSys.input_specs.dehumidification_control_type = "None"; } std::string loc_RunOnSensLoad(""); if (fields.find("run_on_sensible_load") != fields.end()) { // not required field - loc_RunOnSensLoad = UtilityRoutines::MakeUPPERCase(fields.at("run_on_sensible_load").get()); + loc_RunOnSensLoad = UtilityRoutines::makeUPPER(fields.at("run_on_sensible_load").get()); } else { // find default value loc_RunOnSensLoad = "YES"; } std::string loc_RunOnLatLoad(""); if (fields.find("run_on_latent_load") != fields.end()) { // not required field - loc_RunOnLatLoad = UtilityRoutines::MakeUPPERCase(fields.at("run_on_latent_load").get()); + loc_RunOnLatLoad = UtilityRoutines::makeUPPER(fields.at("run_on_latent_load").get()); } else { // find default value loc_RunOnLatLoad = "NO"; @@ -6945,7 +6945,7 @@ namespace UnitarySystems { if (fields.find("use_outdoor_air_dx_cooling_coil") != fields.end()) { // not required field thisSys.input_specs.use_doas_dx_cooling_coil = - UtilityRoutines::MakeUPPERCase(fields.at("use_outdoor_air_dx_cooling_coil").get()); + UtilityRoutines::makeUPPER(fields.at("use_outdoor_air_dx_cooling_coil").get()); } else { // find default value thisSys.input_specs.use_doas_dx_cooling_coil = "NO"; @@ -7007,7 +7007,7 @@ namespace UnitarySystems { auto const &objectSchemaProps = ip->getObjectSchemaProps(state, cCurrentModuleObject); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { - std::string const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); // only get the current data once all data has been read in and vector unitarySys has been initialized // when UnitarySystems::getInputOnceFlag is true read all unitary systems, otherwise read just the curren object @@ -7168,7 +7168,7 @@ namespace UnitarySystems { for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &fields = instance.value(); - std::string const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); if (!UtilityRoutines::SameString(CoilSysName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; @@ -7185,21 +7185,21 @@ namespace UnitarySystems { thisSys.input_specs.name = thisObjectName; thisSys.input_specs.system_type = cCurrentModuleObject; thisSys.input_specs.control_type = "Setpoint"; - thisSys.input_specs.air_inlet_node_name = UtilityRoutines::MakeUPPERCase(fields.at("air_inlet_node_name").get()); - thisSys.input_specs.air_outlet_node_name = UtilityRoutines::MakeUPPERCase(fields.at("air_outlet_node_name").get()); + thisSys.input_specs.air_inlet_node_name = UtilityRoutines::makeUPPER(fields.at("air_inlet_node_name").get()); + thisSys.input_specs.air_outlet_node_name = UtilityRoutines::makeUPPER(fields.at("air_outlet_node_name").get()); std::string availScheduleName(""); if (fields.find("availability_schedule_name") != fields.end()) { // not required field, has default value of Always On - availScheduleName = UtilityRoutines::MakeUPPERCase(fields.at("availability_schedule_name").get()); + availScheduleName = UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); } thisSys.input_specs.availability_schedule_name = availScheduleName; thisSys.input_specs.cooling_coil_object_type = - UtilityRoutines::MakeUPPERCase(fields.at("cooling_coil_object_type").get()); - thisSys.input_specs.cooling_coil_name = UtilityRoutines::MakeUPPERCase(fields.at("cooling_coil_name").get()); + UtilityRoutines::makeUPPER(fields.at("cooling_coil_object_type").get()); + thisSys.input_specs.cooling_coil_name = UtilityRoutines::makeUPPER(fields.at("cooling_coil_name").get()); // why is this cooling coil does not have a field for Design Air Vol Flow Rate // set it "SupplyAirFlowRate" to avoid blank, which lead to fatal out during get input static constexpr std::string_view loc_cooling_coil_object_type("COIL:COOLING:WATER:DETAILEDGEOMETRY"); if (UtilityRoutines::SameString(loc_cooling_coil_object_type, thisSys.input_specs.cooling_coil_object_type)) { - thisSys.input_specs.cooling_supply_air_flow_rate_method = UtilityRoutines::MakeUPPERCase("SupplyAirFlowRate"); + thisSys.input_specs.cooling_supply_air_flow_rate_method = UtilityRoutines::makeUPPER("SupplyAirFlowRate"); thisSys.input_specs.cooling_supply_air_flow_rate = DataSizing::AutoSize; } // optional input fields @@ -7208,7 +7208,7 @@ namespace UnitarySystems { } if (fields.find("dehumidification_control_type") != fields.end()) { thisSys.input_specs.dehumidification_control_type = - UtilityRoutines::MakeUPPERCase(fields.at("dehumidification_control_type").get()); + UtilityRoutines::makeUPPER(fields.at("dehumidification_control_type").get()); } else { thisSys.input_specs.dehumidification_control_type = "None"; } @@ -7254,7 +7254,7 @@ namespace UnitarySystems { } std::string HRWaterCoolingCoilName; if (fields.find("companion_coil_used_for_heat_recovery") != fields.end()) { - HRWaterCoolingCoilName = UtilityRoutines::MakeUPPERCase(fields.at("companion_coil_used_for_heat_recovery").get()); + HRWaterCoolingCoilName = UtilityRoutines::makeUPPER(fields.at("companion_coil_used_for_heat_recovery").get()); thisSys.m_WaterHRPlantLoopModel = true; } if (thisSys.m_WaterHRPlantLoopModel) { @@ -7264,7 +7264,7 @@ namespace UnitarySystems { thisSys.m_HRcoolCoilFluidInletNode = WaterCoils::GetCoilWaterInletNode(state, HRcoolingCoilType, HRWaterCoolingCoilName, errFound); int HRCoilIndex = - WaterCoils::GetWaterCoilIndex(state, UtilityRoutines::MakeUPPERCase(HRcoolingCoilType), HRWaterCoolingCoilName, errFound); + WaterCoils::GetWaterCoilIndex(state, UtilityRoutines::makeUPPER(HRcoolingCoilType), HRWaterCoolingCoilName, errFound); bool heatRecoveryCoil = true; // use local here to highlight where this parameter is set WaterCoils::SetWaterCoilData(state, HRCoilIndex, errFound, _, _, heatRecoveryCoil); if (errFound) { @@ -7316,7 +7316,7 @@ namespace UnitarySystems { auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { - std::string const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); // only get the current data once all data has been read in and vector unitarySys has been initialized // when UnitarySystems::getInputOnceFlag is true read all unitary systems, otherwise read just the curren object if (!UtilityRoutines::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) continue; @@ -7341,59 +7341,59 @@ namespace UnitarySystems { thisSys.input_specs.control_type = fields.at("control_type").get(); if (fields.find("controlling_zone_or_thermostat_location") != fields.end()) { // not required field thisSys.input_specs.controlling_zone_or_thermostat_location = - UtilityRoutines::MakeUPPERCase(fields.at("controlling_zone_or_thermostat_location").get()); + UtilityRoutines::makeUPPER(fields.at("controlling_zone_or_thermostat_location").get()); } if (fields.find("dehumidification_control_type") != fields.end()) { // not required field, has default thisSys.input_specs.dehumidification_control_type = - UtilityRoutines::MakeUPPERCase(fields.at("dehumidification_control_type").get()); + UtilityRoutines::makeUPPER(fields.at("dehumidification_control_type").get()); } else { thisSys.input_specs.dehumidification_control_type = "NONE"; // default value } if (fields.find("availability_schedule_name") != fields.end()) { // not required field thisSys.input_specs.availability_schedule_name = - UtilityRoutines::MakeUPPERCase(fields.at("availability_schedule_name").get()); + UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); } thisSys.input_specs.air_inlet_node_name = - UtilityRoutines::MakeUPPERCase(fields.at("air_inlet_node_name").get()); // required + UtilityRoutines::makeUPPER(fields.at("air_inlet_node_name").get()); // required thisSys.input_specs.air_outlet_node_name = - UtilityRoutines::MakeUPPERCase(fields.at("air_outlet_node_name").get()); // required + UtilityRoutines::makeUPPER(fields.at("air_outlet_node_name").get()); // required if (fields.find("supply_fan_object_type") != fields.end()) { // not required field thisSys.input_specs.supply_fan_object_type = - UtilityRoutines::MakeUPPERCase(fields.at("supply_fan_object_type").get()); + UtilityRoutines::makeUPPER(fields.at("supply_fan_object_type").get()); } if (fields.find("supply_fan_name") != fields.end()) { // not required field - thisSys.input_specs.supply_fan_name = UtilityRoutines::MakeUPPERCase(fields.at("supply_fan_name").get()); + thisSys.input_specs.supply_fan_name = UtilityRoutines::makeUPPER(fields.at("supply_fan_name").get()); } if (fields.find("fan_placement") != fields.end()) { // not required field - thisSys.input_specs.fan_placement = UtilityRoutines::MakeUPPERCase(fields.at("fan_placement").get()); + thisSys.input_specs.fan_placement = UtilityRoutines::makeUPPER(fields.at("fan_placement").get()); } if (fields.find("supply_air_fan_operating_mode_schedule_name") != fields.end()) { // not required field thisSys.input_specs.supply_air_fan_operating_mode_schedule_name = - UtilityRoutines::MakeUPPERCase(fields.at("supply_air_fan_operating_mode_schedule_name").get()); + UtilityRoutines::makeUPPER(fields.at("supply_air_fan_operating_mode_schedule_name").get()); } if (fields.find("heating_coil_object_type") != fields.end()) { // not required field thisSys.input_specs.heating_coil_object_type = - UtilityRoutines::MakeUPPERCase(fields.at("heating_coil_object_type").get()); + UtilityRoutines::makeUPPER(fields.at("heating_coil_object_type").get()); thisSys.m_HeatCoilExists = true; } if (fields.find("heating_coil_name") != fields.end()) { // not required field - thisSys.input_specs.heating_coil_name = UtilityRoutines::MakeUPPERCase(fields.at("heating_coil_name").get()); + thisSys.input_specs.heating_coil_name = UtilityRoutines::makeUPPER(fields.at("heating_coil_name").get()); } if (fields.find("dx_heating_coil_sizing_ratio") != fields.end()) { // not required field, has default thisSys.input_specs.dx_heating_coil_sizing_ratio = fields.at("dx_heating_coil_sizing_ratio").get(); } if (fields.find("cooling_coil_object_type") != fields.end()) { // not required field thisSys.input_specs.cooling_coil_object_type = - UtilityRoutines::MakeUPPERCase(fields.at("cooling_coil_object_type").get()); + UtilityRoutines::makeUPPER(fields.at("cooling_coil_object_type").get()); thisSys.m_CoolCoilExists = true; } if (fields.find("cooling_coil_name") != fields.end()) { // not required field - thisSys.input_specs.cooling_coil_name = UtilityRoutines::MakeUPPERCase(fields.at("cooling_coil_name").get()); + thisSys.input_specs.cooling_coil_name = UtilityRoutines::makeUPPER(fields.at("cooling_coil_name").get()); } if (fields.find("use_doas_dx_cooling_coil") != fields.end()) { // not required field, has default thisSys.input_specs.use_doas_dx_cooling_coil = - UtilityRoutines::MakeUPPERCase(fields.at("use_doas_dx_cooling_coil").get()); + UtilityRoutines::makeUPPER(fields.at("use_doas_dx_cooling_coil").get()); } else { thisSys.input_specs.use_doas_dx_cooling_coil = "No"; } @@ -7406,21 +7406,21 @@ namespace UnitarySystems { } } if (fields.find("latent_load_control") != fields.end()) { // not required field, has default - thisSys.input_specs.latent_load_control = UtilityRoutines::MakeUPPERCase(fields.at("latent_load_control").get()); + thisSys.input_specs.latent_load_control = UtilityRoutines::makeUPPER(fields.at("latent_load_control").get()); } else { thisSys.input_specs.latent_load_control = "SensibleOnlyLoadControl"; } if (fields.find("supplemental_heating_coil_object_type") != fields.end()) { // not required field thisSys.input_specs.supplemental_heating_coil_object_type = - UtilityRoutines::MakeUPPERCase(fields.at("supplemental_heating_coil_object_type").get()); + UtilityRoutines::makeUPPER(fields.at("supplemental_heating_coil_object_type").get()); } if (fields.find("supplemental_heating_coil_name") != fields.end()) { // not required field thisSys.input_specs.supplemental_heating_coil_name = - UtilityRoutines::MakeUPPERCase(fields.at("supplemental_heating_coil_name").get()); + UtilityRoutines::makeUPPER(fields.at("supplemental_heating_coil_name").get()); } if (fields.find("cooling_supply_air_flow_rate_method") != fields.end()) { // not required field thisSys.input_specs.cooling_supply_air_flow_rate_method = - UtilityRoutines::MakeUPPERCase(fields.at("cooling_supply_air_flow_rate_method").get()); + UtilityRoutines::makeUPPER(fields.at("cooling_supply_air_flow_rate_method").get()); } if (fields.find("cooling_supply_air_flow_rate") != fields.end()) { // not required field, autosizable auto const &tempFieldVal = fields.at("cooling_supply_air_flow_rate"); @@ -7444,7 +7444,7 @@ namespace UnitarySystems { } if (fields.find("heating_supply_air_flow_rate_method") != fields.end()) { // not required field thisSys.input_specs.heating_supply_air_flow_rate_method = - UtilityRoutines::MakeUPPERCase(fields.at("heating_supply_air_flow_rate_method").get()); + UtilityRoutines::makeUPPER(fields.at("heating_supply_air_flow_rate_method").get()); } if (fields.find("heating_supply_air_flow_rate") != fields.end()) { // not required field auto const &tempFieldVal = fields.at("heating_supply_air_flow_rate"); @@ -7468,7 +7468,7 @@ namespace UnitarySystems { } if (fields.find("no_load_supply_air_flow_rate_method") != fields.end()) { // not required field thisSys.input_specs.no_load_supply_air_flow_rate_method = - UtilityRoutines::MakeUPPERCase(fields.at("no_load_supply_air_flow_rate_method").get()); + UtilityRoutines::makeUPPER(fields.at("no_load_supply_air_flow_rate_method").get()); } if (fields.find("no_load_supply_air_flow_rate") != fields.end()) { // not required field auto const &tempFieldVal = fields.at("no_load_supply_air_flow_rate"); @@ -7513,7 +7513,7 @@ namespace UnitarySystems { } if (fields.find("outdoor_dry_bulb_temperature_sensor_node_name") != fields.end()) { // not required field thisSys.input_specs.outdoor_dry_bulb_temperature_sensor_node_name = - UtilityRoutines::MakeUPPERCase(fields.at("outdoor_dry_bulb_temperature_sensor_node_name").get()); + UtilityRoutines::makeUPPER(fields.at("outdoor_dry_bulb_temperature_sensor_node_name").get()); } if (fields.find("maximum_cycling_rate") != fields.end()) { // not required field, has default thisSys.input_specs.maximum_cycling_rate = fields.at("maximum_cycling_rate").get(); @@ -7541,19 +7541,19 @@ namespace UnitarySystems { } if (fields.find("heat_recovery_water_inlet_node_name") != fields.end()) { // not required field thisSys.input_specs.heat_recovery_water_inlet_node_name = - UtilityRoutines::MakeUPPERCase(fields.at("heat_recovery_water_inlet_node_name").get()); + UtilityRoutines::makeUPPER(fields.at("heat_recovery_water_inlet_node_name").get()); } if (fields.find("heat_recovery_water_outlet_node_name") != fields.end()) { // not required field thisSys.input_specs.heat_recovery_water_outlet_node_name = - UtilityRoutines::MakeUPPERCase(fields.at("heat_recovery_water_outlet_node_name").get()); + UtilityRoutines::makeUPPER(fields.at("heat_recovery_water_outlet_node_name").get()); } if (fields.find("design_specification_multispeed_object_type") != fields.end()) { // not required field thisSys.input_specs.design_specification_multispeed_object_type = - UtilityRoutines::MakeUPPERCase(fields.at("design_specification_multispeed_object_type").get()); + UtilityRoutines::makeUPPER(fields.at("design_specification_multispeed_object_type").get()); } if (fields.find("design_specification_multispeed_object_name") != fields.end()) { // not required field thisSys.input_specs.design_specification_multispeed_object_name = - UtilityRoutines::MakeUPPERCase(fields.at("design_specification_multispeed_object_name").get()); + UtilityRoutines::makeUPPER(fields.at("design_specification_multispeed_object_name").get()); } thisSys.processInputSpec(state, thisSys.input_specs, sysNum, errorsFound, ZoneEquipment, ZoneOAUnitNum); diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index 3c29cdab40e..15e4d3d46e9 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -627,7 +627,7 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed = static_cast( - getEnumerationValue(DataPlant::HowMetTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(aArgCount + 2)))); + getEnumValue(DataPlant::HowMetTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(aArgCount + 2)))); if (state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).HowLoadServed == DataPlant::HowMet::ByNominalCapLowOutLimit) { // actuator for low out limit @@ -653,8 +653,8 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).FlowPriority = - static_cast(getEnumerationValue( - DataPlant::LoopFlowStatusTypeNamesUC, UtilityRoutines::MakeUPPERCase(cAlphaArgs(aArgCount + 3)))); + static_cast(getEnumValue( + DataPlant::LoopFlowStatusTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(aArgCount + 3)))); } // find program manager for initial setup, begin environment and sizing of this plant connection diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index f15f6200b54..e49d0b265af 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -64,21 +64,21 @@ extern "C" { // EnergyPlus Headers #include #include -#include +// #include #include #include -#include +// #include #include #include #include -#include +// #include #include -#include +// #include #include -#include +// #include #include #include -#include +// #include #include #include #include @@ -88,7 +88,6 @@ extern "C" { #include #include #include - // Third Party Headers #include @@ -400,7 +399,7 @@ namespace UtilityRoutines { size_t case_insensitive_hasher::operator()(std::string_view const key) const noexcept { - std::string keyCopy = MakeUPPERCase(key); + std::string keyCopy = makeUPPER(key); return std::hash()(keyCopy); } @@ -1661,4 +1660,13 @@ void ShowSevereInvalidKey(EnergyPlusData &state, ErrorObjectHeader const &eoh, s ShowContinueError(state, format("{} = {}, invalid key", fieldName, fieldVal)); } +void ShowSevereEmptyField(EnergyPlusData &state, ErrorObjectHeader const &eoh, + std::string_view fieldName, + std::string_view depFieldName, + std::string_view depFieldVal) +{ + ShowSevereError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); + ShowContinueError(state, format("{} cannot be empty{}.", fieldName, depFieldName.empty() ? "" : format (" when {} = {}", depFieldName, depFieldVal))); +} + } // namespace EnergyPlus diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index d49475e6a0b..0cfaf1eddf7 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -229,7 +229,11 @@ struct ErrorObjectHeader void ShowSevereItemNotFound(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); void ShowSevereInvalidKey(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); - +void ShowSevereEmptyField(EnergyPlusData &state, ErrorObjectHeader const &eoh, + std::string_view fieldName, + std::string_view depFieldName = {}, + std::string_view depFieldVal = {}); + namespace UtilityRoutines { static constexpr std::array MonthNamesCC{ @@ -475,7 +479,7 @@ namespace UtilityRoutines { return FindItem(String, ListOfItems, name_p, ListOfItems.isize()); } - inline std::string MakeUPPERCase(std::string_view const InputString) // Input String + inline std::string makeUPPER(std::string_view const InputString) // Input String { // FUNCTION INFORMATION: @@ -659,7 +663,7 @@ namespace UtilityRoutines { } // namespace UtilityRoutines -constexpr int getEnumerationValue(const gsl::span sList, const std::string_view s) +constexpr int getEnumValue(const gsl::span sList, const std::string_view s) { for (unsigned int i = 0; i < sList.size(); ++i) { if (sList[i] == s) return i; @@ -670,7 +674,7 @@ constexpr int getEnumerationValue(const gsl::span sList, constexpr BooleanSwitch getYesNoValue(const std::string_view s) { constexpr std::array yesNo = {"NO", "YES"}; - return static_cast(getEnumerationValue(yesNo, s)); + return static_cast(getEnumValue(yesNo, s)); } struct UtilityRoutinesData : BaseGlobalStruct diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index f15c34d82c9..546f36aab14 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -486,7 +486,7 @@ namespace VentilatedSlab { ventSlab.OutAirVolFlow = state.dataIPShortCut->rNumericArgs(3); ventSlab.outsideAirControlType = static_cast( - getEnumerationValue(OutsideAirControlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(5)))); + getEnumValue(OutsideAirControlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); switch (ventSlab.outsideAirControlType) { case OutsideAirControlType::VariablePercent: { @@ -564,7 +564,7 @@ namespace VentilatedSlab { // System Configuration: ventSlab.SysConfg = static_cast( - getEnumerationValue(VentilatedSlabConfigNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(8)))); + getEnumValue(VentilatedSlabConfigNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (ventSlab.SysConfg == VentilatedSlabConfig::Invalid) { ShowSevereError( @@ -611,7 +611,7 @@ namespace VentilatedSlab { // Process the temperature control type ventSlab.controlType = static_cast( - getEnumerationValue(ControlTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(9)))); + getEnumValue(ControlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); if (ventSlab.controlType == ControlType::Invalid) { ShowSevereError( @@ -987,7 +987,7 @@ namespace VentilatedSlab { // Coil options assign ventSlab.coilOption = - static_cast(getEnumerationValue(CoilTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(26)))); + static_cast(getEnumValue(CoilTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(26)))); if (ventSlab.coilOption == CoilType::Invalid) { ShowSevereError( @@ -1016,7 +1016,7 @@ namespace VentilatedSlab { errFlag = false; ventSlab.hCoilType = static_cast( - getEnumerationValue(HeatingCoilTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(27)))); + getEnumValue(HeatingCoilTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(27)))); switch (ventSlab.hCoilType) { @@ -1132,7 +1132,7 @@ namespace VentilatedSlab { errFlag = false; ventSlab.cCoilType = static_cast( - getEnumerationValue(CoolingCoilTypeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(30)))); + getEnumValue(CoolingCoilTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(30)))); switch (ventSlab.cCoilType) { case CoolingCoilType::WaterCooling: { diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 75bf0fb2430..ea357e1356b 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -1334,7 +1334,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) // Inlet Air Configuration HPWH.InletAirConfiguration = - static_cast(getEnumerationValue(HPWHAmbientTempNamesUC, UtilityRoutines::MakeUPPERCase(hpwhAlpha[6 + nAlphaOffset]))); + static_cast(getEnumValue(HPWHAmbientTempNamesUC, UtilityRoutines::makeUPPER(hpwhAlpha[6 + nAlphaOffset]))); switch (HPWH.InletAirConfiguration) { case WTTAmbientTemp::Schedule: { @@ -1560,7 +1560,7 @@ bool getHPWaterHeaterInput(EnergyPlusData &state) // Compressor Location HPWH.CrankcaseTempIndicator = static_cast( - getEnumerationValue(CrankcaseHeaterControlTempNamesUC, UtilityRoutines::MakeUPPERCase(hpwhAlpha[20 + nAlphaOffset]))); + getEnumValue(CrankcaseHeaterControlTempNamesUC, UtilityRoutines::makeUPPER(hpwhAlpha[20 + nAlphaOffset]))); switch (HPWH.CrankcaseTempIndicator) { case CrankcaseHeaterControlTemp::Schedule: { if (!hpwhAlphaBlank[21 + nAlphaOffset]) { @@ -2404,7 +2404,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) // Validate Heater Control Type Tank.ControlType = static_cast( - getEnumerationValue(HeaterControlModeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(3)))); + getEnumValue(HeaterControlModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.ControlType) { case HeaterControlMode::Cycle: { Tank.MinCapacity = Tank.MaxCapacity; @@ -2434,7 +2434,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) Tank.IgnitionDelay = state.dataIPShortCut->rNumericArgs(7); // Not yet implemented // Validate Heater Fuel Type - Tank.FuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(4))); + Tank.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(4))); switch (Tank.FuelType) { case Constant::eFuel::Invalid: { ShowSevereError(state, @@ -2496,7 +2496,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) Tank.OffCycParaLoad = state.dataIPShortCut->rNumericArgs(9); // Validate Off-Cycle Parasitic Fuel Type - Tank.OffCycParaFuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(6))); + Tank.OffCycParaFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(6))); switch (Tank.OffCycParaFuelType) { case Constant::eFuel::Invalid: if (state.dataIPShortCut->cAlphaArgs(6).empty()) { // If blank, default to Fuel Type for heater @@ -2521,7 +2521,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) Tank.OnCycParaLoad = state.dataIPShortCut->rNumericArgs(11); // Validate On-Cycle Parasitic Fuel Type - Tank.OnCycParaFuelType = static_cast(getEnumerationValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(7))); + Tank.OnCycParaFuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs(7))); switch (Tank.OnCycParaFuelType) { case Constant::eFuel::Invalid: if (state.dataIPShortCut->cAlphaArgs(7).empty()) { // If blank, default to Fuel Type for heater @@ -2544,7 +2544,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) Tank.OnCycParaFracToTank = state.dataIPShortCut->rNumericArgs(12); Tank.AmbientTempIndicator = static_cast( - getEnumerationValue(TankAmbientTempNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(8)))); + getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { Tank.AmbientTempSchedule = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(9)); @@ -2772,7 +2772,7 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) if (!state.dataIPShortCut->lAlphaFieldBlanks(18)) { Tank.SourceSideControlMode = static_cast( - getEnumerationValue(SourceSideControlNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(18)))); + getEnumValue(SourceSideControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(18)))); if (Tank.SourceSideControlMode == SourceSideControl::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Control Mode entered={}", @@ -2863,7 +2863,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) } Tank.Shape = - static_cast(getEnumerationValue(TankShapeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(3)))); + static_cast(getEnumValue(TankShapeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.Shape) { case TankShape::HorizCylinder: case TankShape::VertCylinder: { @@ -2903,7 +2903,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) // Validate Heater Priority Control Tank.StratifiedControlMode = static_cast( - getEnumerationValue(PriorityControlModeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(4)))); + getEnumValue(PriorityControlModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (Tank.StratifiedControlMode == PriorityControlMode::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Heater Priority Control entered={}", @@ -3003,7 +3003,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) // Validate Heater Fuel Type Tank.FuelType = static_cast( - getEnumerationValue(Constant::eFuelNamesUC, + getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs( 7))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported if (Tank.FuelType == Constant::eFuel::Invalid) { @@ -3031,7 +3031,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) // Validate Off-Cycle Parasitic Fuel Type Tank.OffCycParaFuelType = static_cast( - getEnumerationValue(Constant::eFuelNamesUC, + getEnumValue(Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs( 8))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported if (Tank.OffCycParaFuelType == Constant::eFuel::Invalid) { @@ -3055,7 +3055,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.OnCycParaLoad = state.dataIPShortCut->rNumericArgs(15); // Validate On-Cycle Parasitic Fuel Type - Tank.OnCycParaFuelType = static_cast(getEnumerationValue( + Tank.OnCycParaFuelType = static_cast(getEnumValue( Constant::eFuelNamesUC, state.dataIPShortCut->cAlphaArgs( 9))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported/empty @@ -3078,7 +3078,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.OnCycParaHeight = state.dataIPShortCut->rNumericArgs(17); Tank.AmbientTempIndicator = static_cast( - getEnumerationValue(TankAmbientTempNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(10)))); + getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3372,7 +3372,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) // Validate inlet mode Tank.InletMode = static_cast( - getEnumerationValue(InletPositionModeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(20)))); + getEnumValue(InletPositionModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(20)))); Tank.Nodes = state.dataIPShortCut->rNumericArgs(32); int specifiedNodes = 0; @@ -3407,7 +3407,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) if (!state.dataIPShortCut->lAlphaFieldBlanks(21)) { Tank.SourceSideControlMode = static_cast( - getEnumerationValue(SourceSideControlNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(21)))); + getEnumValue(SourceSideControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(21)))); if (Tank.SourceSideControlMode == SourceSideControl::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Control Mode entered={}", @@ -3531,7 +3531,7 @@ bool getWaterTankMixedInput(EnergyPlusData &state) Tank.OnCycParaFracToTank = 0.0; Tank.AmbientTempIndicator = static_cast( - getEnumerationValue(TankAmbientTempNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(3)))); + getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3794,7 +3794,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) } Tank.Shape = - static_cast(getEnumerationValue(TankShapeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(2)))); + static_cast(getEnumValue(TankShapeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); switch (Tank.Shape) { case TankShape::HorizCylinder: case TankShape::VertCylinder: { @@ -3868,7 +3868,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) Tank.OnCycParaHeight = 0.0; Tank.AmbientTempIndicator = static_cast( - getEnumerationValue(TankAmbientTempNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(4)))); + getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -4113,7 +4113,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) // Validate inlet mode Tank.InletMode = static_cast( - getEnumerationValue(InletPositionModeNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(14)))); + getEnumValue(InletPositionModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(14)))); Tank.Nodes = state.dataIPShortCut->rNumericArgs(18); Tank.AdditionalCond = state.dataIPShortCut->rNumericArgs(19); @@ -4405,7 +4405,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) } else { DataLoopNode::ConnectionObjectType objType = static_cast( - getEnumerationValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::MakeUPPERCase(Tank.Type))); + getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, UtilityRoutines::makeUPPER(Tank.Type))); Tank.SourceInletNode = NodeInputManager::GetOnlySingleNode(state, HPWH.OutletNodeName1, diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index 6c9a35b1a3a..aad01f4e860 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -364,7 +364,7 @@ namespace WaterToAirHeatPump { heatPump.LossFactor = NumArray(11); heatPump.compressorType = - static_cast(getEnumerationValue(CompressTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(2)))); + static_cast(getEnumValue(CompressTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(2)))); switch (heatPump.compressorType) { case CompressorType::Reciprocating: { @@ -548,7 +548,7 @@ namespace WaterToAirHeatPump { heatPump.LossFactor = NumArray(8); heatPump.compressorType = - static_cast(getEnumerationValue(CompressTypeNamesUC, UtilityRoutines::MakeUPPERCase(AlphArray(2)))); + static_cast(getEnumValue(CompressTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(2)))); switch (heatPump.compressorType) { case CompressorType::Reciprocating: { heatPump.CompPistonDisp = NumArray(9); diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index 3cffe548d89..e7f36da4bae 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -502,7 +502,7 @@ namespace WaterUse { if ((!state.dataIPShortCut->lAlphaFieldBlanks(8)) && (state.dataIPShortCut->cAlphaArgs(8) != "NONE")) { waterConnection.HeatRecovery = true; waterConnection.HeatRecoveryHX = static_cast( - getEnumerationValue(HeatRecoverHXNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(8)))); + getEnumValue(HeatRecoverHXNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (waterConnection.HeatRecoveryHX == HeatRecovHX::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(8), state.dataIPShortCut->cAlphaArgs(8))); @@ -511,7 +511,7 @@ namespace WaterUse { } waterConnection.HeatRecoveryConfig = static_cast( - getEnumerationValue(HeatRecoveryConfigNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(9)))); + getEnumValue(HeatRecoveryConfigNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); if (waterConnection.HeatRecoveryConfig == HeatRecovConfig::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(9), state.dataIPShortCut->cAlphaArgs(9))); diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index 0d974d5196d..7594f991b7f 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -5443,7 +5443,7 @@ namespace WeatherManager { // A2 , \field Day of Week for Start Day bool inputWeekday = false; if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { // Have input - int dayType = getEnumerationValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2)); + int dayType = getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2)); if (dayType < 1) { ShowWarningError(state, format("{}: object={}{} invalid (Day of Week) [{}] for Start is not valid, Sunday will be used.", @@ -5910,7 +5910,7 @@ namespace WeatherManager { static_cast(ScheduleManager::DayType::Monday); // Defaults to Monday } else { state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek = - getEnumerationValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2)); + getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2)); if (state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek < 1 || state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek == 8) { ShowWarningError(state, @@ -6109,7 +6109,7 @@ namespace WeatherManager { static_cast(ScheduleManager::DayType::Monday); // Defaults to Monday } else { state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek = - getEnumerationValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(3)); + getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(3)); if (state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek < static_cast(ScheduleManager::DayType::Sunday) || state.dataWeatherManager->RunPeriodDesignInput(Count).dayOfWeek == static_cast(ScheduleManager::DayType::Holiday)) { // Sunday-Saturday, SummerDesignDay, WinterDesignDay, CustomDay1, and CustomDay2 are all valid. Holiday is not valid. @@ -6264,7 +6264,7 @@ namespace WeatherManager { ErrorsFound = true; } - int DayType = getEnumerationValue(ScheduleManager::dayTypeNamesUC, AlphArray(3)); + int DayType = getEnumValue(ScheduleManager::dayTypeNamesUC, AlphArray(3)); if (DayType == 0) { ShowSevereError(state, format("{}: {} Invalid {}={}", @@ -7419,7 +7419,7 @@ namespace WeatherManager { // A2, \field Day Type state.dataWeatherManager->DesDayInput(EnvrnNum).DayType = - getEnumerationValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2)); + getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataIPShortCut->cAlphaArgs(2)); if (state.dataWeatherManager->DesDayInput(EnvrnNum).DayType <= 0) { ShowSevereError(state, format("{}=\"{}\", invalid data.", @@ -7652,7 +7652,7 @@ namespace WeatherManager { std::string units; OutputProcessor::Unit unitType; state.dataWeatherManager->WPSkyTemperature(i).CalculationType = - static_cast(getEnumerationValue(WeatherManager::SkyTempModelInputNamesUC, state.dataIPShortCut->cAlphaArgs(2))); + static_cast(getEnumValue(WeatherManager::SkyTempModelInputNamesUC, state.dataIPShortCut->cAlphaArgs(2))); switch (state.dataWeatherManager->WPSkyTemperature(i).CalculationType) { case SkyTempCalcType::ScheduleValue: { @@ -7967,7 +7967,7 @@ namespace WeatherManager { state.dataIPShortCut->cNumericFieldNames); state.dataWeatherManager->WaterMainsTempsMethod = - static_cast(getEnumerationValue(waterMainsCalcMethodNamesUC, AlphArray(1))); + static_cast(getEnumValue(waterMainsCalcMethodNamesUC, AlphArray(1))); if (state.dataWeatherManager->WaterMainsTempsMethod == WaterMainsTempCalcMethod::Schedule) { state.dataWeatherManager->WaterMainsTempsScheduleName = AlphArray(2); state.dataWeatherManager->WaterMainsTempsSchedule = ScheduleManager::GetScheduleIndex(state, AlphArray(2)); @@ -8613,7 +8613,7 @@ namespace WeatherManager { // Process periods to set up other values. for (int i = 1; i <= state.dataWeatherManager->NumEPWTypExtSets; ++i) { // JulianDay (Month,Day,LeapYearValue) - std::string const ExtremePeriodTitle = UtilityRoutines::MakeUPPERCase(state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle); + std::string const ExtremePeriodTitle = UtilityRoutines::makeUPPER(state.dataWeatherManager->TypicalExtremePeriods(i).ShortTitle); if (ExtremePeriodTitle == "SUMMER") { if (UtilityRoutines::SameString(state.dataWeatherManager->TypicalExtremePeriods(i).TEType, "EXTREME")) { state.dataWeatherManager->TypicalExtremePeriods(i).MatchValue = "SummerExtreme"; @@ -8951,7 +8951,7 @@ namespace WeatherManager { if (CurCount <= state.dataWeatherManager->NumDataPeriods) { state.dataWeatherManager->DataPeriods(CurCount).DayOfWeek = Line.substr(0, Pos); state.dataWeatherManager->DataPeriods(CurCount).WeekDay = - getEnumerationValue(ScheduleManager::dayTypeNamesUC, state.dataWeatherManager->DataPeriods(CurCount).DayOfWeek); + getEnumValue(ScheduleManager::dayTypeNamesUC, state.dataWeatherManager->DataPeriods(CurCount).DayOfWeek); if (state.dataWeatherManager->DataPeriods(CurCount).WeekDay < 1 || state.dataWeatherManager->DataPeriods(CurCount).WeekDay > 7) { ShowSevereError(state, @@ -9643,7 +9643,7 @@ namespace WeatherManager { std::string::size_type pos = index(epwLine.data, ','); epwLine.data.erase(0, pos + 1); pos = index(epwLine.data, ','); - std::string LeapYear = UtilityRoutines::MakeUPPERCase(epwLine.data.substr(0, pos)); + std::string LeapYear = UtilityRoutines::makeUPPER(epwLine.data.substr(0, pos)); if (LeapYear[0] == 'Y') { epwHasLeapYear = true; } diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index ab52fc60ede..1e618f56007 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -282,7 +282,7 @@ namespace WindTurbine { } // Select rotor type windTurbine.rotorType = static_cast( - getEnumerationValue(WindTurbine::RotorNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(3)))); + getEnumValue(WindTurbine::RotorNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); if (windTurbine.rotorType == RotorType::Invalid) { if (state.dataIPShortCut->cAlphaArgs(3).empty()) { windTurbine.rotorType = RotorType::HorizontalAxis; @@ -299,7 +299,7 @@ namespace WindTurbine { // Select control type windTurbine.controlType = static_cast( - getEnumerationValue(WindTurbine::ControlNamesUC, UtilityRoutines::MakeUPPERCase(state.dataIPShortCut->cAlphaArgs(4)))); + getEnumValue(WindTurbine::ControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (windTurbine.controlType == ControlType::Invalid) { if (state.dataIPShortCut->cAlphaArgs(4).empty()) { windTurbine.controlType = ControlType::VariableSpeedVariablePitch; diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index a4b3be1e68d..4080721fc4d 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -7937,7 +7937,7 @@ namespace WindowManager { state.dataMaterial->Screens(ScreenNum).ScreenDiameterToSpacingRatio = 1.0 - std::sqrt(thisMaterial->Trans); state.dataMaterial->Screens(ScreenNum).screenBeamReflectanceModel = static_cast( - getEnumerationValue(ScreenBeamReflectanceModelNamesUC, UtilityRoutines::MakeUPPERCase(thisMaterial->ReflectanceModeling))); + getEnumValue(ScreenBeamReflectanceModelNamesUC, UtilityRoutines::makeUPPER(thisMaterial->ReflectanceModeling))); // Reflectance of screen material only state.dataMaterial->Screens(ScreenNum).ReflectCylinder = thisMaterial->ReflectShade / (1 - thisMaterial->Trans); diff --git a/src/EnergyPlus/WindowModel.cc b/src/EnergyPlus/WindowModel.cc index d6c9b83d1e2..c4709f261e5 100644 --- a/src/EnergyPlus/WindowModel.cc +++ b/src/EnergyPlus/WindowModel.cc @@ -87,7 +87,7 @@ namespace WindowManager { if (numCurrModels > 0) { state.dataInputProcessing->inputProcessor->getObjectItem( state, objectName, 1, state.dataIPShortCut->cAlphaArgs, NumAlphas, state.dataIPShortCut->rNumericArgs, NumNums, IOStat); - // Please consider using getEnumerationValue pattern here. + // Please consider using getEnumValue pattern here. // Consider that you are creating an entire map for the // sole purpose of looking up a single element EnumParser aParser; diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 2923aecd212..a6aa6195e0d 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -509,7 +509,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) if (!TempControlledZone(TempControlledZoneNum).ControlType(ControlTypeNum).empty()) { DataHVACGlobals::ThermostatType ctrlType = static_cast( - getEnumerationValue(ValidControlTypesUC, TempControlledZone(TempControlledZoneNum).ControlType(ControlTypeNum))); + getEnumValue(ValidControlTypesUC, TempControlledZone(TempControlledZoneNum).ControlType(ControlTypeNum))); TempControlledZone(TempControlledZoneNum).ControlTypeEnum(ControlTypeNum) = ctrlType; if (ctrlType == DataHVACGlobals::ThermostatType::Invalid) { ShowSevereError(state, @@ -1259,9 +1259,9 @@ void GetZoneAirSetPoints(EnergyPlusData &state) ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum) = cAlphaArgs(nint(2.0 * ControlTypeNum - 1 + 5)); ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ControlTypeNum) = cAlphaArgs(nint(2.0 * ControlTypeNum + 5)); if (ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum) != "") { - CTIndex = getEnumerationValue( + CTIndex = getEnumValue( ValidComfortControlTypesUC, - UtilityRoutines::MakeUPPERCase(ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum))); + UtilityRoutines::makeUPPER(ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum))); if (CTIndex == 0) { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\"", @@ -3586,7 +3586,7 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( this->TempDepZnLd = (11.0 / 6.0) * this->AirPowerCap + this->TempDepCoef; this->TempIndZnLd = this->TempHistoryTerm + this->TempIndCoef; if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { // RoomAirflowNetworkModel - make dynamic term independent of TimeStepSys auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); if (thisRoomAirflowNetworkZoneInfo.IsUsed) { @@ -3618,7 +3618,7 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { this->ZoneT1 = this->ZoneTM2; this->ZoneW1 = this->ZoneWM2; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempTM2; @@ -3628,7 +3628,7 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( } else { this->ZoneT1 = this->ZoneTMX; this->ZoneW1 = this->ZoneWMX; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempTMX; @@ -3640,7 +3640,7 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( } else { this->ZoneT1 = this->ZT; this->ZoneW1 = this->ZoneAirHumRat; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTemp; @@ -4119,7 +4119,7 @@ void ZoneSpaceHeatBalanceData::calcPredictedHumidityRatio(EnergyPlusData &state, } C = RhoAir * volume * thisZone.ZoneVolCapMultpMoist / TimeStepSysSec; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { auto &roomAFNInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); int RoomAirNode = roomAFNInfo.ControlAirNodeID; H2OHtOfVap = Psychrometrics::PsyHgAirFnWTdb(roomAFNInfo.Node(RoomAirNode).HumRat, roomAFNInfo.Node(RoomAirNode).AirTemp); @@ -4356,7 +4356,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; } else { auto &thisAirModel = state.dataRoomAirMod->AirModel(zoneNum); - if ((thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::Mixing) || (!thisAirModel.SimAirModel)) { + if ((thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::Mixing) || (!thisAirModel.SimAirModel)) { // Fully mixed thisSystemNode.Temp = this->ZT; // SpaceHB TODO: What to do here if this is for space @@ -4382,8 +4382,8 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // Negligible flow, assume mixed - reasonable lagged starting value for first step time with significant flow state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; } - } else if (thisAirModel.SimAirModel && ((thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::UserDefined) || - (thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::Mundt))) { + } else if (thisAirModel.SimAirModel && ((thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UserDefined) || + (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::Mundt))) { if (this->SumSysMCp > DataHVACGlobals::SmallMassFlow) { Real64 TempSupplyAir = this->SumSysMCpT / this->SumSysMCp; // Non-negligible flow, calculate supply air temperature if (std::abs(TempSupplyAir - this->ZT) > state.dataHeatBal->TempConvergTol) { @@ -4399,7 +4399,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // Negligible flow, assume mixed - reasonable lagged starting value for first step time with significant flow state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; } - } else if (thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + } else if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { // Zone node used in the RoomAirflowNetwork model this->ZT = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) @@ -4462,7 +4462,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { this->ZT = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) .AirTemp; @@ -4601,9 +4601,9 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::UCSDDV || - thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFI || - thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || + thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || + thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { state.dataRoomAirMod->XM4TFloor(zoneNum) = state.dataRoomAirMod->XM3TFloor(zoneNum); state.dataRoomAirMod->XM3TFloor(zoneNum) = state.dataRoomAirMod->XM2TFloor(zoneNum); state.dataRoomAirMod->XM2TFloor(zoneNum) = state.dataRoomAirMod->XMATFloor(zoneNum); @@ -4624,7 +4624,7 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in } // for RoomAirflowNetwork model - if (thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempX4 = roomAirflowNetworkZoneInfo.AirTempX3; @@ -4647,9 +4647,9 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in this->ZoneWMX = this->ZoneAirHumRatAvg; // using average for whole zone time step. // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::UCSDDV || - thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFI || - thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || + thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || + thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { state.dataRoomAirMod->ZoneM2Floor(zoneNum) = state.dataRoomAirMod->ZoneMXFloor(zoneNum); state.dataRoomAirMod->ZoneMXFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); // using average for whole zone time step. state.dataRoomAirMod->ZoneM2OC(zoneNum) = state.dataRoomAirMod->ZoneMXOC(zoneNum); @@ -4658,7 +4658,7 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in state.dataRoomAirMod->ZoneMXMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); // using average for whole zone time step. } - if (thisAirModel.AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempTM2 = roomAirflowNetworkZoneInfo.AirTempTMX; @@ -4720,7 +4720,7 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->DSXM2TMX(zoneNum) = state.dataRoomAirMod->DSXMATMX(zoneNum); state.dataRoomAirMod->DSXMATMX(zoneNum) = state.dataRoomAirMod->MATMX(zoneNum); } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempDSX4 = roomAirflowNetworkZoneInfo.AirTempDSX3; @@ -4744,9 +4744,9 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { state.dataRoomAirMod->ZoneM2Floor(zoneNum) = state.dataRoomAirMod->ZoneMXFloor(zoneNum); state.dataRoomAirMod->ZoneMXFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); // using average for whole zone time step. state.dataRoomAirMod->ZoneM2OC(zoneNum) = state.dataRoomAirMod->ZoneMXOC(zoneNum); @@ -4754,7 +4754,7 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->ZoneM2MX(zoneNum) = state.dataRoomAirMod->ZoneMXMX(zoneNum); state.dataRoomAirMod->ZoneMXMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); // using average for whole zone time step. } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempTM2 = roomAirflowNetworkZoneInfo.AirTempTMX; @@ -4798,9 +4798,9 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { state.dataRoomAirMod->XMATFloor(zoneNum) = state.dataRoomAirMod->XM2TFloor(zoneNum); state.dataRoomAirMod->XM2TFloor(zoneNum) = state.dataRoomAirMod->XM3TFloor(zoneNum); @@ -4815,7 +4815,7 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->XM3TMX(zoneNum) = state.dataRoomAirMod->XM4TMX(zoneNum); } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempX1 = roomAirflowNetworkZoneInfo.AirTempX2; @@ -4955,7 +4955,7 @@ void ZoneSpaceHeatBalanceData::correctHumRat(EnergyPlusData &state, int const zo if (this->ZoneAirHumRatTemp > WZSat) this->ZoneAirHumRatTemp = WZSat; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { this->ZoneAirHumRatTemp = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) .HumRat; @@ -7163,7 +7163,7 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, state.dataRoomAirMod->DSXM3TMX(zoneNum), state.dataRoomAirMod->DSXM4TMX(zoneNum)); } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModelType == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &ThisRAFNNode(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode)); DownInterpolate4HistoryValues(PriorTimeStep, diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index 138030879e6..ca11e2f7a2c 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -249,8 +249,8 @@ void freeObjectNames(const char **objectNames, unsigned int arraySize) int getNumNodesInCondFDSurfaceLayer(EnergyPlusState state, const char *surfName, const char *matName) { auto *thisState = reinterpret_cast(state); - std::string UCsurfName = EnergyPlus::UtilityRoutines::MakeUPPERCase(surfName); - std::string UCmatName = EnergyPlus::UtilityRoutines::MakeUPPERCase(matName); + std::string UCsurfName = EnergyPlus::UtilityRoutines::makeUPPER(surfName); + std::string UCmatName = EnergyPlus::UtilityRoutines::makeUPPER(matName); return EnergyPlus::HeatBalFiniteDiffManager::numNodesInMaterialLayer(*thisState, UCsurfName, UCmatName); } @@ -278,8 +278,8 @@ int getVariableHandle(EnergyPlusState state, const char *type, const char *key) // In this function, it is as simple as looping over both types and continuing to increment // the handle carefully. In the getValue function it is just a matter of checking array sizes. auto *thisState = reinterpret_cast(state); - std::string const typeUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(type); - std::string const keyUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(key); + std::string const typeUC = EnergyPlus::UtilityRoutines::makeUPPER(type); + std::string const keyUC = EnergyPlus::UtilityRoutines::makeUPPER(key); int handle = -1; // initialize to -1 as a flag if (thisState->dataOutputProcessor->RVariableTypes.allocated()) { handle = 0; // initialize to 0 to get a 1 based Array1D index @@ -347,7 +347,7 @@ Real64 getVariableValue(EnergyPlusState state, const int handle) int getMeterHandle(EnergyPlusState state, const char *meterName) { auto *thisState = reinterpret_cast(state); - std::string const meterNameUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(meterName); + std::string const meterNameUC = EnergyPlus::UtilityRoutines::makeUPPER(meterName); int i = EnergyPlus::GetMeterIndex(*thisState, meterNameUC); if (i == 0) { // inside E+, zero is meaningful, but through the API, I want to use negative one as a signal of a bad lookup @@ -381,16 +381,16 @@ Real64 getMeterValue(EnergyPlusState state, int handle) int getActuatorHandle(EnergyPlusState state, const char *componentType, const char *controlType, const char *uniqueKey) { int handle = 0; - std::string const typeUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(componentType); - std::string const keyUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(uniqueKey); - std::string const controlUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(controlType); + std::string const typeUC = EnergyPlus::UtilityRoutines::makeUPPER(componentType); + std::string const keyUC = EnergyPlus::UtilityRoutines::makeUPPER(uniqueKey); + std::string const controlUC = EnergyPlus::UtilityRoutines::makeUPPER(controlType); auto *thisState = reinterpret_cast(state); for (int ActuatorLoop = 1; ActuatorLoop <= thisState->dataRuntimeLang->numEMSActuatorsAvailable; ++ActuatorLoop) { auto &availActuator = thisState->dataRuntimeLang->EMSActuatorAvailable(ActuatorLoop); handle++; - std::string const actuatorTypeUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(availActuator.ComponentTypeName); - std::string const actuatorIDUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(availActuator.UniqueIDName); - std::string const actuatorControlUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(availActuator.ControlTypeName); + std::string const actuatorTypeUC = EnergyPlus::UtilityRoutines::makeUPPER(availActuator.ComponentTypeName); + std::string const actuatorIDUC = EnergyPlus::UtilityRoutines::makeUPPER(availActuator.UniqueIDName); + std::string const actuatorControlUC = EnergyPlus::UtilityRoutines::makeUPPER(availActuator.ControlTypeName); if (typeUC == actuatorTypeUC && keyUC == actuatorIDUC && controlUC == actuatorControlUC) { if (availActuator.handleCount > 0) { @@ -517,13 +517,13 @@ Real64 getActuatorValue(EnergyPlusState state, const int handle) int getInternalVariableHandle(EnergyPlusState state, const char *type, const char *key) { int handle = 0; - std::string const typeUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(type); - std::string const keyUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(key); + std::string const typeUC = EnergyPlus::UtilityRoutines::makeUPPER(type); + std::string const keyUC = EnergyPlus::UtilityRoutines::makeUPPER(key); auto *thisState = reinterpret_cast(state); for (auto const &availVariable : thisState->dataRuntimeLang->EMSInternalVarsAvailable) { // TODO: this should stop at numEMSInternalVarsAvailable handle++; - std::string const variableTypeUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(availVariable.DataTypeName); - std::string const variableIDUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(availVariable.UniqueIDName); + std::string const variableTypeUC = EnergyPlus::UtilityRoutines::makeUPPER(availVariable.DataTypeName); + std::string const variableIDUC = EnergyPlus::UtilityRoutines::makeUPPER(availVariable.UniqueIDName); if (typeUC == variableTypeUC && keyUC == variableIDUC) { return handle; } @@ -919,11 +919,11 @@ int kindOfSim(EnergyPlusState state) int getConstructionHandle(EnergyPlusState state, const char *constructionName) { int handle = 0; - std::string const nameUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(constructionName); + std::string const nameUC = EnergyPlus::UtilityRoutines::makeUPPER(constructionName); auto *thisState = reinterpret_cast(state); for (auto const &construct : thisState->dataConstruction->Construct) { handle++; - std::string const thisNameUC = EnergyPlus::UtilityRoutines::MakeUPPERCase(construct.Name); + std::string const thisNameUC = EnergyPlus::UtilityRoutines::makeUPPER(construct.Name); if (nameUC == thisNameUC) { return handle; } diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index cdbeefa47ec..a12070f3d23 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -1192,7 +1192,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state->dataSurface->surfIntConv(SurfNum).model = Convect::HcInt::SetByZone; state->dataSurface->surfIntConv(SurfNum).userModelNum = 0; - state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDDV; + state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = DataRoomAirModel::RoomAirModel::UCSDDV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; HcIn(1) = 0.0; @@ -1204,7 +1204,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state->dataSurface->surfIntConv(SurfNum).model = Convect::HcInt::SetByZone; state->dataSurface->surfIntConv(SurfNum).userModelNum = 0; - state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDCV; + state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = DataRoomAirModel::RoomAirModel::UCSDCV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; HcIn(1) = 0.0; diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index 497effc4d67..536509c335c 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -165,7 +165,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataSurface->SurfTAirRefRpt.dimension(TotSurfaces, 0); state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::UCSDDV; + state->dataRoomAirMod->AirModel(1).AirModel = DataRoomAirModel::RoomAirModel::UCSDDV; state->dataUCSDShared->APos_Wall.allocate(TotSurfaces); state->dataUCSDShared->APos_Floor.allocate(TotSurfaces); diff --git a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc index c7f69455351..36d7b794c43 100644 --- a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc +++ b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc @@ -484,19 +484,19 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts) TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_GetMonthNumber) { - EXPECT_EQ(0, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("January"))); - EXPECT_EQ(1, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("February"))); - EXPECT_EQ(2, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("March"))); - EXPECT_EQ(3, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("April"))); - EXPECT_EQ(4, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("May"))); - EXPECT_EQ(5, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("June"))); - EXPECT_EQ(6, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("July"))); - EXPECT_EQ(7, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("August"))); - EXPECT_EQ(8, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("September"))); - EXPECT_EQ(9, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("October"))); - EXPECT_EQ(10, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("November"))); - EXPECT_EQ(11, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("December"))); - EXPECT_EQ(-1, getEnumerationValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::MakeUPPERCase("Hexember"))); + EXPECT_EQ(0, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("January"))); + EXPECT_EQ(1, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("February"))); + EXPECT_EQ(2, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("March"))); + EXPECT_EQ(3, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("April"))); + EXPECT_EQ(4, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("May"))); + EXPECT_EQ(5, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("June"))); + EXPECT_EQ(6, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("July"))); + EXPECT_EQ(7, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("August"))); + EXPECT_EQ(8, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("September"))); + EXPECT_EQ(9, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("October"))); + EXPECT_EQ(10, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("November"))); + EXPECT_EQ(11, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("December"))); + EXPECT_EQ(-1, getEnumValue(UtilityRoutines::MonthNamesUC, UtilityRoutines::makeUPPER("Hexember"))); } TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ExpressAsCashFlows) diff --git a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc index 0919e9dbb12..49733bb43c3 100644 --- a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc @@ -506,17 +506,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest) state->dataViewFactor->EnclSolInfo.allocate(3); state->dataViewFactor->EnclRadInfo(1).Name = "Enclosure 1"; state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 1"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 1"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).Name = "Enclosure 2"; state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(3).Name = "Space 3"; state->dataViewFactor->EnclRadInfo(3).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); ErrorsFound = false; HeatBalanceIntRadExchange::AlignInputViewFactors(*state, "ZoneProperty:UserViewFactors:BySurfaceName", ErrorsFound); @@ -608,17 +608,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest2) state->dataViewFactor->EnclSolInfo.allocate(3); state->dataViewFactor->EnclRadInfo(1).Name = "Enclosure 1"; state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).Name = "Enclosure 2"; state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(3).Name = "Space 3"; state->dataViewFactor->EnclRadInfo(3).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); ErrorsFound = false; HeatBalanceIntRadExchange::AlignInputViewFactors(*state, "ZoneProperty:UserViewFactors:BySurfaceName", ErrorsFound); @@ -707,17 +707,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest3) state->dataViewFactor->EnclSolInfo.allocate(3); state->dataViewFactor->EnclRadInfo(1).Name = "Enclosure 1"; state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 1"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 1"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).Name = "Enclosure 2"; state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(3).Name = "Space 3"; state->dataViewFactor->EnclRadInfo(3).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); ErrorsFound = false; HeatBalanceIntRadExchange::AlignInputViewFactors(*state, "ZoneProperty:UserViewFactors:BySurfaceName", ErrorsFound); @@ -809,17 +809,17 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest4) state->dataViewFactor->EnclSolInfo.allocate(3); state->dataViewFactor->EnclRadInfo(1).Name = "Enclosure 1"; state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 2"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(1).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).Name = "Enclosure 2"; state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 4"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(2).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 5"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); state->dataViewFactor->EnclRadInfo(3).Name = "Space 3"; state->dataViewFactor->EnclRadInfo(3).spaceNums.push_back( - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Space 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Space 3"), state->dataHeatBal->space, state->dataGlobal->numSpaces)); ErrorsFound = false; HeatBalanceIntRadExchange::AlignInputViewFactors(*state, "ZoneProperty:UserViewFactors:BySurfaceName", ErrorsFound); diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index 8df905cb567..41f13b20112 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -1814,7 +1814,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData) EXPECT_EQ(state->dataHeatBal->TotConstructs, 2); - int constrNum = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Grouped Air Boundary"), state->dataConstruction->Construct); + int constrNum = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Grouped Air Boundary"), state->dataConstruction->Construct); EXPECT_TRUE(UtilityRoutines::SameString(state->dataConstruction->Construct(constrNum).Name, "Grouped Air Boundary")); EXPECT_TRUE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundary); EXPECT_FALSE(state->dataConstruction->Construct(constrNum).IsUsedCTF); @@ -1825,7 +1825,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData) EXPECT_EQ(state->dataHeatBal->NominalRforNominalUCalculation(constrNum), 0.0); constrNum = - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Air Boundary with Good Mixing Schedule"), state->dataConstruction->Construct); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Air Boundary with Good Mixing Schedule"), state->dataConstruction->Construct); EXPECT_TRUE(UtilityRoutines::SameString(state->dataConstruction->Construct(constrNum).Name, "Air Boundary with Good Mixing Schedule")); EXPECT_TRUE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundary); EXPECT_FALSE(state->dataConstruction->Construct(constrNum).IsUsedCTF); @@ -1876,7 +1876,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData2) EXPECT_EQ(state->dataHeatBal->TotConstructs, 1); int constrNum = - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Air Boundary with Bad Mixing Schedule"), state->dataConstruction->Construct); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Air Boundary with Bad Mixing Schedule"), state->dataConstruction->Construct); EXPECT_TRUE(UtilityRoutines::SameString(state->dataConstruction->Construct(constrNum).Name, "Air Boundary with Bad Mixing Schedule")); EXPECT_TRUE(state->dataConstruction->Construct(constrNum).TypeIsAirBoundary); EXPECT_FALSE(state->dataConstruction->Construct(constrNum).IsUsedCTF); diff --git a/tst/EnergyPlus/unit/InputProcessor.unit.cc b/tst/EnergyPlus/unit/InputProcessor.unit.cc index 18645c418b4..7be536fd8ec 100644 --- a/tst/EnergyPlus/unit/InputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/InputProcessor.unit.cc @@ -4438,7 +4438,7 @@ TEST_F(InputProcessorFixture, epJSONgetObjectItem_minfields) // User inputs from above // Note even though choice keys are case-sensitive during epJSON processing, getObjectItem pushes Alphas to UPPERcase - EXPECT_EQ(state->dataIPShortCut->cAlphaArgs(1), UtilityRoutines::MakeUPPERCase(name2)); // Material Name field is NOT tagged with /retaincase + EXPECT_EQ(state->dataIPShortCut->cAlphaArgs(1), UtilityRoutines::makeUPPER(name2)); // Material Name field is NOT tagged with /retaincase EXPECT_EQ(state->dataIPShortCut->cAlphaArgs(2), "MEDIUMROUGH"); EXPECT_NEAR(state->dataIPShortCut->rNumericArgs(1), 2.0, 0.0001); EXPECT_NEAR(state->dataIPShortCut->rNumericArgs(3), 0.5, 0.0001); @@ -4672,7 +4672,7 @@ TEST_F(InputProcessorFixture, epJSONgetFieldValue_extensiblesFromIDF) auto &instancesValue = instances.value(); for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { auto const &objectFields = instance.value(); - std::string const &thisObjectName = UtilityRoutines::MakeUPPERCase(instance.key()); + std::string const &thisObjectName = UtilityRoutines::makeUPPER(instance.key()); EXPECT_EQ(thisObjectName, "SPACE EQUIPMENT"); // Fields before extensibles alphaFieldValue = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "load_distribution_scheme"); diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 08aea591f9e..8b8fa5ff328 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -567,7 +567,7 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) ErrorsFound = false; state->dataRoomAirMod->AirModel.allocate(1); - state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::AirflowNetwork; + state->dataRoomAirMod->AirModel(1).AirModel = DataRoomAirModel::RoomAirModel::AirflowNetwork; RoomAirModelManager::GetRoomAirflowNetworkData(*state, ErrorsFound); EXPECT_TRUE(ErrorsFound); diff --git a/tst/EnergyPlus/unit/SQLite.unit.cc b/tst/EnergyPlus/unit/SQLite.unit.cc index 128a6eebe1f..ebb94a5529a 100644 --- a/tst/EnergyPlus/unit/SQLite.unit.cc +++ b/tst/EnergyPlus/unit/SQLite.unit.cc @@ -807,10 +807,10 @@ TEST_F(SQLiteFixture, SQLiteProcedures_createZoneExtendedOutput) ventilationData1->DesignLevel = 2; auto const roomAirModelData0 = std::make_unique(); - roomAirModelData0->AirModelName = "test roomAirModel 1"; + roomAirModelData0->Name = "test roomAirModel 1"; auto const roomAirModelData1 = std::make_unique(); - roomAirModelData1->AirModelName = "test roomAirModel 2"; - roomAirModelData1->AirModelType = DataRoomAirModel::RoomAirModel::Mundt; + roomAirModelData1->Name = "test roomAirModel 2"; + roomAirModelData1->AirModel = DataRoomAirModel::RoomAirModel::Mundt; roomAirModelData1->TempCoupleScheme = DataRoomAirModel::CouplingScheme::Direct; // hmm this was set to 3 which wasn't a valid option roomAirModelData1->SimAirModel = true; diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 6cb7d3fbd7a..f6741b4bcde 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -5740,13 +5740,13 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBounda EXPECT_EQ(state->dataHeatBal->space(3).solarEnclosureNum, 1); // Check surface order - int Zone1Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone1-Surface1"), state->dataSurface->Surface); - int Zone1Surface2 = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone1-Surface2"), state->dataSurface->Surface); - int Zone2Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone2-Surface1"), state->dataSurface->Surface); - int Zone3Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone3-Surface1"), state->dataSurface->Surface); - int Zone1Floor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone1-Floor"), state->dataSurface->Surface); - int Zone2Floor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone2-Floor"), state->dataSurface->Surface); - int Zone3Floor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Zone3-Floor"), state->dataSurface->Surface); + int Zone1Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone1-Surface1"), state->dataSurface->Surface); + int Zone1Surface2 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone1-Surface2"), state->dataSurface->Surface); + int Zone2Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone2-Surface1"), state->dataSurface->Surface); + int Zone3Surface1 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone3-Surface1"), state->dataSurface->Surface); + int Zone1Floor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone1-Floor"), state->dataSurface->Surface); + int Zone2Floor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone2-Floor"), state->dataSurface->Surface); + int Zone3Floor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Zone3-Floor"), state->dataSurface->Surface); EXPECT_EQ(state->dataHeatBal->Zone(1).AllSurfaceFirst, Zone1Surface2); // air boundary surface EXPECT_EQ(state->dataHeatBal->Zone(1).AllSurfaceFirst + 1, Zone1Surface1); // air boundary surface @@ -8644,17 +8644,17 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) // Simulation Order (1-based): // SHADING SURFACES: int siteShadeShadeFlatShadeSurface = - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("SiteShade:FlatShadeSurface"), state->dataSurface->Surface); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("SiteShade:FlatShadeSurface"), state->dataSurface->Surface); int mirSiteShadeFlatShadeSurface = - UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::MakeUPPERCase("SiteShade:FlatShadeSurface"), state->dataSurface->Surface); + UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::makeUPPER("SiteShade:FlatShadeSurface"), state->dataSurface->Surface); int buildingShadeTiltedShadeSurface = - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("BuildingShade:TiltedShadeSurface"), state->dataSurface->Surface); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("BuildingShade:TiltedShadeSurface"), state->dataSurface->Surface); int mirBuildingShadeTiltedShadeSurface = - UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::MakeUPPERCase("BuildingShade:TiltedShadeSurface"), state->dataSurface->Surface); + UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::makeUPPER("BuildingShade:TiltedShadeSurface"), state->dataSurface->Surface); int zoneShadeLivingSouthShade001 = - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("ZoneShade:Living:South:Shade001"), state->dataSurface->Surface); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("ZoneShade:Living:South:Shade001"), state->dataSurface->Surface); int mirZoneShadeLivingSouthShade001 = - UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::MakeUPPERCase("ZoneShade:Living:South:Shade001"), state->dataSurface->Surface); + UtilityRoutines::FindItemInList("Mir-" + UtilityRoutines::makeUPPER("ZoneShade:Living:South:Shade001"), state->dataSurface->Surface); EXPECT_EQ(siteShadeShadeFlatShadeSurface, 1); EXPECT_EQ(mirSiteShadeFlatShadeSurface, 2); EXPECT_EQ(buildingShadeTiltedShadeSurface, 3); @@ -8663,20 +8663,20 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_EQ(mirZoneShadeLivingSouthShade001, 6); // LIVING ZONE: - int wallLivingNorth = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Living:North"), state->dataSurface->Surface); - int wallLivingEast = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Living:East"), state->dataSurface->Surface); - int wallLivingSouth = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Living:South"), state->dataSurface->Surface); - int wallLivingWest = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Living:West"), state->dataSurface->Surface); - int wallLivingInterior = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Living:Interior"), state->dataSurface->Surface); - int floorLivingFloor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Living:Floor"), state->dataSurface->Surface); - int ceilingLivingCeiling = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Living:Ceiling"), state->dataSurface->Surface); - int doorWestDoor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("WestDoor"), state->dataSurface->Surface); + int wallLivingNorth = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:North"), state->dataSurface->Surface); + int wallLivingEast = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:East"), state->dataSurface->Surface); + int wallLivingSouth = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:South"), state->dataSurface->Surface); + int wallLivingWest = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:West"), state->dataSurface->Surface); + int wallLivingInterior = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:Interior"), state->dataSurface->Surface); + int floorLivingFloor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:Floor"), state->dataSurface->Surface); + int ceilingLivingCeiling = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Living:Ceiling"), state->dataSurface->Surface); + int doorWestDoor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("WestDoor"), state->dataSurface->Surface); int windowTubularDaylightingDiffuser1 = - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("TubularDaylightingDiffuser1"), state->dataSurface->Surface); - int windowNorthWindow = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("NorthWindow"), state->dataSurface->Surface); - int windowEastWindow = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("EastWindow"), state->dataSurface->Surface); - int windowSouthWindow = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("SouthWindow"), state->dataSurface->Surface); - int windowWestWindow = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("WestWindow"), state->dataSurface->Surface); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("TubularDaylightingDiffuser1"), state->dataSurface->Surface); + int windowNorthWindow = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthWindow"), state->dataSurface->Surface); + int windowEastWindow = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("EastWindow"), state->dataSurface->Surface); + int windowSouthWindow = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("SouthWindow"), state->dataSurface->Surface); + int windowWestWindow = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("WestWindow"), state->dataSurface->Surface); EXPECT_EQ(wallLivingNorth, 7); EXPECT_EQ(wallLivingEast, 8); @@ -8699,13 +8699,13 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_EQ(state->dataHeatBal->space(1).WindowSurfaceLast, 19); // GARAGE ZONE: - int wallGarageInterior = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Garage:Interior"), state->dataSurface->Surface); - int wallGarageEast = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Garage:EastWall"), state->dataSurface->Surface); - int wallGarageWest = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Garage:WestWall"), state->dataSurface->Surface); - int wallGarageFrontDoor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Garage:FrontDoor"), state->dataSurface->Surface); - int floorGarageFloor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Garage:Floor"), state->dataSurface->Surface); - int ceilingGarageInterior = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Garage:Ceiling"), state->dataSurface->Surface); - int intmassEVChargingStation = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("EVChargingStation"), state->dataSurface->Surface); + int wallGarageInterior = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:Interior"), state->dataSurface->Surface); + int wallGarageEast = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:EastWall"), state->dataSurface->Surface); + int wallGarageWest = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:WestWall"), state->dataSurface->Surface); + int wallGarageFrontDoor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:FrontDoor"), state->dataSurface->Surface); + int floorGarageFloor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:Floor"), state->dataSurface->Surface); + int ceilingGarageInterior = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Garage:Ceiling"), state->dataSurface->Surface); + int intmassEVChargingStation = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("EVChargingStation"), state->dataSurface->Surface); EXPECT_EQ(wallGarageInterior, 20); EXPECT_EQ(wallGarageEast, 21); @@ -8722,21 +8722,21 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_EQ(state->dataHeatBal->space(2).WindowSurfaceLast, -1); // ATTIC ZONE: - int wallEastGable = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("EastGable"), state->dataSurface->Surface); - int wallWestGable = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("WestGable"), state->dataSurface->Surface); - int wallNorthGable = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("NorthGable"), state->dataSurface->Surface); - int floorAtticLivingFloor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Attic:LivingFloor"), state->dataSurface->Surface); - int floorAtticGarageFloor = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Attic:GarageFloor"), state->dataSurface->Surface); - int roofNorthRoof1 = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("NorthRoof1"), state->dataSurface->Surface); - int roofSouthRoof = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("SouthRoof"), state->dataSurface->Surface); - int roofNorthRoof2 = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("NorthRoof2"), state->dataSurface->Surface); - int roofNorthRoof3 = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("NorthRoof3"), state->dataSurface->Surface); - int roofNorthRoof4 = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("NorthRoof4"), state->dataSurface->Surface); - int roofEastRoof = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("EastRoof"), state->dataSurface->Surface); - int roofWestRoof = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("WestRoof"), state->dataSurface->Surface); + int wallEastGable = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("EastGable"), state->dataSurface->Surface); + int wallWestGable = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("WestGable"), state->dataSurface->Surface); + int wallNorthGable = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthGable"), state->dataSurface->Surface); + int floorAtticLivingFloor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Attic:LivingFloor"), state->dataSurface->Surface); + int floorAtticGarageFloor = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("Attic:GarageFloor"), state->dataSurface->Surface); + int roofNorthRoof1 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthRoof1"), state->dataSurface->Surface); + int roofSouthRoof = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("SouthRoof"), state->dataSurface->Surface); + int roofNorthRoof2 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthRoof2"), state->dataSurface->Surface); + int roofNorthRoof3 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthRoof3"), state->dataSurface->Surface); + int roofNorthRoof4 = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("NorthRoof4"), state->dataSurface->Surface); + int roofEastRoof = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("EastRoof"), state->dataSurface->Surface); + int roofWestRoof = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("WestRoof"), state->dataSurface->Surface); int nonwindowTubularDaylightingDome1 = - UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("TubularDaylightingDome1"), state->dataSurface->Surface); - int windowAtticSkylight = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("AtticSkylight"), state->dataSurface->Surface); + UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("TubularDaylightingDome1"), state->dataSurface->Surface); + int windowAtticSkylight = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER("AtticSkylight"), state->dataSurface->Surface); EXPECT_EQ(wallEastGable, 27); EXPECT_EQ(wallWestGable, 28); @@ -11074,7 +11074,7 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_ShadingSurfaceScheduleChecks) static constexpr std::array isTransparent{false, true, false, false, false, true, false, false}; for (int surf = 0; surf < 8; ++surf) { - int surfNum = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase(surfacenames[surf]), state->dataSurface->Surface); + int surfNum = UtilityRoutines::FindItemInList(UtilityRoutines::makeUPPER(surfacenames[surf]), state->dataSurface->Surface); EXPECT_EQ(state->dataSurface->Surface(surfNum).IsTransparent, isTransparent[surf]); } EXPECT_TRUE(state->dataSolarShading->anyScheduledShadingSurface); diff --git a/tst/EnergyPlus/unit/SystemReports.unit.cc b/tst/EnergyPlus/unit/SystemReports.unit.cc index 018c785d5eb..4d741047651 100644 --- a/tst/EnergyPlus/unit/SystemReports.unit.cc +++ b/tst/EnergyPlus/unit/SystemReports.unit.cc @@ -111,7 +111,7 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).MeteredVar(1).EndUse_CompMode = SystemReports::EndUseType::CoolingOnly; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).MeteredVar(1).CurMeterReading = 100.0; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).MeteredVar(1).ResourceType = - static_cast(getEnumerationValue(Constant::eResourceNamesUC, UtilityRoutines::MakeUPPERCase("NaturalGas"))); + static_cast(getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER("NaturalGas"))); state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).Name = "Main Gas Heating Coil"; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).TypeOf = "COIL:HEATING:DESUPERHEATER"; @@ -122,7 +122,7 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).MeteredVar(1).EndUse_CompMode = SystemReports::EndUseType::CoolingOnly; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).MeteredVar(1).CurMeterReading = 100.0; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).MeteredVar(1).ResourceType = - static_cast(getEnumerationValue(Constant::eResourceNamesUC, UtilityRoutines::MakeUPPERCase("NaturalGas"))); + static_cast(getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER("NaturalGas"))); state->dataLoopNodes->Node(1).MassFlowRate = 1.0; state->dataLoopNodes->Node(2).MassFlowRate = 1.0; @@ -160,9 +160,9 @@ TEST_F(EnergyPlusFixture, SeparateGasOutputVariables) state->dataSysRpts->SysLoadRepVars(1).TotNaturalGas = 0; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).MeteredVar(1).ResourceType = - static_cast(getEnumerationValue(Constant::eResourceNamesUC, UtilityRoutines::MakeUPPERCase("Propane"))); + static_cast(getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER("Propane"))); state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(2).MeteredVar(1).ResourceType = - static_cast(getEnumerationValue(Constant::eResourceNamesUC, UtilityRoutines::MakeUPPERCase("Propane"))); + static_cast(getEnumValue(Constant::eResourceNamesUC, UtilityRoutines::makeUPPER("Propane"))); // Calculate SysHumidPropane ("Air System Humidifier Propane Energy" Output Variable) CalcSystemEnergyUse(*state, diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index 408af6fb070..3f547c0cbd8 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -91,7 +91,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcIfSetPointMetTest1) state->dataThermalComforts->ThermalComfortSetPoint.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->TempControlType.allocate(1); state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::Mixing; + state->dataRoomAirMod->AirModel(1).AirModel = DataRoomAirModel::RoomAirModel::Mixing; state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointLo.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointHi.allocate(state->dataGlobal->NumOfZones); @@ -926,7 +926,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcIfSetPointMetWithCutoutTest) state->dataThermalComforts->ThermalComfortSetPoint.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->TempControlType.allocate(1); state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::Mixing; + state->dataRoomAirMod->AirModel(1).AirModel = DataRoomAirModel::RoomAirModel::Mixing; state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointLo.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointHi.allocate(state->dataGlobal->NumOfZones); From 2583805bba3c425141e59f07d61bf36946fcce7c Mon Sep 17 00:00:00 2001 From: amirroth Date: Wed, 21 Jun 2023 16:27:44 -0400 Subject: [PATCH 02/17] Unify DataZoneEquipment::ZoneEquip with DataHVACGlobals::ZoneEquipTypeOf_* --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 4 +- src/EnergyPlus/BaseboardElectric.cc | 2 +- src/EnergyPlus/BaseboardRadiator.cc | 2 +- src/EnergyPlus/ChilledCeilingPanelSimple.cc | 2 +- src/EnergyPlus/ConvectionCoefficients.cc | 42 +++--- src/EnergyPlus/DataHVACGlobals.cc | 4 +- src/EnergyPlus/DataHVACGlobals.hh | 4 +- src/EnergyPlus/DataRoomAirModel.hh | 4 +- src/EnergyPlus/DataZoneEquipment.cc | 128 ++++++++++-------- src/EnergyPlus/DataZoneEquipment.hh | 74 ++++++---- src/EnergyPlus/ElectricBaseboardRadiator.cc | 2 +- src/EnergyPlus/EvaporativeCoolers.cc | 6 +- src/EnergyPlus/FanCoilUnits.cc | 11 +- src/EnergyPlus/HVACStandAloneERV.cc | 9 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 17 ++- src/EnergyPlus/HWBaseboardRadiator.cc | 2 +- .../HybridUnitaryAirConditioners.cc | 9 +- src/EnergyPlus/MixedAir.cc | 2 +- src/EnergyPlus/OutdoorAirUnit.cc | 8 +- src/EnergyPlus/PurchasedAirManager.cc | 5 +- src/EnergyPlus/ReportCoilSelection.cc | 108 ++++++--------- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 39 ++---- src/EnergyPlus/RoomAirModelManager.cc | 88 ++++++------ src/EnergyPlus/RoomAirModelManager.hh | 3 +- src/EnergyPlus/SingleDuct.cc | 2 +- src/EnergyPlus/SteamBaseboardRadiator.cc | 2 +- src/EnergyPlus/SystemReports.cc | 116 +++++++--------- src/EnergyPlus/UnitHeater.cc | 9 +- src/EnergyPlus/UnitVentilator.cc | 10 +- src/EnergyPlus/UnitarySystem.cc | 51 ++++--- src/EnergyPlus/UnitarySystem.hh | 2 +- src/EnergyPlus/VentilatedSlab.cc | 7 +- src/EnergyPlus/WaterThermalTanks.cc | 19 ++- src/EnergyPlus/WindowAC.cc | 9 +- src/EnergyPlus/ZoneEquipmentManager.cc | 114 ++++++++++------ src/EnergyPlus/ZoneEquipmentManager.hh | 6 +- tst/EnergyPlus/unit/DataZoneEquipment.unit.cc | 12 +- .../unit/HVACUnitaryBypassVAV.unit.cc | 6 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 6 +- .../unit/PackagedTerminalHeatPump.unit.cc | 12 +- .../unit/ReportCoilSelection.unit.cc | 26 ++-- .../unit/RoomAirflowNetwork.unit.cc | 6 +- tst/EnergyPlus/unit/SystemReports.unit.cc | 20 +-- tst/EnergyPlus/unit/UnitHeater.unit.cc | 4 +- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 6 +- .../unit/ZoneHVACEvaporativeCooler.unit.cc | 6 +- 46 files changed, 516 insertions(+), 510 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 71cc6e0428e..f8a47e77db7 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -11214,7 +11214,7 @@ namespace AirflowNetwork { for (int j = 1; j <= m_state.dataGlobal->NumOfZones; ++j) { if (!m_state.dataZoneEquip->ZoneEquipConfig(j).IsControlled) continue; for (int EquipTypeNum = 1; EquipTypeNum <= m_state.dataZoneEquip->ZoneEquipList(j).NumOfEquipTypes; ++EquipTypeNum) { - if (m_state.dataZoneEquip->ZoneEquipList(j).EquipTypeEnum(EquipTypeNum) == DataZoneEquipment::ZoneEquip::ZoneExhaustFan) { + if (m_state.dataZoneEquip->ZoneEquipList(j).EquipType(EquipTypeNum) == DataZoneEquipment::ZoneEquipType::ExhaustFan) { bool found = false; for (int k = 1; k <= m_state.dataZoneEquip->ZoneEquipConfig(j).NumExhaustNodes; ++k) { for (int i = 1; i <= AirflowNetworkNumOfExhFan; ++i) { @@ -12090,7 +12090,7 @@ namespace AirflowNetwork { if (!m_state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) continue; NumOfCtrlZones++; for (int EquipTypeNum = 1; EquipTypeNum <= m_state.dataZoneEquip->ZoneEquipList(ZoneNum).NumOfEquipTypes; ++EquipTypeNum) { - if (m_state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipTypeEnum(EquipTypeNum) == DataZoneEquipment::ZoneEquip::AirDistUnit) { + if (m_state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipType(EquipTypeNum) == DataZoneEquipment::ZoneEquipType::AirDistributionUnit) { int AirDistUnitNum = m_state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipIndex(EquipTypeNum); MdotBranch = m_state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).MassFlowRateTU; break; diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index c0a25acda28..39f287cece9 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -330,7 +330,7 @@ namespace BaseboardElectric { } thisBaseboard.ZonePtr = DataZoneEquipment::GetZoneEquipControlledZoneNum( - state, DataZoneEquipment::ZoneEquip::BBElectricConvective, thisBaseboard.EquipName); + state, DataZoneEquipment::ZoneEquipType::BaseboardConvectiveElectric, thisBaseboard.EquipName); } if (ErrorsFound) { diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index 3fff34f01be..0f766206ff8 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -417,7 +417,7 @@ namespace BaseboardRadiator { } thisBaseboard.ZonePtr = - DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquip::BBWaterConvective, thisBaseboard.EquipID); + DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater, thisBaseboard.EquipID); } if (ErrorsFound) { diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index 0e018636d99..134344ca61e 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -601,7 +601,7 @@ void GetCoolingPanelInput(EnergyPlusData &state) // search zone equipment list structure for zone index for (int ctrlZone = 1; ctrlZone <= state.dataGlobal->NumOfZones; ++ctrlZone) { for (int zoneEquipTypeNum = 1; zoneEquipTypeNum <= state.dataZoneEquip->ZoneEquipList(ctrlZone).NumOfEquipTypes; ++zoneEquipTypeNum) { - if (state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipTypeEnum(zoneEquipTypeNum) == DataZoneEquipment::ZoneEquip::CoolingPanel && + if (state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipType(zoneEquipTypeNum) == DataZoneEquipment::ZoneEquipType::CoolingPanel && state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipName(zoneEquipTypeNum) == thisCP.Name) { thisCP.ZonePtr = ctrlZone; } diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 4c9234547bf..31a50d07f9d 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -3995,9 +3995,9 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu auto &zoneEquipList = state.dataZoneEquip->ZoneEquipList(zoneEquipConfig.EquipListIndex); for (int EquipNum = 1; EquipNum <= zoneEquipList.NumOfEquipTypes; ++EquipNum) { - switch (zoneEquipList.EquipTypeEnum(EquipNum)) { - case DataZoneEquipment::ZoneEquip::AirDistUnit: - case DataZoneEquipment::ZoneEquip::PurchasedAir: { + switch (zoneEquipList.EquipType(EquipNum)) { + case DataZoneEquipment::ZoneEquipType::AirDistributionUnit: + case DataZoneEquipment::ZoneEquipType::PurchasedAir: { if (!allocated(zoneEquipList.EquipData(EquipNum).OutletNodeNums)) continue; // get inlet node, not zone node if possible @@ -4010,15 +4010,15 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum); } } break; - case DataZoneEquipment::ZoneEquip::WindowAC: - case DataZoneEquipment::ZoneEquip::PkgTermHPAirToAir: - case DataZoneEquipment::ZoneEquip::PkgTermACAirToAir: - case DataZoneEquipment::ZoneEquip::ZoneDXDehumidifier: - case DataZoneEquipment::ZoneEquip::PkgTermHPWaterToAir: - case DataZoneEquipment::ZoneEquip::FanCoil4Pipe: - case DataZoneEquipment::ZoneEquip::UnitVentilator: - case DataZoneEquipment::ZoneEquip::UnitHeater: - case DataZoneEquipment::ZoneEquip::OutdoorAirUnit: { + case DataZoneEquipment::ZoneEquipType::WindowAirConditioner: + case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump: + case DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner: + case DataZoneEquipment::ZoneEquipType::DehumidifierDX: + case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir: + case DataZoneEquipment::ZoneEquipType::FourPipeFanCoil: + case DataZoneEquipment::ZoneEquipType::UnitVentilator: + case DataZoneEquipment::ZoneEquipType::UnitHeater: + case DataZoneEquipment::ZoneEquipType::OutdoorAirUnit: { if (!allocated(zoneEquipList.EquipData(EquipNum).OutletNodeNums)) continue; int zoneInletNodeNum = zoneEquipList.EquipData(EquipNum).OutletNodeNums(1); @@ -4031,11 +4031,11 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum); } } break; - case DataZoneEquipment::ZoneEquip::CoolingPanel: - case DataZoneEquipment::ZoneEquip::BBSteam: - case DataZoneEquipment::ZoneEquip::BBWaterConvective: - case DataZoneEquipment::ZoneEquip::BBElectricConvective: - case DataZoneEquipment::ZoneEquip::BBWater: { + case DataZoneEquipment::ZoneEquipType::CoolingPanel: + case DataZoneEquipment::ZoneEquipType::BaseboardSteam: + case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater: + case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveElectric: + case DataZoneEquipment::ZoneEquipType::BaseboardWater: { if (zoneEquipList.EquipData(EquipNum).ON) { EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx); FlowRegimeStack[EquipOnCount] = InConvFlowRegime::B; @@ -4044,8 +4044,8 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu } } break; // Is this the same case as above? - case DataZoneEquipment::ZoneEquip::BBElectric: - case DataZoneEquipment::ZoneEquip::HiTempRadiant: { + case DataZoneEquipment::ZoneEquipType::BaseboardElectric: + case DataZoneEquipment::ZoneEquipType::HighTemperatureRadiant: { if (zoneEquipList.EquipData(EquipNum).ON) { EquipOnCount = min(EquipOnCount + 1, MaxZoneEquipmentIdx); FlowRegimeStack[EquipOnCount] = InConvFlowRegime::B; @@ -4053,8 +4053,8 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu CoolingPriorityStack[EquipOnCount] = zoneEquipList.CoolingPriority(EquipNum); } } break; - case DataZoneEquipment::ZoneEquip::VentilatedSlab: - case DataZoneEquipment::ZoneEquip::LoTempRadiant: { + case DataZoneEquipment::ZoneEquipType::VentilatedSlab: + case DataZoneEquipment::ZoneEquipType::LowTemperatureRadiant: { if (zoneEquipConfig.InFloorActiveElement) { for (int spaceNum : zone.spaceIndexes) { auto const &thisSpace = state.dataHeatBal->space(spaceNum); diff --git a/src/EnergyPlus/DataHVACGlobals.cc b/src/EnergyPlus/DataHVACGlobals.cc index 4e19337557e..caf614d0f96 100644 --- a/src/EnergyPlus/DataHVACGlobals.cc +++ b/src/EnergyPlus/DataHVACGlobals.cc @@ -199,7 +199,7 @@ namespace DataHVACGlobals { Array1D_string const cVRFTUTypes(NumVRFTUTypes, std::string("ZoneHVAC:TerminalUnit:VariableRefrigerantFlow")); Array1D_string const cVRFHeatingPerformanceOATTypes(NumVRFHeatingPerformanceOATTypes, {"WetBulbTemperature", "DryBulbTemperature"}); - +#ifdef GET_OUT constexpr std::array zoneEquipTypeNamesUC = { "DUMMY", "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", @@ -281,7 +281,7 @@ namespace DataHVACGlobals { "AirTerminal:SingleDuct:ConstantVolume:CooledBeam", "AirTerminal:DualDuct:VAV:OutdoorAir", "AirLoopHVACReturnAir"}; - +#endif // } // namespace DataHVACGlobals } // namespace EnergyPlus diff --git a/src/EnergyPlus/DataHVACGlobals.hh b/src/EnergyPlus/DataHVACGlobals.hh index fa5f8b0a040..704a91fa3d0 100644 --- a/src/EnergyPlus/DataHVACGlobals.hh +++ b/src/EnergyPlus/DataHVACGlobals.hh @@ -372,7 +372,7 @@ namespace DataHVACGlobals { // Parameters for HVACSystemRootFindingAlgorithm int constexpr Bisection(2); - +#ifdef GET_OUT enum class ZoneEquipType { Invalid = -1, DUMMY, // There is some back and forth with AFN enumerations here that I just don't want to mess with @@ -427,7 +427,7 @@ namespace DataHVACGlobals { // ZoneUnitarySys extern const std::array zoneEquipTypeNames; extern const std::array zoneEquipTypeNamesUC; - +#endif // int constexpr MaxSpeedLevels = 10; extern Array1D_string const cFanTypes; diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index 47f88781bc0..b1b43b5c9fa 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -55,8 +55,8 @@ // EnergyPlus Headers #include #include -#include #include +#include #include namespace EnergyPlus { @@ -424,7 +424,7 @@ namespace DataRoomAirModel { std::string ObjectTypeName = ""; // HVAC object type name std::string SupplyNodeName = ""; // HVAC system supply node name std::string ReturnNodeName = ""; // HVAC system return node name - DataHVACGlobals::ZoneEquipType zoneEquipType = DataHVACGlobals::ZoneEquipType::Invalid; // HVAC type num + DataZoneEquipment::ZoneEquipType zoneEquipType = DataZoneEquipment::ZoneEquipType::Invalid; // HVAC type num Real64 SupplyFraction = 0.0; // Supply flow fraction Real64 ReturnFraction = 0.0; // Return flow fraction int EquipConfigIndex = 0; // HVAC equipment configuration index diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index ff93222f3fe..40c43dcd53f 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -94,37 +94,59 @@ Array1D_string const cValidSysAvailManagerCompTypes(NumValidSysAvailZoneComponen "ZoneHVAC:EvaporativeCoolerUnit", "ZoneHVAC:HybridUnitaryHVAC"}); -constexpr std::array(ZoneEquip::Num)> ZoneEquipTypeNamesUC = {"NONE", - "ZONEHVAC:FOURPIPEFANCOIL", - "ZONEHVAC:PACKAGEDTERMINALHEATPUMP", - "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER", - "ZONEHVAC:WATERTOAIRHEATPUMP", - "ZONEHVAC:WINDOWAIRCONDITIONER", - "ZONEHVAC:UNITHEATER", - "ZONEHVAC:UNITVENTILATOR", - "ZONEHVAC:ENERGYRECOVERYVENTILATOR", - "ZONEHVAC:VENTILATEDSLAB", - "ZONEHVAC:OUTDOORAIRUNIT", - "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", - "ZONEHVAC:IDEALLOADSAIRSYSTEM", - "ZONEHVAC:EVAPORATIVECOOLERUNIT", - "ZONEHVAC:HYBRIDUNITARYHVAC", - "ZONEHVAC:AIRDISTRIBUTIONUNIT", - "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", - "ZONEHVAC:BASEBOARD:CONVECTIVE:ELECTRIC", - "ZONEHVAC:HIGHTEMPERATURERADIANT", - "ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW", - "FAN:ZONEEXHAUST", - "HEATEXCHANGER:AIRTOAIR:FLATPLATE", - "WATERHEATER:HEATPUMP:PUMPEDCONDENSER", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", - "ZONEHVAC:DEHUMIDIFIER:DX", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:ELECTRIC", - "ZONEHVAC:REFRIGERATIONCHILLERSET", - "ZONEHVAC:FORCEDAIR:USERDEFINED", - "ZONEHVAC:COOLINGPANEL:RADIANTCONVECTIVE:WATER", - "AIRLOOPHVAC:UNITARYSYSTEM"}; +constexpr std::array(ZoneEquipType::Num)> zoneEquipTypeNamesUC = + {"DUMMY", // DUMMY, + + "ZONEHVAC:FOURPIPEFANCOIL", // FanCoilFourPipe + "ZONEHVAC:PACKAGEDTERMINALHEATPUMP", // PackagedTerminalHeatPump + "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER", // PackagedTerminalAirConditioner + "ZONEHVAC:WATERTOAIRHEATPUMP", // PackagedTerminalHeatPumpWaterToAir + "ZONEHVAC:WINDOWAIRCONDITIONER", // WindowAirConditioner + "ZONEHVAC:UNITHEATER", // UnitHeater + "ZONEHVAC:UNITVENTILATOR", // UnitVentilator + "ZONEHVAC:ENERGYRECOVERYVENTILATOR", // EnergyRecoveryVentilator + "ZONEHVAC:VENTILATEDSLAB", // VentilatedSlab + "ZONEHVAC:OUTDOORAIRUNIT", // OutdoorAirUnit + "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", // VariableRefrigerantFlowTerminal + "ZONEHVAC:IDEALLOADSAIRSYSTEM", // IdealLoadsAirSystem + "ZONEHVAC:EVAPORATIVECOOLERUNIT", // EvaporativeCooler + "ZONEHVAC:HYBRIDUNITARYHVAC", // HybridEvaporativeCooler, + + // last zone equipment type to use zone availability manager. The above list must not change or + // NumValidSysAvailZoneComponents must also change. + + "ZONEHVAC:AIRDISTRIBUTIONUNIT", // AirDistributionUnit + "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", // BaseboardWaterConvective + "ZONEHVAC:BASEBOARD:CONVECTIVE:ELECTRIC", // BaseboardElectricConvective + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", // BaseboardSteam + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", // BaseboardWater + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:ELECTRIC", // BaseboardElectric + "ZONEHVAC:HIGHTEMPERATURERADIANT", // HighTempRadiant + "ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW", // LowTempRadiant + "FAN:ZONEEXHAUST", // ExhaustFan + "HEATEXCHANGER:AIRTOAIR:FLATPLATE", // HeatExchanger + "WATERHEATER:HEATPUMP:PUMPEDCONDENSER", // HeatPumpWaterHeater + "ZONEHVAC:DEHUMIDIFIER:DX", // DXDehumidifier + "ZONEHVAC:REFRIGERATIONCHILLERSET", // RefrigerationAirChillerSet + "ZONEHVAC:FORCEDAIR:USERDEFINED", // UserDefinedVACForcedAir + "ZONEHVAC:COOLINGPANEL:RADIANTCONVECTIVE:WATER", // CoolingPanel + "AIRLOOPHVAC:UNITARYSYSTEM", // UnitarySystem + "AIRTERMINAL:DUALDUCT:CONSTANTVOLUME", // AirTerminalDualDuctConstantVolume + "AIRTERMINAL:DUALDUCT:VAV", // AirTerminalDualDuctVAV + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:REHEAT", // AirTerminalSingleDuctConstantVolumeReheat + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:NOREHEAT", // AirTerminalSingleDuctConstantVolumeNoReheat + "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT", // AirTerminalSingleDuctVAVReheat + "AIRTERMINAL:SINGLEDUCT:VAV:NOREHEAT", // AirTerminalSingleDuctVAVNoReheat + "AIRTERMINAL:SINGLEDUCT:SERIESPIU:REHEAT", // AirTerminalSingleDuctSeriesPIUReheat + "AIRTERMINAL:SINGLEDUCT:PARALLELPIU:REHEAT", // AirTerminalSingleDuctParallelPIUReheat + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEINDUCTION", // AirTerminalSingleDuctCAVFourPipeInduction + "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT:VARIABLESPEEDFAN", // AirTerminalSingleDuctVAVReheatVariableSpeedFan + "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT", // AirTerminalSingleDuctVAVHeatAndCoolReheat + "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:NOREHEAT", // AirTerminalSingleDuctVAVHeatAndCoolNoReheat + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", // AirTerminalSingleDuctConstantVolumeCooledBeam + "AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR", // AirTerminalDualDuctVAVOutdoorAir + "AIRLOOPHVACRETURNAIR" // AirLoopHVACReturnAir +}; static constexpr std::array(LoadDist::Num)> LoadDistNamesUC = { "SEQUENTIALLOAD", "UNIFORMLOAD", "UNIFORMPLR", "SEQUENTIALUNIFORMPLR"}; @@ -408,8 +430,8 @@ void GetZoneEquipmentData(EnergyPlusData &state) // Increment overall count of equipment overallEquipCount += thisZoneEquipList.NumOfEquipTypes; + thisZoneEquipList.EquipTypeName.allocate(thisZoneEquipList.NumOfEquipTypes); thisZoneEquipList.EquipType.allocate(thisZoneEquipList.NumOfEquipTypes); - thisZoneEquipList.EquipTypeEnum.allocate(thisZoneEquipList.NumOfEquipTypes); thisZoneEquipList.compPointer.resize(thisZoneEquipList.NumOfEquipTypes + 1); thisZoneEquipList.EquipName.allocate(thisZoneEquipList.NumOfEquipTypes); thisZoneEquipList.EquipIndex.allocate(thisZoneEquipList.NumOfEquipTypes); @@ -420,8 +442,8 @@ void GetZoneEquipmentData(EnergyPlusData &state) thisZoneEquipList.HeatingCapacity.allocate(thisZoneEquipList.NumOfEquipTypes); thisZoneEquipList.SequentialCoolingFractionSchedPtr.allocate(thisZoneEquipList.NumOfEquipTypes); thisZoneEquipList.SequentialHeatingFractionSchedPtr.allocate(thisZoneEquipList.NumOfEquipTypes); - thisZoneEquipList.EquipType = ""; - thisZoneEquipList.EquipTypeEnum = DataZoneEquipment::ZoneEquip::Invalid; + thisZoneEquipList.EquipTypeName = ""; + thisZoneEquipList.EquipType = DataZoneEquipment::ZoneEquipType::Invalid; thisZoneEquipList.EquipName = ""; thisZoneEquipList.EquipIndex = 0; thisZoneEquipList.CoolingPriority = 0; @@ -437,13 +459,13 @@ void GetZoneEquipmentData(EnergyPlusData &state) for (auto &extensibleInstance : extensiblesArray) { ++ZoneEquipTypeNum; - thisZoneEquipList.EquipType(ZoneEquipTypeNum) = + thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum) = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "zone_equipment_object_type"); thisZoneEquipList.EquipName(ZoneEquipTypeNum) = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "zone_equipment_name"); ValidateComponent(state, - thisZoneEquipList.EquipType(ZoneEquipTypeNum), + thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum), thisZoneEquipList.EquipName(ZoneEquipTypeNum), IsNotOK, CurrentModuleObject); @@ -520,13 +542,13 @@ void GetZoneEquipmentData(EnergyPlusData &state) ++thisZoneEquipList.NumAvailCoolEquip; } - thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) = static_cast( - getEnumValue(ZoneEquipTypeNamesUC, UtilityRoutines::makeUPPER(thisZoneEquipList.EquipType(ZoneEquipTypeNum)))); + thisZoneEquipList.EquipType(ZoneEquipTypeNum) = static_cast( + getEnumValue(zoneEquipTypeNamesUC, UtilityRoutines::makeUPPER(thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum)))); - if (thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) == ZoneEquip::ZoneUnitarySys || - thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) == ZoneEquip::PkgTermACAirToAir || - thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) == ZoneEquip::PkgTermHPAirToAir || - thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) == ZoneEquip::PkgTermHPWaterToAir) { + if (thisZoneEquipList.EquipType(ZoneEquipTypeNum) == ZoneEquipType::UnitarySystem || + thisZoneEquipList.EquipType(ZoneEquipTypeNum) == ZoneEquipType::PackagedTerminalAirConditioner || + thisZoneEquipList.EquipType(ZoneEquipTypeNum) == ZoneEquipType::PackagedTerminalHeatPump || + thisZoneEquipList.EquipType(ZoneEquipTypeNum) == ZoneEquipType::PackagedTerminalHeatPumpWaterToAir) { // loop index accesses correct pointer to equipment on this equipment list // EquipIndex is used to access specific equipment for a single class of equipment (e.g., PTAC 1, 2 and 3) thisZoneEquipList.compPointer[ZoneEquipTypeNum] = UnitarySystems::UnitarySys::factory( @@ -534,12 +556,12 @@ void GetZoneEquipmentData(EnergyPlusData &state) thisZoneEquipList.EquipIndex(ZoneEquipTypeNum) = thisZoneEquipList.compPointer[ZoneEquipTypeNum]->getEquipIndex(); } - if (thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) == ZoneEquip::Invalid) { - if (thisZoneEquipList.EquipType(ZoneEquipTypeNum) == "ZONEHVAC:LOWTEMPERATURERADIANT:CONSTANTFLOW" || - thisZoneEquipList.EquipType(ZoneEquipTypeNum) == "ZONEHVAC:LOWTEMPERATURERADIANT:ELECTRIC") { - thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) = ZoneEquip::LoTempRadiant; - } else if (thisZoneEquipList.EquipType(ZoneEquipTypeNum) == "WATERHEATER:HEATPUMP:WRAPPEDCONDENSER") { - thisZoneEquipList.EquipTypeEnum(ZoneEquipTypeNum) = DataZoneEquipment::ZoneEquip::HPWaterHeater; + if (thisZoneEquipList.EquipType(ZoneEquipTypeNum) == ZoneEquipType::Invalid) { + if (thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum) == "ZONEHVAC:LOWTEMPERATURERADIANT:CONSTANTFLOW" || + thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum) == "ZONEHVAC:LOWTEMPERATURERADIANT:ELECTRIC") { + thisZoneEquipList.EquipType(ZoneEquipTypeNum) = ZoneEquipType::LowTemperatureRadiant; + } else if (thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum) == "WATERHEATER:HEATPUMP:WRAPPEDCONDENSER") { + thisZoneEquipList.EquipType(ZoneEquipTypeNum) = DataZoneEquipment::ZoneEquipType::HeatPumpWaterHeater; } else { ShowSevereError(state, format("{}{} = {}", RoutineName, CurrentModuleObject, thisZoneEquipList.Name)); ShowContinueError(state, format("..Invalid Equipment Type = {}", thisZoneEquipList.EquipType(ZoneEquipTypeNum))); @@ -975,7 +997,7 @@ bool CheckZoneEquipmentList(EnergyPlusData &state, for (Loop = 1; Loop <= state.dataGlobal->NumOfZones; ++Loop) { // NumOfZoneEquipLists if (state.dataZoneEquip->ZoneEquipList(Loop).Name.empty()) continue; // dimensioned by NumOfZones. Only valid ones have names. for (ListLoop = 1; ListLoop <= state.dataZoneEquip->ZoneEquipList(Loop).NumOfEquipTypes; ++ListLoop) { - if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(Loop).EquipType(ListLoop), ComponentType)) continue; + if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(Loop).EquipTypeName(ListLoop), ComponentType)) continue; if (ComponentName == "*") { IsOnList = true; CtrlZoneNumLocal = Loop; @@ -1195,7 +1217,7 @@ void EquipList::getPrioritiesForInletNode(EnergyPlusData &state, { bool equipFound = false; for (int equipNum = 1; equipNum <= this->NumOfEquipTypes; ++equipNum) { - if (this->EquipTypeEnum(equipNum) == DataZoneEquipment::ZoneEquip::AirDistUnit) { + if (this->EquipType(equipNum) == DataZoneEquipment::ZoneEquipType::AirDistributionUnit) { if (inletNodeNum == state.dataDefineEquipment->AirDistUnit(this->EquipIndex(equipNum)).OutletNodeNum) { equipFound = true; } @@ -1233,7 +1255,7 @@ Real64 EquipList::SequentialCoolingFraction(EnergyPlusData &state, const int equ return ScheduleManager::GetCurrentScheduleValue(state, SequentialCoolingFractionSchedPtr(equipNum)); } -int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::ZoneEquip const ZoneEquipTypeNum, std::string const &EquipmentName) +int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::ZoneEquipType const zoneEquipType, std::string const &EquipmentName) { static constexpr std::string_view RoutineName("GetZoneEquipControlledZoneNum: "); int ControlZoneNum = 0; @@ -1241,7 +1263,7 @@ int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::Zone for (int CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZone).IsControlled) continue; for (int Num = 1; Num <= state.dataZoneEquip->ZoneEquipList(CtrlZone).NumOfEquipTypes; ++Num) { - if (ZoneEquipTypeNum == state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipTypeEnum(Num) && + if (zoneEquipType == state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipType(Num) && UtilityRoutines::SameString(EquipmentName, state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipName(Num))) { return ControlZoneNum = CtrlZone; } @@ -1250,7 +1272,7 @@ int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::Zone ShowSevereError(state, fmt::format("{}{}=\"{}\" is not on any ZoneHVAC:Equipmentlist. It will not be simulated.", RoutineName, - DataZoneEquipment::ZoneEquipTypeNamesUC[ZoneEquipTypeNum], + zoneEquipTypeNamesUC[(int)zoneEquipType], EquipmentName)); return ControlZoneNum; } diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index 8e4043f3480..72d90b06dd6 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -105,43 +105,61 @@ namespace DataZoneEquipment { // Start zone equip objects // list units that are valid for zone system availability managers first - enum ZoneEquip + enum ZoneEquipType { Invalid = -1, - FanCoil4Pipe = 1, - PkgTermHPAirToAir, - PkgTermACAirToAir, - PkgTermHPWaterToAir, - WindowAC, + DUMMY, + FourPipeFanCoil, + PackagedTerminalHeatPump, + PackagedTerminalAirConditioner, + PackagedTerminalHeatPumpWaterToAir, + WindowAirConditioner, UnitHeater, UnitVentilator, - ERVStandAlone, + EnergyRecoveryVentilator, VentilatedSlab, OutdoorAirUnit, - VRFTerminalUnit, + VariableRefrigerantFlowTerminal, PurchasedAir, - ZoneEvaporativeCoolerUnit, - ZoneHybridEvaporativeCooler, // last zone equipment type to use zone availability manager. The above list must not change or + EvaporativeCooler, + HybridEvaporativeCooler, // last zone equipment type to use zone availability manager. The above list must not change or // NumValidSysAvailZoneComponents must also change. - AirDistUnit, - BBWaterConvective, - BBElectricConvective, - HiTempRadiant, - LoTempRadiant, - ZoneExhaustFan, - HeatXchngr, - HPWaterHeater, - BBWater, - ZoneDXDehumidifier, - BBSteam, - BBElectric, - RefrigerationAirChillerSet, - UserDefinedZoneHVACForcedAir, + AirDistributionUnit, + BaseboardConvectiveWater, + BaseboardConvectiveElectric, + BaseboardSteam, + BaseboardWater, + BaseboardElectric, + HighTemperatureRadiant, + LowTemperatureRadiant, + ExhaustFan, + HeatExchanger, + HeatPumpWaterHeater, + DehumidifierDX, + RefrigerationChillerSet, + UserDefinedHVACForcedAir, CoolingPanel, - ZoneUnitarySys, + UnitarySystem, + AirTerminalDualDuctConstantVolume, + AirTerminalDualDuctVAV, + AirTerminalSingleDuctConstantVolumeReheat, + AirTerminalSingleDuctConstantVolumeNoReheat, + AirTerminalSingleDuctVAVReheat, + AirTerminalSingleDuctVAVNoReheat, + AirTerminalSingleDuctSeriesPIUReheat, + AirTerminalSingleDuctParallelPIUReheat, + AirTerminalSingleDuctCAVFourPipeInduction, + AirTerminalSingleDuctVAVReheatVariableSpeedFan, + AirTerminalSingleDuctVAVHeatAndCoolReheat, + AirTerminalSingleDuctVAVHeatAndCoolNoReheat, + AirTerminalSingleDuctConstantVolumeCooledBeam, + AirTerminalDualDuctVAVOutdoorAir, + AirLoopHVACReturnAir, Num }; + extern const std::array(ZoneEquipType::Num)> zoneEquipTypeNamesUC; + constexpr int NumValidSysAvailZoneComponents(14); extern Array1D_string const cValidSysAvailManagerCompTypes; @@ -383,8 +401,8 @@ namespace DataZoneEquipment { int NumOfEquipTypes; // Number of items on this list int NumAvailHeatEquip; // Number of pieces of equipment available for heating int NumAvailCoolEquip; // Number of pieces of equipment available for cooling - Array1D_string EquipType; // TODO: Convert this from string to enum and remove EquipTypeEnum below - Array1D EquipTypeEnum; + Array1D_string EquipTypeName; // TODO: Convert this from string to enum and remove EquipTypeEnum below + Array1D EquipType; Array1D_string EquipName; Array1D_int EquipIndex; // SystemAvailManagers need to know the index of specific equipment (e.g., PTAC as 1,2,3) @@ -494,7 +512,7 @@ namespace DataZoneEquipment { std::string const &NodeName // Return air node name to match (may be blank) ); - int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::ZoneEquip const ZoneEquipTypeNum, std::string const &EquipmentName); + int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::ZoneEquipType const ZoneEquipType, std::string const &EquipmentName); bool VerifyLightsExhaustNodeForZone(EnergyPlusData &state, int const ZoneNum, int const ZoneExhaustNodeNum); diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index 17ad4c62a36..47302cda1e6 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -386,7 +386,7 @@ namespace ElectricBaseboardRadiator { elecBaseboard.FracDistribToSurf = 0.0; elecBaseboard.ZonePtr = - DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquip::BBElectric, elecBaseboard.EquipName); + DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::BaseboardElectric, elecBaseboard.EquipName); AllFracsSummed = elecBaseboard.FracDistribPerson; for (int SurfNum = 1; SurfNum <= elecBaseboard.TotSurfToDistrib; ++SurfNum) { diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index 80db5a7262d..5679aa44559 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -3775,13 +3775,13 @@ void InitZoneEvaporativeCoolerUnit(EnergyPlusData &state, if (allocated(state.dataHVACGlobal->ZoneComp)) { if (zoneEvapUnit.MyZoneEq) { // initialize the name of each availability manager list and zone number - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::ZoneEvaporativeCoolerUnit).ZoneCompAvailMgrs(UnitNum).AvailManagerListName = + state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::EvaporativeCooler).ZoneCompAvailMgrs(UnitNum).AvailManagerListName = zoneEvapUnit.AvailManagerListName; - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::ZoneEvaporativeCoolerUnit).ZoneCompAvailMgrs(UnitNum).ZoneNum = ZoneNum; + state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::EvaporativeCooler).ZoneCompAvailMgrs(UnitNum).ZoneNum = ZoneNum; zoneEvapUnit.MyZoneEq = false; } zoneEvapUnit.FanAvailStatus = - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::ZoneEvaporativeCoolerUnit).ZoneCompAvailMgrs(UnitNum).AvailStatus; + state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::EvaporativeCooler).ZoneCompAvailMgrs(UnitNum).AvailStatus; } if (!state.dataEvapCoolers->ZoneEquipmentListChecked && state.dataZoneEquip->ZoneEquipInputsFilled) { diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 8ca917b6fa9..31245c64a5b 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -630,7 +630,7 @@ namespace FanCoilUnits { state.dataFanCoilUnits->ATMixerOutNode, fanCoil.AirOutNode); fanCoil.ControlZoneNum = - DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquip::FanCoil4Pipe, fanCoil.Name); + DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::FourPipeFanCoil, fanCoil.Name); if (fanCoil.ControlZoneNum == 0) { ErrorsFound = true; } @@ -1032,14 +1032,13 @@ namespace FanCoilUnits { } if (allocated(state.dataHVACGlobal->ZoneComp)) { + auto &availMgr = state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::FourPipeFanCoil).ZoneCompAvailMgrs(FanCoilNum); if (state.dataFanCoilUnits->MyZoneEqFlag(FanCoilNum)) { // initialize the name of each availability manager list and zone number - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::FanCoil4Pipe).ZoneCompAvailMgrs(FanCoilNum).AvailManagerListName = - fanCoil.AvailManagerListName; - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::FanCoil4Pipe).ZoneCompAvailMgrs(FanCoilNum).ZoneNum = ControlledZoneNum; + availMgr.AvailManagerListName = fanCoil.AvailManagerListName; + availMgr.ZoneNum = ControlledZoneNum; state.dataFanCoilUnits->MyZoneEqFlag(FanCoilNum) = false; } - fanCoil.AvailStatus = - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::FanCoil4Pipe).ZoneCompAvailMgrs(FanCoilNum).AvailStatus; + fanCoil.AvailStatus = availMgr.AvailStatus; } if (state.dataFanCoilUnits->MyPlantScanFlag(FanCoilNum) && allocated(state.dataPlnt->PlantLoop)) { diff --git a/src/EnergyPlus/HVACStandAloneERV.cc b/src/EnergyPlus/HVACStandAloneERV.cc index 2072ff5a642..09c45cb7b8b 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -1139,14 +1139,13 @@ void InitStandAloneERV(EnergyPlusData &state, } if (allocated(state.dataHVACGlobal->ZoneComp)) { + auto &availMgr = state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator).ZoneCompAvailMgrs(StandAloneERVNum); if (state.dataHVACStandAloneERV->MyZoneEqFlag(StandAloneERVNum)) { // initialize the name of each availability manager list and zone number - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::ERVStandAlone).ZoneCompAvailMgrs(StandAloneERVNum).AvailManagerListName = - state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).AvailManagerListName; - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::ERVStandAlone).ZoneCompAvailMgrs(StandAloneERVNum).ZoneNum = ZoneNum; + availMgr.AvailManagerListName = state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).AvailManagerListName; + availMgr.ZoneNum = ZoneNum; state.dataHVACStandAloneERV->MyZoneEqFlag(StandAloneERVNum) = false; } - state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).AvailStatus = - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::ERVStandAlone).ZoneCompAvailMgrs(StandAloneERVNum).AvailStatus; + state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).AvailStatus = availMgr.AvailStatus; } // need to check all units to see if they are on Zone Equipment List or issue warning diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 6b7c11fe023..d69d6b75678 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -5663,14 +5663,13 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool } if (allocated(state.dataHVACGlobal->ZoneComp)) { + auto &availMgr = state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal).ZoneCompAvailMgrs(VRFTUNum); if (state.dataHVACVarRefFlow->MyZoneEqFlag(VRFTUNum)) { // initialize the name of each availability manager list and zone number - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::VRFTerminalUnit).ZoneCompAvailMgrs(VRFTUNum).AvailManagerListName = - state.dataHVACVarRefFlow->VRFTU(VRFTUNum).AvailManagerListName; - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::VRFTerminalUnit).ZoneCompAvailMgrs(VRFTUNum).ZoneNum = ZoneNum; + availMgr.AvailManagerListName = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).AvailManagerListName; + availMgr.ZoneNum = ZoneNum; state.dataHVACVarRefFlow->MyZoneEqFlag(VRFTUNum) = false; } - state.dataHVACVarRefFlow->VRFTU(VRFTUNum).AvailStatus = - state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquip::VRFTerminalUnit).ZoneCompAvailMgrs(VRFTUNum).AvailStatus; + state.dataHVACVarRefFlow->VRFTU(VRFTUNum).AvailStatus = availMgr.AvailStatus; } if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MySuppCoilPlantScanFlag && allocated(state.dataPlnt->PlantLoop)) { @@ -5771,7 +5770,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool for (ELLoop = 1; ELLoop <= state.dataGlobal->NumOfZones; ++ELLoop) { // NumOfZoneEquipLists if (state.dataZoneEquip->ZoneEquipList(ELLoop).Name == "") continue; // dimensioned by NumOfZones. Only valid ones have names. for (ListLoop = 1; ListLoop <= state.dataZoneEquip->ZoneEquipList(ELLoop).NumOfEquipTypes; ++ListLoop) { - if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(ELLoop).EquipType(ListLoop), + if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(ELLoop).EquipTypeName(ListLoop), DataHVACGlobals::cVRFTUTypes(state.dataHVACVarRefFlow->VRFTU(TUIndex).VRFTUType_Num))) continue; if (!UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(ELLoop).EquipName(ListLoop), @@ -5920,7 +5919,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool EquipList_exit:; if (ctrlZoneNum > 0) { int inletNodeADUNum = 0; - DataZoneEquipment::ZoneEquip sysType_Num = DataZoneEquipment::ZoneEquip::Invalid; + DataZoneEquipment::ZoneEquipType sysType_Num = DataZoneEquipment::ZoneEquipType::Invalid; std::string sysName = ""; for (int inletNode = 1; inletNode <= state.dataZoneEquip->ZoneEquipConfig(ctrlZoneNum).NumInletNodes; inletNode++) { if (state.dataZoneEquip->ZoneEquipConfig(ctrlZoneNum).InletNodeAirLoopNum(inletNode) != @@ -5928,7 +5927,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool continue; inletNodeADUNum = state.dataZoneEquip->ZoneEquipConfig(ctrlZoneNum).InletNodeADUNum(inletNode); if (inletNodeADUNum > 0 && inletNodeADUNum <= (int)state.dataDefineEquipment->AirDistUnit.size()) { - sysType_Num = DataZoneEquipment::ZoneEquip::AirDistUnit; + sysType_Num = DataZoneEquipment::ZoneEquipType::AirDistributionUnit; sysName = state.dataDefineEquipment->AirDistUnit(inletNodeADUNum).Name; break; } @@ -5940,7 +5939,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ctrlZoneNum).EquipListIndex).NumOfEquipTypes; ++EquipNum) { if ((state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ctrlZoneNum).EquipListIndex) - .EquipTypeEnum(EquipNum) != sysType_Num) || + .EquipType(EquipNum) != sysType_Num) || state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(ctrlZoneNum).EquipListIndex) .EquipName(EquipNum) != sysName) continue; diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index 010a1abb109..ce8be22e9b1 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -631,7 +631,7 @@ namespace HWBaseboardRadiator { thisHWBaseboard.FracDistribToSurf = 0.0; thisHWBaseboard.ZonePtr = - DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquip::BBWater, thisHWBaseboard.Name); + DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::BaseboardWater, thisHWBaseboard.Name); AllFracsSummed = HWBaseboardDesignDataObject.FracDistribPerson; for (SurfNum = 1; SurfNum <= thisHWBaseboard.TotSurfToDistrib; ++SurfNum) { diff --git a/src/EnergyPlus/HybridUnitaryAirConditioners.cc b/src/EnergyPlus/HybridUnitaryAirConditioners.cc index a26aa8caaf6..10b5bc9b5dc 100644 --- a/src/EnergyPlus/HybridUnitaryAirConditioners.cc +++ b/src/EnergyPlus/HybridUnitaryAirConditioners.cc @@ -220,14 +220,13 @@ void InitZoneHybridUnitaryAirConditioners(EnergyPlusData &state, // set the availability status based on the availability manager list name if (allocated(ZoneComp)) { + auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::HybridEvaporativeCooler).ZoneCompAvailMgrs(UnitNum); if (state.dataHybridUnitaryAC->MyZoneEqFlag(UnitNum)) { // initialize the name of each availability manager list and zone number - ZoneComp(DataZoneEquipment::ZoneEquip::ZoneHybridEvaporativeCooler).ZoneCompAvailMgrs(UnitNum).AvailManagerListName = - state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitNum).AvailManagerListName; - ZoneComp(DataZoneEquipment::ZoneEquip::ZoneHybridEvaporativeCooler).ZoneCompAvailMgrs(UnitNum).ZoneNum = ZoneNum; + availMgr.AvailManagerListName = state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitNum).AvailManagerListName; + availMgr.ZoneNum = ZoneNum; state.dataHybridUnitaryAC->MyZoneEqFlag(UnitNum) = false; } - state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitNum).AvailStatus = - ZoneComp(DataZoneEquipment::ZoneEquip::ZoneHybridEvaporativeCooler).ZoneCompAvailMgrs(UnitNum).AvailStatus; + state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitNum).AvailStatus = availMgr.AvailStatus; } // need to check all zone outdoor air control units to see if they are on Zone Equipment List or issue warning diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index aad37d016e8..aa7c07e8aac 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -1633,7 +1633,7 @@ void GetOAControllerInputs(EnergyPlusData &state) for (int EquipListNum = 1; EquipListNum <= state.dataZoneEquip->NumOfZoneEquipLists; ++EquipListNum) { if (EquipListNum == EquipListIndex) { for (int EquipNum = 1; EquipNum <= state.dataZoneEquip->ZoneEquipList(EquipListNum).NumOfEquipTypes; ++EquipNum) { - if (UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(EquipListNum).EquipType(EquipNum), + if (UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(EquipListNum).EquipTypeName(EquipNum), "ZONEHVAC:AIRDISTRIBUTIONUNIT")) { for (int ADUNum = 1; ADUNum <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++ADUNum) { if (UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(EquipListNum).EquipName(EquipNum), diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 1d40e8d2eb0..88718c9b661 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -1190,13 +1190,13 @@ namespace OutdoorAirUnit { } if (allocated(ZoneComp)) { + auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::OutdoorAirUnit).ZoneCompAvailMgrs(OAUnitNum); if (state.dataOutdoorAirUnit->MyZoneEqFlag(OAUnitNum)) { // initialize the name of each availability manager list and zone number - ZoneComp(DataZoneEquipment::ZoneEquip::OutdoorAirUnit).ZoneCompAvailMgrs(OAUnitNum).AvailManagerListName = - thisOutAirUnit.AvailManagerListName; - ZoneComp(DataZoneEquipment::ZoneEquip::OutdoorAirUnit).ZoneCompAvailMgrs(OAUnitNum).ZoneNum = ZoneNum; + availMgr.AvailManagerListName = thisOutAirUnit.AvailManagerListName; + availMgr.ZoneNum = ZoneNum; state.dataOutdoorAirUnit->MyZoneEqFlag(OAUnitNum) = false; } - thisOutAirUnit.AvailStatus = ZoneComp(DataZoneEquipment::ZoneEquip::OutdoorAirUnit).ZoneCompAvailMgrs(OAUnitNum).AvailStatus; + thisOutAirUnit.AvailStatus = availMgr.AvailStatus; } if (state.dataOutdoorAirUnit->MyPlantScanFlag(OAUnitNum) && allocated(state.dataPlnt->PlantLoop)) { diff --git a/src/EnergyPlus/PurchasedAirManager.cc b/src/EnergyPlus/PurchasedAirManager.cc index 83db6ad5cd2..5ad52758b7f 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -2156,8 +2156,9 @@ void CalcPurchAirLoads(EnergyPlusData &state, QZnCoolSP = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ControlledZoneNum).RemainingOutputReqToCoolSP; if (allocated(ZoneComp)) { - ZoneComp(DataZoneEquipment::ZoneEquip::PurchasedAir).ZoneCompAvailMgrs(PurchAirNum).ZoneNum = ControlledZoneNum; - PurchAir(PurchAirNum).AvailStatus = ZoneComp(DataZoneEquipment::ZoneEquip::PurchasedAir).ZoneCompAvailMgrs(PurchAirNum).AvailStatus; + auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::PurchasedAir).ZoneCompAvailMgrs(PurchAirNum); + availMgr.ZoneNum = ControlledZoneNum; + PurchAir(PurchAirNum).AvailStatus = availMgr.AvailStatus; // Check if the hybrid ventilation availability manager is turning the unit off if (PurchAir(PurchAirNum).AvailStatus == ForceOff) { UnitOn = false; diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index b2ac04f2b17..ef04bd0664d 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -600,49 +600,42 @@ void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVec c->userNameforHVACsystem = "Unknown"; // now search equiment if (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes == 1) { // this must be it, fill strings for type and name - c->typeHVACname = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(1); + c->typeHVACname = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeName(1); c->userNameforHVACsystem = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(1); c->coilLocation = "Zone Equipment"; - c->zoneHVACTypeNum = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(1); + c->zoneHVACTypeNum = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(1); c->zoneHVACIndex = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipIndex(1); } else if (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes > 1) { -#ifdef GET_OUT_FOR_NOW bool foundOne(false); for (int equipLoop = 1; equipLoop <= state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes; ++equipLoop) { // go with the first ZoneHVAC device in the list - if ((state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_VariableRefrigerantFlow) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_EnergyRecoveryVentilator) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == DataHVACGlobals::ZoneEquipTypeOf_FourPipeFanCoil) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == DataHVACGlobals::ZoneEquipTypeOf_OutdoorAirUnit) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_PackagedTerminalAirConditioner) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_PackagedTerminalHeatPump) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == DataHVACGlobals::ZoneEquipTypeOf_UnitHeater) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == DataHVACGlobals::ZoneEquipTypeOf_UnitVentilator) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == DataHVACGlobals::ZoneEquipTypeOf_VentilatedSlab) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_WaterToAirHeatPump) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_WindowAirConditioner) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == DataHVACGlobals::ZoneEquipTypeOf_DehumidifierDX)) { + DataZoneEquipment::ZoneEquipType equipType = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(equipLoop); + if (equipType == DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal || + equipType == DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator || + equipType == DataZoneEquipment::ZoneEquipType::FourPipeFanCoil || + equipType == DataZoneEquipment::ZoneEquipType::OutdoorAirUnit || + equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner || + equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump || + equipType == DataZoneEquipment::ZoneEquipType::UnitHeater || + equipType == DataZoneEquipment::ZoneEquipType::UnitVentilator || + equipType == DataZoneEquipment::ZoneEquipType::VentilatedSlab || + equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir || + equipType == DataZoneEquipment::ZoneEquipType::WindowAirConditioner || + equipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { if (!foundOne) { - c->typeHVACname = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(equipLoop); + c->typeHVACname = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeName(equipLoop); c->userNameforHVACsystem = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(equipLoop); foundOne = true; c->coilLocation = "Zone Equipment"; - c->zoneHVACTypeNum = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop); + c->zoneHVACTypeNum = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(equipLoop); c->zoneHVACIndex = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipIndex(equipLoop); } else { // or may have found another - c->typeHVACname += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(equipLoop); + c->typeHVACname += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeName(equipLoop); c->userNameforHVACsystem += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(equipLoop); } } } -#endif // } } } @@ -658,53 +651,42 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) c->coilLocation = "Unknown"; c->typeHVACname = "Unknown"; c->userNameforHVACsystem = "Unknown"; - // now search equiment - if (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes == 1) { // this must be it, fill strings for type and name - c->typeHVACname = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(1); - c->userNameforHVACsystem = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(1); + // now search equipment + auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum); + if (zoneEquipList.NumOfEquipTypes == 1) { // this must be it, fill strings for type and name + c->typeHVACname = zoneEquipList.EquipType(1); + c->userNameforHVACsystem = zoneEquipList.EquipName(1); c->coilLocation = "Zone Equipment"; - } else if (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes > 1) { -#ifdef GET_OUT_FOR_NOW + } else if (zoneEquipList.NumOfEquipTypes > 1) { bool foundOne(false); - for (int equipLoop = 1; equipLoop <= state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).NumOfEquipTypes; ++equipLoop) { + for (int equipLoop = 1; equipLoop <= zoneEquipList.NumOfEquipTypes; ++equipLoop) { // go with the first ZoneHVAC device in the list - if ((state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_VariableRefrigerantFlow) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_EnergyRecoveryVentilator) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_FourPipeFanCoil) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_OutdoorAirUnit) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_PackagedTerminalAirConditioner) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_PackagedTerminalHeatPump) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == DataHVACGlobals::ZoneEquipTypeOf_UnitHeater) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_UnitVentilator) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_VentilatedSlab) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_WaterToAirHeatPump) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_WindowAirConditioner) || - (state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeEnum(equipLoop) == - DataHVACGlobals::ZoneEquipTypeOf_DehumidifierDX)) { + DataZoneEquipment::ZoneEquipType equipType = zoneEquipList.EquipType(equipLoop); + if (equipType == DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal || + equipType == DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator || + equipType == DataZoneEquipment::ZoneEquipType::FourPipeFanCoil || + equipType == DataZoneEquipment::ZoneEquipType::OutdoorAirUnit || + equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner || + equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump || + equipType == DataZoneEquipment::ZoneEquipType::UnitHeater || + equipType == DataZoneEquipment::ZoneEquipType::UnitVentilator || + equipType == DataZoneEquipment::ZoneEquipType::VentilatedSlab || + equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir || + equipType == DataZoneEquipment::ZoneEquipType::WindowAirConditioner || + equipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { if (!foundOne) { - c->typeHVACname = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(equipLoop); - c->userNameforHVACsystem = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(equipLoop); + c->typeHVACname = zoneEquipList.EquipTypeName(equipLoop); + c->userNameforHVACsystem = zoneEquipList.EquipName(equipLoop); foundOne = true; c->coilLocation = "Zone Equipment"; } else { // or may have found another - c->typeHVACname += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(equipLoop); - c->userNameforHVACsystem += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(equipLoop); + c->typeHVACname += " or " + zoneEquipList.EquipTypeName(equipLoop); + c->userNameforHVACsystem += " or " + zoneEquipList.EquipName(equipLoop); } } - } // for (loop) -#endif // - } - } + } // for (equipLoop) + } // if (zoneEquipList.numOfEquipTypes > 0) + } // if (c->ZoneEqNum > 0) if (c->airloopNum > 0 && c->zoneEqNum == 0) { c->coilLocation = "AirLoop"; diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 931caab4dfb..d1236960c5b 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -358,7 +358,7 @@ namespace RoomAirModelAirflowNetwork { ++EquipLoop) { // loop over all the equip for a single room air node // Check zone equipment name for (I = 1; I <= state.dataZoneEquip->ZoneEquipList(LoopZone).NumOfEquipTypes; ++I) { // loop over all equip types - if (state.dataZoneEquip->ZoneEquipList(LoopZone).EquipTypeEnum(I) == DataZoneEquipment::ZoneEquip::AirDistUnit) { + if (state.dataZoneEquip->ZoneEquipList(LoopZone).EquipType(I) == DataZoneEquipment::ZoneEquipType::AirDistributionUnit) { if (numAirDistUnits == 0) numAirDistUnits = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "ZoneHVAC:AirDistributionUnit"); @@ -1274,14 +1274,7 @@ namespace RoomAirModelAirflowNetwork { // PURPOSE OF THIS SUBROUTINE: // Sum system response from none air systems - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - // USE STATEMENTS: - using DataHVACGlobals::ZoneEquipType; using BaseboardElectric::SimElectricBaseboard; using BaseboardRadiator::SimBaseboard; using ElectricBaseboardRadiator::SimElecBaseboard; @@ -1305,14 +1298,14 @@ namespace RoomAirModelAirflowNetwork { auto &roomAFNNodeHVAC = roomAFNNode.HVAC(I); switch (roomAFNNodeHVAC.zoneEquipType) { - case ZoneEquipType::BaseboardRadiantConvectiveWater: { + case DataZoneEquipment::ZoneEquipType::BaseboardWater: { //'ZoneHVAC:Baseboard:RadiantConvective:Water' 13 SimHWBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; - case ZoneEquipType::BaseboardRadiantConvectiveSteam: { + case DataZoneEquipment::ZoneEquipType::BaseboardSteam: { // CASE(BBSteam_Num) !'ZoneHVAC:Baseboard:RadiantConvective:Steam' 14 SimSteamBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); @@ -1320,35 +1313,35 @@ namespace RoomAirModelAirflowNetwork { // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; - case ZoneEquipType::BaseboardConvectiveWater: { + case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater: { // CASE(BBWaterConvective_Num) !'ZoneHVAC:Baseboard:Convective:Water' 16 SimBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; - case ZoneEquipType::BaseboardConvectiveElectric: { + case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveElectric: { // CASE(BBElectricConvective_Num) !'ZoneHVAC:Baseboard:Convective:Electric' 15 SimElectricBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, SysOutputProvided, roomAFNNodeHVAC.CompIndex); roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; - case ZoneEquipType::RefrigerationChillerSet: { + case DataZoneEquipment::ZoneEquipType::RefrigerationChillerSet: { // CASE(RefrigerationAirChillerSet_Num) !'ZoneHVAC:RefrigerationChillerSet' 20 SimAirChillerSet( state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, LatOutputProvided, roomAFNNodeHVAC.CompIndex); roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; } break; - case ZoneEquipType::BaseboardRadiantConvectiveElectric: { + case DataZoneEquipment::ZoneEquipType::BaseboardElectric: { // CASE(BBElectric_Num) !'ZoneHVAC:Baseboard:RadiantConvective:Electric' 12 SimElecBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; - case ZoneEquipType::HighTemperatureRadiant: { + case DataZoneEquipment::ZoneEquipType::HighTemperatureRadiant: { // CASE(BBElectric_Num) !'ZoneHVAC:HighTemperatureRadiant' 17 SimHighTempRadiantSystem(state, roomAFNNodeHVAC.Name, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; @@ -1377,19 +1370,9 @@ namespace RoomAirModelAirflowNetwork { // PURPOSE OF THIS SUBROUTINE: // Sum system sensible loads used at the next time step - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - // USE STATEMENTS: - using DataHVACGlobals::ZoneEquipType; using ZoneDehumidifier::SimZoneDehumidifier; - // Return value - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int I; Real64 SysOutputProvided; @@ -1404,8 +1387,8 @@ namespace RoomAirModelAirflowNetwork { SysOutputProvided = 0.0; for (RoomAirNode = 1; RoomAirNode <= ThisRAFNZone.NumOfAirNodes; ++RoomAirNode) { ThisRAFNZone.Node(RoomAirNode).SysDepZoneLoadsLaggedOld = 0.0; - for (I = 1; I <= ThisRAFNZone.Node(RoomAirNode).NumHVACs; ++I) { - if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).zoneEquipType == ZoneEquipType::DehumidifierDX) { + for (int I = 1; I <= ThisRAFNZone.Node(RoomAirNode).NumHVACs; ++I) { + if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { if (SysOutputProvided == 0.0) SimZoneDehumidifier(state, ThisRAFNZone.Node(RoomAirNode).HVAC(I).Name, @@ -1422,7 +1405,7 @@ namespace RoomAirModelAirflowNetwork { if (SysOutputProvided > 0.0) { for (RoomAirNode = 1; RoomAirNode <= ThisRAFNZone.NumOfAirNodes; ++RoomAirNode) { for (I = 1; I <= ThisRAFNZone.Node(RoomAirNode).NumHVACs; ++I) { - if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).zoneEquipType == ZoneEquipType::DehumidifierDX) { + if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { ThisRAFNZone.Node(RoomAirNode).SysDepZoneLoadsLaggedOld += ThisRAFNZone.Node(RoomAirNode).HVAC(I).SupplyFraction * SysOutputProvided; } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 197aa714cce..4f41fa51160 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1695,8 +1695,8 @@ namespace RoomAirModelManager { int iEquipArg = 2 + (iEquip - 1) * 2; auto &roomAFNNodeHVAC = roomAFNNode.HVAC(iEquip); roomAFNNodeHVAC.zoneEquipType = - static_cast(getEnumValue(DataHVACGlobals::zoneEquipTypeNamesUC, ipsc->cAlphaArgs(iEquipArg))); - if (roomAFNNodeHVAC.zoneEquipType == DataHVACGlobals::ZoneEquipType::Invalid) { + static_cast(getEnumValue(DataZoneEquipment::zoneEquipTypeNamesUC, ipsc->cAlphaArgs(iEquipArg))); + if (roomAFNNodeHVAC.zoneEquipType == DataZoneEquipment::ZoneEquipType::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(iEquipArg), ipsc->cAlphaArgs(iEquipArg)); ErrorsFound = true; } @@ -1713,7 +1713,6 @@ namespace RoomAirModelManager { IntEquipError = CheckEquipName( state, - roomAFNNodeHVAC.ObjectTypeName, roomAFNNodeHVAC.Name, roomAFNNodeHVAC.SupplyNodeName, roomAFNNodeHVAC.ReturnNodeName, @@ -2881,12 +2880,11 @@ namespace RoomAirModelManager { } bool CheckEquipName(EnergyPlusData &state, - std::string const &EquipType, // Equipment type std::string const &EquipName, // Equipment Name std::string &SupplyNodeName, // Supply node name std::string &ReturnNodeName, // Return node name int TotNumEquip, // how many of this equipment type - DataHVACGlobals::ZoneEquipType zoneEquipType + DataZoneEquipment::ZoneEquipType zoneEquipType ) { @@ -2923,9 +2921,9 @@ namespace RoomAirModelManager { SupplyNodeName = ""; - if (zoneEquipType == DataHVACGlobals::ZoneEquipType::Invalid) return EquipFind; + if (zoneEquipType == DataZoneEquipment::ZoneEquipType::Invalid) return EquipFind; - std::string_view equipTypeName = DataHVACGlobals::zoneEquipTypeNamesUC[(int)zoneEquipType]; + std::string_view equipTypeName = DataZoneEquipment::zoneEquipTypeNamesUC[(int)zoneEquipType]; state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, equipTypeName, TotalArgs, NumAlphas, NumNumbers); MaxNums = max(MaxNums, NumNumbers); @@ -2954,158 +2952,158 @@ namespace RoomAirModelManager { } switch (zoneEquipType) { - case DataHVACGlobals::ZoneEquipType::VariableRefrigerantFlow: { // ZoneHVAC:TerminalUnit : VariableRefrigerantFlow + case DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal: { // ZoneHVAC:TerminalUnit : VariableRefrigerantFlow SupplyNodeName = Alphas(4); ReturnNodeName = ""; // Zone return node } break; - case DataHVACGlobals::ZoneEquipType::EnergyRecoveryVentilator: { // ZoneHVAC : EnergyRecoveryVentilator + case DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator: { // ZoneHVAC : EnergyRecoveryVentilator I = GetFanOutletNode(state, "Fan:OnOff", Alphas(4), errorfound); if (errorfound) { } SupplyNodeName = state.dataLoopNodes->NodeID(I); // ????? ReturnNodeName = ""; // Zone exhaust node } break; - case DataHVACGlobals::ZoneEquipType::FourPipeFanCoil: { // ZoneHVAC : FourPipeFanCoil + case DataZoneEquipment::ZoneEquipType::FourPipeFanCoil: { // ZoneHVAC : FourPipeFanCoil SupplyNodeName = Alphas(6); ReturnNodeName = Alphas(5); } break; - case DataHVACGlobals::ZoneEquipType::OutdoorAirUnit: { // ZoneHVAC : OutdoorAirUnit + case DataZoneEquipment::ZoneEquipType::OutdoorAirUnit: { // ZoneHVAC : OutdoorAirUnit SupplyNodeName = Alphas(13); ReturnNodeName = Alphas(14); } break; - case DataHVACGlobals::ZoneEquipType::PackagedTerminalAirConditioner: { // ZoneHVAC : PackagedTerminalAirConditioner + case DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner: { // ZoneHVAC : PackagedTerminalAirConditioner SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); } break; - case DataHVACGlobals::ZoneEquipType::PackagedTerminalHeatPump: { // ZoneHVAC : PackagedTerminalHeatPump + case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump: { // ZoneHVAC : PackagedTerminalHeatPump SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); } break; - case DataHVACGlobals::ZoneEquipType::UnitHeater: { // ZoneHVAC : UnitHeater + case DataZoneEquipment::ZoneEquipType::UnitHeater: { // ZoneHVAC : UnitHeater SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); } break; - case DataHVACGlobals::ZoneEquipType::UnitVentilator: { // ZoneHVAC : UnitVentilator + case DataZoneEquipment::ZoneEquipType::UnitVentilator: { // ZoneHVAC : UnitVentilator SupplyNodeName = Alphas(7); ReturnNodeName = Alphas(6); } break; - case DataHVACGlobals::ZoneEquipType::VentilatedSlab: { // ZoneHVAC : VentilatedSlab + case DataZoneEquipment::ZoneEquipType::VentilatedSlab: { // ZoneHVAC : VentilatedSlab SupplyNodeName = Alphas(20); ReturnNodeName = Alphas(18); } break; - case DataHVACGlobals::ZoneEquipType::WaterToAirHeatPump: { // ZoneHVAC : WaterToAirHeatPump + case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir: { // ZoneHVAC : WaterToAirHeatPump SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); } break; - case DataHVACGlobals::ZoneEquipType::WindowAirConditioner: { // ZoneHVAC : WindowAirConditioner + case DataZoneEquipment::ZoneEquipType::WindowAirConditioner: { // ZoneHVAC : WindowAirConditioner SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); } break; - case DataHVACGlobals::ZoneEquipType::BaseboardRadiantConvectiveElectric: { // ZoneHVAC : Baseboard : RadiantConvective : Electric + case DataZoneEquipment::ZoneEquipType::BaseboardElectric: { // ZoneHVAC : Baseboard : RadiantConvective : Electric SupplyNodeName = ""; // convection only } break; - case DataHVACGlobals::ZoneEquipType::BaseboardRadiantConvectiveWater: { // ZoneHVAC : Baseboard : RadiantConvective : Water + case DataZoneEquipment::ZoneEquipType::BaseboardWater: { // ZoneHVAC : Baseboard : RadiantConvective : Water SupplyNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::BaseboardRadiantConvectiveSteam: { // ZoneHVAC : Baseboard : RadiantConvective : Steam + case DataZoneEquipment::ZoneEquipType::BaseboardSteam: { // ZoneHVAC : Baseboard : RadiantConvective : Steam SupplyNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::BaseboardConvectiveElectric: { // ZoneHVAC : Baseboard : Convective : Electric + case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveElectric: { // ZoneHVAC : Baseboard : Convective : Electric SupplyNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::BaseboardConvectiveWater: { // ZoneHVAC : Baseboard : Convective : Water + case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater: { // ZoneHVAC : Baseboard : Convective : Water SupplyNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::HighTemperatureRadiant: { // ZoneHVAC : HighTemperatureRadiant + case DataZoneEquipment::ZoneEquipType::HighTemperatureRadiant: { // ZoneHVAC : HighTemperatureRadiant SupplyNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::DehumidifierDX: { // ZoneHVAC : Dehumidifier : DX + case DataZoneEquipment::ZoneEquipType::DehumidifierDX: { // ZoneHVAC : Dehumidifier : DX SupplyNodeName = Alphas(4); ReturnNodeName = Alphas(3); } break; - case DataHVACGlobals::ZoneEquipType::IdealLoadsAirSystem: { // ZoneHVAC : IdealLoadsAirSystem + case DataZoneEquipment::ZoneEquipType::PurchasedAir: { // ZoneHVAC : IdealLoadsAirSystem SupplyNodeName = Alphas(3); ReturnNodeName = Alphas(4); } break; - case DataHVACGlobals::ZoneEquipType::RefrigerationChillerSet: { // ZoneHVAC : RefrigerationChillerSet + case DataZoneEquipment::ZoneEquipType::RefrigerationChillerSet: { // ZoneHVAC : RefrigerationChillerSet SupplyNodeName = Alphas(5); ReturnNodeName = Alphas(4); } break; - case DataHVACGlobals::ZoneEquipType::HybridUnitaryAirConditioners: { // ZoneHVAC : HybridUnitaryAirConditioners + case DataZoneEquipment::ZoneEquipType::HybridEvaporativeCooler: { // ZoneHVAC : HybridUnitaryAirConditioners SupplyNodeName = Alphas(11); ReturnNodeName = Alphas(9); } break; - case DataHVACGlobals::ZoneEquipType::FanZoneExhaust: { // Fan : ZoneExhaust + case DataZoneEquipment::ZoneEquipType::ExhaustFan: { // Fan : ZoneExhaust SupplyNodeName = ""; // ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? May not use } break; - case DataHVACGlobals::ZoneEquipType::WaterHeaterHeatPump: { // WaterHeater : HeatPump + case DataZoneEquipment::ZoneEquipType::HeatPumpWaterHeater: { // WaterHeater : HeatPump SupplyNodeName = Alphas(8); ReturnNodeName = Alphas(7); // For AirTerminals, find matching return node later } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalDualDuctConstantVolume: { // AirTerminal : DualDuct : ConstantVolume + case DataZoneEquipment::ZoneEquipType::AirTerminalDualDuctConstantVolume: { // AirTerminal : DualDuct : ConstantVolume SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalDualDuctVAV: { // AirTerminal : DualDuct : VAV + case DataZoneEquipment::ZoneEquipType::AirTerminalDualDuctVAV: { // AirTerminal : DualDuct : VAV SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctConstantVolumeReheat: { // AirTerminal : SingleDuct : ConstantVolume : Reheat + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctConstantVolumeReheat: { // AirTerminal : SingleDuct : ConstantVolume : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctConstantVolumeNoReheat: { // AirTerminal : SingleDuct : + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctConstantVolumeNoReheat: { // AirTerminal : SingleDuct : // ConstantVolume : NoReheat SupplyNodeName = Alphas(4); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVReheat: { // AirTerminal : SingleDuct : VAV : Reheat + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctVAVReheat: { // AirTerminal : SingleDuct : VAV : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVNoReheat: { // AirTerminal : SingleDuct : VAV : NoReheat + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctVAVNoReheat: { // AirTerminal : SingleDuct : VAV : NoReheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctSeriesPIUReheat: { // AirTerminal : SingleDuct : SeriesPIU : Reheat + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctSeriesPIUReheat: { // AirTerminal : SingleDuct : SeriesPIU : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctParallelPIUReheat: { // AirTerminal : SingleDuct : ParallelPIU : Reheat + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctParallelPIUReheat: { // AirTerminal : SingleDuct : ParallelPIU : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctCAVFourPipeInduction: { // AirTerminal : SingleDuct : + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctCAVFourPipeInduction: { // AirTerminal : SingleDuct : // ConstantVolume : FourPipeInduction SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVReheatVariableSpeedFan: { // AirTerminal : SingleDuct : VAV + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctVAVReheatVariableSpeedFan: { // AirTerminal : SingleDuct : VAV // : Reheat : VariableSpeedFan SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVHeatAndCoolReheat: { // AirTerminal : SingleDuct : VAV : + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctVAVHeatAndCoolReheat: { // AirTerminal : SingleDuct : VAV : // HeatAndCool : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctVAVHeatAndCoolNoReheat: { // AirTerminal : SingleDuct : VAV : + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctVAVHeatAndCoolNoReheat: { // AirTerminal : SingleDuct : VAV : // HeatAndCool : NoReheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalSingleDuctConstantVolumeCooledBeam: { // AirTerminal : SingleDuct : + case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctConstantVolumeCooledBeam: { // AirTerminal : SingleDuct : // ConstantVolume : CooledBeam SupplyNodeName = Alphas(5); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirTerminalDualDuctVAVOutdoorAir: { // AirTerminal : DualDuct : VAV : OutdoorAir + case DataZoneEquipment::ZoneEquipType::AirTerminalDualDuctVAVOutdoorAir: { // AirTerminal : DualDuct : VAV : OutdoorAir SupplyNodeName = Alphas(3); ReturnNodeName = ""; } break; - case DataHVACGlobals::ZoneEquipType::AirLoopHVACReturnAir: { // AirLoopHVACReturnAir + case DataZoneEquipment::ZoneEquipType::AirLoopHVACReturnAir: { // AirLoopHVACReturnAir SupplyNodeName = Alphas(4); // ReturnNodeName = ""; // } break; diff --git a/src/EnergyPlus/RoomAirModelManager.hh b/src/EnergyPlus/RoomAirModelManager.hh index 1ffef317104..eea8da27d9a 100644 --- a/src/EnergyPlus/RoomAirModelManager.hh +++ b/src/EnergyPlus/RoomAirModelManager.hh @@ -86,12 +86,11 @@ namespace RoomAirModelManager { bool &Errorfound); // find zone number and node number based on the node name bool CheckEquipName(EnergyPlusData &state, - std::string const &EquipType, // Equipment type std::string const &EquipName, // Equipment Name std::string &SupplyNodeName, // Supply node name std::string &ReturnNodeName, // Return node name int TotNumEquip, // how many of this equipment type - DataHVACGlobals::ZoneEquipType zeType); // equipment type number + DataZoneEquipment::ZoneEquipType zoneEquipType); // equipment type number } // namespace RoomAirModelManager diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 27883b8a43d..beb21896255 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -5873,7 +5873,7 @@ void GetATMixers(EnergyPlusData &state) if (UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(3), state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipName(Num)) && UtilityRoutines::SameString(state.dataIPShortCut->cAlphaArgs(2), - state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipType(Num))) { + state.dataZoneEquip->ZoneEquipList(CtrlZone).EquipTypeName(Num))) { state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->SysATMixer(ATMixerNum).ADUNum).ZoneEqNum = CtrlZone; state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum = CtrlZone; // Must wait until InitATMixer to fill other zone equip config data because ultimate zone inlet node is not known yet diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index 5a16420a5bd..10124cd192e 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -704,7 +704,7 @@ namespace SteamBaseboardRadiator { // search zone equipment list structure for zone index for (int ctrlZone = 1; ctrlZone <= state.dataGlobal->NumOfZones; ++ctrlZone) { for (int zoneEquipTypeNum = 1; zoneEquipTypeNum <= state.dataZoneEquip->ZoneEquipList(ctrlZone).NumOfEquipTypes; ++zoneEquipTypeNum) { - if (state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipTypeEnum(zoneEquipTypeNum) == DataZoneEquipment::ZoneEquip::BBSteam && + if (state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipType(zoneEquipTypeNum) == DataZoneEquipment::ZoneEquipType::BaseboardSteam && state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipName(zoneEquipTypeNum) == state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID) { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ZonePtr = ctrlZone; diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index 864ef7f2b54..02f7d05b3b0 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -2568,7 +2568,7 @@ void CreateEnergyReportStructure(EnergyPlusData &state) if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) continue; // Set index of air loop serving zone for (CompNum = 1; CompNum <= state.dataZoneEquip->ZoneEquipList(CtrlZoneNum).NumOfEquipTypes; ++CompNum) { - std::string &TypeOfComp = state.dataZoneEquip->ZoneEquipList(CtrlZoneNum).EquipType(CompNum); + std::string &TypeOfComp = state.dataZoneEquip->ZoneEquipList(CtrlZoneNum).EquipTypeName(CompNum); std::string &NameOfComp = state.dataZoneEquip->ZoneEquipList(CtrlZoneNum).EquipName(CompNum); DataLoopNode::ConnectionObjectType TypeOfCompNum = static_cast( EnergyPlus::getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, TypeOfComp)); @@ -4133,10 +4133,10 @@ void ReportVentilationLoads(EnergyPlusData &state) for (int thisZoneEquipNum = 1; thisZoneEquipNum <= thisZoneEquipList.NumOfEquipTypes; ++thisZoneEquipNum) { auto &thisEquipIndex = thisZoneEquipList.EquipIndex(thisZoneEquipNum); - switch (thisZoneEquipList.EquipTypeEnum(thisZoneEquipNum)) { + switch (thisZoneEquipList.EquipType(thisZoneEquipNum)) { // case statement to cover all possible zone forced air units that could have outside air - case DataZoneEquipment::ZoneEquip::WindowAC: { // Window Air Conditioner + case DataZoneEquipment::ZoneEquipType::WindowAirConditioner: { // Window Air Conditioner int OutAirNode = WindowAC::GetWindowACOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4152,10 +4152,9 @@ void ReportVentilationLoads(EnergyPlusData &state) } else { ZFAUZoneVentLoad += 0.0; } + } break; - break; - } - case DataZoneEquipment::ZoneEquip::VRFTerminalUnit: { + case DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal: { int OutAirNode = HVACVariableRefrigerantFlow::GetVRFTUOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; int ZoneInletAirNode = HVACVariableRefrigerantFlow::GetVRFTUZoneInletAirNode(state, thisEquipIndex); @@ -4170,12 +4169,11 @@ void ReportVentilationLoads(EnergyPlusData &state) } else { ZFAUZoneVentLoad += 0.0; } - - break; - } - case DataZoneEquipment::ZoneEquip::PkgTermHPAirToAir: - case DataZoneEquipment::ZoneEquip::PkgTermACAirToAir: - case DataZoneEquipment::ZoneEquip::PkgTermHPWaterToAir: { + } break; + + case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump: + case DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner: + case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir: { // loop index accesses correct pointer to equipment on this equipment list, DataZoneEquipment::GetZoneEquipmentData // thisEquipIndex (EquipIndex) is used to access specific equipment for a single class of equipment (e.g., PTAC 1, 2 and 3) int OutAirNode = thisZoneEquipList.compPointer[thisZoneEquipNum]->getMixerOANode(); @@ -4190,10 +4188,9 @@ void ReportVentilationLoads(EnergyPlusData &state) // Calculate the zone ventilation load for this supply air path (i.e. zone inlet) ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSysSec; //*KJperJ } - - break; - } - case DataZoneEquipment::ZoneEquip::FanCoil4Pipe: { + } break; + + case DataZoneEquipment::ZoneEquipType::FourPipeFanCoil: { int OutAirNode = FanCoilUnits::GetFanCoilOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4209,10 +4206,9 @@ void ReportVentilationLoads(EnergyPlusData &state) } else { ZFAUZoneVentLoad += 0.0; } - - break; - } - case DataZoneEquipment::ZoneEquip::UnitVentilator: { + } break; + + case DataZoneEquipment::ZoneEquipType::UnitVentilator: { int OutAirNode = UnitVentilator::GetUnitVentilatorOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4228,10 +4224,9 @@ void ReportVentilationLoads(EnergyPlusData &state) } else { ZFAUZoneVentLoad += 0.0; } - - break; - } - case DataZoneEquipment::ZoneEquip::PurchasedAir: { + } break; + + case DataZoneEquipment::ZoneEquipType::PurchasedAir: { ZFAUOutAirFlow += PurchasedAirManager::GetPurchasedAirOutAirMassFlow(state, thisEquipIndex); int ZoneInletAirNode = PurchasedAirManager::GetPurchasedAirZoneInletAirNode(state, thisEquipIndex); if (ZoneInletAirNode > 0) ZFAUFlowRate = max(Node(ZoneInletAirNode).MassFlowRate, 0.0); @@ -4246,10 +4241,9 @@ void ReportVentilationLoads(EnergyPlusData &state) } else { ZFAUZoneVentLoad += 0.0; } - - break; - } - case DataZoneEquipment::ZoneEquip::ERVStandAlone: { + } break; + + case DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator: { int OutAirNode = HVACStandAloneERV::GetStandAloneERVOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4265,15 +4259,13 @@ void ReportVentilationLoads(EnergyPlusData &state) } else { ZFAUZoneVentLoad += 0.0; } - - break; - } - case DataZoneEquipment::ZoneEquip::ZoneUnitarySys: { + } break; + + case DataZoneEquipment::ZoneEquipType::UnitarySystem: { // add accounting for OA when unitary system is used as zone equipment + } break; - break; - } - case DataZoneEquipment::ZoneEquip::OutdoorAirUnit: { + case DataZoneEquipment::ZoneEquipType::OutdoorAirUnit: { int OutAirNode = OutdoorAirUnit::GetOutdoorAirUnitOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4288,10 +4280,9 @@ void ReportVentilationLoads(EnergyPlusData &state) } else { ZFAUZoneVentLoad += 0.0; } - - break; - } - case DataZoneEquipment::ZoneEquip::ZoneHybridEvaporativeCooler: { + } break; + + case DataZoneEquipment::ZoneEquipType::HybridEvaporativeCooler: { int OutAirNode = HybridUnitaryAirConditioners::GetHybridUnitaryACOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4308,36 +4299,33 @@ void ReportVentilationLoads(EnergyPlusData &state) } else { ZFAUZoneVentLoad += 0.0; } - - break; - } - case DataZoneEquipment::ZoneEquip::UnitHeater: - case DataZoneEquipment::ZoneEquip::VentilatedSlab: + } break; + + case DataZoneEquipment::ZoneEquipType::UnitHeater: + case DataZoneEquipment::ZoneEquipType::VentilatedSlab: // ZoneHVAC:EvaporativeCoolerUnit ????? - case DataZoneEquipment::ZoneEquip::ZoneEvaporativeCoolerUnit: - case DataZoneEquipment::ZoneEquip::AirDistUnit: - case DataZoneEquipment::ZoneEquip::BBWaterConvective: - case DataZoneEquipment::ZoneEquip::BBElectricConvective: - case DataZoneEquipment::ZoneEquip::HiTempRadiant: + case DataZoneEquipment::ZoneEquipType::EvaporativeCooler: + case DataZoneEquipment::ZoneEquipType::AirDistributionUnit: + case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater: + case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveElectric: + case DataZoneEquipment::ZoneEquipType::HighTemperatureRadiant: // not sure how HeatExchanger:* could be used as zone equipment ????? - case DataZoneEquipment::ZoneEquip::LoTempRadiant: - case DataZoneEquipment::ZoneEquip::ZoneExhaustFan: - case DataZoneEquipment::ZoneEquip::HeatXchngr: + case DataZoneEquipment::ZoneEquipType::LowTemperatureRadiant: + case DataZoneEquipment::ZoneEquipType::ExhaustFan: + case DataZoneEquipment::ZoneEquipType::HeatExchanger: // HPWaterHeater can be used as zone equipment - case DataZoneEquipment::ZoneEquip::HPWaterHeater: - case DataZoneEquipment::ZoneEquip::BBWater: - case DataZoneEquipment::ZoneEquip::ZoneDXDehumidifier: - case DataZoneEquipment::ZoneEquip::BBSteam: - case DataZoneEquipment::ZoneEquip::BBElectric: - case DataZoneEquipment::ZoneEquip::RefrigerationAirChillerSet: - case DataZoneEquipment::ZoneEquip::UserDefinedZoneHVACForcedAir: - case DataZoneEquipment::ZoneEquip::CoolingPanel: { + case DataZoneEquipment::ZoneEquipType::HeatPumpWaterHeater: + case DataZoneEquipment::ZoneEquipType::BaseboardWater: + case DataZoneEquipment::ZoneEquipType::DehumidifierDX: + case DataZoneEquipment::ZoneEquipType::BaseboardSteam: + case DataZoneEquipment::ZoneEquipType::BaseboardElectric: + case DataZoneEquipment::ZoneEquipType::RefrigerationChillerSet: + case DataZoneEquipment::ZoneEquipType::UserDefinedHVACForcedAir: + case DataZoneEquipment::ZoneEquipType::CoolingPanel: { // do nothing, OA not included - - break; - } + } break; + default: { - ShowFatalError(state, "ReportMaxVentilationLoads: Developer must either create accounting for OA or include in final else if " "to do nothing"); diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 488121df0a8..d36031eef59 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -800,14 +800,13 @@ namespace UnitHeater { } if (allocated(ZoneComp)) { + auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::UnitHeater).ZoneCompAvailMgrs(UnitHeatNum); if (state.dataUnitHeaters->MyZoneEqFlag(UnitHeatNum)) { // initialize the name of each availability manager list and zone number - ZoneComp(DataZoneEquipment::ZoneEquip::UnitHeater).ZoneCompAvailMgrs(UnitHeatNum).AvailManagerListName = - state.dataUnitHeaters->UnitHeat(UnitHeatNum).AvailManagerListName; - ZoneComp(DataZoneEquipment::ZoneEquip::UnitHeater).ZoneCompAvailMgrs(UnitHeatNum).ZoneNum = ZoneNum; + availMgr.AvailManagerListName = state.dataUnitHeaters->UnitHeat(UnitHeatNum).AvailManagerListName; + availMgr.ZoneNum = ZoneNum; state.dataUnitHeaters->MyZoneEqFlag(UnitHeatNum) = false; } - state.dataUnitHeaters->UnitHeat(UnitHeatNum).AvailStatus = - ZoneComp(DataZoneEquipment::ZoneEquip::UnitHeater).ZoneCompAvailMgrs(UnitHeatNum).AvailStatus; + state.dataUnitHeaters->UnitHeat(UnitHeatNum).AvailStatus = availMgr.AvailStatus; } if (state.dataUnitHeaters->MyPlantScanFlag(UnitHeatNum) && allocated(state.dataPlnt->PlantLoop)) { diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 6bcc0237f6d..6f3c6f22504 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -376,7 +376,7 @@ namespace UnitVentilator { if (unitVent.ATMixerType == DataHVACGlobals::ATMixer_InletSide || unitVent.ATMixerType == DataHVACGlobals::ATMixer_SupplySide) { unitVent.ATMixerExists = true; } - unitVent.ZonePtr = DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquip::UnitVentilator, unitVent.Name); + unitVent.ZonePtr = DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::UnitVentilator, unitVent.Name); if (unitVent.ZonePtr == 0) { ErrorsFound = true; } @@ -1103,13 +1103,13 @@ namespace UnitVentilator { } if (allocated(ZoneComp)) { + auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::UnitVentilator).ZoneCompAvailMgrs(UnitVentNum); if (state.dataUnitVentilators->MyZoneEqFlag(UnitVentNum)) { // initialize the name of each availability manager list and zone number - ZoneComp(DataZoneEquipment::ZoneEquip::UnitVentilator).ZoneCompAvailMgrs(UnitVentNum).AvailManagerListName = - unitVent.AvailManagerListName; - ZoneComp(DataZoneEquipment::ZoneEquip::UnitVentilator).ZoneCompAvailMgrs(UnitVentNum).ZoneNum = ZoneNum; + availMgr.AvailManagerListName = unitVent.AvailManagerListName; + availMgr.ZoneNum = ZoneNum; state.dataUnitVentilators->MyZoneEqFlag(UnitVentNum) = false; } - unitVent.AvailStatus = ZoneComp(DataZoneEquipment::ZoneEquip::UnitVentilator).ZoneCompAvailMgrs(UnitVentNum).AvailStatus; + unitVent.AvailStatus = availMgr.AvailStatus; } if (state.dataUnitVentilators->MyPlantScanFlag(UnitVentNum) && allocated(state.dataPlnt->PlantLoop)) { diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 96b01efb10a..cd574f67f83 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -378,16 +378,16 @@ namespace UnitarySystems { // need to move to better location and save thisObjectIndex and thisObjectType in struct // this->m_EquipCompNum is by parent type, not total UnitarySystems // e.g., PTAC = 1,2,3; PTHP = 1,2; PTWSHP = 1,2,3,4; UnitarySystems = 9 total - DataZoneEquipment::ZoneEquip thisObjectType = DataZoneEquipment::ZoneEquip::Invalid; + DataZoneEquipment::ZoneEquipType thisObjectType = DataZoneEquipment::ZoneEquipType::Invalid; switch (this->m_sysType) { case SysType::PackagedAC: - thisObjectType = DataZoneEquipment::ZoneEquip::PkgTermACAirToAir; + thisObjectType = DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner; break; case SysType::PackagedHP: - thisObjectType = DataZoneEquipment::ZoneEquip::PkgTermHPAirToAir; + thisObjectType = DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump; break; case SysType::PackagedWSHP: - thisObjectType = DataZoneEquipment::ZoneEquip::PkgTermHPWaterToAir; + thisObjectType = DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir; break; default: break; @@ -6986,7 +6986,7 @@ namespace UnitarySystems { { std::string cCurrentModuleObject = "ZoneHVAC:PackagedTerminalAirConditioner"; SysType sysTypeNum = SysType::PackagedAC; - DataZoneEquipment::ZoneEquip zoneEqType = DataZoneEquipment::ZoneEquip::Invalid; + DataZoneEquipment::ZoneEquipType zoneEqType = DataZoneEquipment::ZoneEquipType::Invalid; int numPTAC = 0; int numPTHP = 0; int numPTWSHP = 0; @@ -6994,11 +6994,11 @@ namespace UnitarySystems { for (int getPTUnitType = 1; getPTUnitType <= 3; ++getPTUnitType) { if (getPTUnitType == 2) { sysTypeNum = SysType::PackagedHP; - zoneEqType = DataZoneEquipment::ZoneEquip::PkgTermACAirToAir; + zoneEqType = DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner; cCurrentModuleObject = "ZoneHVAC:PackagedTerminalHeatPump"; } else if (getPTUnitType == 3) { sysTypeNum = SysType::PackagedWSHP; - zoneEqType = DataZoneEquipment::ZoneEquip::PkgTermACAirToAir; + zoneEqType = DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner; cCurrentModuleObject = "ZoneHVAC:WaterToAirHeatPump"; } auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject); @@ -7104,7 +7104,7 @@ namespace UnitarySystems { thisSys.UnitType = cCurrentModuleObject; thisSys.m_sysType = sysTypeNum; - thisSys.ZoneEqType = zoneEqType; + thisSys.zoneEquipType = zoneEqType; // TODO: figure out another way to set this next variable // Unitary System will not turn on unless this mode is set OR a different method is used to set air flow rate @@ -7114,11 +7114,11 @@ namespace UnitarySystems { if (sysNum == -1) { // zone equipment require a 1-n index for access to zone availability managers switch (getPTUnitType) { - case 1: + case 1: // Excuse me? ++numPTAC; thisSys.m_EquipCompNum = numPTAC; break; - case 2: + case 2: // Baking powder? ++numPTHP; thisSys.m_EquipCompNum = numPTHP; break; @@ -17116,27 +17116,22 @@ namespace UnitarySystems { void UnitarySys::setSystemParams(EnergyPlusData &state, Real64 &TotalFloorAreaOnAirLoop, const std::string &thisObjectName) { - this->NodeNumOfControlledZone = state.dataZoneEquip->ZoneEquipConfig(this->ControlZoneNum).ZoneNode; + auto &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(this->ControlZoneNum); + this->NodeNumOfControlledZone = zoneEquipConfig.ZoneNode; TotalFloorAreaOnAirLoop = state.dataHeatBal->Zone(this->ControlZoneNum).FloorArea; this->m_AirLoopEquipment = false; - if (state.dataZoneEquip->ZoneEquipConfig(this->ControlZoneNum).EquipListIndex > 0) { - for (int EquipNum = 1; - EquipNum <= - state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(this->ControlZoneNum).EquipListIndex).NumOfEquipTypes; - ++EquipNum) { - if ((state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(this->ControlZoneNum).EquipListIndex) - .EquipTypeEnum(EquipNum) != DataZoneEquipment::ZoneEquip::ZoneUnitarySys) || - state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(this->ControlZoneNum).EquipListIndex) - .EquipName(EquipNum) != thisObjectName) - continue; - this->m_ZoneSequenceCoolingNum = - state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(this->ControlZoneNum).EquipListIndex) - .CoolingPriority(EquipNum); - this->m_ZoneSequenceHeatingNum = - state.dataZoneEquip->ZoneEquipList(state.dataZoneEquip->ZoneEquipConfig(this->ControlZoneNum).EquipListIndex) - .HeatingPriority(EquipNum); - break; + if (zoneEquipConfig.EquipListIndex == 0) + return; + + auto &zoneEquipList = state.dataZoneEquip->ZoneEquipList(zoneEquipConfig.EquipListIndex); + for (int EquipNum = 1; EquipNum <= zoneEquipList.NumOfEquipTypes; ++EquipNum) { + if ((zoneEquipList.EquipType(EquipNum) != DataZoneEquipment::ZoneEquipType::UnitarySystem) || + zoneEquipList.EquipName(EquipNum) != thisObjectName) { + continue; } + this->m_ZoneSequenceCoolingNum = zoneEquipList.CoolingPriority(EquipNum); + this->m_ZoneSequenceHeatingNum = zoneEquipList.HeatingPriority(EquipNum); + break; } } diff --git a/src/EnergyPlus/UnitarySystem.hh b/src/EnergyPlus/UnitarySystem.hh index a25f91db514..f086b56749b 100644 --- a/src/EnergyPlus/UnitarySystem.hh +++ b/src/EnergyPlus/UnitarySystem.hh @@ -489,7 +489,7 @@ namespace UnitarySystems { public: // SZVAV variables - DataZoneEquipment::ZoneEquip ZoneEqType = DataZoneEquipment::ZoneEquip::Invalid; + DataZoneEquipment::ZoneEquipType zoneEquipType = DataZoneEquipment::ZoneEquipType::Invalid; SimAirServingZones::CompType AirloopEqType = SimAirServingZones::CompType::Invalid; int MaxIterIndex = 0; int RegulaFalsiFailedIndex = 0; diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 546f36aab14..9609749f21d 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -1561,12 +1561,13 @@ namespace VentilatedSlab { } if (allocated(ZoneComp)) { + auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::VentilatedSlab).ZoneCompAvailMgrs(Item); if (state.dataVentilatedSlab->MyZoneEqFlag(Item)) { // initialize the name of each availability manager list and zone number - ZoneComp(DataZoneEquipment::ZoneEquip::VentilatedSlab).ZoneCompAvailMgrs(Item).AvailManagerListName = ventSlab.AvailManagerListName; - ZoneComp(DataZoneEquipment::ZoneEquip::VentilatedSlab).ZoneCompAvailMgrs(Item).ZoneNum = VentSlabZoneNum; + availMgr.AvailManagerListName = ventSlab.AvailManagerListName; + availMgr.ZoneNum = VentSlabZoneNum; state.dataVentilatedSlab->MyZoneEqFlag(Item) = false; } - ventSlab.AvailStatus = ZoneComp(DataZoneEquipment::ZoneEquip::VentilatedSlab).ZoneCompAvailMgrs(Item).AvailStatus; + ventSlab.AvailStatus = availMgr.AvailStatus; } if (state.dataVentilatedSlab->MyPlantScanFlag(Item) && allocated(state.dataPlnt->PlantLoop)) { diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index ea357e1356b..20d1296498c 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -4506,12 +4506,13 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) int ZoneEquipListNum = state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).EquipListIndex; int TankCoolingPriority = 0; int TankHeatingPriority = 0; - for (int EquipmentTypeNum = 1; EquipmentTypeNum <= state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum).NumOfEquipTypes; + auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum); + for (int EquipmentTypeNum = 1; EquipmentTypeNum <= zoneEquipList.NumOfEquipTypes; ++EquipmentTypeNum) { - if (state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum).EquipName(EquipmentTypeNum) != HPWH.Name) continue; + if (zoneEquipList.EquipName(EquipmentTypeNum) != HPWH.Name) continue; FoundTankInList = true; - TankCoolingPriority = state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum).CoolingPriority(EquipmentTypeNum); - TankHeatingPriority = state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum).HeatingPriority(EquipmentTypeNum); + TankCoolingPriority = zoneEquipList.CoolingPriority(EquipmentTypeNum); + TankHeatingPriority = zoneEquipList.HeatingPriority(EquipmentTypeNum); break; } // EquipmentTypeNum if (!FoundTankInList) { @@ -4524,13 +4525,11 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) } // check that tank has lower priority than all other non-HPWH objects in Zone // Equipment List - for (int EquipmentTypeNum = 1; EquipmentTypeNum <= state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum).NumOfEquipTypes; - ++EquipmentTypeNum) { - if (UtilityRoutines::SameString(state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum).EquipType(EquipmentTypeNum), - state.dataIPShortCut->cCurrentModuleObject)) + for (int EquipmentTypeNum = 1; EquipmentTypeNum <= zoneEquipList.NumOfEquipTypes; ++EquipmentTypeNum) { + if (UtilityRoutines::SameString(zoneEquipList.EquipTypeName(EquipmentTypeNum), state.dataIPShortCut->cCurrentModuleObject)) continue; - if (TankCoolingPriority > state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum).CoolingPriority(EquipmentTypeNum) || - TankHeatingPriority > state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum).HeatingPriority(EquipmentTypeNum)) { + if (TankCoolingPriority > zoneEquipList.CoolingPriority(EquipmentTypeNum) || + TankHeatingPriority > zoneEquipList.HeatingPriority(EquipmentTypeNum)) { TankNotLowestPriority = true; } } // EquipmentTypeNum diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index 93311ec2be3..296238c83d5 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -831,14 +831,13 @@ namespace WindowAC { } if (allocated(ZoneComp)) { + auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::WindowAirConditioner).ZoneCompAvailMgrs(WindACNum); if (state.dataWindowAC->MyZoneEqFlag(WindACNum)) { // initialize the name of each availability manager list and zone number - ZoneComp(DataZoneEquipment::ZoneEquip::WindowAC).ZoneCompAvailMgrs(WindACNum).AvailManagerListName = - state.dataWindowAC->WindAC(WindACNum).AvailManagerListName; - ZoneComp(DataZoneEquipment::ZoneEquip::WindowAC).ZoneCompAvailMgrs(WindACNum).ZoneNum = ZoneNum; + availMgr.AvailManagerListName = state.dataWindowAC->WindAC(WindACNum).AvailManagerListName; + availMgr.ZoneNum = ZoneNum; state.dataWindowAC->MyZoneEqFlag(WindACNum) = false; } - state.dataWindowAC->WindAC(WindACNum).AvailStatus = - ZoneComp(DataZoneEquipment::ZoneEquip::WindowAC).ZoneCompAvailMgrs(WindACNum).AvailStatus; + state.dataWindowAC->WindAC(WindACNum).AvailStatus = availMgr.AvailStatus; } // need to check all Window AC units to see if they are on Zone Equipment List or issue warning diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index b9e1cb53efd..7216a6cf805 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -3085,7 +3085,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool zoneEqSizing.DesignSizeFromParent = false; } - const int ZoneEquipTypeNum = state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipTypeEnum; + DataZoneEquipment::ZoneEquipType zoneEquipType = state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).equipType; auto &zoneEquipList = state.dataZoneEquip->ZoneEquipList(state.dataSize->CurZoneEqNum); @@ -3093,25 +3093,25 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool bool ValidSAMComp = false; - if (ZoneEquipTypeNum <= NumValidSysAvailZoneComponents) ValidSAMComp = true; + if ((int)zoneEquipType <= NumValidSysAvailZoneComponents) ValidSAMComp = true; auto &ZoneComp = state.dataHVACGlobal->ZoneComp; if (ZoneCompNum > 0 && ValidSAMComp) { - SystemAvailabilityManager::GetZoneEqAvailabilityManager(state, ZoneEquipTypeNum, ZoneCompNum, ErrorFlag); + SystemAvailabilityManager::GetZoneEqAvailabilityManager(state, zoneEquipType, ZoneCompNum, ErrorFlag); - if (ZoneComp(ZoneEquipTypeNum).ZoneCompAvailMgrs(ZoneCompNum).AvailStatus == DataHVACGlobals::CycleOn) { + if (ZoneComp((int)zoneEquipType).ZoneCompAvailMgrs(ZoneCompNum).AvailStatus == DataHVACGlobals::CycleOn) { state.dataHVACGlobal->TurnFansOn = true; state.dataHVACGlobal->TurnFansOff = false; - } else if (ZoneComp(ZoneEquipTypeNum).ZoneCompAvailMgrs(ZoneCompNum).AvailStatus == DataHVACGlobals::ForceOff) { + } else if (ZoneComp((int)zoneEquipType).ZoneCompAvailMgrs(ZoneCompNum).AvailStatus == DataHVACGlobals::ForceOff) { state.dataHVACGlobal->TurnFansOn = false; state.dataHVACGlobal->TurnFansOff = true; } } - switch (ZoneEquipTypeNum) { - case ZoneEquip::AirDistUnit: { // 'ZoneHVAC:AirDistributionUnit' + switch (zoneEquipType) { + case ZoneEquipType::AirDistributionUnit: { // 'ZoneHVAC:AirDistributionUnit' // Air loop system availability manager status only applies to PIU and exhaust fans // Check to see if System Availability Managers are asking for fans to cycle on or shut off // and set fan on/off flags accordingly. @@ -3135,7 +3135,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += NonAirSysOutput; SysOutputProvided = NonAirSysOutput + AirSysOutput; } break; - case ZoneEquip::VRFTerminalUnit: { // 'ZoneHVAC:TerminalUnit:VariableRefrigerantFlow' + + case ZoneEquipType::VariableRefrigerantFlowTerminal: { // 'ZoneHVAC:TerminalUnit:VariableRefrigerantFlow' bool HeatingActive = false; bool CoolingActive = false; int constexpr OAUnitNum = 0; @@ -3154,7 +3155,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool SysOutputProvided, LatOutputProvided); } break; - case ZoneEquip::WindowAC: { // 'ZoneHVAC:WindowAirConditioner' + + case ZoneEquipType::WindowAirConditioner: { // 'ZoneHVAC:WindowAirConditioner' WindowAC::SimWindowAC(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3163,10 +3165,11 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::PkgTermHPAirToAir: // 'ZoneHVAC:PackagedTerminalHeatPump' - case ZoneEquip::PkgTermACAirToAir: // 'ZoneHVAC:PackagedTerminalAirConditioner' - case ZoneEquip::PkgTermHPWaterToAir: // 'ZoneHVAC:WaterToAirHeatPump' - case ZoneEquip::ZoneUnitarySys: { // 'AirloopHVAC:UnitarySystem' + + case ZoneEquipType::PackagedTerminalHeatPump: // 'ZoneHVAC:PackagedTerminalHeatPump' + case ZoneEquipType::PackagedTerminalAirConditioner: // 'ZoneHVAC:PackagedTerminalAirConditioner' + case ZoneEquipType::PackagedTerminalHeatPumpWaterToAir: // 'ZoneHVAC:WaterToAirHeatPump' + case ZoneEquipType::UnitarySystem: { // 'AirloopHVAC:UnitarySystem' int AirLoopNum = 0; bool HeatingActive = false; bool CoolingActive = false; @@ -3186,7 +3189,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool SysOutputProvided, LatOutputProvided); } break; - case ZoneEquip::ZoneDXDehumidifier: { // 'ZoneHVAC:Dehumidifier:DX' + case ZoneEquipType::DehumidifierDX: { // 'ZoneHVAC:Dehumidifier:DX' ZoneDehumidifier::SimZoneDehumidifier(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3201,7 +3204,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool // temperature) SysOutputProvided amount was already sent above to // next Predict-Correct series of calcs via SysDepZoneLoads } break; - case ZoneEquip::FanCoil4Pipe: { // 'ZoneHVAC:FourPipeFanCoil' + + case ZoneEquipType::FourPipeFanCoil: { // 'ZoneHVAC:FourPipeFanCoil' FanCoilUnits::SimFanCoilUnit(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3210,7 +3214,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::UnitVentilator: { // 'ZoneHVAC:UnitVentilator' + + case ZoneEquipType::UnitVentilator: { // 'ZoneHVAC:UnitVentilator' UnitVentilator::SimUnitVentilator(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3219,7 +3224,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::UnitHeater: { // 'ZoneHVAC:UnitHeater' + + case ZoneEquipType::UnitHeater: { // 'ZoneHVAC:UnitHeater' UnitHeater::SimUnitHeater(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3228,7 +3234,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::PurchasedAir: { // 'ZoneHVAC:IdealLoadsAirSystem' + + case ZoneEquipType::PurchasedAir: { // 'ZoneHVAC:IdealLoadsAirSystem' PurchasedAirManager::SimPurchasedAir(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, SysOutputProvided, @@ -3237,7 +3244,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool ControlledZoneNum, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::BBWater: { // 'ZoneHVAC:Baseboard:RadiantConvective:Water' + + case ZoneEquipType::BaseboardWater: { // 'ZoneHVAC:Baseboard:RadiantConvective:Water' HWBaseboardRadiator::SimHWBaseboard(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3248,7 +3256,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - case ZoneEquip::BBSteam: { // 'ZoneHVAC:Baseboard:RadiantConvective:Steam' + + case ZoneEquipType::BaseboardSteam: { // 'ZoneHVAC:Baseboard:RadiantConvective:Steam' SteamBaseboardRadiator::SimSteamBaseboard(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3259,7 +3268,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - case ZoneEquip::BBWaterConvective: { // 'ZoneHVAC:Baseboard:Convective:Water' + + case ZoneEquipType::BaseboardConvectiveWater: { // 'ZoneHVAC:Baseboard:Convective:Water' BaseboardRadiator::SimBaseboard(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3270,7 +3280,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - case ZoneEquip::BBElectricConvective: { // 'ZoneHVAC:Baseboard:Convective:Electric' + + case ZoneEquipType::BaseboardConvectiveElectric: { // 'ZoneHVAC:Baseboard:Convective:Electric' BaseboardElectric::SimElectricBaseboard(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3280,7 +3291,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - case ZoneEquip::CoolingPanel: { // 'ZoneHVAC:CoolingPanel:RadiantConvective:Water' + + case ZoneEquipType::CoolingPanel: { // 'ZoneHVAC:CoolingPanel:RadiantConvective:Water' CoolingPanelSimple::SimCoolingPanel(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3291,7 +3303,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This cooling panel does not add/remove any latent heat } break; - case ZoneEquip::HiTempRadiant: { // 'ZoneHVAC:HighTemperatureRadiant' + + case ZoneEquipType::HighTemperatureRadiant: { // 'ZoneHVAC:HighTemperatureRadiant' HighTempRadiantSystem::SimHighTempRadiantSystem(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, FirstHVACIteration, @@ -3300,7 +3313,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided = 0.0; // This baseboard currently sends its latent heat gain directly to predictor/corrector // via SumLatentHTRadSys... so setting LatOutputProvided = 0.0 } break; - case ZoneEquip::LoTempRadiant: { // 'ZoneHVAC:LowTemperatureRadiant:VariableFlow', + + case ZoneEquipType::LowTemperatureRadiant: { // 'ZoneHVAC:LowTemperatureRadiant:VariableFlow', // 'ZoneHVAC:LowTemperatureRadiant:ConstantFlow' // 'ZoneHVAC:LowTemperatureRadiant:Electric' LowTempRadiantSystem::SimLowTempRadiantSystem(state, @@ -3310,7 +3324,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool zoneEquipList.EquipIndex(EquipPtr)); LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - case ZoneEquip::ZoneExhaustFan: { // 'Fan:ZoneExhaust' + + case ZoneEquipType::ExhaustFan: { // 'Fan:ZoneExhaust' // Air loop system availability manager status only applies to PIU and exhaust fans // Check to see if System Availability Managers are asking for fans to cycle on or shut off // and set fan on/off flags accordingly. @@ -3328,14 +3343,16 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::HeatXchngr: { // 'HeatExchanger:AirToAir:FlatPlate' + + case ZoneEquipType::HeatExchanger: { // 'HeatExchanger:AirToAir:FlatPlate' HeatRecovery::SimHeatRecovery(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, FirstHVACIteration, zoneEquipList.EquipIndex(EquipPtr), DataHVACGlobals::ContFanCycCoil); } break; - case ZoneEquip::ERVStandAlone: { // 'ZoneHVAC:EnergyRecoveryVentilator' + + case ZoneEquipType::EnergyRecoveryVentilator: { // 'ZoneHVAC:EnergyRecoveryVentilator' HVACStandAloneERV::SimStandAloneERV(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3344,7 +3361,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::HPWaterHeater: { // 'WaterHeater:HeatPump:PumpedCondenser' + + case ZoneEquipType::HeatPumpWaterHeater: { // 'WaterHeater:HeatPump:PumpedCondenser' WaterThermalTanks::SimHeatPumpWaterHeater(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, FirstHVACIteration, @@ -3352,7 +3370,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, state.dataZoneEquip->ZoneEquipList(ControlledZoneNum).EquipIndex(EquipPtr)); } break; - case ZoneEquip::VentilatedSlab: { // 'ZoneHVAC:VentilatedSlab' + + case ZoneEquipType::VentilatedSlab: { // 'ZoneHVAC:VentilatedSlab' VentilatedSlab::SimVentilatedSlab(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3361,7 +3380,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::OutdoorAirUnit: { // 'ZoneHVAC:OutdoorAirUnit' + + case ZoneEquipType::OutdoorAirUnit: { // 'ZoneHVAC:OutdoorAirUnit' OutdoorAirUnit::SimOutdoorAirUnit(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3370,7 +3390,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::BBElectric: { // 'ZoneHVAC:Baseboard:RadiantConvective:Electric' + + case ZoneEquipType::BaseboardElectric: { // 'ZoneHVAC:Baseboard:RadiantConvective:Electric' ElectricBaseboardRadiator::SimElecBaseboard(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3381,7 +3402,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - case ZoneEquip::RefrigerationAirChillerSet: { // 'ZoneHVAC:RefrigerationChillerSet' + + case ZoneEquipType::RefrigerationChillerSet: { // 'ZoneHVAC:RefrigerationChillerSet' RefrigeratedCase::SimAirChillerSet(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3392,7 +3414,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; } break; - case ZoneEquip::UserDefinedZoneHVACForcedAir: { + + case ZoneEquipType::UserDefinedHVACForcedAir: { UserDefinedComponents::SimZoneAirUserDefined(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3400,7 +3423,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::ZoneEvaporativeCoolerUnit: { + + case ZoneEquipType::EvaporativeCooler: { EvaporativeCoolers::SimZoneEvaporativeCoolerUnit(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, ControlledZoneNum, @@ -3408,7 +3432,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquip::ZoneHybridEvaporativeCooler: { + + case ZoneEquipType::HybridEvaporativeCooler: { HybridUnitaryAirConditioners::SimZoneHybridUnitaryAirConditioners( state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3417,6 +3442,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; + default: break; } @@ -3527,9 +3553,9 @@ void SetZoneEquipSimOrder(EnergyPlusData &state, int const ControlledZoneNum) int const NumOfEquipTypes(zeq.NumOfEquipTypes); for (int EquipTypeNum = 1; EquipTypeNum <= NumOfEquipTypes; ++EquipTypeNum) { auto &pso(state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum)); - pso.EquipType = zeq.EquipType(EquipTypeNum); + pso.EquipTypeName = zeq.EquipTypeName(EquipTypeNum); pso.EquipName = zeq.EquipName(EquipTypeNum); - pso.EquipTypeEnum = zeq.EquipTypeEnum(EquipTypeNum); + pso.equipType = zeq.EquipType(EquipTypeNum); pso.CoolingPriority = zeq.CoolingPriority(EquipTypeNum); pso.HeatingPriority = zeq.HeatingPriority(EquipTypeNum); pso.EquipPtr = EquipTypeNum; @@ -3538,9 +3564,9 @@ void SetZoneEquipSimOrder(EnergyPlusData &state, int const ControlledZoneNum) EquipTypeNum <= EquipTypeNum_end; ++EquipTypeNum) { // Reset unused upper array portion auto &pso(state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum)); - pso.EquipType.clear(); + pso.EquipTypeName.clear(); pso.EquipName.clear(); - pso.EquipTypeEnum = 0; + pso.equipType = DataZoneEquipment::ZoneEquipType::Invalid; pso.EquipPtr = 0; } @@ -3559,10 +3585,10 @@ void SetZoneEquipSimOrder(EnergyPlusData &state, int const ControlledZoneNum) state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ControlledZoneNum).RemainingOutputRequired >= 0.0)) { // Tuned C++ string swap avoids copying - pso.EquipType.swap(psc.EquipType); + pso.EquipTypeName.swap(psc.EquipTypeName); pso.EquipName.swap(psc.EquipName); std::swap(pso.EquipPtr, psc.EquipPtr); - std::swap(pso.EquipTypeEnum, psc.EquipTypeEnum); + std::swap(pso.equipType, psc.equipType); std::swap(pso.CoolingPriority, psc.CoolingPriority); std::swap(pso.HeatingPriority, psc.HeatingPriority); @@ -6141,7 +6167,7 @@ void GetStandAloneERVNodes(EnergyPlusData &state, DataHeatBalance::ZoneAirBalanc thisZoneAirBalance.OneTimeFlag = true; if (state.dataZoneEquip->ZoneEquipList(ZoneNum).NumOfEquipTypes > 0) { for (int I = 1; I <= state.dataZoneEquip->ZoneEquipList(ZoneNum).NumOfEquipTypes; ++I) { - if (state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipTypeEnum(I) == DataZoneEquipment::ZoneEquip::ERVStandAlone) { + if (state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipType(I) == DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator) { ++thisZoneAirBalance.NumOfERVs; } } @@ -6150,7 +6176,7 @@ void GetStandAloneERVNodes(EnergyPlusData &state, DataHeatBalance::ZoneAirBalanc thisZoneAirBalance.ERVExhaustNode.allocate(thisZoneAirBalance.NumOfERVs); int j = 1; for (int I = 1; I <= state.dataZoneEquip->ZoneEquipList(ZoneNum).NumOfEquipTypes; ++I) { - if (state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipTypeEnum(I) == DataZoneEquipment::ZoneEquip::ERVStandAlone) { + if (state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipType(I) == DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator) { thisZoneAirBalance.ERVInletNode(j) = HVACStandAloneERV::GetStandAloneERVOutAirNode(state, state.dataZoneEquip->ZoneEquipList(ZoneNum).EquipIndex(I)); thisZoneAirBalance.ERVExhaustNode(j) = diff --git a/src/EnergyPlus/ZoneEquipmentManager.hh b/src/EnergyPlus/ZoneEquipmentManager.hh index 3f48b8979d6..ebb89d4cdbb 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.hh +++ b/src/EnergyPlus/ZoneEquipmentManager.hh @@ -70,9 +70,9 @@ namespace ZoneEquipmentManager { struct SimulationOrder { - std::string EquipType; - int EquipTypeEnum = 0; - std::string EquipName; + std::string EquipTypeName = ""; + DataZoneEquipment::ZoneEquipType equipType = DataZoneEquipment::ZoneEquipType::Invalid; + std::string EquipName = ""; int EquipPtr = 0; int CoolingPriority = 0; int HeatingPriority = 0; diff --git a/tst/EnergyPlus/unit/DataZoneEquipment.unit.cc b/tst/EnergyPlus/unit/DataZoneEquipment.unit.cc index 7eea6d33b61..ce5263f05d1 100644 --- a/tst/EnergyPlus/unit/DataZoneEquipment.unit.cc +++ b/tst/EnergyPlus/unit/DataZoneEquipment.unit.cc @@ -403,24 +403,24 @@ TEST_F(EnergyPlusFixture, GetZoneEquipmentData_epJSON) EXPECT_TRUE(compare_enums(DataZoneEquipment::LoadDist::Sequential, thisZoneEquipList.LoadDistScheme)); EXPECT_EQ("FAN ZONE EXHAUST 1", thisZoneEquipList.EquipName(1)); - EXPECT_EQ("FAN:ZONEEXHAUST", thisZoneEquipList.EquipType(1)); - EXPECT_TRUE(compare_enums(DataZoneEquipment::ZoneEquip::ZoneExhaustFan, thisZoneEquipList.EquipTypeEnum(1))); + EXPECT_EQ("FAN:ZONEEXHAUST", thisZoneEquipList.EquipTypeName(1)); + EXPECT_TRUE(compare_enums(DataZoneEquipment::ZoneEquipType::ExhaustFan, thisZoneEquipList.EquipType(1))); EXPECT_EQ(1, thisZoneEquipList.CoolingPriority(1)); EXPECT_EQ(1, thisZoneEquipList.HeatingPriority(1)); EXPECT_EQ(-1, thisZoneEquipList.SequentialCoolingFractionSchedPtr(1)); EXPECT_EQ(-1, thisZoneEquipList.SequentialHeatingFractionSchedPtr(1)); EXPECT_EQ("ADU AIR TERMINAL SINGLE DUCT CONSTANT VOLUME NO REHEAT 1", thisZoneEquipList.EquipName(2)); - EXPECT_EQ("ZONEHVAC:AIRDISTRIBUTIONUNIT", thisZoneEquipList.EquipType(2)); - EXPECT_TRUE(compare_enums(DataZoneEquipment::ZoneEquip::AirDistUnit, thisZoneEquipList.EquipTypeEnum(2))); + EXPECT_EQ("ZONEHVAC:AIRDISTRIBUTIONUNIT", thisZoneEquipList.EquipTypeName(2)); + EXPECT_TRUE(compare_enums(DataZoneEquipment::ZoneEquipType::AirDistributionUnit, thisZoneEquipList.EquipType(2))); EXPECT_EQ(3, thisZoneEquipList.CoolingPriority(2)); EXPECT_EQ(2, thisZoneEquipList.HeatingPriority(2)); EXPECT_EQ(-1, thisZoneEquipList.SequentialCoolingFractionSchedPtr(2)); EXPECT_EQ(-1, thisZoneEquipList.SequentialHeatingFractionSchedPtr(2)); EXPECT_EQ("ADU AIR TERMINAL SINGLE DUCT VAV REHEAT 1", thisZoneEquipList.EquipName(3)); - EXPECT_EQ("ZONEHVAC:AIRDISTRIBUTIONUNIT", thisZoneEquipList.EquipType(3)); - EXPECT_TRUE(compare_enums(DataZoneEquipment::ZoneEquip::AirDistUnit, thisZoneEquipList.EquipTypeEnum(3))); + EXPECT_EQ("ZONEHVAC:AIRDISTRIBUTIONUNIT", thisZoneEquipList.EquipTypeName(3)); + EXPECT_TRUE(compare_enums(DataZoneEquipment::ZoneEquipType::AirDistributionUnit, thisZoneEquipList.EquipType(3))); EXPECT_EQ(2, thisZoneEquipList.CoolingPriority(3)); EXPECT_EQ(3, thisZoneEquipList.HeatingPriority(3)); EXPECT_EQ(-1, thisZoneEquipList.SequentialCoolingFractionSchedPtr(3)); diff --git a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc index d384be5a89e..25827ffed71 100644 --- a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc +++ b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc @@ -124,19 +124,19 @@ class CBVAVSys : public EnergyPlusFixture state->dataZoneEquip->ZoneEquipList(1).Name = "ZONEEQUIPMENT"; int maxEquipCount = 1; state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes = maxEquipCount; + state->dataZoneEquip->ZoneEquipList(1).EquipTypeName.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipType.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipName.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipIndex.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipIndex = 1; state->dataZoneEquip->ZoneEquipList(1).EquipData.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).CoolingPriority.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).HeatingPriority.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); - state->dataZoneEquip->ZoneEquipList(1).EquipType(1) = "ZONEHVAC:AIRDISTRIBUTIONUNIT"; + state->dataZoneEquip->ZoneEquipList(1).EquipTypeName(1) = "ZONEHVAC:AIRDISTRIBUTIONUNIT"; state->dataZoneEquip->ZoneEquipList(1).EquipName(1) = "ZONEREHEATTU"; state->dataZoneEquip->ZoneEquipList(1).CoolingPriority(1) = 1; state->dataZoneEquip->ZoneEquipList(1).HeatingPriority(1) = 1; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::AirDistUnit; + state->dataZoneEquip->ZoneEquipList(1).EquipType(1) = DataZoneEquipment::ZoneEquipType::AirDistributionUnit; state->dataZoneEquip->ZoneEquipConfig(1).NumInletNodes = NumNodes; state->dataZoneEquip->ZoneEquipConfig(1).InletNode.allocate(NumNodes); state->dataZoneEquip->ZoneEquipConfig(1).AirDistUnitCool.allocate(NumNodes); diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index c34462c28f0..a07e44c2d17 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -259,19 +259,19 @@ class AirLoopFixture : public EnergyPlusFixture thisZoneEqList.Name = "ZONE1EQUIPMENT"; int maxEquipCount1 = 1; thisZoneEqList.NumOfEquipTypes = maxEquipCount1; + thisZoneEqList.EquipTypeName.allocate(maxEquipCount1); thisZoneEqList.EquipType.allocate(maxEquipCount1); - thisZoneEqList.EquipTypeEnum.allocate(maxEquipCount1); thisZoneEqList.EquipName.allocate(maxEquipCount1); thisZoneEqList.EquipIndex.allocate(maxEquipCount1); thisZoneEqList.EquipIndex = 1; thisZoneEqList.EquipData.allocate(maxEquipCount1); thisZoneEqList.CoolingPriority.allocate(maxEquipCount1); thisZoneEqList.HeatingPriority.allocate(maxEquipCount1); - thisZoneEqList.EquipType(1) = "NOT A VRF TU"; + thisZoneEqList.EquipTypeName(1) = "NOT A VRF TU"; thisZoneEqList.EquipName(1) = "NO NAME"; thisZoneEqList.CoolingPriority(1) = 1; thisZoneEqList.HeatingPriority(1) = 1; - thisZoneEqList.EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::ZoneUnitarySys; + thisZoneEqList.EquipType(1) = DataZoneEquipment::ZoneEquipType::UnitarySystem; auto &finalZoneSizing(state->dataSize->FinalZoneSizing(zoneNum)); finalZoneSizing.DesCoolVolFlow = 1.5; diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index 8b8e824e209..0468a5b4132 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -4990,7 +4990,7 @@ TEST_F(EnergyPlusFixture, PTAC_AvailabilityManagerTest) int SysAvailNum = 1; int PriAirSysNum = 0; int AvailStatus = 0; - int constexpr ZoneEquipType = DataZoneEquipment::ZoneEquip::PkgTermACAirToAir; + constexpr DataZoneEquipment::ZoneEquipType zoneEquipType = DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner; int constexpr CompNum = 1; bool SimAir = false; // set this as zone equipment @@ -5023,7 +5023,7 @@ TEST_F(EnergyPlusFixture, PTAC_AvailabilityManagerTest) state->dataHeatBalFanSys->TempTstatAir(1) = 21.1; sysAvailMgr.AvailStatus = 0; // run calc system availability requirement - SystemAvailabilityManager::CalcNCycSysAvailMgr(*state, SysAvailNum, PriAirSysNum, AvailStatus, ZoneEquipType, CompNum); + SystemAvailabilityManager::CalcNCycSysAvailMgr(*state, SysAvailNum, PriAirSysNum, AvailStatus, zoneEquipType, CompNum); // check that the fan is off EXPECT_EQ(DataHVACGlobals::NoAction, sysAvailMgr.AvailStatus); EXPECT_FALSE(state->dataHVACGlobal->TurnFansOn); @@ -5038,20 +5038,20 @@ TEST_F(EnergyPlusFixture, PTAC_AvailabilityManagerTest) EXPECT_FALSE(state->dataHVACGlobal->TurnFansOff); // test 2: availability manager status to on - state->dataHVACGlobal->ZoneComp(ZoneEquipType).ZoneCompAvailMgrs(1).StartTime = 0.0; - state->dataHVACGlobal->ZoneComp(ZoneEquipType).ZoneCompAvailMgrs(1).StopTime = 4.0; + state->dataHVACGlobal->ZoneComp(zoneEquipType).ZoneCompAvailMgrs(1).StartTime = 0.0; + state->dataHVACGlobal->ZoneComp(zoneEquipType).ZoneCompAvailMgrs(1).StopTime = 4.0; state->dataHeatBalFanSys->TempZoneThermostatSetPoint(1) = 21.10; state->dataHeatBalFanSys->TempTstatAir(1) = 21.5; sysAvailMgr.AvailStatus = 0; state->dataScheduleMgr->Schedule(1).CurrentValue = 1; state->dataScheduleMgr->Schedule(2).CurrentValue = 0; // run calc system availability requirement - SystemAvailabilityManager::CalcNCycSysAvailMgr(*state, SysAvailNum, PriAirSysNum, AvailStatus, ZoneEquipType, CompNum); + SystemAvailabilityManager::CalcNCycSysAvailMgr(*state, SysAvailNum, PriAirSysNum, AvailStatus, zoneEquipType, CompNum); // check that the availability manager is cycling On EXPECT_EQ(DataHVACGlobals::CycleOn, sysAvailMgr.AvailStatus); EXPECT_FALSE(state->dataHVACGlobal->TurnFansOn); EXPECT_FALSE(state->dataHVACGlobal->TurnFansOff); - state->dataHVACGlobal->ZoneComp(ZoneEquipType).ZoneCompAvailMgrs(1).AvailStatus = DataHVACGlobals::CycleOn; + state->dataHVACGlobal->ZoneComp(zoneEquipType).ZoneCompAvailMgrs(1).AvailStatus = DataHVACGlobals::CycleOn; // run to set zone night cycle manager ZoneEquipmentManager::SimZoneEquipment(*state, true, SimAir); // test global zone fan control variables are turned on diff --git a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc index 027324674ef..34294b0a4e8 100644 --- a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc +++ b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc @@ -312,14 +312,14 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) state->dataZoneEquip->ZoneEquipList.allocate(3); state->dataZoneEquip->ZoneEquipList(curZoneEqNum).NumOfEquipTypes = 2; state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipName.allocate(2); + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeName.allocate(2); state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType.allocate(2); - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeEnum.allocate(2); state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipName(1) = "Zone 2 Fan Coil"; - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType(1) = "ZoneHVAC:FourPipeFanCoil"; - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::FanCoil4Pipe; + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeName(1) = "ZoneHVAC:FourPipeFanCoil"; + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType(1) = DataZoneEquipment::ZoneEquipType::FourPipeFanCoil; state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipName(2) = "Zone 2 Unit Heater"; - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType(2) = "ZoneHVAC:UnitHeater"; - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeEnum(2) = DataZoneEquipment::ZoneEquip::UnitHeater; + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeName(2) = "ZoneHVAC:UnitHeater"; + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType(2) = DataZoneEquipment::ZoneEquipType::UnitHeater; Real64 totGrossCap = 500.0; Real64 sensGrossCap = 500.0; @@ -572,14 +572,14 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) state->dataZoneEquip->ZoneEquipList.allocate(3); state->dataZoneEquip->ZoneEquipList(curZoneEqNum).NumOfEquipTypes = 2; state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipName.allocate(2); + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeName.allocate(2); state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType.allocate(2); - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeEnum.allocate(2); state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipName(1) = "Zone 2 DX Eq"; - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType(1) = "ZoneHVAC:WindowAirConditioner"; - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::WindowAC; + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeName(1) = "ZoneHVAC:WindowAirConditioner"; + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType(1) = DataZoneEquipment::ZoneEquipType::WindowAirConditioner; state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipName(2) = "Zone 2 Unit Heater"; - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType(2) = "ZoneHVAC:UnitHeater"; - state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeEnum(2) = DataZoneEquipment::ZoneEquip::UnitHeater; + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipTypeName(2) = "ZoneHVAC:UnitHeater"; + state->dataZoneEquip->ZoneEquipList(curZoneEqNum).EquipType(2) = DataZoneEquipment::ZoneEquipType::UnitHeater; Real64 totGrossCap = 500.0; Real64 sensGrossCap = 400.0; @@ -820,11 +820,11 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_4PipeFCU_ElecHeatingCoil) zoneEquipList.NumOfEquipTypes = 1; zoneEquipList.EquipName.allocate(1); + zoneEquipList.EquipTypeName.allocate(1); zoneEquipList.EquipType.allocate(1); - zoneEquipList.EquipTypeEnum.allocate(1); zoneEquipList.EquipName(1) = "Zone 1 FCU"; - zoneEquipList.EquipType(1) = "ZoneHVAC:FourPipeFanCoil"; - zoneEquipList.EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::FanCoil4Pipe; + zoneEquipList.EquipTypeName(1) = "ZoneHVAC:FourPipeFanCoil"; + zoneEquipList.EquipType(1) = DataZoneEquipment::ZoneEquipType::FourPipeFanCoil; Real64 totGrossCap = 6206.4; Real64 sensGrossCap = 6206.4; diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 8b8fa5ff328..7791b70334a 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -250,8 +250,8 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataZoneEquip->ZoneEquipList(ZoneNum).NumOfEquipTypes = 1; state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipName.allocate(1); state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipName(1) = "ZoneHVAC"; - state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipTypeEnum.allocate(1); - state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::PkgTermHPAirToAir; + state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipType.allocate(1); + state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipType(1) = DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump; state->dataZoneEquip->ZoneEquipConfig(ZoneNum).NumInletNodes = 1; state->dataZoneEquip->ZoneEquipConfig(ZoneNum).InletNode.allocate(1); @@ -394,7 +394,7 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) ASSERT_TRUE(process_idf(idf_objects)); state->afn->get_input(); - state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::AirDistUnit; + state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipType(1) = DataZoneEquipment::ZoneEquipType::AirDistributionUnit; state->dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf = true; state->dataZoneAirLoopEquipmentManager->GetAirDistUnitsFlag = false; state->dataDefineEquipment->AirDistUnit.allocate(1); diff --git a/tst/EnergyPlus/unit/SystemReports.unit.cc b/tst/EnergyPlus/unit/SystemReports.unit.cc index 4d741047651..2c061664661 100644 --- a/tst/EnergyPlus/unit/SystemReports.unit.cc +++ b/tst/EnergyPlus/unit/SystemReports.unit.cc @@ -235,13 +235,13 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) int NumEquip1 = 9; state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes = NumEquip1; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum.allocate(NumEquip1); + state->dataZoneEquip->ZoneEquipList(1).EquipType.allocate(NumEquip1); state->dataZoneEquip->ZoneEquipList(1).EquipIndex.allocate(NumEquip1); // 1: WindowAC int equipNum = 1; int nodeNumOA = 1; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::WindowAC; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::WindowAirConditioner; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; state->dataWindowAC->GetWindowACInputFlag = false; state->dataWindowAC->WindAC.allocate(1); @@ -251,7 +251,7 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) // 2: VRF ++equipNum; ++nodeNumOA; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::VRFTerminalUnit; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; state->dataHVACVarRefFlow->GetVRFInputFlag = false; state->dataHVACVarRefFlow->NumVRFTU = 1; @@ -262,7 +262,7 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) // 3: PTAC ++equipNum; ++nodeNumOA; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::PkgTermACAirToAir; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; UnitarySystems::UnitarySys thisSys; thisSys.m_OAMixerNodes[0] = nodeNumOA; @@ -274,7 +274,7 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) // 4: FanCoil ++equipNum; ++nodeNumOA; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::FanCoil4Pipe; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::FourPipeFanCoil; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; state->dataFanCoilUnits->GetFanCoilInputFlag = false; state->dataFanCoilUnits->NumFanCoils = 1; @@ -285,7 +285,7 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) // 5: Unit Ventilator ++equipNum; ++nodeNumOA; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::UnitVentilator; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::UnitVentilator; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; state->dataUnitVentilators->GetUnitVentilatorInputFlag = false; state->dataUnitVentilators->NumOfUnitVents = 1; @@ -296,7 +296,7 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) // 6: Purchased Air (Ideal Loads) ++equipNum; ++nodeNumOA; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::PurchasedAir; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::PurchasedAir; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; state->dataPurchasedAirMgr->GetPurchAirInputFlag = false; state->dataPurchasedAirMgr->NumPurchAir = 1; @@ -306,7 +306,7 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) // 7: ERV ++equipNum; ++nodeNumOA; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::ERVStandAlone; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; state->dataHVACStandAloneERV->GetERVInputFlag = false; state->dataHVACStandAloneERV->NumStandAloneERVs = 1; @@ -317,7 +317,7 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) // 8: Outdoor air unit ++equipNum; ++nodeNumOA; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::OutdoorAirUnit; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::OutdoorAirUnit; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; state->dataOutdoorAirUnit->GetOutdoorAirUnitInputFlag = false; state->dataOutdoorAirUnit->NumOfOAUnits = 1; @@ -328,7 +328,7 @@ TEST_F(EnergyPlusFixture, ReportVentilationLoads_ZoneEquip) // 9: Zone Hybrid Unitary ++equipNum; ++nodeNumOA; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(equipNum) = DataZoneEquipment::ZoneEquip::ZoneHybridEvaporativeCooler; + state->dataZoneEquip->ZoneEquipList(1).EquipType(equipNum) = DataZoneEquipment::ZoneEquipType::HybridEvaporativeCooler; state->dataZoneEquip->ZoneEquipList(1).EquipIndex(equipNum) = 1; state->dataHybridUnitaryAC->GetInputZoneHybridEvap = false; state->dataHybridUnitaryAC->NumZoneHybridEvap = 1; diff --git a/tst/EnergyPlus/unit/UnitHeater.unit.cc b/tst/EnergyPlus/unit/UnitHeater.unit.cc index b0f19307b40..721b90add77 100644 --- a/tst/EnergyPlus/unit/UnitHeater.unit.cc +++ b/tst/EnergyPlus/unit/UnitHeater.unit.cc @@ -2463,11 +2463,11 @@ TEST_F(EnergyPlusFixture, UnitHeater_SecondPriorityZoneEquipment) EXPECT_EQ(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes, 2); // first priority zone equipment is zone ADU - EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(1).EquipType, "ZONEHVAC:AIRDISTRIBUTIONUNIT"); + EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(1).EquipTypeName, "ZONEHVAC:AIRDISTRIBUTIONUNIT"); EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(1).EquipName, "MAIN ZONE ATU"); EXPECT_EQ(state->dataHeatingCoils->HeatingCoil(1).Name, "MAIN ZONE REHEAT COIL"); // second priority zone equipment is unit heater - EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(2).EquipType, "ZONEHVAC:UNITHEATER"); + EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(2).EquipTypeName, "ZONEHVAC:UNITHEATER"); EXPECT_EQ(state->dataZoneEquipmentManager->PrioritySimOrder(2).EquipName, "UNITHEATER"); EXPECT_EQ(state->dataHeatingCoils->HeatingCoil(2).Name, "UNITHEATER_ELECTRICHEATER"); // check the reheat coil output diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 3666f48f555..71a713b1e63 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -140,19 +140,19 @@ class ZoneUnitarySysTest : public EnergyPlusFixture state->dataZoneEquip->ZoneEquipList(1).Name = "ZONE2EQUIPMENT"; int maxEquipCount = 1; state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes = maxEquipCount; + state->dataZoneEquip->ZoneEquipList(1).EquipTypeName.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipType.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipName.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipIndex.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipIndex = 1; state->dataZoneEquip->ZoneEquipList(1).EquipData.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).CoolingPriority.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).HeatingPriority.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); - state->dataZoneEquip->ZoneEquipList(1).EquipType(1) = "AIRLOOPHVAC:UNITARYSYSTEM"; + state->dataZoneEquip->ZoneEquipList(1).EquipTypeName(1) = "AIRLOOPHVAC:UNITARYSYSTEM"; state->dataZoneEquip->ZoneEquipList(1).EquipName(1) = "UNITARY SYSTEM MODEL"; state->dataZoneEquip->ZoneEquipList(1).CoolingPriority(1) = 1; state->dataZoneEquip->ZoneEquipList(1).HeatingPriority(1) = 1; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::ZoneUnitarySys; + state->dataZoneEquip->ZoneEquipList(1).EquipType(1) = DataZoneEquipment::ZoneEquipType::UnitarySystem; state->dataZoneEquip->ZoneEquipConfig(1).NumInletNodes = NumNodes; state->dataZoneEquip->ZoneEquipConfig(1).InletNode.allocate(NumNodes); state->dataZoneEquip->ZoneEquipConfig(1).AirDistUnitCool.allocate(NumNodes); diff --git a/tst/EnergyPlus/unit/ZoneHVACEvaporativeCooler.unit.cc b/tst/EnergyPlus/unit/ZoneHVACEvaporativeCooler.unit.cc index b0cf64b1a84..af6bef670c9 100644 --- a/tst/EnergyPlus/unit/ZoneHVACEvaporativeCooler.unit.cc +++ b/tst/EnergyPlus/unit/ZoneHVACEvaporativeCooler.unit.cc @@ -122,18 +122,18 @@ class ZoneHVACEvapCoolerUnitTest : public EnergyPlusFixture state->dataZoneEquip->ZoneEquipList(1).Name = "ZONEHVACEVAPEQUIPMENT"; state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes = 1; + state->dataZoneEquip->ZoneEquipList(1).EquipTypeName.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipType.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipName.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipIndex.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).EquipIndex = 1; state->dataZoneEquip->ZoneEquipList(1).EquipData.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).CoolingPriority.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); state->dataZoneEquip->ZoneEquipList(1).HeatingPriority.allocate(state->dataZoneEquip->ZoneEquipList(1).NumOfEquipTypes); - state->dataZoneEquip->ZoneEquipList(1).EquipType(1) = "ZoneHVAC:EvaporativeCoolerUnit"; + state->dataZoneEquip->ZoneEquipList(1).EquipTypeName(1) = "ZoneHVAC:EvaporativeCoolerUnit"; state->dataZoneEquip->ZoneEquipList(1).CoolingPriority(1) = 1; state->dataZoneEquip->ZoneEquipList(1).HeatingPriority(1) = 1; - state->dataZoneEquip->ZoneEquipList(1).EquipTypeEnum(1) = DataZoneEquipment::ZoneEquip::ZoneEvaporativeCoolerUnit; + state->dataZoneEquip->ZoneEquipList(1).EquipType(1) = DataZoneEquipment::ZoneEquipType::EvaporativeCooler; } virtual void TearDown() From 8f6474f8622dfc2ed0387707eea26cacc0113ef4 Mon Sep 17 00:00:00 2001 From: amirroth Date: Wed, 21 Jun 2023 22:30:15 -0400 Subject: [PATCH 03/17] Prune state --- src/EnergyPlus/DataHVACGlobals.hh | 55 -- src/EnergyPlus/RoomAirModelAirflowNetwork.hh | 25 +- src/EnergyPlus/RoomAirModelManager.cc | 798 ++++++++----------- src/EnergyPlus/RoomAirModelManager.hh | 43 +- src/EnergyPlus/SimulationManager.cc | 2 +- 5 files changed, 359 insertions(+), 564 deletions(-) diff --git a/src/EnergyPlus/DataHVACGlobals.hh b/src/EnergyPlus/DataHVACGlobals.hh index 704a91fa3d0..529b3d60ac4 100644 --- a/src/EnergyPlus/DataHVACGlobals.hh +++ b/src/EnergyPlus/DataHVACGlobals.hh @@ -372,62 +372,7 @@ namespace DataHVACGlobals { // Parameters for HVACSystemRootFindingAlgorithm int constexpr Bisection(2); -#ifdef GET_OUT - enum class ZoneEquipType { - Invalid = -1, - DUMMY, // There is some back and forth with AFN enumerations here that I just don't want to mess with - VariableRefrigerantFlow, // VRFTerminalUnit - EnergyRecoveryVentilator, // ERVStandAlone - FourPipeFanCoil, // FanCoil4Pipe - OutdoorAirUnit, // OutdoorAirUnit - PackagedTerminalAirConditioner, // PkgTermACAirToAir - PackagedTerminalHeatPump, // PkgTermHPAirToAir - UnitHeater, // UnitHeater - UnitVentilator, // UnitVentilator - VentilatedSlab, // VentilatedSlab - WaterToAirHeatPump, // PkgTermHPWaterToAir - WindowAirConditioner, // WindowAC - BaseboardRadiantConvectiveElectric, // BBElectric - BaseboardRadiantConvectiveWater, // BBWater - BaseboardRadiantConvectiveSteam, // BBSteam - BaseboardConvectiveElectric, // BBElectricConvective - BaseboardConvectiveWater, // BBWaterConvective - HighTemperatureRadiant, // HiTempRadiant - DehumidifierDX, // ZoneDXDehumidifier - IdealLoadsAirSystem, // PurchasedAir - RefrigerationChillerSet, // RefrigerationAirChillerSet - HybridUnitaryAirConditioners, - FanZoneExhaust, // FanZoneExhaust - WaterHeaterHeatPump, // HPWaterHeater - AirTerminalDualDuctConstantVolume, - AirTerminalDualDuctVAV, - AirTerminalSingleDuctConstantVolumeReheat, - AirTerminalSingleDuctConstantVolumeNoReheat, - AirTerminalSingleDuctVAVReheat, - AirTerminalSingleDuctVAVNoReheat, - AirTerminalSingleDuctSeriesPIUReheat, - AirTerminalSingleDuctParallelPIUReheat, - AirTerminalSingleDuctCAVFourPipeInduction, - AirTerminalSingleDuctVAVReheatVariableSpeedFan, - AirTerminalSingleDuctVAVHeatAndCoolReheat, - AirTerminalSingleDuctVAVHeatAndCoolNoReheat, - AirTerminalSingleDuctConstantVolumeCooledBeam, - AirTerminalDualDuctVAVOutdoorAir, - AirLoopHVACReturnAir, - Num - }; - // ZoneEvaporativeCoolerUnit - // ZoneHybridEvaporativeCooler - // AirDistUnit - // LoTempRadiant - // HeatExchanger - // UserDefinedZoneHVACForcedAir - // CoolingPanel - // ZoneUnitarySys - extern const std::array zoneEquipTypeNames; - extern const std::array zoneEquipTypeNamesUC; -#endif // int constexpr MaxSpeedLevels = 10; extern Array1D_string const cFanTypes; diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.hh b/src/EnergyPlus/RoomAirModelAirflowNetwork.hh index 7d1262ab51f..a7761d4bda3 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.hh +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.hh @@ -60,40 +60,23 @@ struct EnergyPlusData; namespace RoomAirModelAirflowNetwork { // Data - class RAFNData - { - - private: + class RAFNData { public: - int ZoneNum; - int RoomAirNode; - - // constructor - RAFNData() : ZoneNum(0), RoomAirNode(0) - { - } + int ZoneNum = 0; + int RoomAirNode = 0; - // functions - - //***************************************************************************************** void InitRoomAirModelAirflowNetwork(EnergyPlusData &state, int const RoomAirNode); // index number for the specified zone and room air node - //***************************************************************************************** void CalcRoomAirModelAirflowNetwork(EnergyPlusData &state, int const ThisRoomAirNode); // index number for the specified zone and room air node - //***************************************************************************************** void UpdateRoomAirModelAirflowNetwork(EnergyPlusData &state); // index number for the specified zone - //***************************************************************************************** void CalcNodeSums(EnergyPlusData &state, int const RoomAirNode); // index number for the specified zone and room air node - //***************************************************************************************** void SumNonAirSystemResponseForNode(EnergyPlusData &state, int const RoomAirNode); // index number for the specified zone and room air node - //***************************************************************************************** - void SumSystemDepResponseForNode(EnergyPlusData &state); // index number for the specified zone and room air node - //***************************************************************************************** + void SumSystemDepResponseForNode(EnergyPlusData &state); // index number for the specified zone and room air node void CalcSurfaceMoistureSums( EnergyPlusData &state, int const RoomAirNode, Real64 &SumHmAW, Real64 &SumHmARa, Real64 &SumHmARaW, Array1D const &SurfMask); diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 4f41fa51160..3f5ecb9432a 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -262,11 +262,6 @@ namespace RoomAirModelManager { int NumNumbers; // Number of numbers encountered int Status; // Notes if there was an error in processing the input - int thisSurfinZone; // working variable for indexing surfaces within a ZoneRadiantInfo structure - - int NumPairs; // number of zeta/deltaTai pairs - int found; // test for UtilityRoutines::FindItemInList( - auto &ipsc = state.dataIPShortCut; // access input file and setup @@ -357,7 +352,7 @@ namespace RoomAirModelManager { airPatternZoneInfo.Surf.allocate(airPatternZoneInfo.totNumSurfs); // Fill in what we know for nested structure for surfaces - thisSurfinZone = 0; + int thisSurfinZone = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); for (int thisHBsurfID = thisSpace.HTSurfaceFirst; thisHBsurfID <= thisSpace.HTSurfaceLast; ++thisHBsurfID) { @@ -506,7 +501,7 @@ namespace RoomAirModelManager { roomAirPattern.DeltaTleaving = ipsc->rNumericArgs(3); roomAirPattern.DeltaTexhaust = ipsc->rNumericArgs(4); - NumPairs = std::floor((double(NumNumbers) - 4.0) / 2.0); + int NumPairs = std::floor((double(NumNumbers) - 4.0) / 2.0); // TODO error checking @@ -561,7 +556,7 @@ namespace RoomAirModelManager { roomAirPattern.DeltaTleaving = ipsc->rNumericArgs(3); roomAirPattern.DeltaTexhaust = ipsc->rNumericArgs(4); - NumPairs = NumNumbers - 4; + int NumPairs = NumNumbers - 4; if (NumPairs != (NumAlphas - 1)) { ShowSevereError(state, @@ -580,10 +575,8 @@ namespace RoomAirModelManager { for (int i = 1; i <= NumPairs; ++i) { roomAirPattern.MapPatrn.SurfName(i) = ipsc->cAlphaArgs(i + 1); roomAirPattern.MapPatrn.DeltaTai(i) = ipsc->rNumericArgs(i + 4); - found = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataSurface->Surface); - if (found != 0) { - roomAirPattern.MapPatrn.SurfID(i) = found; - } else { + roomAirPattern.MapPatrn.SurfID(i) = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataSurface->Surface); + if (roomAirPattern.MapPatrn.SurfID(i) == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i+1), ipsc->cAlphaArgs(i+1)); ErrorsFound = true; } @@ -615,7 +608,7 @@ namespace RoomAirModelManager { for (int i = 1; i <= state.dataGlobal->NumOfZones; ++i) { if (state.dataRoomAirMod->AirPatternZoneInfo(i).IsUsed) { // first get return and exhaust air node index - found = UtilityRoutines::FindItemInList( + int found = UtilityRoutines::FindItemInList( state.dataRoomAirMod->AirPatternZoneInfo(i).ZoneName, state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); if (found != 0) { @@ -653,11 +646,6 @@ namespace RoomAirModelManager { // "Number" line int NumNumbers; // Number of numbers encountered int Status; // Notes if there was an error in processing the input - int ZoneNum; // Index number for zones - int NumSurfsInvolved; // Number of surfaces involved with air nodes - // (used for checking error) - int NumOfSurfs; // Index number for last surface of zones - bool SurfNeeded; if (!state.dataRoomAirMod->MundtModelUsed) return; @@ -708,9 +696,8 @@ namespace RoomAirModelManager { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } else { - ZoneNum = airNode.ZonePtr; - NumOfSurfs = 0; - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + int NumOfSurfs = 0; + for (int spaceNum : state.dataHeatBal->Zone(airNode.ZonePtr).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); NumOfSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; } @@ -724,7 +711,7 @@ namespace RoomAirModelManager { } airNode.Height = ipsc->rNumericArgs(1); // Air node height - NumSurfsInvolved = NumAlphas - 3; // Number of surfaces involved with air nodes + int NumSurfsInvolved = NumAlphas - 3; // Number of surfaces involved with air nodes // Initialize airNode.SurfMask = false; @@ -741,84 +728,69 @@ namespace RoomAirModelManager { airNode.Name)); ErrorsFound = true; } + continue; + } - } else { - - // initialize - SurfNeeded = true; - - // report warning error since the following air nodes do not require surfaces associated with them - // and assign .FALSE. to 'SurfNeeded' - if (airNode.ClassType == AirNodeType::Inlet || airNode.ClassType == AirNodeType::Control || - airNode.ClassType == AirNodeType::Return || airNode.ClassType == AirNodeType::Plume) { - ShowWarningError(state, format("GetAirNodeData: {}=\"{}\" invalid linkage", ipsc->cCurrentModuleObject, airNode.Name)); - ShowContinueError(state, format("Mundt Room Air Model: No surface names needed. Air node=\"{} does not relate to any surfaces.", - airNode.Name)); - SurfNeeded = false; - } - - if (SurfNeeded) { + // report warning error since the following air nodes do not require surfaces associated with them + // and assign .FALSE. to 'SurfNeeded' + if (airNode.ClassType == AirNodeType::Inlet || airNode.ClassType == AirNodeType::Control || + airNode.ClassType == AirNodeType::Return || airNode.ClassType == AirNodeType::Plume) { + ShowWarningError(state, format("GetAirNodeData: {}=\"{}\" invalid linkage", ipsc->cCurrentModuleObject, airNode.Name)); + ShowContinueError(state, format("Mundt Room Air Model: No surface names needed. Air node=\"{} does not relate to any surfaces.", + airNode.Name)); + continue; + } - // this air node is in this zone; hence, first get name of all surfaces in this zone - ZoneNum = airNode.ZonePtr; - NumOfSurfs = 0; - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { - auto &thisSpace = state.dataHeatBal->space(spaceNum); - NumOfSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; - } + // this air node is in this zone; hence, first get name of all surfaces in this zone + auto const &zone = state.dataHeatBal->Zone(airNode.ZonePtr); + int NumOfSurfs = 0; + for (int spaceNum : zone.spaceIndexes) { + auto &thisSpace = state.dataHeatBal->space(spaceNum); + NumOfSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; + } - // terminate the program due to a severe error in the specified input - if (NumSurfsInvolved > NumOfSurfs) { - ShowFatalError( - state, - format( - "GetAirNodeData: Mundt Room Air Model: Number of surfaces connected to {} is greater than number of surfaces in {}", - airNode.Name, - state.dataHeatBal->Zone(ZoneNum).Name)); - return; - } + // terminate the program due to a severe error in the specified input + if (NumSurfsInvolved > NumOfSurfs) { + ShowFatalError(state, + format("GetAirNodeData: Mundt Room Air Model: Number of surfaces connected to {} is greater than number of surfaces in {}", + airNode.Name, + zone.Name)); + return; + } - // relate surfaces to this air node and check to see whether surface names are specified correctly or not - int SurfCount = 0; - for (int ListSurfNum = 4; ListSurfNum <= NumAlphas; ++ListSurfNum) { - int thisSurfinZone = 0; - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { - auto &thisSpace = state.dataHeatBal->space(spaceNum); - for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { - ++thisSurfinZone; - if (ipsc->cAlphaArgs(ListSurfNum) == state.dataSurface->Surface(SurfNum).Name) { - airNode.SurfMask(thisSurfinZone) = true; - ++SurfCount; - break; - } - } - if (SurfCount > 0) break; + // relate surfaces to this air node and check to see whether surface names are specified correctly or not + int SurfCount = 0; + for (int ListSurfNum = 4; ListSurfNum <= NumAlphas; ++ListSurfNum) { + int thisSurfinZone = 0; + for (int spaceNum : zone.spaceIndexes) { + auto &thisSpace = state.dataHeatBal->space(spaceNum); + for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { + ++thisSurfinZone; + if (ipsc->cAlphaArgs(ListSurfNum) == state.dataSurface->Surface(SurfNum).Name) { + airNode.SurfMask(thisSurfinZone) = true; + ++SurfCount; + break; } } - - // report warning error since surface names are specified correctly - if ((NumSurfsInvolved) != SurfCount) { - ShowWarningError(state, - format("GetAirNodeData: Mundt Room Air Model: Some surface names specified for {} are not in {}", - airNode.Name, - state.dataHeatBal->Zone(ZoneNum).Name)); - } + if (SurfCount > 0) break; } } - } - // get number of air nodes in each zone - for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + // report warning error since surface names are specified correctly + if ((NumSurfsInvolved) != SurfCount) { + ShowWarningError(state, + format("GetAirNodeData: Mundt Room Air Model: Some surface names specified for {} are not in {}", + airNode.Name, + zone.Name)); + } + } // for (AirNodeNum) + // get number of air nodes in each zone + for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { + auto const &airNode = state.dataRoomAirMod->AirNode(AirNodeNum); // this zone uses other air model so skip the rest - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAirModel::Mundt) continue; - - // this zone uses a nodal air model so get number of air nodes in each zone - for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { - if (state.dataRoomAirMod->AirNode(AirNodeNum).ZonePtr == ZoneNum) { - ++state.dataRoomAirMod->TotNumOfZoneAirNodes(ZoneNum); - } - } + if (state.dataRoomAirMod->AirModel(airNode.ZonePtr).AirModel == RoomAirModel::Mundt) + ++state.dataRoomAirMod->TotNumOfZoneAirNodes(airNode.ZonePtr); } } @@ -847,7 +819,6 @@ namespace RoomAirModelManager { int NumNumbers; // Number of numbers encountered int Status; // Notes if there was an error in processing the input int NumOfMundtContrl; // Number of Mundt Model Controls - int ZoneNum; // Index number for zones auto &ipsc = state.dataIPShortCut; @@ -891,7 +862,7 @@ namespace RoomAirModelManager { ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ""}; - ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); if (ZoneNum == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; @@ -1008,7 +979,6 @@ namespace RoomAirModelManager { int IOStat; int NumAlpha; int NumNumber; - int ThisZone; auto &ipsc = state.dataIPShortCut; if (!state.dataRoomAirMod->UCSDModelUsed) return; @@ -1068,8 +1038,7 @@ namespace RoomAirModelManager { ErrorsFound = true; } - ThisZone = zoneUCSDCV.ZonePtr; - if (ThisZone == 0) continue; + if (zoneUCSDCV.ZonePtr == 0) continue; // Following depend on valid zone @@ -1084,29 +1053,29 @@ namespace RoomAirModelManager { // If a crack is used it must have an air flow coefficient = 0.5 for (int iLink = 1; iLink <= state.afn->NumOfLinksMultiZone; ++iLink) { auto const &mzSurfaceData = state.afn->MultizoneSurfaceData(iLink); - state.dataRoomAirModelMgr->NodeNum1 = mzSurfaceData.NodeNums[0]; - state.dataRoomAirModelMgr->NodeNum2 = mzSurfaceData.NodeNums[1]; - if (state.dataSurface->Surface(mzSurfaceData.SurfNum).Zone == ThisZone || - (state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNum2).EPlusZoneNum == ThisZone && - state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNum1).EPlusZoneNum > 0) || - (state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNum2).EPlusZoneNum > 0 && - state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNum1).EPlusZoneNum == ThisZone)) { - state.dataRoomAirModelMgr->CompNum = state.afn->AirflowNetworkLinkageData(iLink).CompNum; - state.dataRoomAirModelMgr->TypeNum = state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNum).TypeNum; - if (state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { - if (state.afn->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNum).exponent != 0.50) { - state.dataRoomAirMod->AirModel(ThisZone).AirModel = RoomAirModel::Mixing; + int nodeNum1 = mzSurfaceData.NodeNums[0]; + int nodeNum2 = mzSurfaceData.NodeNums[1]; + if (state.dataSurface->Surface(mzSurfaceData.SurfNum).Zone == zoneUCSDCV.ZonePtr || + (state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum == zoneUCSDCV.ZonePtr && + state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum > 0) || + (state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum > 0 && + state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum == zoneUCSDCV.ZonePtr)) { + int compNum = state.afn->AirflowNetworkLinkageData(iLink).CompNum; + int typeNum = state.afn->AirflowNetworkCompData(compNum).TypeNum; + if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { + if (state.afn->MultizoneSurfaceCrackData(typeNum).exponent != 0.50) { + state.dataRoomAirMod->AirModel(zoneUCSDCV.ZonePtr).AirModel = RoomAirModel::Mixing; ShowWarningError(state, format("Problem with {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowWarningError(state, format("Roomair model will not be applied for Zone={}.", ipsc->cAlphaArgs(1))); ShowContinueError( state, format("AirflowNetwrok:Multizone:Surface crack object must have an air flow coefficient = 0.5, value was={:.2R}", - state.afn->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNum).exponent)); + state.afn->MultizoneSurfaceCrackData(typeNum).exponent)); } } - } - } - } + } // if + } // for (iLink) + } // for (Loop) } void GetUFADZoneData(EnergyPlusData &state, bool &ErrorsFound) // True if errors found during this get input routine @@ -1299,12 +1268,8 @@ namespace RoomAirModelManager { int TotNumOfRAFNNodeSurfLists; int TotNumOfRAFNNodeGainsLists; int TotNumOfRAFNNodeHVACLists; - bool foundList; - int NumSurfsThisNode; - int NumOfSurfs; int TotNumEquip; bool IntEquipError; - std::string Name; auto &ipsc = state.dataIPShortCut; ipsc->cCurrentModuleObject = "RoomAirSettings:AirflowNetwork"; @@ -1444,7 +1409,7 @@ namespace RoomAirModelManager { ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:AdjacentSurfaceList"; TotNumOfRAFNNodeSurfLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); for (int Loop = 1; Loop <= TotNumOfRAFNNodeSurfLists; ++Loop) { - foundList = false; + bool foundList = false; state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -1474,8 +1439,8 @@ namespace RoomAirModelManager { // found it foundList = true; - NumSurfsThisNode = NumAlphas - 1; - NumOfSurfs = 0; + int NumSurfsThisNode = NumAlphas - 1; + int NumOfSurfs = 0; // What is this used for? for (int spaceNum : state.dataHeatBal->Zone(iZone).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); NumOfSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; @@ -1536,7 +1501,7 @@ namespace RoomAirModelManager { ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:InternalGains"; TotNumOfRAFNNodeGainsLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); for (int Loop = 1; Loop <= TotNumOfRAFNNodeGainsLists; ++Loop) { - foundList = false; + int foundList = false; state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -1687,7 +1652,6 @@ namespace RoomAirModelManager { continue; } - foundList = true; roomAFNNode.NumHVACs = (NumAlphas + NumNumbers - 1) / 4; roomAFNNode.HVAC.allocate(roomAFNNode.NumHVACs); roomAFNNode.HasHVACAssigned = true; @@ -1780,7 +1744,7 @@ namespace RoomAirModelManager { ShowContinueError(state, format("Entered in RoomAir:Node:AirflowNetwork with Zone Name = {}, Intrnal gain name = {}", state.dataHeatBal->Zone(iZone).Name, - Name)); + intGain.Name)); ShowContinueError(state, "The Fraction of internal gain across all the nodes needs to sum to 1.0."); ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SumFraction)); ErrorsFound = true; @@ -1840,9 +1804,6 @@ namespace RoomAirModelManager { using namespace DataSurfaces; using Psychrometrics::PsyRhoAirFnPbTdbW; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: Real64 constexpr BaseDischargeCoef(0.62); @@ -1851,14 +1812,7 @@ namespace RoomAirModelManager { Array1D_int AuxSurf; int MaxSurf; Array2D_int AuxAirflowNetworkSurf; - Real64 WidthFactMax; - Real64 HeightFactMax; - Real64 WidthFact; - Real64 HeightFact; int ZoneEquipConfigNum; // counter - Real64 AinCV; - int AirflowNetworkSurfPtr; - int NSides; // Do the one time initializations if (state.dataRoomAirModelMgr->MyOneTimeFlag) { @@ -1909,130 +1863,114 @@ namespace RoomAirModelManager { state.dataUCSDShared->HWindow = 0.0; state.dataUCSDShared->HDoor = 0.0; + int contWall = 0, contFloor = 0, contCeiling = 0, contWindow = 0, contInternal = 0, contDoor = 0; + int contWallBeg = 0, contFloorBeg = 0, contCeilingBeg = 0, contWindowBeg = 0, contInternalBeg = 0, contDoorBeg = 0; + int contWallLast = 0, contFloorLast = 0, contCeilingLast = 0, contWindowLast = 0, contInternalLast = 0, contDoorLast = 0; + // Put the surface and zone information in Apos and PosZ arrays for (int ZNum = 1; ZNum <= state.dataGlobal->NumOfZones; ++ZNum) { // advance ONE position in the arrays PosZ because this is a new zone - state.dataRoomAirModelMgr->contWallBegin = state.dataRoomAirModelMgr->contWall + 1; - state.dataRoomAirModelMgr->contFloorBegin = state.dataRoomAirModelMgr->contFloor + 1; - state.dataRoomAirModelMgr->contCeilingBegin = state.dataRoomAirModelMgr->contCeiling + 1; - state.dataRoomAirModelMgr->contWindowBegin = state.dataRoomAirModelMgr->contWindow + 1; - state.dataRoomAirModelMgr->contInternalBegin = state.dataRoomAirModelMgr->contInternal + 1; - state.dataRoomAirModelMgr->contDoorBegin = state.dataRoomAirModelMgr->contDoor + 1; + contWallBeg = contWall + 1; + contFloorBeg = contFloor + 1; + contCeilingBeg = contCeiling + 1; + contWindowBeg = contWindow + 1; + contInternalBeg = contInternal + 1; + contDoorBeg = contDoor + 1; SetZoneAux = true; + Real64 Z1ofZone = std::numeric_limits::max(); + Real64 Z2ofZone = std::numeric_limits::lowest(); + // cycle in this zone for all the surfaces for (int spaceNum : state.dataHeatBal->Zone(ZNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); + for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { - if (state.dataSurface->Surface(SurfNum).Class != DataSurfaces::SurfaceClass::IntMass) { + auto const &surf = state.dataSurface->Surface(SurfNum); + if (surf.Class != DataSurfaces::SurfaceClass::IntMass) { // Recalculate lowest and highest height for the zone - state.dataRoomAirModelMgr->Z1ofZone = std::numeric_limits::max(); - state.dataRoomAirModelMgr->Z2ofZone = std::numeric_limits::lowest(); - for (int i = 1, u = state.dataSurface->Surface(SurfNum).Sides; i <= u; ++i) { - Real64 const z_i(state.dataSurface->Surface(SurfNum).Vertex(i).z); - state.dataRoomAirModelMgr->Z1ofZone = std::min(state.dataRoomAirModelMgr->Z1ofZone, z_i); - state.dataRoomAirModelMgr->Z2ofZone = std::max(state.dataRoomAirModelMgr->Z2ofZone, z_i); + for (int i = 1, u = surf.Sides; i <= u; ++i) { + Real64 const z_i = surf.Vertex(i).z; + if (z_i < Z1ofZone) { Z1ofZone = z_i; }; + if (z_i > Z2ofZone) { Z2ofZone = z_i; }; } } - if (SetZoneAux) { - // lowest height for the zone (for the first surface of the zone) - state.dataRoomAirModelMgr->Z1ofZoneAux = state.dataRoomAirModelMgr->Z1ofZone; - // highest height for the zone (for the first surface of the zone) - state.dataRoomAirModelMgr->Z2ofZoneAux = state.dataRoomAirModelMgr->Z2ofZone; - SetZoneAux = false; - } - - if (state.dataRoomAirModelMgr->Z1ofZone < state.dataRoomAirModelMgr->Z1ofZoneAux) { - state.dataRoomAirModelMgr->Z1ofZoneAux = state.dataRoomAirModelMgr->Z1ofZone; - } - if (state.dataRoomAirModelMgr->Z2ofZone > state.dataRoomAirModelMgr->Z2ofZoneAux) { - state.dataRoomAirModelMgr->Z2ofZoneAux = state.dataRoomAirModelMgr->Z2ofZone; - } - state.dataRoomAirModelMgr->Z1ofZone = state.dataRoomAirModelMgr->Z1ofZoneAux; - state.dataRoomAirModelMgr->Z2ofZone = state.dataRoomAirModelMgr->Z2ofZoneAux; - // Put the reference to this surface in the appropriate array - if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Floor) { - ++state.dataRoomAirModelMgr->contFloor; - state.dataUCSDShared->APos_Floor(state.dataRoomAirModelMgr->contFloor) = SurfNum; - } else if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Wall) { - ++state.dataRoomAirModelMgr->contWall; - state.dataUCSDShared->APos_Wall(state.dataRoomAirModelMgr->contWall) = SurfNum; - } else if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Window) { - ++state.dataRoomAirModelMgr->contWindow; - state.dataUCSDShared->APos_Window(state.dataRoomAirModelMgr->contWindow) = SurfNum; - } else if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::IntMass) { - ++state.dataRoomAirModelMgr->contInternal; - state.dataUCSDShared->APos_Internal(state.dataRoomAirModelMgr->contInternal) = SurfNum; - } else if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Door) { - ++state.dataRoomAirModelMgr->contDoor; - state.dataUCSDShared->APos_Door(state.dataRoomAirModelMgr->contDoor) = SurfNum; + if (surf.Class == SurfaceClass::Floor) { + ++contFloor; + state.dataUCSDShared->APos_Floor(contFloor) = SurfNum; + } else if (surf.Class == SurfaceClass::Wall) { + ++contWall; + state.dataUCSDShared->APos_Wall(contWall) = SurfNum; + } else if (surf.Class == SurfaceClass::Window) { + ++contWindow; + state.dataUCSDShared->APos_Window(contWindow) = SurfNum; + } else if (surf.Class == SurfaceClass::IntMass) { + ++contInternal; + state.dataUCSDShared->APos_Internal(contInternal) = SurfNum; + } else if (surf.Class == SurfaceClass::Door) { + ++contDoor; + state.dataUCSDShared->APos_Door(contDoor) = SurfNum; } else { - ++state.dataRoomAirModelMgr->contCeiling; - state.dataUCSDShared->APos_Ceiling(state.dataRoomAirModelMgr->contCeiling) = SurfNum; + ++contCeiling; + state.dataUCSDShared->APos_Ceiling(contCeiling) = SurfNum; } } - } // Surfaces - - state.dataRoomAirModelMgr->contWallLast = state.dataRoomAirModelMgr->contWall; - state.dataRoomAirModelMgr->contFloorLast = state.dataRoomAirModelMgr->contFloor; - state.dataRoomAirModelMgr->contCeilingLast = state.dataRoomAirModelMgr->contCeiling; - state.dataRoomAirModelMgr->contWindowLast = state.dataRoomAirModelMgr->contWindow; - state.dataRoomAirModelMgr->contDoorLast = state.dataRoomAirModelMgr->contDoor; - state.dataRoomAirModelMgr->contInternalLast = state.dataRoomAirModelMgr->contInternal; + } // for (SurfNum) + + contWallLast = contWall; + contFloorLast = contFloor; + contCeilingLast = contCeiling; + contWindowLast = contWindow; + contDoorLast = contDoor; + contInternalLast = contInternal; // PosZ_Wall (... + 1) has the Begin Wall reference in Apos_Wall for the ZNum // PosZ_Wall (... + 2) has the End Wall reference in Apos_Wall for the ZNum - state.dataUCSDShared->PosZ_Wall((ZNum - 1) * 2 + 1) = state.dataRoomAirModelMgr->contWallBegin; - state.dataUCSDShared->PosZ_Wall((ZNum - 1) * 2 + 2) = state.dataRoomAirModelMgr->contWallLast; - state.dataUCSDShared->PosZ_Floor((ZNum - 1) * 2 + 1) = state.dataRoomAirModelMgr->contFloorBegin; - state.dataUCSDShared->PosZ_Floor((ZNum - 1) * 2 + 2) = state.dataRoomAirModelMgr->contFloorLast; - state.dataUCSDShared->PosZ_Ceiling((ZNum - 1) * 2 + 1) = state.dataRoomAirModelMgr->contCeilingBegin; - state.dataUCSDShared->PosZ_Ceiling((ZNum - 1) * 2 + 2) = state.dataRoomAirModelMgr->contCeilingLast; - state.dataUCSDShared->PosZ_Window((ZNum - 1) * 2 + 1) = state.dataRoomAirModelMgr->contWindowBegin; - state.dataUCSDShared->PosZ_Window((ZNum - 1) * 2 + 2) = state.dataRoomAirModelMgr->contWindowLast; - state.dataUCSDShared->PosZ_Door((ZNum - 1) * 2 + 1) = state.dataRoomAirModelMgr->contDoorBegin; - state.dataUCSDShared->PosZ_Door((ZNum - 1) * 2 + 2) = state.dataRoomAirModelMgr->contDoorLast; - state.dataUCSDShared->PosZ_Internal((ZNum - 1) * 2 + 1) = state.dataRoomAirModelMgr->contInternalBegin; - state.dataUCSDShared->PosZ_Internal((ZNum - 1) * 2 + 2) = state.dataRoomAirModelMgr->contInternalLast; + state.dataUCSDShared->PosZ_Wall((ZNum - 1) * 2 + 1) = contWallBeg; + state.dataUCSDShared->PosZ_Wall((ZNum - 1) * 2 + 2) = contWallLast; + state.dataUCSDShared->PosZ_Floor((ZNum - 1) * 2 + 1) = contFloorBeg; + state.dataUCSDShared->PosZ_Floor((ZNum - 1) * 2 + 2) = contFloorLast; + state.dataUCSDShared->PosZ_Ceiling((ZNum - 1) * 2 + 1) = contCeilingBeg; + state.dataUCSDShared->PosZ_Ceiling((ZNum - 1) * 2 + 2) = contCeilingLast; + state.dataUCSDShared->PosZ_Window((ZNum - 1) * 2 + 1) = contWindowBeg; + state.dataUCSDShared->PosZ_Window((ZNum - 1) * 2 + 2) = contWindowLast; + state.dataUCSDShared->PosZ_Door((ZNum - 1) * 2 + 1) = contDoorBeg; + state.dataUCSDShared->PosZ_Door((ZNum - 1) * 2 + 2) = contDoorLast; + state.dataUCSDShared->PosZ_Internal((ZNum - 1) * 2 + 1) = contInternalBeg; + state.dataUCSDShared->PosZ_Internal((ZNum - 1) * 2 + 2) = contInternalLast; // Save the highest and lowest height for this zone - state.dataRoomAirMod->ZoneCeilingHeight((ZNum - 1) * 2 + 1) = state.dataRoomAirModelMgr->Z1ofZone; - state.dataRoomAirMod->ZoneCeilingHeight((ZNum - 1) * 2 + 2) = state.dataRoomAirModelMgr->Z2ofZone; + state.dataRoomAirMod->ZoneCeilingHeight((ZNum - 1) * 2 + 1) = Z1ofZone; + state.dataRoomAirMod->ZoneCeilingHeight((ZNum - 1) * 2 + 2) = Z2ofZone; - if (std::abs((state.dataRoomAirModelMgr->Z2ofZone - state.dataRoomAirModelMgr->Z1ofZone) - - state.dataHeatBal->Zone(ZNum).CeilingHeight) > state.dataRoomAirModelMgr->CeilingHeightDiffMaximum) { + constexpr Real64 CeilingHeightDiffMaximum = 0.1; + if (std::abs((Z2ofZone - Z1ofZone) - state.dataHeatBal->Zone(ZNum).CeilingHeight) > CeilingHeightDiffMaximum) { ShowWarningError(state, format("RoomAirManager: Inconsistent ceiling heights in Zone: {}", state.dataHeatBal->Zone(ZNum).Name)); - ShowContinueError(state, format("Lowest height=[{:.3R}].", state.dataRoomAirModelMgr->Z1ofZone)); - ShowContinueError(state, format("Highest height=[{:.3R}].", state.dataRoomAirModelMgr->Z2ofZone)); + ShowContinueError(state, format("Lowest height=[{:.3R}].", Z1ofZone)); + ShowContinueError(state, format("Highest height=[{:.3R}].", Z2ofZone)); ShowContinueError(state, format("Ceiling height=[{:.3R}].", state.dataHeatBal->Zone(ZNum).CeilingHeight)); } - } // Zones + } // for (ZoneNum) AuxSurf = 0; state.dataRoomAirMod->CVNumAirflowNetworkSurfaces = 0; // calculate maximum number of airflow network surfaces in each zone - for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.afn->NumOfLinksMultiZone; - ++state.dataRoomAirModelMgr->Loop) { - ++AuxSurf(state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop).SurfNum).Zone); + for (int iMzLink = 1; iMzLink <= state.afn->NumOfLinksMultiZone; ++iMzLink) { + auto const &mzSurf = state.dataSurface->Surface(state.afn->MultizoneSurfaceData(iMzLink).SurfNum); + ++AuxSurf(mzSurf.Zone); ++state.dataRoomAirMod->CVNumAirflowNetworkSurfaces; // Check if this is an interzone airflow network surface - if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop).SurfNum).ExtBoundCond > 0 && - (state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop).SurfNum != - state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop).SurfNum).ExtBoundCond)) { - ++AuxSurf( - state.dataSurface - ->Surface( - state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop).SurfNum).ExtBoundCond) - .Zone); + if (mzSurf.ExtBoundCond > 0 && + (state.afn->MultizoneSurfaceData(iMzLink).SurfNum != mzSurf.ExtBoundCond)) { + ++AuxSurf(state.dataSurface->Surface(mzSurf.ExtBoundCond).Zone); ++state.dataRoomAirMod->CVNumAirflowNetworkSurfaces; } } // calculate maximum number of airflow network surfaces in a single zone MaxSurf = AuxSurf(1); - for (state.dataRoomAirModelMgr->Loop = 2; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; - ++state.dataRoomAirModelMgr->Loop) { - if (AuxSurf(state.dataRoomAirModelMgr->Loop) > MaxSurf) MaxSurf = AuxSurf(state.dataRoomAirModelMgr->Loop); + for (int iZone = 2; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + if (AuxSurf(iZone) > MaxSurf) MaxSurf = AuxSurf(iZone); } if (!allocated(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV)) { @@ -2049,123 +1987,95 @@ namespace RoomAirModelManager { state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV = 0; // Organize surfaces in vector AirflowNetworkSurfaceUCSDCV(Zone, surface indexes) - for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; - ++state.dataRoomAirModelMgr->Loop) { + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { // the 0 component of the array has the number of relevant AirflowNetwork surfaces for the zone - state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, state.dataRoomAirModelMgr->Loop) = AuxSurf(state.dataRoomAirModelMgr->Loop); - if (AuxSurf(state.dataRoomAirModelMgr->Loop) != 0) { - Real64 const ceilingHeight(state.dataRoomAirMod->ZoneCeilingHeight((state.dataRoomAirModelMgr->Loop - 1) * 2 + 1)); - int SurfNum = 1; - for (state.dataRoomAirModelMgr->Loop2 = 1; state.dataRoomAirModelMgr->Loop2 <= state.afn->NumOfLinksMultiZone; - ++state.dataRoomAirModelMgr->Loop2) { - if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum).Zone == - state.dataRoomAirModelMgr->Loop) { - // SurfNum has the reference surface number relative to AirflowNetworkSurfaceData - state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(SurfNum, state.dataRoomAirModelMgr->Loop) = - state.dataRoomAirModelMgr->Loop2; - // calculate the surface width and height - state.dataRoomAirModelMgr->CompNumber = state.afn->AirflowNetworkLinkageData(state.dataRoomAirModelMgr->Loop2).CompNum; - state.dataRoomAirModelMgr->TypeNumber = state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNumber).TypeNum; - if (state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNumber).CompTypeNum == - AirflowNetwork::iComponentTypeNum::DOP) { - WidthFactMax = 0.0; - HeightFactMax = 0.0; - for (state.dataRoomAirModelMgr->Loop3 = 1; - state.dataRoomAirModelMgr->Loop3 <= - state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).NumFac; - ++state.dataRoomAirModelMgr->Loop3) { - if (state.dataRoomAirModelMgr->Loop3 == 1) { - WidthFact = state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).WidthFac1; - HeightFact = state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).HeightFac1; - } - if (state.dataRoomAirModelMgr->Loop3 == 2) { - WidthFact = state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).WidthFac2; - HeightFact = state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).HeightFac2; - } - if (state.dataRoomAirModelMgr->Loop3 == 3) { - WidthFact = state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).WidthFac3; - HeightFact = state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).HeightFac3; - } - if (state.dataRoomAirModelMgr->Loop3 == 4) { - WidthFact = state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).WidthFac4; - HeightFact = state.afn->MultizoneCompDetOpeningData(state.dataRoomAirModelMgr->TypeNumber).HeightFac4; - } - if (WidthFact > WidthFactMax) { - WidthFactMax = WidthFact; - } - if (HeightFact > HeightFactMax) { - HeightFactMax = HeightFact; - } + state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, iZone) = AuxSurf(iZone); + if (AuxSurf(iZone) == 0) + continue; + + Real64 const ceilingHeight(state.dataRoomAirMod->ZoneCeilingHeight((iZone - 1) * 2 + 1)); + int SurfNum = 1; + + for (int iMzLink = 1; iMzLink <= state.afn->NumOfLinksMultiZone; ++iMzLink) { + auto const &mzSurf = state.dataSurface->Surface(state.afn->MultizoneSurfaceData(iMzLink).SurfNum); + auto &surfParamsCVDV = state.dataRoomAirMod->SurfParametersCVDV(iMzLink); + + if (mzSurf.Zone == iZone) { + // SurfNum has the reference surface number relative to AirflowNetworkSurfaceData + state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(SurfNum, iZone) = iMzLink; + // calculate the surface width and height + int compNum = state.afn->AirflowNetworkLinkageData(iMzLink).CompNum; + int typeNum = state.afn->AirflowNetworkCompData(compNum).TypeNum; + if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) { + Real64 WidthFactMax = 0.0; + Real64 HeightFactMax = 0.0; + + Real64 WidthFact = 0.0; + Real64 HeightFact = 0.0; + auto const &mzCompDetOpening = state.afn->MultizoneCompDetOpeningData(typeNum); + for (int Loop3 = 1; Loop3 <= mzCompDetOpening.NumFac; ++Loop3) { + if (Loop3 == 1) { + WidthFact = mzCompDetOpening.WidthFac1; + HeightFact = mzCompDetOpening.HeightFac1; + } else if (Loop3 == 2) { + WidthFact = mzCompDetOpening.WidthFac2; + HeightFact = mzCompDetOpening.HeightFac2; + } else if (Loop3 == 3) { + WidthFact = mzCompDetOpening.WidthFac3; + HeightFact = mzCompDetOpening.HeightFac3; + } else if (Loop3 == 4) { + WidthFact = mzCompDetOpening.WidthFac4; + HeightFact = mzCompDetOpening.HeightFac4; } - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Width = - WidthFactMax * - state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum).Width; - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Height = - HeightFactMax * - state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum).Height; - } else if (state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNumber).CompTypeNum == - AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Width = - state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum).Width / 2; - AinCV = - state.afn->MultizoneSurfaceCrackData(state.dataRoomAirModelMgr->TypeNumber).coefficient / - (BaseDischargeCoef * - std::sqrt( - 2.0 / - PsyRhoAirFnPbTdbW( - state, - state.dataEnvrn->OutBaroPress, - state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataRoomAirModelMgr->Loop).MAT, - state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataRoomAirModelMgr->Loop).ZoneAirHumRat))); - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Height = - AinCV / state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Width; - } - // calculate the surface Zmin and Zmax - if (state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNumber).CompTypeNum == - AirflowNetwork::iComponentTypeNum::DOP) { - AirflowNetworkSurfPtr = state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum; - NSides = state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum).Sides; - Real64 z_min(std::numeric_limits::max()), z_max(std::numeric_limits::lowest()); - for (int i = 1; i <= NSides; ++i) { - Real64 const z_i(state.dataSurface->Surface(AirflowNetworkSurfPtr).Vertex(i).z); - z_min = std::min(z_min, z_i); - z_max = std::max(z_max, z_i); + if (WidthFact > WidthFactMax) { + WidthFactMax = WidthFact; } - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Zmin = z_min - ceilingHeight; - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Zmax = z_max - ceilingHeight; - } else if (state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->CompNumber).CompTypeNum == - AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK - AirflowNetworkSurfPtr = state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum; - NSides = state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).SurfNum).Sides; - Real64 z_min(std::numeric_limits::max()), z_max(std::numeric_limits::lowest()); - for (int i = 1; i <= NSides; ++i) { - Real64 const z_i(state.dataSurface->Surface(AirflowNetworkSurfPtr).Vertex(i).z); - z_min = std::min(z_min, z_i); - z_max = std::max(z_max, z_i); + if (HeightFact > HeightFactMax) { + HeightFactMax = HeightFact; } - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Zmin = z_min - ceilingHeight; - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirModelMgr->Loop2).Zmax = z_max - ceilingHeight; } + surfParamsCVDV.Width = WidthFactMax * mzSurf.Width; + surfParamsCVDV.Height = HeightFactMax * mzSurf.Height; + + } else if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK + surfParamsCVDV.Width = mzSurf.Width / 2; + auto const &zoneHeatBal = state.dataZoneTempPredictorCorrector->zoneHeatBalance(iZone); + Real64 AinCV = + state.afn->MultizoneSurfaceCrackData(typeNum).coefficient / + (BaseDischargeCoef * + std::sqrt(2.0 / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, zoneHeatBal.MAT, zoneHeatBal.ZoneAirHumRat))); + surfParamsCVDV.Height = AinCV / surfParamsCVDV.Width; + } - ++SurfNum; - // Check if airflow network Surface is an interzone surface: - } else { - state.dataRoomAirModelMgr->NodeNumber1 = state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).NodeNums[0]; - state.dataRoomAirModelMgr->NodeNumber2 = state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->Loop2).NodeNums[1]; - if ((state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNumber2).EPlusZoneNum == - state.dataRoomAirModelMgr->Loop && - state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNumber1).EPlusZoneNum > 0) || - (state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNumber2).EPlusZoneNum > 0 && - state.afn->AirflowNetworkNodeData(state.dataRoomAirModelMgr->NodeNumber1).EPlusZoneNum == - state.dataRoomAirModelMgr->Loop)) { - state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(SurfNum, state.dataRoomAirModelMgr->Loop) = - state.dataRoomAirModelMgr->Loop2; - ++SurfNum; + // calculate the surface Zmin and Zmax + if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP || + state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK + Real64 z_min(std::numeric_limits::max()), z_max(std::numeric_limits::lowest()); + for (int i = 1; i <= mzSurf.Sides; ++i) { + Real64 const z_i = mzSurf.Vertex(i).z; + z_min = std::min(z_min, z_i); + z_max = std::max(z_max, z_i); } + surfParamsCVDV.Zmin = z_min - ceilingHeight; + surfParamsCVDV.Zmax = z_max - ceilingHeight; + } + + ++SurfNum; + // Check if airflow network Surface is an interzone surface: + + } else { // if (mzSurf.Zone == iZone) + int nodeNum1 = state.afn->MultizoneSurfaceData(iMzLink).NodeNums[0]; + int nodeNum2 = state.afn->MultizoneSurfaceData(iMzLink).NodeNums[1]; + if ((state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum == iZone && + state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum > 0) || + (state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum > 0 && + state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum == iZone)) { + state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(SurfNum, iZone) = iMzLink; + ++SurfNum; } } - } - } + } // for (Loop2) + } // for (iZone) AuxSurf.deallocate(); @@ -2307,83 +2217,82 @@ namespace RoomAirModelManager { state.dataRoomAirMod->ZoneDVMixedFlagRep = 0.0; state.dataRoomAirMod->ZoneDVMixedFlag = 0; // Output variables and DV zone flag - for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; - ++state.dataRoomAirModelMgr->Loop) { - if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModel != RoomAirModel::UCSDDV) + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UCSDDV) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:ThreeNodeDisplacementVentilation' SetupOutputVariable(state, "Room Air Zone Mixed Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTMX(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTMX(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Occupied Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTOC(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTOC(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Floor Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTFloor(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTFloor(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Transition Height", OutputProcessor::Unit::m, - state.dataRoomAirMod->HeightTransition(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->HeightTransition(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Recommended Minimum Flow Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->FracMinFlow(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->FracMinFlow(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneDVMixedFlagRep(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneDVMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Average Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->AvgTempGrad(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->AvgTempGrad(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Maximum Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->MaxTempGrad(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->MaxTempGrad(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Thermal Comfort Effective Air Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->TCMF(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->TCMF(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Thermostat Temperature", OutputProcessor::Unit::C, - state.dataHeatBalFanSys->TempTstatAir(state.dataRoomAirModelMgr->Loop), + state.dataHeatBalFanSys->TempTstatAir(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); - } - } + state.dataHeatBal->Zone(iZone).Name); + } // for (iZone) + } // if (any(IsZoneDV)) if (any(state.dataRoomAirMod->IsZoneUI)) { state.dataRoomAirMod->ZoneUFMixedFlag.allocate(state.dataGlobal->NumOfZones); @@ -2398,172 +2307,174 @@ namespace RoomAirModelManager { state.dataRoomAirMod->ZoneUFGamma = 0.0; state.dataRoomAirMod->ZoneUFPowInPlumes = 0.0; state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows = 0.0; + // Output variables and UF zone flag - for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; - ++state.dataRoomAirModelMgr->Loop) { - if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModel != RoomAirModel::UCSDUFI) + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UCSDUFI) continue; // don't set these up if they don't make sense + + auto &zone = state.dataHeatBal->Zone(iZone); // CurrentModuleObject='RoomAirSettings:UnderFloorAirDistributionInterior' SetupOutputVariable(state, "Room Air Zone Mixed Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTMX(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTMX(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Occupied Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTOC(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTOC(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Transition Height", OutputProcessor::Unit::m, - state.dataRoomAirMod->HeightTransition(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->HeightTransition(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFMixedFlagRep(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneUFMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Average Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->AvgTempGrad(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->AvgTempGrad(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Effective Comfort Air Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->TCMF(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->TCMF(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Thermostat Temperature", OutputProcessor::Unit::C, - state.dataHeatBalFanSys->TempTstatAir(state.dataRoomAirModelMgr->Loop), + state.dataHeatBalFanSys->TempTstatAir(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Transition Height Gamma Value", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFGamma(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneUFGamma(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFPowInPlumes(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneUFPowInPlumes(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Temperature Stratification Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->Phi(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->Phi(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); // set zone equip pointer in the UCSDUI data structure - state.dataRoomAirMod->ZoneUCSDUI(state.dataRoomAirMod->ZoneUFPtr(state.dataRoomAirModelMgr->Loop)).ZoneEquipPtr = - state.dataRoomAirModelMgr->Loop; - } - for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; - ++state.dataRoomAirModelMgr->Loop) { - if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModel != RoomAirModel::UCSDUFE) + state.dataRoomAirMod->ZoneUCSDUI(state.dataRoomAirMod->ZoneUFPtr(iZone)).ZoneEquipPtr = iZone; + } // for (iZone) + + + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UCSDUFE) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:UnderFloorAirDistributionExterior' + auto const &zone = state.dataHeatBal->Zone(iZone); SetupOutputVariable(state, "Room Air Zone Mixed Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTMX(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTMX(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Occupied Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTOC(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTOC(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Transition Height", OutputProcessor::Unit::m, - state.dataRoomAirMod->HeightTransition(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->HeightTransition(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFMixedFlagRep(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneUFMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Average Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->AvgTempGrad(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->AvgTempGrad(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Effective Comfort Air Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->TCMF(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->TCMF(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Thermostat Temperature", OutputProcessor::Unit::C, - state.dataHeatBalFanSys->TempTstatAir(state.dataRoomAirModelMgr->Loop), + state.dataHeatBalFanSys->TempTstatAir(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Transition Height Gamma Value", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFGamma(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneUFGamma(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFPowInPlumes(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneUFPowInPlumes(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Window Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Temperature Stratification Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->Phi(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->Phi(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); // set zone equip pointer in the UCSDUE data structure - state.dataRoomAirMod->ZoneUCSDUE(state.dataRoomAirMod->ZoneUFPtr(state.dataRoomAirModelMgr->Loop)).ZoneEquipPtr = - state.dataRoomAirModelMgr->Loop; + state.dataRoomAirMod->ZoneUCSDUE(state.dataRoomAirMod->ZoneUFPtr(iZone)).ZoneEquipPtr = iZone; } } @@ -2611,109 +2522,107 @@ namespace RoomAirModelManager { state.dataUCSDShared->HWindow = 0.0; state.dataUCSDShared->HDoor = 0.0; - for (state.dataRoomAirModelMgr->Loop = 1; state.dataRoomAirModelMgr->Loop <= state.dataGlobal->NumOfZones; - ++state.dataRoomAirModelMgr->Loop) { - if (state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).AirModel != RoomAirModel::UCSDCV) + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UCSDCV) continue; // don't set these up if they don't make sense - ZoneEquipConfigNum = ZoneNum; + + ZoneEquipConfigNum = ZoneNum; // Where does this ZoneNum come from? + + auto const &zone = state.dataHeatBal->Zone(iZone); // check whether this zone is a controlled zone or not if (state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).IsControlled) { - state.dataRoomAirMod->IsZoneCV(state.dataRoomAirModelMgr->Loop) = false; - state.dataRoomAirMod->AirModel(state.dataRoomAirModelMgr->Loop).SimAirModel = false; + state.dataRoomAirMod->IsZoneCV(iZone) = false; + state.dataRoomAirMod->AirModel(iZone).SimAirModel = false; ShowSevereError(state, - format("Unmixed Flow: Cross Ventilation cannot be applied for Zone={}", - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name)); + format("Unmixed Flow: Cross Ventilation cannot be applied for Zone={}", zone.Name)); ShowContinueError(state, - format("An HVAC system is present in the zone. Fully mixed airflow model will be used for Zone={}", - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name)); + format("An HVAC system is present in the zone. Fully mixed airflow model will be used for Zone={}", zone.Name)); continue; } // CurrentModuleObject='RoomAirSettings:CrossVentilation' SetupOutputVariable(state, "Room Air Zone Jet Region Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTJET(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTJET(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Recirculation Region Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTREC(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZTREC(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Jet Region Average Air Velocity", OutputProcessor::Unit::m_s, - state.dataRoomAirMod->Ujet(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->Ujet(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Recirculation Region Average Air Velocity", OutputProcessor::Unit::m_s, - state.dataRoomAirMod->Urec(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->Urec(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Recirculation and Inflow Rate Ratio", OutputProcessor::Unit::None, - state.dataRoomAirMod->RecInflowRatio(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->RecInflowRatio(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Inflow Opening Area", OutputProcessor::Unit::m2, - state.dataRoomAirMod->Ain(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->Ain(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Room Length", OutputProcessor::Unit::m, - state.dataRoomAirMod->Dstar(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->Dstar(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Is Mixing Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneCVisMixing(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneCVisMixing(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); + zone.Name); SetupOutputVariable(state, "Room Air Zone Is Recirculating Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneCVhasREC(state.dataRoomAirModelMgr->Loop), + state.dataRoomAirMod->ZoneCVhasREC(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::State, - state.dataHeatBal->Zone(state.dataRoomAirModelMgr->Loop).Name); - for (state.dataRoomAirModelMgr->i = 1; - state.dataRoomAirModelMgr->i <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); - ++state.dataRoomAirModelMgr->i) { - state.dataRoomAirModelMgr->N = state.afn->AirflowNetworkLinkageData(state.dataRoomAirModelMgr->i).CompNum; - if (state.afn->AirflowNetworkCompData(state.dataRoomAirModelMgr->N).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) { + zone.Name); + for (int i = 1; i <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++i) { + int N = state.afn->AirflowNetworkLinkageData(i).CompNum; + if (state.afn->AirflowNetworkCompData(N).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) { SetupOutputVariable( state, "Room Air Window Jet Region Average Air Velocity", OutputProcessor::Unit::m_s, - state.dataRoomAirMod->CVJetRecFlows(state.dataRoomAirModelMgr->i, state.dataRoomAirModelMgr->Loop).Ujet, + state.dataRoomAirMod->CVJetRecFlows(i, iZone).Ujet, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, - state.afn->MultizoneSurfaceData(state.dataRoomAirModelMgr->i).SurfName); + state.afn->MultizoneSurfaceData(i).SurfName); } } - } - } + } // for (iZone) + } // if (any(isZoneCV)) state.dataRoomAirModelMgr->MyEnvrnFlag = true; state.dataRoomAirModelMgr->MyOneTimeFlag = false; - } + } // if (myOneTimeFlag) // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirModelMgr->MyEnvrnFlag(ZoneNum)) { @@ -2906,7 +2815,6 @@ namespace RoomAirModelManager { // FUNCTION LOCAL VARIABLE DECLARATIONS: int NumAlphas; int NumNumbers; - int I; int Status; // Used in GetObjectItem int MaxNums = 0; // Maximum number of numeric input fields int MaxAlphas = 0; // Maximum number of alpha input fields @@ -2957,10 +2865,10 @@ namespace RoomAirModelManager { ReturnNodeName = ""; // Zone return node } break; case DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator: { // ZoneHVAC : EnergyRecoveryVentilator - I = GetFanOutletNode(state, "Fan:OnOff", Alphas(4), errorfound); + int nodeNum = GetFanOutletNode(state, "Fan:OnOff", Alphas(4), errorfound); if (errorfound) { } - SupplyNodeName = state.dataLoopNodes->NodeID(I); // ????? + SupplyNodeName = state.dataLoopNodes->NodeID(nodeNum); // ????? ReturnNodeName = ""; // Zone exhaust node } break; case DataZoneEquipment::ZoneEquipType::FourPipeFanCoil: { // ZoneHVAC : FourPipeFanCoil diff --git a/src/EnergyPlus/RoomAirModelManager.hh b/src/EnergyPlus/RoomAirModelManager.hh index eea8da27d9a..3a96902c644 100644 --- a/src/EnergyPlus/RoomAirModelManager.hh +++ b/src/EnergyPlus/RoomAirModelManager.hh @@ -100,52 +100,11 @@ struct RoomAirModelManagerData : BaseGlobalStruct bool GetUCSDDVDataFlag = true; // UCSD bool GetAirModelData = true; // Used to "get" all air model data bool MyOneTimeFlag = true; - int CompNum = 0; - int TypeNum = 0; - int NodeNum1 = 0; - int NodeNum2 = 0; - int CompNumber = 0; // AirflowNetwork Component number - int TypeNumber = 0; // Airflownetwork Type Number within a component - int NodeNumber1 = 0; // The first node number in an AirflowNetwork linkage data - int NodeNumber2 = 0; // The Second node number in an AirflowNetwork linkage data - int contFloorBegin = 0; // counter - int contFloorLast = 0; // counter - int contFloor = 0; // counter - int contCeilingBegin = 0; // counter - int contCeilingLast = 0; // counter - int contCeiling = 0; // counter - int contWallBegin = 0; // counter - int contWallLast = 0; // counter - int contWall = 0; // counter - int contWindowBegin = 0; // counter - int contWindowLast = 0; // counter - int contWindow = 0; // counter - int contInternalBegin = 0; // counter - int contInternalLast = 0; // counter - int contInternal = 0; // counter - int contDoorBegin = 0; // counter - int contDoorLast = 0; // counter - int contDoor = 0; // counter - int Loop = 0; // counter - int Loop2 = 0; // counter - int Loop3 = 0; // counter - int i = 0; // counter - int N = 0; // counter - Real64 Z1ZoneAux = 0.0; // Auxiliary variables - Real64 Z2ZoneAux = 0.0; // Auxiliary variables - Real64 Z1Zone = 0.0; // Auxiliary variables - Real64 Z2Zone = 0.0; // Auxiliary variables - Real64 CeilingHeightDiffMax = 0.1; // Maximum difference between wall height and ceiling height - Real64 Z1ofZoneAux = 0.0; // Auxiliary variables - Real64 Z2ofZoneAux = 0.0; // Auxiliary variables - Real64 Z1ofZone = 0.0; // Auxiliary variables - Real64 Z2ofZone = 0.0; // Auxiliary variables - Real64 CeilingHeightDiffMaximum = 0.1; // Maximum difference between wall height and ceiling height Array1D_bool MyEnvrnFlag; void clear_state() override { - *this = RoomAirModelManagerData(); + new (this) RoomAirModelManagerData(); } }; diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index b863cfb80a1..4d51da78544 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -2579,7 +2579,7 @@ namespace SimulationManager { print(state.files.bnd, " Zone Equipment Component,{},{},{},{},{},{}\n", Count1, - state.dataZoneEquip->ZoneEquipList(Count).EquipType(Count1), + state.dataZoneEquip->ZoneEquipList(Count).EquipTypeName(Count1), state.dataZoneEquip->ZoneEquipList(Count).EquipName(Count1), state.dataZoneEquip->ZoneEquipConfig(Count).ZoneName, state.dataZoneEquip->ZoneEquipList(Count).CoolingPriority(Count1), From 7a6d510a952cdd694dda9d3863622ca7c9f5c0d4 Mon Sep 17 00:00:00 2001 From: amirroth Date: Thu, 22 Jun 2023 09:02:50 -0400 Subject: [PATCH 04/17] Unify RoomAir namespace --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 2 +- src/EnergyPlus/ConvectionCoefficients.cc | 8 +- src/EnergyPlus/CrossVentMgr.cc | 13 ++-- src/EnergyPlus/CrossVentMgr.hh | 4 +- src/EnergyPlus/DataRoomAirModel.hh | 36 ++++----- src/EnergyPlus/DisplacementVentMgr.cc | 18 ++--- src/EnergyPlus/DisplacementVentMgr.hh | 4 +- src/EnergyPlus/HeatBalanceAirManager.cc | 74 +++++++------------ src/EnergyPlus/HybridModel.cc | 5 +- src/EnergyPlus/MundtSimMgr.cc | 29 ++++---- src/EnergyPlus/MundtSimMgr.hh | 38 ++++------ src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 17 +---- src/EnergyPlus/RoomAirModelAirflowNetwork.hh | 6 +- src/EnergyPlus/RoomAirModelManager.cc | 26 +++---- src/EnergyPlus/RoomAirModelManager.hh | 4 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 25 +++---- src/EnergyPlus/RoomAirModelUserTempPattern.hh | 4 +- src/EnergyPlus/SQLiteProcedures.cc | 2 +- src/EnergyPlus/SQLiteProcedures.hh | 8 +- src/EnergyPlus/ThermalComfort.cc | 14 ++-- src/EnergyPlus/UFADManager.cc | 27 ++++--- src/EnergyPlus/UFADManager.hh | 10 +-- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 62 ++++++++-------- .../unit/ConvectionCoefficients.unit.cc | 4 +- tst/EnergyPlus/unit/CrossVentMgr.unit.cc | 3 +- .../unit/DisplacementVentMgr.unit.cc | 5 +- tst/EnergyPlus/unit/HybridModel.unit.cc | 2 +- .../unit/RoomAirModelUserTempPattern.unit.cc | 2 +- .../unit/RoomAirflowNetwork.unit.cc | 7 +- tst/EnergyPlus/unit/SQLite.unit.cc | 8 +- tst/EnergyPlus/unit/ThermalComfort.unit.cc | 6 +- .../unit/ZoneTempPredictorCorrector.unit.cc | 2 +- 32 files changed, 207 insertions(+), 268 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index f8a47e77db7..4c09e8aa03d 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -1643,7 +1643,7 @@ namespace AirflowNetwork { using MixedAir::GetOAMixerNumber; using NodeInputManager::GetOnlySingleNode; using OutAirNodeManager::SetOutAirNodes; - using RoomAirModelManager::GetRAFNNodeNum; + using RoomAir::GetRAFNNodeNum; // SUBROUTINE PARAMETER DEFINITIONS: static constexpr std::string_view RoutineName("AirflowNetwork::Solver::get_input: "); // include trailing blank space diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 31a50d07f9d..9f6444a11ee 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -1981,9 +1981,9 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, } assert(state.dataRoomAirMod->AirModel.allocated()); - if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(surface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(surface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UCSDDV || + state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UCSDUFI || + state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UCSDUFE) { // Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf if (state.dataSurface->surfIntConv(SurfNum).userModelNum != 0) { @@ -1996,7 +1996,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, -surface.CosTilt); // negative CosTilt because CosTilt is relative to exterior } - } else if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDCV) { + } else if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UCSDCV) { Hf = 4.3 * Vhc()(surface.Zone); diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 5f6ce90d60d..2b374d9c820 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -73,7 +73,7 @@ namespace EnergyPlus { -namespace CrossVentMgr { +namespace RoomAir { // MODULE INFORMATION: // AUTHOR G. Carrilho da Graca @@ -86,7 +86,6 @@ namespace CrossVentMgr { using namespace DataHeatBalance; using namespace DataHeatBalSurface; using namespace DataSurfaces; - using namespace DataRoomAirModel; using Convect::CalcDetailedHcInForDVModel; Real64 constexpr Cjet1(1.873); // First correlation constant for the jet velocity @@ -725,7 +724,7 @@ namespace CrossVentMgr { if (state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum <= 0) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModel == - DataRoomAirModel::RoomAirModel::UCSDCV) { + RoomAir::RoomAirModel::UCSDCV) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum); } else { @@ -738,7 +737,7 @@ namespace CrossVentMgr { if (state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum <= 0) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModel == - DataRoomAirModel::RoomAirModel::UCSDCV) { + RoomAir::RoomAirModel::UCSDCV) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum); } else { @@ -748,10 +747,10 @@ namespace CrossVentMgr { } } else if ((thisSurface.Zone == ZoneNum) && (state.dataRoomAirMod->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModel == - DataRoomAirModel::RoomAirModel::UCSDCV)) { + RoomAir::RoomAirModel::UCSDCV)) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone); } else if ((thisSurface.Zone != ZoneNum) && - (state.dataRoomAirMod->AirModel(thisSurface.Zone).AirModel == DataRoomAirModel::RoomAirModel::UCSDCV)) { + (state.dataRoomAirMod->AirModel(thisSurface.Zone).AirModel == RoomAir::RoomAirModel::UCSDCV)) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(surfNum); } else { if (thisSurface.Zone == ZoneNum) { @@ -914,6 +913,6 @@ namespace CrossVentMgr { } } -} // namespace CrossVentMgr +} // namespace RoomAir } // namespace EnergyPlus diff --git a/src/EnergyPlus/CrossVentMgr.hh b/src/EnergyPlus/CrossVentMgr.hh index 0ffe03c4b1f..09104e4c757 100644 --- a/src/EnergyPlus/CrossVentMgr.hh +++ b/src/EnergyPlus/CrossVentMgr.hh @@ -57,7 +57,7 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace CrossVentMgr { +namespace RoomAir { void ManageUCSDCVModel(EnergyPlusData &state, int ZoneNum); @@ -69,7 +69,7 @@ namespace CrossVentMgr { void CalcUCSDCV(EnergyPlusData &state, int ZoneNum); -} // namespace CrossVentMgr +} // namespace RoomAir struct CrossVentMgrData : BaseGlobalStruct { diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index b1b43b5c9fa..e560f508af3 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -61,13 +61,13 @@ namespace EnergyPlus { -namespace DataRoomAirModel { +namespace RoomAir { - auto constexpr cUserDefinedControlObject("RoomAir:TemperaturePattern:UserDefined"); - auto constexpr cTempPatternConstGradientObject("RoomAir:TemperaturePattern:ConstantGradient"); - auto constexpr cTempPatternTwoGradientObject("RoomAir:TemperaturePattern:TwoGradient"); - auto constexpr cTempPatternNDHeightObject("RoomAir:TemperaturePattern:NondimensionalHeight"); - auto constexpr cTempPatternSurfMapObject("RoomAir:TemperaturePattern:SurfaceMapping"); + constexpr std::string_view cUserDefinedControlObject("RoomAir:TemperaturePattern:UserDefined"); + constexpr std::string_view cTempPatternConstGradientObject("RoomAir:TemperaturePattern:ConstantGradient"); + constexpr std::string_view cTempPatternTwoGradientObject("RoomAir:TemperaturePattern:TwoGradient"); + constexpr std::string_view cTempPatternNDHeightObject("RoomAir:TemperaturePattern:NondimensionalHeight"); + constexpr std::string_view cTempPatternSurfMapObject("RoomAir:TemperaturePattern:SurfaceMapping"); // Parameters to indicate room air model selected enum class RoomAirModel : int @@ -537,7 +537,7 @@ namespace DataRoomAirModel { int RAFNNum = 0; // RAFN number }; -} // namespace DataRoomAirModel +} // namespace RoomAir struct RoomAirModelData : BaseGlobalStruct { @@ -668,17 +668,17 @@ struct RoomAirModelData : BaseGlobalStruct int NumOfRoomAirflowNetControl = 0; // count of RoomAirSettings:AirflowNetwork // Object Data - Array1D AirModel; - Array1D AirNode; - Array1D ZoneUCSDDV; // UCSD - Array1D ZoneUCSDCV; - Array1D ZoneUCSDUI; - Array1D ZoneUCSDUE; - Array2D CVJetRecFlows; // Jet and recirculation zone flows and properties - Array1D SurfParametersCVDV; // Surface parameters - Array1D RoomAirPattern; // user defined patterns ,various types - Array1D AirPatternZoneInfo; // added zone information for user defined patterns - Array1D RoomAirflowNetworkZoneInfo; // added zone info + Array1D AirModel; + Array1D AirNode; + Array1D ZoneUCSDDV; // UCSD + Array1D ZoneUCSDCV; + Array1D ZoneUCSDUI; + Array1D ZoneUCSDUE; + Array2D CVJetRecFlows; // Jet and recirculation zone flows and properties + Array1D SurfParametersCVDV; // Surface parameters + Array1D RoomAirPattern; // user defined patterns ,various types + Array1D AirPatternZoneInfo; // added zone information for user defined patterns + Array1D RoomAirflowNetworkZoneInfo; // added zone info void clear_state() override { diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index 03b739ed1e3..f170cc57266 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -74,7 +74,9 @@ #include #include -namespace EnergyPlus::DisplacementVentMgr { +namespace EnergyPlus { + +namespace RoomAir { // MODULE INFORMATION: // AUTHOR G. Carrilho da Graca @@ -91,7 +93,6 @@ using namespace DataEnvironment; using namespace DataHeatBalance; using namespace DataHeatBalSurface; using namespace DataSurfaces; -using namespace DataRoomAirModel; using Convect::CalcDetailedHcInForDVModel; void ManageUCSDDVModel(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone @@ -100,8 +101,6 @@ void ManageUCSDDVModel(EnergyPlusData &state, int const ZoneNum) // index number // SUBROUTINE INFORMATION: // AUTHOR G. Carrilho da Graca // DATE WRITTEN February 2004 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // manage the UCSD Displacement Ventilation model @@ -611,22 +610,22 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum } } - ConvGainsOccupiedSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, DisplacementVentMgr::IntGainTypesOccupied); + ConvGainsOccupiedSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); ConvGainsOccupiedSubzone += 0.5 * thisZoneHB.SysDepZoneLoadsLagged; // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very // low or zero) if (zone.NoHeatToReturnAir) { - RetAirGain = SumReturnAirConvectionGainsByTypes(state, ZoneNum, DisplacementVentMgr::IntGainTypesOccupied); + RetAirGain = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); ConvGainsOccupiedSubzone += RetAirGain; } - ConvGainsMixedSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, DisplacementVentMgr::IntGainTypesMixedSubzone); + ConvGainsMixedSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesMixedSubzone); ConvGainsMixedSubzone += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum) + state.dataHeatBalFanSys->SumConvPool(ZoneNum) + 0.5 * thisZoneHB.SysDepZoneLoadsLagged; if (zone.NoHeatToReturnAir) { - RetAirGain = SumReturnAirConvectionGainsByTypes(state, ZoneNum, DisplacementVentMgr::IntGainTypesMixedSubzone); + RetAirGain = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesMixedSubzone); ConvGainsMixedSubzone += RetAirGain; } @@ -1121,4 +1120,5 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum } } -} // namespace EnergyPlus::DisplacementVentMgr +} // namespace RoomAir +} // namespace EnergyPlus diff --git a/src/EnergyPlus/DisplacementVentMgr.hh b/src/EnergyPlus/DisplacementVentMgr.hh index cbbdcab0b9c..b4cfa7caf93 100644 --- a/src/EnergyPlus/DisplacementVentMgr.hh +++ b/src/EnergyPlus/DisplacementVentMgr.hh @@ -58,7 +58,7 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace DisplacementVentMgr { +namespace RoomAir { void ManageUCSDDVModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone @@ -113,7 +113,7 @@ namespace DisplacementVentMgr { static constexpr std::array IntGainTypesMixedSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, DataHeatBalance::IntGainType::Lights}; -} // namespace DisplacementVentMgr +} // namespace RoomAir struct DisplacementVentMgrData : BaseGlobalStruct { diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index d4f19ce1368..96688d7b048 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -129,7 +129,7 @@ constexpr std::array(AirflowSpecAlt::Num)> ai constexpr std::array(DataHeatBalance::VentilationType::Num)> ventilationTypeNamesUC = { "NATURAL", "INTAKE", "EXHAUST", "BALANCED"}; -constexpr std::array(DataRoomAirModel::RoomAirModel::Num)> roomAirModelNamesUC = { +constexpr std::array(RoomAir::RoomAirModel::Num)> roomAirModelNamesUC = { "USERDEFINED", "MIXING", "ONENODEDISPLACEMENTVENTILATION", @@ -139,7 +139,7 @@ constexpr std::array(DataRoomAirModel::RoomAi "UNDERFLOORAIRDISTRIBUTIONEXTERIOR", "AIRFLOWNETWORK"}; -constexpr std::array(DataRoomAirModel::CouplingScheme::Num)> couplingSchemeNamesUC = {"DIRECT", "INDIRECT"}; +constexpr std::array(RoomAir::CouplingScheme::Num)> couplingSchemeNamesUC = {"DIRECT", "INDIRECT"}; void ManageAirHeatBalance(EnergyPlusData &state) { @@ -4614,13 +4614,13 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if // state.dataRoomAirMod->AirModel(ZoneNum).AirModelName = state.dataIPShortCut->cAlphaArgs(1); state.dataRoomAirMod->AirModel(ZoneNum).AirModel = - static_cast(getEnumValue(roomAirModelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); // is this arg1 or arg3? + static_cast(getEnumValue(roomAirModelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); // is this arg1 or arg3? switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModel) { - case DataRoomAirModel::RoomAirModel::Mixing: + case RoomAir::RoomAirModel::Mixing: // nothing to do here actually break; - case DataRoomAirModel::RoomAirModel::Mundt: + case RoomAir::RoomAirModel::Mundt: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->MundtModelUsed = true; IsNotOK = false; @@ -4636,7 +4636,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case DataRoomAirModel::RoomAirModel::UCSDDV: + case RoomAir::RoomAirModel::UCSDDV: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UCSDModelUsed = true; IsNotOK = false; @@ -4652,7 +4652,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case DataRoomAirModel::RoomAirModel::UCSDCV: + case RoomAir::RoomAirModel::UCSDCV: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UCSDModelUsed = true; IsNotOK = false; @@ -4668,7 +4668,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case DataRoomAirModel::RoomAirModel::UCSDUFI: + case RoomAir::RoomAirModel::UCSDUFI: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UCSDModelUsed = true; ValidateComponent(state, @@ -4683,7 +4683,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case DataRoomAirModel::RoomAirModel::UCSDUFE: + case RoomAir::RoomAirModel::UCSDUFE: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UCSDModelUsed = true; ValidateComponent(state, @@ -4698,12 +4698,12 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case DataRoomAirModel::RoomAirModel::UserDefined: + case RoomAir::RoomAirModel::UserDefined: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UserDefinedUsed = true; break; - case DataRoomAirModel::RoomAirModel::AirflowNetwork: + case RoomAir::RoomAirModel::AirflowNetwork: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; if (state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "AirflowNetwork:SimulationControl") == 0) { ShowSevereError(state, @@ -4723,16 +4723,16 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if ShowWarningError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("The mixing air model will be used for Zone ={}", state.dataIPShortCut->cAlphaArgs(2))); - state.dataRoomAirMod->AirModel(ZoneNum).AirModel = DataRoomAirModel::RoomAirModel::Mixing; + state.dataRoomAirMod->AirModel(ZoneNum).AirModel = RoomAir::RoomAirModel::Mixing; } state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme = - static_cast(getEnumValue(couplingSchemeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); - if (state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme == DataRoomAirModel::CouplingScheme::Invalid) { + static_cast(getEnumValue(couplingSchemeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); + if (state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme == RoomAir::CouplingScheme::Invalid) { ShowWarningError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("The direct coupling scheme will be used for Zone ={}", state.dataIPShortCut->cAlphaArgs(2))); - state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme = DataRoomAirModel::CouplingScheme::Direct; + state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme = RoomAir::CouplingScheme::Direct; } } else { // Zone Not Found @@ -4747,7 +4747,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if state.dataRoomAirMod->AirModel(ZoneNum).Name = "MIXING AIR MODEL FOR " + state.dataHeatBal->Zone(ZoneNum).Name; state.dataRoomAirMod->AirModel(ZoneNum).ZoneName = state.dataHeatBal->Zone(ZoneNum).Name; // set global flag for non-mixing model - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != DataRoomAirModel::RoomAirModel::Mixing) { + if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAir::RoomAirModel::Mixing) { state.dataRoomAirMod->anyNonMixingRoomAirModel = true; } } @@ -4763,38 +4763,16 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if static constexpr std::string_view RoomAirHeader("! , Zone Name, Mixing/Mundt/UCSDDV/UCSDCV/UCSDUFI/UCSDUFE/User Defined\n"); print(state.files.eio, RoomAirHeader); for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - { - static constexpr std::string_view RoomAirZoneFmt("RoomAir Model,{},{}\n"); - - switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModel) { - case DataRoomAirModel::RoomAirModel::Mixing: { - print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "Mixing/Well-Stirred"); - } break; - case DataRoomAirModel::RoomAirModel::Mundt: { - print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "OneNodeDisplacementVentilation"); - } break; - case DataRoomAirModel::RoomAirModel::UCSDDV: { - print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "ThreeNodeDisplacementVentilation"); - } break; - case DataRoomAirModel::RoomAirModel::UCSDCV: { - print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "CrossVentilation"); - } break; - case DataRoomAirModel::RoomAirModel::UCSDUFI: { - print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "UnderFloorAirDistributionInterior"); - } break; - case DataRoomAirModel::RoomAirModel::UCSDUFE: { - print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "UnderFloorAirDistributionExterior"); - } break; - case DataRoomAirModel::RoomAirModel::UserDefined: { - print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "UserDefined"); - } break; - case DataRoomAirModel::RoomAirModel::AirflowNetwork: { - print(state.files.eio, RoomAirZoneFmt, state.dataHeatBal->Zone(ZoneNum).Name, "AirflowNetwork"); - } break; - default: - break; - } - } + static constexpr std::array roomAirModelStrings = { + "UserDefined", "Mixing/Well-Stirred", + "OneNodeDisplacementVentilation", "ThreeNodeDisplacementVentilation", + "CrossVentilation", + "UnderFloorAirDistributionInterior", "UnderFloorAirDistributionExterior", + "AirflowNetwork"}; + + print(state.files.eio, "RoomAir Model,{},{}\n", + state.dataHeatBal->Zone(ZoneNum).Name, + roomAirModelStrings[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel]); } if (ErrorsFound) { diff --git a/src/EnergyPlus/HybridModel.cc b/src/EnergyPlus/HybridModel.cc index 65f5b7bf26a..d0f9bb3efae 100644 --- a/src/EnergyPlus/HybridModel.cc +++ b/src/EnergyPlus/HybridModel.cc @@ -78,7 +78,6 @@ namespace HybridModel { // Using/Aliasing using namespace DataHeatBalance; - using namespace DataRoomAirModel; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -495,8 +494,8 @@ namespace HybridModel { for (ZonePtr = 1; ZonePtr <= state.dataGlobal->NumOfZones; ZonePtr++) { if ((state.dataHybridModel->HybridModelZone(ZonePtr).InternalThermalMassCalc_T || state.dataHybridModel->HybridModelZone(ZonePtr).InfiltrationCalc_T) && - (state.dataRoomAirMod->AirModel(ZonePtr).AirModel != DataRoomAirModel::RoomAirModel::Mixing)) { - state.dataRoomAirMod->AirModel(ZonePtr).AirModel = DataRoomAirModel::RoomAirModel::Mixing; + (state.dataRoomAirMod->AirModel(ZonePtr).AirModel != RoomAir::RoomAirModel::Mixing)) { + state.dataRoomAirMod->AirModel(ZonePtr).AirModel = RoomAir::RoomAirModel::Mixing; ShowWarningError(state, "Room Air Model Type should be Mixing if Hybrid Modeling is performed for the zone."); } } diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index 9d18a4d8ca0..5b535334d12 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -68,7 +68,7 @@ namespace EnergyPlus { -namespace MundtSimMgr { +namespace RoomAir { // MODULE INFORMATION: // AUTHOR Brent Griffith @@ -190,7 +190,7 @@ namespace MundtSimMgr { ErrorsFound = false; for (ZoneIndex = 1; ZoneIndex <= state.dataGlobal->NumOfZones; ++ZoneIndex) { auto &thisZone = state.dataHeatBal->Zone(ZoneIndex); - if (state.dataRoomAirMod->AirModel(ZoneIndex).AirModel == DataRoomAirModel::RoomAirModel::Mundt) { + if (state.dataRoomAirMod->AirModel(ZoneIndex).AirModel == RoomAir::RoomAirModel::Mundt) { // find number of zones using the Mundt model ++NumOfMundtZones; // find maximum number of surfaces in zones using the Mundt model @@ -227,7 +227,7 @@ namespace MundtSimMgr { } for (auto &e : state.dataMundtSimMgr->LineNode) { e.AirNodeName.clear(); - e.ClassType = DataRoomAirModel::AirNodeType::Invalid; + e.ClassType = RoomAir::AirNodeType::Invalid; e.Height = 0.0; e.Temp = 25.0; } @@ -292,12 +292,12 @@ namespace MundtSimMgr { } // count air nodes connected to walls in each zone - if (state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType == DataRoomAirModel::AirNodeType::Mundt) { + if (state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType == RoomAir::AirNodeType::Mundt) { ++RoomNodesCount; } // count floors in each zone - if (state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType == DataRoomAirModel::AirNodeType::Floor) { + if (state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType == RoomAir::AirNodeType::Floor) { FloorSurfCount += count(state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).SurfMask); } } @@ -449,9 +449,6 @@ namespace MundtSimMgr { // REFERENCES: // na - // Using/Aliasing - using namespace DataRoomAirModel; - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -472,23 +469,23 @@ namespace MundtSimMgr { state.dataMundtSimMgr->NumRoomNodes = 0; for (NodeNum = 1; NodeNum <= state.dataRoomAirMod->TotNumOfZoneAirNodes(ZoneNum); ++NodeNum) { switch (state.dataMundtSimMgr->LineNode(NodeNum, state.dataMundtSimMgr->MundtZoneNum).ClassType) { - case AirNodeType::Inlet: { // inlet + case RoomAir::AirNodeType::Inlet: { // inlet state.dataMundtSimMgr->SupplyNodeID = NodeNum; } break; - case AirNodeType::Floor: { // floor + case RoomAir::AirNodeType::Floor: { // floor state.dataMundtSimMgr->MundtFootAirID = NodeNum; } break; - case AirNodeType::Control: { // thermostat + case RoomAir::AirNodeType::Control: { // thermostat state.dataMundtSimMgr->TstatNodeID = NodeNum; } break; - case AirNodeType::Ceiling: { // ceiling + case RoomAir::AirNodeType::Ceiling: { // ceiling state.dataMundtSimMgr->MundtCeilAirID = NodeNum; } break; - case AirNodeType::Mundt: { // wall + case RoomAir::AirNodeType::Mundt: { // wall ++state.dataMundtSimMgr->NumRoomNodes; state.dataMundtSimMgr->RoomNodeIDs(state.dataMundtSimMgr->NumRoomNodes) = NodeNum; } break; - case AirNodeType::Return: { // return + case RoomAir::AirNodeType::Return: { // return state.dataMundtSimMgr->ReturnNodeID = NodeNum; } break; default: { @@ -742,7 +739,7 @@ namespace MundtSimMgr { if ((state.dataMundtSimMgr->SupplyAirVolumeRate > 0.0001) && (state.dataMundtSimMgr->QsysCoolTot > 0.0001)) { // Controlled zone when the system is on - if (state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme == DataRoomAirModel::CouplingScheme::Direct) { + if (state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme == RoomAir::CouplingScheme::Direct) { // Use direct coupling scheme to report air temperatures back to surface/system domains // a) Bulk air temperatures -> TempEffBulkAir(SurfNum) for (int SurfNum = 1; SurfNum <= NumOfSurfs; ++SurfNum) { @@ -808,6 +805,6 @@ namespace MundtSimMgr { //***************************************************************************************** -} // namespace MundtSimMgr +} // namespace RoomAir } // namespace EnergyPlus diff --git a/src/EnergyPlus/MundtSimMgr.hh b/src/EnergyPlus/MundtSimMgr.hh index 1e57764f492..7e98855f327 100644 --- a/src/EnergyPlus/MundtSimMgr.hh +++ b/src/EnergyPlus/MundtSimMgr.hh @@ -62,37 +62,27 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace MundtSimMgr { +namespace RoomAir { // Types struct DefineLinearModelNode { // Members - std::string AirNodeName; // Name of air nodes - DataRoomAirModel::AirNodeType ClassType; // Type of air nodes - Real64 Height; // Z coordinates [m] node's Control Vol. center - Real64 Temp; // Surface temperature BC + std::string AirNodeName = ""; // Name of air nodes + RoomAir::AirNodeType ClassType = RoomAir::AirNodeType::Invalid; // Type of air nodes + Real64 Height = 0.0; // Z coordinates [m] node's Control Vol. center + Real64 Temp = 0.0; // Surface temperature BC Array1D_bool SurfMask; // Limit of 60 surfaces at current sizing - - // Default Constructor - DefineLinearModelNode() : ClassType(DataRoomAirModel::AirNodeType::Invalid), Height(0.0), Temp(0.0) - { - } }; struct DefineSurfaceSettings { // Members - Real64 Area; // m2 - Real64 Temp; // surface temperature BC - Real64 Hc; // convective film coeff BC - Real64 TMeanAir; // effective near-surface air temp from air model solution - - // Default Constructor - DefineSurfaceSettings() : Area(0.0), Temp(0.0), Hc(0.0), TMeanAir(0.0) - { - } + Real64 Area = 0.0; // m2 + Real64 Temp = 0.0; // surface temperature BC + Real64 Hc = 0.0; // convective film coeff BC + Real64 TMeanAir = 0.0; // effective near-surface air temp from air model solution }; struct DefineZoneData @@ -146,7 +136,7 @@ namespace MundtSimMgr { //***************************************************************************************** -} // namespace MundtSimMgr +} // namespace RoomAir struct MundtSimMgrData : BaseGlobalStruct { @@ -173,10 +163,10 @@ struct MundtSimMgrData : BaseGlobalStruct Real64 QsysCoolTot = 0.0; // zone sensible cooling load // Object Data - Array1D ZoneData; // zone data - Array2D LineNode; // air nodes - Array2D MundtAirSurf; // surfaces - Array1D FloorSurf; // floor + Array1D ZoneData; // zone data + Array2D LineNode; // air nodes + Array2D MundtAirSurf; // surfaces + Array1D FloorSurf; // floor void clear_state() override { diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index d1236960c5b..40b69c5cc48 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -91,13 +91,12 @@ namespace EnergyPlus { -namespace RoomAirModelAirflowNetwork { +namespace RoomAir { // MODULE INFORMATION: // AUTHOR Brent Griffith // DATE WRITTEN November 2009 // MODIFIED Lixing Gu, Aug. 2015 for v8.4 replease - // RE-ENGINEERED na // PURPOSE OF THIS MODULE: // contains the RoomAir model portions of RoomAirflowNetwork modeling @@ -107,7 +106,6 @@ namespace RoomAirModelAirflowNetwork { // Do heat and moisture balance calculations on roomair nodes. // Using/Aliasing - using namespace DataRoomAirModel; using namespace DataHeatBalSurface; using namespace DataSurfaces; using namespace DataHeatBalance; @@ -123,19 +121,12 @@ namespace RoomAirModelAirflowNetwork { // AUTHOR Brent Griffith // DATE WRITTEN January 2004/Aug 2005 // MODIFIED Lixing Gu, Aug. 2015 for v8.4 replease - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine manages RoomAirflowNetwork model simulation // METHODOLOGY EMPLOYED: - // calls subroutines - - // REFERENCES: - // na - - // USE STATEMENTS: - // na + // calls subroutines (LOL) // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ThisRoomAirNode; @@ -225,7 +216,7 @@ namespace RoomAirModelAirflowNetwork { // SUBROUTINE INFORMATION: // AUTHOR B. Griffith // DATE WRITTEN November 2009 - // MODIFIED Lixing Gu, Aug. 2015 for v8.4 replease + // MODIFIED Lixing Gu, Aug. 2015 for v8.4 release // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: @@ -1417,6 +1408,6 @@ namespace RoomAirModelAirflowNetwork { //***************************************************************************************** -} // namespace RoomAirModelAirflowNetwork +} // namespace RoomAir } // namespace EnergyPlus diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.hh b/src/EnergyPlus/RoomAirModelAirflowNetwork.hh index a7761d4bda3..add3d454989 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.hh +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.hh @@ -57,7 +57,7 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace RoomAirModelAirflowNetwork { +namespace RoomAir { // Data class RAFNData { @@ -92,7 +92,7 @@ namespace RoomAirModelAirflowNetwork { //***************************************************************************************** -} // namespace RoomAirModelAirflowNetwork +} // namespace RoomAir struct RoomAirModelAirflowNetworkData : BaseGlobalStruct { @@ -100,7 +100,7 @@ struct RoomAirModelAirflowNetworkData : BaseGlobalStruct bool InitRoomAirModelAirflowNetworkOneTimeFlagConf = true; bool InitRoomAirModelAirflowNetworkEnvrnFlag = true; bool LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag = true; - Array1D RAFN; + Array1D RAFN; void clear_state() override { diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 3f5ecb9432a..cc99a4a10b4 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -89,21 +89,17 @@ namespace EnergyPlus { -namespace RoomAirModelManager { +namespace RoomAir { // MODULE INFORMATION // AUTHOR Weixiu Kong // DATE WRITTEN March 2003 // MODIFIED July 2003, CC // Aug, 2005, BG - // RE-ENGINEERED na // PURPOSE OF THIS MODULE: // Contains subroutines for managing the room air models - // Using/Aliasing - using namespace DataRoomAirModel; - constexpr std::array roomAirModelNamesUC = { "USERDEFINED", "MIXING", "MUNDT", "UCSD_DV", "UCSD_CV", "UCSD_UFI", "UCSD_UFE", "AIRFLOWNETWORK"}; @@ -119,7 +115,7 @@ namespace RoomAirModelManager { constexpr std::array userDefinedPatternModeNamesUC = {"OUTDOORDRYBULBTEMPERATURE", "SENSIBLECOOLINGLOAD", "SENSIBLEHEATINGLOAD", "ZONEDRYBULBTEMPERATURE", "ZONEANDOUTDOORTEMPERATUREDIFFERENCE"}; - void ManageAirModel(EnergyPlusData &state, int const ZoneNum) + void ManageAirModel(EnergyPlusData &state, int const ZoneNum) { // SUBROUTINE INFORMATION: @@ -127,7 +123,6 @@ namespace RoomAirModelManager { // DATE WRITTEN April 2003 // MODIFIED July 2003, CC // Jan 2004, CC - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // manage room air models. @@ -145,7 +140,7 @@ namespace RoomAirModelManager { switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModel) { case RoomAirModel::UserDefined: - RoomAirModelUserTempPattern::ManageUserDefinedPatterns(state, ZoneNum); + ManageUserDefinedPatterns(state, ZoneNum); break; case RoomAirModel::Mixing: // Mixing air model @@ -153,32 +148,32 @@ namespace RoomAirModelManager { case RoomAirModel::Mundt: // Mundt air model // simulate room airflow using Mundt model - MundtSimMgr::ManageMundtModel(state, ZoneNum); + ManageMundtModel(state, ZoneNum); break; case RoomAirModel::UCSDDV: // UCDV Displacement Ventilation model // simulate room airflow using UCSDDV model - DisplacementVentMgr::ManageUCSDDVModel(state, ZoneNum); + ManageUCSDDVModel(state, ZoneNum); break; case RoomAirModel::UCSDCV: // UCSD Cross Ventilation model // simulate room airflow using UCSDDV model - CrossVentMgr::ManageUCSDCVModel(state, ZoneNum); + ManageUCSDCVModel(state, ZoneNum); break; case RoomAirModel::UCSDUFI: // UCSD UFAD interior zone model // simulate room airflow using the UCSDUFI model - UFADManager::ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UCSDUFI); + ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UCSDUFI); break; case RoomAirModel::UCSDUFE: // UCSD UFAD exterior zone model // simulate room airflow using the UCSDUFE model - UFADManager::ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UCSDUFE); + ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UCSDUFE); break; case RoomAirModel::AirflowNetwork: // RoomAirflowNetwork zone model // simulate room airflow using the AirflowNetwork - based model - RoomAirModelAirflowNetwork::SimRoomAirModelAirflowNetwork(state, ZoneNum); + SimRoomAirModelAirflowNetwork(state, ZoneNum); break; default: // mixing air model @@ -251,7 +246,6 @@ namespace RoomAirModelManager { // Using/Aliasing using DataZoneEquipment::EquipConfiguration; - using RoomAirModelUserTempPattern::FigureNDheightInZone; using ScheduleManager::GetScheduleIndex; // SUBROUTINE PARAMETER DEFINITIONS: @@ -3034,6 +3028,6 @@ namespace RoomAirModelManager { //***************************************************************************************** -} // namespace RoomAirModelManager +} // namespace RoomAir } // namespace EnergyPlus diff --git a/src/EnergyPlus/RoomAirModelManager.hh b/src/EnergyPlus/RoomAirModelManager.hh index 3a96902c644..c0bfe2fcd06 100644 --- a/src/EnergyPlus/RoomAirModelManager.hh +++ b/src/EnergyPlus/RoomAirModelManager.hh @@ -57,7 +57,7 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace RoomAirModelManager { +namespace RoomAir { void ManageAirModel(EnergyPlusData &state, int const ZoneNum); @@ -92,7 +92,7 @@ namespace RoomAirModelManager { int TotNumEquip, // how many of this equipment type DataZoneEquipment::ZoneEquipType zoneEquipType); // equipment type number -} // namespace RoomAirModelManager +} // namespace RoomAir struct RoomAirModelManagerData : BaseGlobalStruct { diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index e92b2b48fac..e21958a5595 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -74,7 +74,7 @@ #include #include -namespace EnergyPlus::RoomAirModelUserTempPattern { +namespace EnergyPlus::RoomAir { // MODULE INFORMATION: // AUTHOR Brent Griffith @@ -94,9 +94,6 @@ namespace EnergyPlus::RoomAirModelUserTempPattern { // user defined temperature pattern roomair modeling. // See DataRoomAir.cc for variable declarations -// Using/Aliasing -using namespace DataRoomAirModel; - // Functions void ManageUserDefinedPatterns(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone @@ -245,16 +242,16 @@ void CalcTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number } switch (state.dataRoomAirMod->RoomAirPattern(CurPatrnID).PatternMode) { - case DataRoomAirModel::UserDefinedPatternType::ConstGradTemp: { + case UserDefinedPatternType::ConstGradTemp: { FigureConstGradPattern(state, CurPatrnID, ZoneNum); } break; - case DataRoomAirModel::UserDefinedPatternType::TwoGradInterp: { + case UserDefinedPatternType::TwoGradInterp: { FigureTwoGradInterpPattern(state, CurPatrnID, ZoneNum); } break; - case DataRoomAirModel::UserDefinedPatternType::NonDimenHeight: { + case UserDefinedPatternType::NonDimenHeight: { FigureHeightPattern(state, CurPatrnID, ZoneNum); } break; - case DataRoomAirModel::UserDefinedPatternType::SurfMapTemp: + case UserDefinedPatternType::SurfMapTemp: FigureSurfMapPattern(state, CurPatrnID, ZoneNum); break; default: { @@ -427,14 +424,14 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c // determine gradient depending on mode switch (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.InterpolationMode) { - case DataRoomAirModel::UserDefinedPatternMode::OutdoorDryBulb: { + case UserDefinedPatternMode::OutdoorDryBulb: { Grad = OutdoorDryBulbGrad(state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp, state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale, state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient, state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale, state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient); } break; - case DataRoomAirModel::UserDefinedPatternMode::ZoneAirTemp: { + case UserDefinedPatternMode::ZoneAirTemp: { if (Tmean >= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale) { Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient; @@ -457,7 +454,7 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c } } } break; - case DataRoomAirModel::UserDefinedPatternMode::DeltaOutdoorZone: { + case UserDefinedPatternMode::DeltaOutdoorZone: { DeltaT = state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp - Tmean; if (DeltaT >= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale) { Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient; @@ -481,7 +478,7 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c } } } break; - case DataRoomAirModel::UserDefinedPatternMode::SensibleCooling: { + case UserDefinedPatternMode::SensibleCooling: { CoolLoad = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadCoolRate; if (CoolLoad >= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundHeatRateScale) { Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient; @@ -504,7 +501,7 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c } } } break; - case DataRoomAirModel::UserDefinedPatternMode::SensibleHeating: { + case UserDefinedPatternMode::SensibleHeating: { HeatLoad = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadHeatRate; if (HeatLoad >= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundHeatRateScale) { Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient; @@ -958,4 +955,4 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // //***************************************************************************************** -} // namespace EnergyPlus::RoomAirModelUserTempPattern +} // namespace EnergyPlus::RoomAir diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.hh b/src/EnergyPlus/RoomAirModelUserTempPattern.hh index f880ecfbc53..de17d3a779f 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.hh +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.hh @@ -57,7 +57,7 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace RoomAirModelUserTempPattern { +namespace RoomAir { // Data // MODULE PARAMETER DEFINITIONS: @@ -114,7 +114,7 @@ namespace RoomAirModelUserTempPattern { //***************************************************************************************** -} // namespace RoomAirModelUserTempPattern +} // namespace RoomAir struct RoomAirModelUserTempPatternData : BaseGlobalStruct { diff --git a/src/EnergyPlus/SQLiteProcedures.cc b/src/EnergyPlus/SQLiteProcedures.cc index 1403260ecbb..f46cf5d6279 100644 --- a/src/EnergyPlus/SQLiteProcedures.cc +++ b/src/EnergyPlus/SQLiteProcedures.cc @@ -2239,7 +2239,7 @@ void SQLite::addVentilationData(int const number, DataHeatBalance::VentilationDa { ventilations.push_back(std::make_unique(m_errorStream, m_db, number, ventilationData)); } -void SQLite::addRoomAirModelData(int const number, DataRoomAirModel::AirModelData const &roomAirModelData) +void SQLite::addRoomAirModelData(int const number, RoomAir::AirModelData const &roomAirModelData) { roomAirModels.push_back(std::make_unique(m_errorStream, m_db, number, roomAirModelData)); } diff --git a/src/EnergyPlus/SQLiteProcedures.hh b/src/EnergyPlus/SQLiteProcedures.hh index 7d0b5304351..54736a9a94c 100644 --- a/src/EnergyPlus/SQLiteProcedures.hh +++ b/src/EnergyPlus/SQLiteProcedures.hh @@ -132,7 +132,7 @@ public: void addNominalBaseboardData(int const number, DataHeatBalance::BBHeatData const &nominalBaseboardData); void addInfiltrationData(int const number, DataHeatBalance::InfiltrationData const &infiltrationData); void addVentilationData(int const number, DataHeatBalance::VentilationData const &ventilationData); - void addRoomAirModelData(int const number, DataRoomAirModel::AirModelData const &roomAirModelData); + void addRoomAirModelData(int const number, RoomAir::AirModelData const &roomAirModelData); // Open the DB and prepare for writing data // Create all of the tables on construction @@ -970,7 +970,7 @@ private: RoomAirModel(std::shared_ptr const &errorStream, std::shared_ptr const &db, int const roomAirModelNumber, - DataRoomAirModel::AirModelData const &roomAirModelData) + RoomAir::AirModelData const &roomAirModelData) : SQLiteData(errorStream, db), number(roomAirModelNumber), airModelName(roomAirModelData.Name), airModel(roomAirModelData.AirModel), tempCoupleScheme(roomAirModelData.TempCoupleScheme), simAirModel(roomAirModelData.SimAirModel) @@ -982,8 +982,8 @@ private: private: int const number; std::string const &airModelName; - DataRoomAirModel::RoomAirModel const &airModel; - DataRoomAirModel::CouplingScheme const &tempCoupleScheme; + RoomAir::RoomAirModel const &airModel; + RoomAir::CouplingScheme const &tempCoupleScheme; bool const &simAirModel; }; diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index c71e222eb32..c0299e0aa42 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -543,10 +543,9 @@ namespace ThermalComfort { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 // UCSD-CV } else if (state.dataRoomAirMod->IsZoneCV(state.dataThermalComforts->ZoneNum)) { - if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == DataRoomAirModel::Comfort::Jet) { + if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->ZTJET(state.dataThermalComforts->ZoneNum); - } else if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == - DataRoomAirModel::Comfort::Recirculation) { + } else if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->ZTJET(state.dataThermalComforts->ZoneNum); } } @@ -619,10 +618,9 @@ namespace ThermalComfort { } if (state.dataRoomAirMod->anyNonMixingRoomAirModel && state.dataRoomAirMod->IsZoneCV(state.dataThermalComforts->ZoneNum)) { - if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == DataRoomAirModel::Comfort::Jet) { + if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { state.dataThermalComforts->AirVel = state.dataRoomAirMod->Ujet(state.dataThermalComforts->ZoneNum); - } else if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == - DataRoomAirModel::Comfort::Recirculation) { + } else if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { state.dataThermalComforts->AirVel = state.dataRoomAirMod->Urec(state.dataThermalComforts->ZoneNum); } else { state.dataThermalComforts->AirVel = 0.2; @@ -2539,7 +2537,7 @@ namespace ThermalComfort { testCooling = (state.dataHeatBalFanSys->TempControlType(iZone) != DataHVACGlobals::ThermostatType::SingleHeating); if (testHeating && (SensibleLoadPredictedNoAdj > 0)) { // heating - if (state.dataRoomAirMod->AirModel(iZone).AirModel != DataRoomAirModel::RoomAirModel::Mixing) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAir::RoomAirModel::Mixing) { deltaT = state.dataHeatBalFanSys->TempTstatAir(iZone) - state.dataHeatBalFanSys->ZoneThermostatSetPointLo(iZone); } else { if (state.dataZoneTempPredictorCorrector->NumOnOffCtrZone > 0) { @@ -2565,7 +2563,7 @@ namespace ThermalComfort { } } } else if (testCooling && (SensibleLoadPredictedNoAdj < 0)) { // cooling - if (state.dataRoomAirMod->AirModel(iZone).AirModel != DataRoomAirModel::RoomAirModel::Mixing) { + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAir::RoomAirModel::Mixing) { deltaT = state.dataHeatBalFanSys->TempTstatAir(iZone) - state.dataHeatBalFanSys->ZoneThermostatSetPointHi(iZone); } else { if (state.dataZoneTempPredictorCorrector->NumOnOffCtrZone > 0) { diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 7426c0f65a3..0ec74f66e7d 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -75,7 +75,9 @@ #include #include -namespace EnergyPlus::UFADManager { +namespace EnergyPlus { + +namespace RoomAir { // Module containing the routines dealing with the UnderFloor Air // Distribution zone model @@ -83,8 +85,6 @@ namespace EnergyPlus::UFADManager { // MODULE INFORMATION: // AUTHOR Fred Buhl // DATE WRITTEN August 2005 -// MODIFIED na -// RE-ENGINEERED na // PURPOSE OF THIS MODULE: // Encapsulate the routines that do the simulation of the UCSD UFAD non-uniform @@ -106,12 +106,11 @@ using namespace DataEnvironment; using namespace DataHeatBalance; using namespace DataHeatBalSurface; using namespace DataSurfaces; -using namespace DataRoomAirModel; using Convect::CalcDetailedHcInForDVModel; void ManageUCSDUFModels(EnergyPlusData &state, int const ZoneNum, // index number for the specified zone - DataRoomAirModel::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ) { @@ -135,7 +134,6 @@ void ManageUCSDUFModels(EnergyPlusData &state, using namespace DataHeatBalance; using namespace DataHeatBalSurface; using namespace DataSurfaces; - using namespace DataRoomAirModel; using Convect::CalcDetailedHcInForDVModel; // input was obtained in RoomAirManager, GetUFADIntZoneData @@ -143,11 +141,11 @@ void ManageUCSDUFModels(EnergyPlusData &state, InitUCSDUF(state, ZoneNum, ZoneModelType); // initialize some module variables switch (ZoneModelType) { - case DataRoomAirModel::RoomAirModel::UCSDUFI: { // UCSD UFAD interior zone model + case RoomAirModel::UCSDUFI: { // UCSD UFAD interior zone model // simulate room airflow using the UCSDUFI model CalcUCSDUI(state, ZoneNum); } break; - case DataRoomAirModel::RoomAirModel::UCSDUFE: { // UCSD UFAD interior zone model + case RoomAirModel::UCSDUFE: { // UCSD UFAD interior zone model // simulate room airflow using the UCSDUFI model CalcUCSDUE(state, ZoneNum); } break; @@ -158,7 +156,7 @@ void ManageUCSDUFModels(EnergyPlusData &state, void InitUCSDUF(EnergyPlusData &state, int const ZoneNum, - DataRoomAirModel::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ) { @@ -209,7 +207,7 @@ void InitUCSDUF(EnergyPlusData &state, } } } - if (ZoneModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (ZoneModelType == RoomAirModel::UCSDUFE) { UINum = state.dataRoomAirMod->ZoneUFPtr(ZoneNum); if (state.dataRoomAirMod->ZoneUCSDUE(UINum).NumExtWin > 1.0) { if (NumShadesDown / state.dataRoomAirMod->ZoneUCSDUE(UINum).NumExtWin >= 0.5) { @@ -225,7 +223,7 @@ void InitUCSDUF(EnergyPlusData &state, void SizeUCSDUF(EnergyPlusData &state, int const ZoneNum, - DataRoomAirModel::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ) { @@ -252,7 +250,7 @@ void SizeUCSDUF(EnergyPlusData &state, Real64 ZoneHWEqConv(0.0); // zone hot water equip design convective gain [W] Real64 ZoneSteamEqConv(0.0); // zone steam equip design convective gain [W] - if (ZoneModelType == DataRoomAirModel::RoomAirModel::UCSDUFI) { + if (ZoneModelType == RoomAirModel::UCSDUFI) { UINum = state.dataRoomAirMod->ZoneUFPtr(ZoneNum); NumberOfOccupants = 0.0; for (int Ctd = 1; Ctd <= state.dataHeatBal->TotPeople; ++Ctd) { @@ -442,7 +440,7 @@ void SizeUCSDUF(EnergyPlusData &state, } } - if (ZoneModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (ZoneModelType == RoomAirModel::UCSDUFE) { UINum = state.dataRoomAirMod->ZoneUFPtr(ZoneNum); // calculate total window width in zone for (int Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); @@ -2035,4 +2033,5 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th } } -} // namespace EnergyPlus::UFADManager +} // namespace RoomAir +} // namespace EnergyPlus diff --git a/src/EnergyPlus/UFADManager.hh b/src/EnergyPlus/UFADManager.hh index 707f05d1122..131f999a07e 100644 --- a/src/EnergyPlus/UFADManager.hh +++ b/src/EnergyPlus/UFADManager.hh @@ -57,21 +57,21 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace UFADManager { +namespace RoomAir { void ManageUCSDUFModels(EnergyPlusData &state, int const ZoneNum, // index number for the specified zone - DataRoomAirModel::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ); void InitUCSDUF(EnergyPlusData &state, int const ZoneNum, - DataRoomAirModel::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ); void SizeUCSDUF(EnergyPlusData &state, int const ZoneNum, - DataRoomAirModel::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ); void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight); @@ -80,7 +80,7 @@ namespace UFADManager { void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone -} // namespace UFADManager +} // namespace RoomAir struct UFADManagerData : BaseGlobalStruct { diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index a6aa6195e0d..c4472b39583 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -3586,12 +3586,12 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( this->TempDepZnLd = (11.0 / 6.0) * this->AirPowerCap + this->TempDepCoef; this->TempIndZnLd = this->TempHistoryTerm + this->TempIndCoef; if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { // RoomAirflowNetworkModel - make dynamic term independent of TimeStepSys auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); if (thisRoomAirflowNetworkZoneInfo.IsUsed) { int RoomAirNode = thisRoomAirflowNetworkZoneInfo.ControlAirNodeID; - RoomAirModelAirflowNetwork::LoadPredictionRoomAirModelAirflowNetwork(state, zoneNum, RoomAirNode); + RoomAir::LoadPredictionRoomAirModelAirflowNetwork(state, zoneNum, RoomAirNode); this->TempDepCoef = thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumHA + thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumLinkMCp; this->TempIndCoef = thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumIntSensibleGain + @@ -3618,7 +3618,7 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { this->ZoneT1 = this->ZoneTM2; this->ZoneW1 = this->ZoneWM2; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempTM2; @@ -3628,7 +3628,7 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( } else { this->ZoneT1 = this->ZoneTMX; this->ZoneW1 = this->ZoneWMX; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempTMX; @@ -3640,7 +3640,7 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( } else { this->ZoneT1 = this->ZT; this->ZoneW1 = this->ZoneAirHumRat; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTemp; @@ -4119,7 +4119,7 @@ void ZoneSpaceHeatBalanceData::calcPredictedHumidityRatio(EnergyPlusData &state, } C = RhoAir * volume * thisZone.ZoneVolCapMultpMoist / TimeStepSysSec; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { auto &roomAFNInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); int RoomAirNode = roomAFNInfo.ControlAirNodeID; H2OHtOfVap = Psychrometrics::PsyHgAirFnWTdb(roomAFNInfo.Node(RoomAirNode).HumRat, roomAFNInfo.Node(RoomAirNode).AirTemp); @@ -4292,7 +4292,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - RoomAirModelManager::ManageAirModel(state, zoneNum); + RoomAir::ManageAirModel(state, zoneNum); } // Calculate the various heat balance sums @@ -4356,7 +4356,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; } else { auto &thisAirModel = state.dataRoomAirMod->AirModel(zoneNum); - if ((thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::Mixing) || (!thisAirModel.SimAirModel)) { + if ((thisAirModel.AirModel == RoomAir::RoomAirModel::Mixing) || (!thisAirModel.SimAirModel)) { // Fully mixed thisSystemNode.Temp = this->ZT; // SpaceHB TODO: What to do here if this is for space @@ -4382,8 +4382,8 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // Negligible flow, assume mixed - reasonable lagged starting value for first step time with significant flow state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; } - } else if (thisAirModel.SimAirModel && ((thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UserDefined) || - (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::Mundt))) { + } else if (thisAirModel.SimAirModel && ((thisAirModel.AirModel == RoomAir::RoomAirModel::UserDefined) || + (thisAirModel.AirModel == RoomAir::RoomAirModel::Mundt))) { if (this->SumSysMCp > DataHVACGlobals::SmallMassFlow) { Real64 TempSupplyAir = this->SumSysMCpT / this->SumSysMCp; // Non-negligible flow, calculate supply air temperature if (std::abs(TempSupplyAir - this->ZT) > state.dataHeatBal->TempConvergTol) { @@ -4399,7 +4399,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // Negligible flow, assume mixed - reasonable lagged starting value for first step time with significant flow state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; } - } else if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + } else if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { // Zone node used in the RoomAirflowNetwork model this->ZT = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) @@ -4462,7 +4462,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { this->ZT = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) .AirTemp; @@ -4601,9 +4601,9 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || - thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || - thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDDV || + thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDUFI || + thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDUFE) { state.dataRoomAirMod->XM4TFloor(zoneNum) = state.dataRoomAirMod->XM3TFloor(zoneNum); state.dataRoomAirMod->XM3TFloor(zoneNum) = state.dataRoomAirMod->XM2TFloor(zoneNum); state.dataRoomAirMod->XM2TFloor(zoneNum) = state.dataRoomAirMod->XMATFloor(zoneNum); @@ -4624,7 +4624,7 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in } // for RoomAirflowNetwork model - if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempX4 = roomAirflowNetworkZoneInfo.AirTempX3; @@ -4647,9 +4647,9 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in this->ZoneWMX = this->ZoneAirHumRatAvg; // using average for whole zone time step. // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || - thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || - thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDDV || + thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDUFI || + thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDUFE) { state.dataRoomAirMod->ZoneM2Floor(zoneNum) = state.dataRoomAirMod->ZoneMXFloor(zoneNum); state.dataRoomAirMod->ZoneMXFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); // using average for whole zone time step. state.dataRoomAirMod->ZoneM2OC(zoneNum) = state.dataRoomAirMod->ZoneMXOC(zoneNum); @@ -4658,7 +4658,7 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in state.dataRoomAirMod->ZoneMXMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); // using average for whole zone time step. } - if (thisAirModel.AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempTM2 = roomAirflowNetworkZoneInfo.AirTempTMX; @@ -4720,7 +4720,7 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->DSXM2TMX(zoneNum) = state.dataRoomAirMod->DSXMATMX(zoneNum); state.dataRoomAirMod->DSXMATMX(zoneNum) = state.dataRoomAirMod->MATMX(zoneNum); } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempDSX4 = roomAirflowNetworkZoneInfo.AirTempDSX3; @@ -4744,9 +4744,9 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDDV || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDUFI || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDUFE) { state.dataRoomAirMod->ZoneM2Floor(zoneNum) = state.dataRoomAirMod->ZoneMXFloor(zoneNum); state.dataRoomAirMod->ZoneMXFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); // using average for whole zone time step. state.dataRoomAirMod->ZoneM2OC(zoneNum) = state.dataRoomAirMod->ZoneMXOC(zoneNum); @@ -4754,7 +4754,7 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->ZoneM2MX(zoneNum) = state.dataRoomAirMod->ZoneMXMX(zoneNum); state.dataRoomAirMod->ZoneMXMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); // using average for whole zone time step. } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempTM2 = roomAirflowNetworkZoneInfo.AirTempTMX; @@ -4798,9 +4798,9 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDDV || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDUFI || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDUFE) { state.dataRoomAirMod->XMATFloor(zoneNum) = state.dataRoomAirMod->XM2TFloor(zoneNum); state.dataRoomAirMod->XM2TFloor(zoneNum) = state.dataRoomAirMod->XM3TFloor(zoneNum); @@ -4815,7 +4815,7 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->XM3TMX(zoneNum) = state.dataRoomAirMod->XM4TMX(zoneNum); } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); roomAirflowNetworkZoneInfo.AirTempX1 = roomAirflowNetworkZoneInfo.AirTempX2; @@ -4955,7 +4955,7 @@ void ZoneSpaceHeatBalanceData::correctHumRat(EnergyPlusData &state, int const zo if (this->ZoneAirHumRatTemp > WZSat) this->ZoneAirHumRatTemp = WZSat; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { this->ZoneAirHumRatTemp = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) .HumRat; @@ -7163,7 +7163,7 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, state.dataRoomAirMod->DSXM3TMX(zoneNum), state.dataRoomAirMod->DSXM4TMX(zoneNum)); } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == DataRoomAirModel::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { auto &ThisRAFNNode(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode)); DownInterpolate4HistoryValues(PriorTimeStep, diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index a12070f3d23..171dfdc71eb 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -1192,7 +1192,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state->dataSurface->surfIntConv(SurfNum).model = Convect::HcInt::SetByZone; state->dataSurface->surfIntConv(SurfNum).userModelNum = 0; - state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = DataRoomAirModel::RoomAirModel::UCSDDV; + state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::UCSDDV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; HcIn(1) = 0.0; @@ -1204,7 +1204,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state->dataSurface->surfIntConv(SurfNum).model = Convect::HcInt::SetByZone; state->dataSurface->surfIntConv(SurfNum).userModelNum = 0; - state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = DataRoomAirModel::RoomAirModel::UCSDCV; + state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::UCSDCV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; HcIn(1) = 0.0; diff --git a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc index 2e208652db7..6756c1978dd 100644 --- a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc @@ -67,8 +67,7 @@ #include using namespace EnergyPlus; -using namespace CrossVentMgr; -using namespace DataRoomAirModel; +using namespace RoomAir; TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) { diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index 536509c335c..4e5626fb605 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -64,8 +64,7 @@ using namespace EnergyPlus; using namespace EnergyPlus::DataSurfaces; using namespace EnergyPlus::DataHeatBalance; -using namespace EnergyPlus::DisplacementVentMgr; -using namespace EnergyPlus::DataRoomAirModel; +using namespace EnergyPlus::RoomAir; TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) { @@ -165,7 +164,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataSurface->SurfTAirRefRpt.dimension(TotSurfaces, 0); state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModel = DataRoomAirModel::RoomAirModel::UCSDDV; + state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::UCSDDV; state->dataUCSDShared->APos_Wall.allocate(TotSurfaces); state->dataUCSDShared->APos_Floor.allocate(TotSurfaces); diff --git a/tst/EnergyPlus/unit/HybridModel.unit.cc b/tst/EnergyPlus/unit/HybridModel.unit.cc index f104ca71845..93a711a7e0d 100644 --- a/tst/EnergyPlus/unit/HybridModel.unit.cc +++ b/tst/EnergyPlus/unit/HybridModel.unit.cc @@ -93,7 +93,7 @@ using namespace EnergyPlus::DataSurfaces; using namespace EnergyPlus::DataEnvironment; using namespace EnergyPlus::Psychrometrics; using namespace EnergyPlus::ScheduleManager; -using namespace EnergyPlus::DataRoomAirModel; +using namespace EnergyPlus::RoomAir; using namespace EnergyPlus::HybridModel; using namespace EnergyPlus::DataPrecisionGlobals; diff --git a/tst/EnergyPlus/unit/RoomAirModelUserTempPattern.unit.cc b/tst/EnergyPlus/unit/RoomAirModelUserTempPattern.unit.cc index e88dc5dff7a..6e103cce479 100644 --- a/tst/EnergyPlus/unit/RoomAirModelUserTempPattern.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirModelUserTempPattern.unit.cc @@ -56,7 +56,7 @@ #include using namespace EnergyPlus; -using namespace EnergyPlus::RoomAirModelUserTempPattern; +using namespace EnergyPlus::RoomAir; TEST_F(EnergyPlusFixture, RoomAirModelUserTempPattern_OutdoorDryBulbGradTest) { diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 7791b70334a..6b948c51b27 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -83,11 +83,10 @@ using namespace DataEnvironment; using namespace EnergyPlus::DataSizing; using namespace EnergyPlus::DataHeatBalance; using namespace EnergyPlus::DataHVACGlobals; -using namespace DataRoomAirModel; +using namespace RoomAir; using namespace DataMoistureBalanceEMPD; using namespace DataSurfaces; using namespace DataHeatBalSurface; -using namespace EnergyPlus::RoomAirModelAirflowNetwork; using namespace EnergyPlus::DataLoopNode; using namespace EnergyPlus::DataHeatBalFanSys; using namespace EnergyPlus::Psychrometrics; @@ -567,8 +566,8 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) ErrorsFound = false; state->dataRoomAirMod->AirModel.allocate(1); - state->dataRoomAirMod->AirModel(1).AirModel = DataRoomAirModel::RoomAirModel::AirflowNetwork; - RoomAirModelManager::GetRoomAirflowNetworkData(*state, ErrorsFound); + state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::AirflowNetwork; + RoomAir::GetRoomAirflowNetworkData(*state, ErrorsFound); EXPECT_TRUE(ErrorsFound); std::string const error_string = diff --git a/tst/EnergyPlus/unit/SQLite.unit.cc b/tst/EnergyPlus/unit/SQLite.unit.cc index ebb94a5529a..600dcc3a315 100644 --- a/tst/EnergyPlus/unit/SQLite.unit.cc +++ b/tst/EnergyPlus/unit/SQLite.unit.cc @@ -806,12 +806,12 @@ TEST_F(SQLiteFixture, SQLiteProcedures_createZoneExtendedOutput) ventilationData1->SchedPtr = 1; ventilationData1->DesignLevel = 2; - auto const roomAirModelData0 = std::make_unique(); + auto const roomAirModelData0 = std::make_unique(); roomAirModelData0->Name = "test roomAirModel 1"; - auto const roomAirModelData1 = std::make_unique(); + auto const roomAirModelData1 = std::make_unique(); roomAirModelData1->Name = "test roomAirModel 2"; - roomAirModelData1->AirModel = DataRoomAirModel::RoomAirModel::Mundt; - roomAirModelData1->TempCoupleScheme = DataRoomAirModel::CouplingScheme::Direct; // hmm this was set to 3 which wasn't a valid option + roomAirModelData1->AirModel = RoomAir::RoomAirModel::Mundt; + roomAirModelData1->TempCoupleScheme = RoomAir::CouplingScheme::Direct; // hmm this was set to 3 which wasn't a valid option roomAirModelData1->SimAirModel = true; std::string const alwaysOn("always on"); diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index 3f547c0cbd8..bfd6ce06417 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -77,7 +77,7 @@ using namespace EnergyPlus::ThermalComfort; using namespace EnergyPlus::DataEnvironment; using namespace EnergyPlus::DataHeatBalance; using namespace EnergyPlus::DataHVACGlobals; -using namespace EnergyPlus::DataRoomAirModel; +using namespace EnergyPlus::RoomAir; using namespace EnergyPlus::DataHeatBalFanSys; using namespace EnergyPlus::DataSurfaces; using namespace EnergyPlus::DataHeatBalSurface; @@ -91,7 +91,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcIfSetPointMetTest1) state->dataThermalComforts->ThermalComfortSetPoint.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->TempControlType.allocate(1); state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModel = DataRoomAirModel::RoomAirModel::Mixing; + state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::Mixing; state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointLo.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointHi.allocate(state->dataGlobal->NumOfZones); @@ -926,7 +926,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcIfSetPointMetWithCutoutTest) state->dataThermalComforts->ThermalComfortSetPoint.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->TempControlType.allocate(1); state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModel = DataRoomAirModel::RoomAirModel::Mixing; + state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::Mixing; state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointLo.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointHi.allocate(state->dataGlobal->NumOfZones); diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index 3a5d786ec40..c99cdb59039 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -94,7 +94,7 @@ using namespace EnergyPlus::DataSurfaces; using namespace EnergyPlus::DataEnvironment; using namespace EnergyPlus::Psychrometrics; using namespace EnergyPlus::ScheduleManager; -using namespace EnergyPlus::DataRoomAirModel; +using namespace EnergyPlus::RoomAir; using namespace EnergyPlus::HybridModel; using namespace SimulationManager; From f3aed9b87ac7ea68971048b1c166487a3926981e Mon Sep 17 00:00:00 2001 From: amirroth Date: Thu, 22 Jun 2023 15:37:23 -0400 Subject: [PATCH 05/17] Some renaming and shortcuts --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 36 +- src/EnergyPlus/ConvectionCoefficients.cc | 8 +- src/EnergyPlus/CrossVentMgr.cc | 241 +++--- src/EnergyPlus/DataRoomAirModel.hh | 167 ++-- src/EnergyPlus/DisplacementVentMgr.cc | 215 ++--- src/EnergyPlus/HeatBalanceAirManager.cc | 16 +- src/EnergyPlus/InternalHeatGains.cc | 2 +- src/EnergyPlus/MundtSimMgr.cc | 2 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 284 +++---- src/EnergyPlus/RoomAirModelManager.cc | 389 +++++---- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 252 +++--- src/EnergyPlus/ThermalComfort.cc | 24 +- src/EnergyPlus/UFADManager.cc | 775 +++++++++--------- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 186 ++--- .../unit/ConvectionCoefficients.unit.cc | 4 +- tst/EnergyPlus/unit/CrossVentMgr.unit.cc | 42 +- .../unit/DisplacementVentMgr.unit.cc | 24 +- tst/EnergyPlus/unit/HybridModel.unit.cc | 13 +- .../unit/RoomAirflowNetwork.unit.cc | 218 ++--- tst/EnergyPlus/unit/SQLite.unit.cc | 2 +- tst/EnergyPlus/unit/ThermalComfort.unit.cc | 4 +- 21 files changed, 1391 insertions(+), 1513 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 4c09e8aa03d..5201bb94b7f 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -4802,7 +4802,7 @@ namespace AirflowNetwork { n = AirflowNetworkNodeData(i).EPlusZoneNum; AirflowNetworkNodeData(i).NumOfLinks = 0; if (n > 0 && AirflowNetworkNodeData(i).RAFNNodeNum > 0) { - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID = i; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID = i; for (j = 1; j <= AirflowNetworkNumOfSurfaces; ++j) { if (AirflowNetworkLinkageData(j).NodeNums[0] == i) { AirflowNetworkNodeData(i).NumOfLinks = AirflowNetworkNodeData(i).NumOfLinks + 1; @@ -4813,21 +4813,21 @@ namespace AirflowNetwork { } } if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) { - for (j = 1; j <= m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).NumOfAirNodes; ++j) { - if (m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).AirflowNetworkNodeID == i) { - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).NumOfAirflowLinks = AirflowNetworkNodeData(i).NumOfLinks; - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link.allocate(AirflowNetworkNodeData(i).NumOfLinks); + for (j = 1; j <= m_state.dataRoomAirMod->AFNZoneInfo(n).NumOfAirNodes; ++j) { + if (m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).AirflowNetworkNodeID == i) { + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).NumOfAirflowLinks = AirflowNetworkNodeData(i).NumOfLinks; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link.allocate(AirflowNetworkNodeData(i).NumOfLinks); k = 1; for (int m = 1; m <= AirflowNetworkNumOfSurfaces; ++m) { if (AirflowNetworkLinkageData(m).NodeNums[0] == i) { - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkSimuID = m; - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkageDataID = m; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkSimuID = m; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkageDataID = m; k = k + 1; if (k > AirflowNetworkNodeData(i).NumOfLinks) break; } if (AirflowNetworkLinkageData(m).NodeNums[1] == i) { - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkSimuID = m; - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkageDataID = m; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkSimuID = m; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkageDataID = m; k = k + 1; if (k > AirflowNetworkNodeData(i).NumOfLinks) break; } @@ -5386,8 +5386,8 @@ namespace AirflowNetwork { } if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) { ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp = 23.0; - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat = 0.0; + m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp = 23.0; + m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat = 0.0; } } @@ -5469,13 +5469,13 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) { ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum) + if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum) .Node(AirflowNetworkNodeData(i).RAFNNodeNum) .AirflowNetworkNodeID == i) { AirflowNetworkNodeSimu(i).TZ = - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp; + m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp; AirflowNetworkNodeSimu(i).WZ = - m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat; + m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat; } } } @@ -7736,9 +7736,9 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) { MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10; ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID == + if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID == i) { - MV(i) = m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp * 1.0e10; + MV(i) = m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp * 1.0e10; } } } @@ -8030,9 +8030,9 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) { MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10; ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID == + if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID == i) { - MV(i) = m_state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat * 1.0e10; + MV(i) = m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat * 1.0e10; } } } diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 9f6444a11ee..8bc1af11509 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -1981,9 +1981,9 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, } assert(state.dataRoomAirMod->AirModel.allocated()); - if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::DispVent3Node || + state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UFADInt || + state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UFADExt) { // Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf if (state.dataSurface->surfIntConv(SurfNum).userModelNum != 0) { @@ -1996,7 +1996,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, -surface.CosTilt); // negative CosTilt because CosTilt is relative to exterior } - } else if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UCSDCV) { + } else if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent) { Hf = 4.3 * Vhc()(surface.Zone); diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 2b374d9c820..d038af3255e 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -165,7 +165,7 @@ namespace RoomAir { state.dataCrossVentMgr->HA_R = 0.0; // Is the air flow model for this zone set to UCSDCV Cross Ventilation? - if (state.dataRoomAirMod->IsZoneCV(ZoneNum)) { + if (state.dataRoomAirMod->IsZoneCrossVent(ZoneNum)) { // WALL Hc, HA and HAT calculation for (int Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2); ++Ctd) { @@ -175,8 +175,8 @@ namespace RoomAir { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); - state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); + state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); @@ -191,8 +191,8 @@ namespace RoomAir { if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Window Wall state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); @@ -200,12 +200,12 @@ namespace RoomAir { if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); - Real64 Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Ujet); + Real64 Hjet = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); - Real64 Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); + Real64 Hrec = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * @@ -223,12 +223,12 @@ namespace RoomAir { if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); - Real64 Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Ujet); + Real64 Hjet = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); - Real64 Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); + Real64 Hrec = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * @@ -243,7 +243,7 @@ namespace RoomAir { state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum); } - state.dataRoomAirMod->CVHcIn(SurfNum) = state.dataUCSDShared->HWindow(Ctd); + state.dataRoomAirMod->CrossVentHcIn(SurfNum) = state.dataUCSDShared->HWindow(Ctd); } // END WINDOW // DOOR Hc, HA and HAT CALCULATION for (int Ctd = state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 2); @@ -254,8 +254,8 @@ namespace RoomAir { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); - state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); + state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); @@ -270,8 +270,8 @@ namespace RoomAir { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); - state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); + state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HInternal(Ctd); @@ -287,12 +287,12 @@ namespace RoomAir { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); - Real64 Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Ujet); + Real64 Hjet = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); - Real64 Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); + Real64 Hrec = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * @@ -305,7 +305,7 @@ namespace RoomAir { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum); - state.dataRoomAirMod->CVHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); + state.dataRoomAirMod->CrossVentHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); } // END CEILING // FLOOR Hc, HA and HAT CALCULATION for (int Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2); @@ -316,12 +316,12 @@ namespace RoomAir { if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); - Real64 Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Ujet); + Real64 Hjet = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); - Real64 Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); + Real64 Hrec = state.dataRoomAirMod->CrossVentHcIn(SurfNum); state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * Hrec; state.dataCrossVentMgr->HAT_R += state.dataSurface->Surface(SurfNum).Area * (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * @@ -334,7 +334,7 @@ namespace RoomAir { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum); - state.dataRoomAirMod->CVHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); + state.dataRoomAirMod->CrossVentHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); } // END FLOOR } } @@ -376,33 +376,36 @@ namespace RoomAir { auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); // Identify the dominant aperture: - MaxSurf = state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum); + MaxSurf = state.dataRoomAirMod->AFNSurfaceCrossVent(1, ZoneNum); int const surfNum = state.afn->MultizoneSurfaceData(MaxSurf).SurfNum; auto const &thisSurface = state.dataSurface->Surface(surfNum); + + int afnSurfNum1 = state.dataRoomAirMod->AFNSurfaceCrossVent(1, ZoneNum); + if (thisSurface.Zone == ZoneNum) { // this is a direct airflow network aperture - SumToZone = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum)).VolFLOW2; - MaxFlux = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum)).VolFLOW2; + SumToZone = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW2; + MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW2; } else { // this is an indirect airflow network aperture - SumToZone = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum)).VolFLOW; - MaxFlux = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, ZoneNum)).VolFLOW; + SumToZone = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW; + MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW; } - for (int Ctd2 = 2; Ctd2 <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd2) { - if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).SurfNum) - .Zone == ZoneNum) { - if (state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW2 > MaxFlux) { - MaxFlux = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW2; - MaxSurf = state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum); + for (int Ctd2 = 2; Ctd2 <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd2) { + int afnSurfNum = state.dataRoomAirMod->AFNSurfaceCrossVent(Ctd2, ZoneNum); + if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(afnSurfNum).SurfNum).Zone == ZoneNum) { + if (state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2 > MaxFlux) { + MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2; + MaxSurf = afnSurfNum; } - SumToZone += state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW2; + SumToZone += state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2; } else { - if (state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW > MaxFlux) { - MaxFlux = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW; - MaxSurf = state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum); + if (state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW > MaxFlux) { + MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW; + MaxSurf = afnSurfNum; } - SumToZone += state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd2, ZoneNum)).VolFLOW; + SumToZone += state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW; } } @@ -411,7 +414,7 @@ namespace RoomAir { CosPhi = std::cos((state.dataEnvrn->WindDir - SurfNorm) * Constant::DegToRadians); if (CosPhi <= 0) { state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; - auto flows(state.dataRoomAirMod->CVJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) + auto flows(state.dataRoomAirMod->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) for (int i = 1, u = flows.u(); i <= u; ++i) { auto &e(flows(i)); e.Ujet = e.Urec = 0.0; @@ -440,15 +443,14 @@ namespace RoomAir { } // Calculate the opening area for all apertures - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) { + for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); + auto const &surfParams = state.dataRoomAirMod->SurfParametersCrossDispVent(Ctd); int cCompNum = state.afn->AirflowNetworkLinkageData(Ctd).CompNum; if (state.afn->AirflowNetworkCompData(cCompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) { - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area = state.dataRoomAirMod->SurfParametersCVDV(Ctd).Width * - state.dataRoomAirMod->SurfParametersCVDV(Ctd).Height * - state.afn->MultizoneSurfaceData(Ctd).OpenFactor; + jetRecFlows.Area = surfParams.Width * surfParams.Height * state.afn->MultizoneSurfaceData(Ctd).OpenFactor; } else if (state.afn->AirflowNetworkCompData(cCompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area = - state.dataRoomAirMod->SurfParametersCVDV(Ctd).Width * state.dataRoomAirMod->SurfParametersCVDV(Ctd).Height; + jetRecFlows.Area = surfParams.Width * surfParams.Height; } else { ShowSevereError( state, "RoomAirModelCrossVent:EvolveParaUCSDCV: Illegal leakage component referenced in the cross ventilation room air model"); @@ -468,7 +470,7 @@ namespace RoomAir { // is a Window or Door it looks for the second base surface). // Dstar is Droom corrected for wind angle Wroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataHeatBal->Zone(ZoneNum).FloorArea; - auto const &baseSurface(state.dataSurface->Surface(thisSurface.BaseSurf)); + auto const &baseSurface = state.dataSurface->Surface(thisSurface.BaseSurf); if ((baseSurface.Sides == 3) || (baseSurface.Sides == 4)) { XX = baseSurface.Centroid.x; YY = baseSurface.Centroid.y; @@ -523,21 +525,19 @@ namespace RoomAir { // Populate an array of inflow volume fluxes (Fin) for all apertures in the zone // Calculate inflow velocity (%Uin) for each aperture in the zone - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) { + for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(Ctd).SurfNum).Zone == ZoneNum) { // this is a direct airflow network aperture - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Fin = - state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd, ZoneNum)).VolFLOW2; + jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW2; } else { // this is an indirect airflow network aperture - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Fin = - state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Ctd, ZoneNum)).VolFLOW; + jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW; } - if (state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area != 0) { - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin = - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Fin / state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area; + if (jetRecFlows.Area != 0) { + jetRecFlows.Uin = jetRecFlows.Fin / jetRecFlows.Area; } else { - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin = 0.0; + jetRecFlows.Uin = 0.0; } } @@ -546,15 +546,12 @@ namespace RoomAir { // Calculate the total area of all active apertures ActiveSurfNum = 0.0; state.dataRoomAirMod->Ain(ZoneNum) = 0.0; - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) { - if (state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin <= MinUin) { - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag = 0; - } else { - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag = 1; - } - ActiveSurfNum += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag; - state.dataRoomAirMod->Ain(ZoneNum) += - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag; + for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); + jetRecFlows.FlowFlag = (int)(jetRecFlows.Uin > MinUin); + + ActiveSurfNum += jetRecFlows.FlowFlag; + state.dataRoomAirMod->Ain(ZoneNum) += jetRecFlows.Area * jetRecFlows.FlowFlag; } // Verify if any of the apertures have minimum flow @@ -580,7 +577,7 @@ namespace RoomAir { state.dataRoomAirMod->Urec(ZoneNum) = 0.0; state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; - auto flows(state.dataRoomAirMod->CVJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) + auto flows(state.dataRoomAirMod->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) for (int i = 1, u = flows.u(); i <= u; ++i) { auto &e(flows(i)); e.Ujet = e.Urec = 0.0; @@ -592,9 +589,9 @@ namespace RoomAir { // Calculate Qtot, the total volumetric flow rate through all active openings in the zone Uin = 0.0; - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) { - Uin += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag / state.dataRoomAirMod->Ain(ZoneNum); + for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto const &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); + Uin += jetRecFlows.Area * jetRecFlows.Uin * jetRecFlows.FlowFlag / state.dataRoomAirMod->Ain(ZoneNum); } // Verify if Uin is higher than minimum: @@ -604,7 +601,7 @@ namespace RoomAir { state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0; - auto flows(state.dataRoomAirMod->CVJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) + auto flows(state.dataRoomAirMod->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) for (int i = 1, u = flows.u(); i <= u; ++i) { auto &e(flows(i)); e.Ujet = e.Urec = 0.0; @@ -631,8 +628,8 @@ namespace RoomAir { } // Evaluate parameter that determines whether recirculations are present - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotUCSDCV; ++Ctd) { - if (ZoneNum == state.dataRoomAirMod->ZoneUCSDCV(Ctd).ZonePtr) { + for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotCrossVent; ++Ctd) { + if (ZoneNum == state.dataRoomAirMod->ZoneCrossVent(Ctd).ZonePtr) { if (state.dataRoomAirMod->Ain(ZoneNum) / Aroom > 1.0 / 2.0) { state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) = 1.0; } else { @@ -647,49 +644,29 @@ namespace RoomAir { state.dataRoomAirMod->Urec(ZoneNum) = 0.0; state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; state.dataRoomAirMod->Qtot(ZoneNum) = 0.0; - auto flows(state.dataRoomAirMod->CVJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) + auto flows(state.dataRoomAirMod->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) for (int i = 1, u = flows.u(); i <= u; ++i) { auto &e(flows(i)); e.Ujet = e.Urec = e.Qrec = 0.0; } - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Ctd) { - if (state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin != 0) { - Real64 dstarexp = - max(state.dataRoomAirMod->Dstar(ZoneNum) / (6.0 * std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area)), 1.0); - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Vjet = state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin * - std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area) * 6.3 * - std::log(dstarexp) / state.dataRoomAirMod->Dstar(ZoneNum); - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Yjet = - Cjet1 * std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area / Aroom) * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Vjet / state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin + - Cjet2; - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Yrec = - Crec1 * std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area / Aroom) * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Vjet / state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin + - Crec2; - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).YQrec = - CrecFlow1 * std::sqrt(state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * Aroom) * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Vjet / state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin + - CrecFlow2; - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Ujet = state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Yjet / - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin; - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Urec = state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Yrec / - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin; - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Qrec = state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).YQrec / - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Uin; - state.dataRoomAirMod->Ujet(ZoneNum) += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Ujet / state.dataRoomAirMod->Ain(ZoneNum); - state.dataRoomAirMod->Urec(ZoneNum) += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Urec / state.dataRoomAirMod->Ain(ZoneNum); - state.dataRoomAirMod->Qrec(ZoneNum) += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Qrec; - state.dataRoomAirMod->Qtot(ZoneNum) += - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Fin * state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).FlowFlag; - state.dataRoomAirMod->Urec(ZoneNum) += state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Area * - state.dataRoomAirMod->CVJetRecFlows(Ctd, ZoneNum).Urec / state.dataRoomAirMod->Ain(ZoneNum); - } + for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); + if (jetRecFlows.Uin == 0) + continue; + + Real64 dstarexp = max(state.dataRoomAirMod->Dstar(ZoneNum) / (6.0 * std::sqrt(jetRecFlows.Area)), 1.0); + jetRecFlows.Vjet = jetRecFlows.Uin * std::sqrt(jetRecFlows.Area) * 6.3 * std::log(dstarexp) / state.dataRoomAirMod->Dstar(ZoneNum); + jetRecFlows.Yjet = Cjet1 * std::sqrt(jetRecFlows.Area / Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + Cjet2; + jetRecFlows.Yrec = Crec1 * std::sqrt(jetRecFlows.Area / Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + Crec2; + jetRecFlows.YQrec = CrecFlow1 * std::sqrt(jetRecFlows.Area * Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + CrecFlow2; + jetRecFlows.Ujet = jetRecFlows.FlowFlag * jetRecFlows.Yjet / jetRecFlows.Uin; + jetRecFlows.Urec = jetRecFlows.FlowFlag * jetRecFlows.Yrec / jetRecFlows.Uin; + jetRecFlows.Qrec = jetRecFlows.FlowFlag * jetRecFlows.YQrec / jetRecFlows.Uin; + state.dataRoomAirMod->Ujet(ZoneNum) += jetRecFlows.Area * jetRecFlows.Ujet / state.dataRoomAirMod->Ain(ZoneNum); + state.dataRoomAirMod->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAirMod->Ain(ZoneNum); + state.dataRoomAirMod->Qrec(ZoneNum) += jetRecFlows.Qrec; + state.dataRoomAirMod->Qtot(ZoneNum) += jetRecFlows.Fin * jetRecFlows.FlowFlag; + state.dataRoomAirMod->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAirMod->Ain(ZoneNum); } // Ratio between recirculation flow rate and total inflow rate @@ -724,7 +701,7 @@ namespace RoomAir { if (state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum <= 0) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModel == - RoomAir::RoomAirModel::UCSDCV) { + RoomAir::RoomAirModel::CrossVent) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum); } else { @@ -737,7 +714,7 @@ namespace RoomAir { if (state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum <= 0) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModel == - RoomAir::RoomAirModel::UCSDCV) { + RoomAir::RoomAirModel::CrossVent) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum); } else { @@ -747,10 +724,10 @@ namespace RoomAir { } } else if ((thisSurface.Zone == ZoneNum) && (state.dataRoomAirMod->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModel == - RoomAir::RoomAirModel::UCSDCV)) { + RoomAir::RoomAirModel::CrossVent)) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone); } else if ((thisSurface.Zone != ZoneNum) && - (state.dataRoomAirMod->AirModel(thisSurface.Zone).AirModel == RoomAir::RoomAirModel::UCSDCV)) { + (state.dataRoomAirMod->AirModel(thisSurface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent)) { state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(surfNum); } else { if (thisSurface.Zone == ZoneNum) { @@ -787,9 +764,9 @@ namespace RoomAir { Real64 ZoneMult = zone.Multiplier * zone.ListMultiplier; // total zone multiplier auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotUCSDCV; ++Ctd) { - if (ZoneNum == state.dataRoomAirMod->ZoneUCSDCV(Ctd).ZonePtr) { - GainsFrac = ScheduleManager::GetCurrentScheduleValue(state, state.dataRoomAirMod->ZoneUCSDCV(Ctd).SchedGainsPtr); + for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotCrossVent; ++Ctd) { + if (ZoneNum == state.dataRoomAirMod->ZoneCrossVent(Ctd).ZonePtr) { + GainsFrac = ScheduleManager::GetCurrentScheduleValue(state, state.dataRoomAirMod->ZoneCrossVent(Ctd).SchedGainsPtr); } } @@ -821,8 +798,8 @@ namespace RoomAir { if (state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel) { //=============================== CROSS VENTILATION Calculation ============================================== - state.dataRoomAirMod->ZoneCVisMixing(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 1.0; + state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 1.0; for (int Ctd = 1; Ctd <= 4; ++Ctd) { HcUCSDCV(state, ZoneNum); if (state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) != 1.0) { @@ -841,21 +818,21 @@ namespace RoomAir { MCp_Total; } if (state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) == 1.0) { - state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 0.0; state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(ZoneNum); state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->ZTJET(ZoneNum); state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->ZTJET(ZoneNum); } // If temperature increase is above 1.5C then go to mixing if (state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) - state.dataRoomAirMod->Tin(ZoneNum) > 1.5) { - state.dataRoomAirMod->ZoneCVisMixing(ZoneNum) = 1.0; - state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 1.0; + state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 0.0; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; state.dataRoomAirMod->Urec(ZoneNum) = 0.0; state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0; - for (auto &e : state.dataRoomAirMod->CVJetRecFlows) { + for (auto &e : state.dataRoomAirMod->CrossVentJetRecFlows) { e.Ujet = 0.0; e.Urec = 0.0; } @@ -881,13 +858,13 @@ namespace RoomAir { } } else { //=============================== M I X E D Calculation ====================================================== - state.dataRoomAirMod->ZoneCVisMixing(ZoneNum) = 1.0; - state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 1.0; + state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 0.0; state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; state.dataRoomAirMod->Urec(ZoneNum) = 0.0; state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0; - for (auto &e : state.dataRoomAirMod->CVJetRecFlows) { + for (auto &e : state.dataRoomAirMod->CrossVentJetRecFlows) { e.Ujet = 0.0; e.Urec = 0.0; } diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index e560f508af3..0896981e8d5 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -75,11 +75,11 @@ namespace RoomAir { Invalid = -1, UserDefined, // user defined patterns Mixing, // mixing air model - Mundt, // Mundt nodal model - UCSDDV, // UCSD Displacement Ventilation model - UCSDCV, // UCSD-CV - UCSDUFI, // UCSD UFAD interior zone model - UCSDUFE, // UCSD UFAD exterior zone model + DispVent1Node, // Mundt nodal model + DispVent3Node, // UCSD Displacement Ventilation model + CrossVent, // UCSD-CV + UFADInt, // UCSD UFAD interior zone model + UFADExt, // UCSD UFAD exterior zone model AirflowNetwork, // RoomAirModel_AirflowNetwork interior zone model Num }; @@ -171,11 +171,8 @@ namespace RoomAir { std::string Name = ""; std::string ZoneName = ""; int ZonePtr = 0; // Pointer to the zone number for this statement - RoomAirModel AirModel = RoomAirModel::Mixing; // 1 = Mixing, 2 = Mundt, 3 = Rees and Haves, - // 4 = UCSDDV, 5 = UCSDCV, -1 = user defined - // 6 = UCSDUFI, 7 = UCSDUFE, 8 = AirflowNetwork - CouplingScheme TempCoupleScheme = CouplingScheme::Direct; // 1 = absolute (direct), - // 2 = relative air model temperature passing scheme (indirect) + RoomAirModel AirModel = RoomAirModel::Mixing; + CouplingScheme TempCoupleScheme = CouplingScheme::Direct; bool SimAirModel = false; // FALSE if Mixing air model is currently used and // TRUE if other air models are currently used }; @@ -193,7 +190,7 @@ namespace RoomAir { bool IsZone = false; // TRUE if this node is zone node }; - struct DVData + struct DispVentData { // Members std::string ZoneName = ""; // Name of zone @@ -206,7 +203,7 @@ namespace RoomAir { Real64 TempTrigger = 0.0; // Minimum temperature difference between TOC TMX for stratification }; - struct CVData + struct CrossVentData { // Members std::string ZoneName = ""; // Name of zone @@ -217,7 +214,7 @@ namespace RoomAir { // for comfort models }; - struct CVFlow + struct CrossVentFlow { // Members int FlowFlag = 0; // Equal to 1 if the opening has inflow, else equal to 0. @@ -234,7 +231,7 @@ namespace RoomAir { Real64 Qrec = 0.0; // Total flow rate for the recirculation regions in the plane of maximum flow [m3/s] }; - struct CVDVParameters + struct CrossDispVentParameters { // Members Real64 Width = 0.0; @@ -244,7 +241,7 @@ namespace RoomAir { Real64 Zmax = 0.0; }; - struct UFIData + struct UFADIntData { // Members std::string ZoneName = ""; // Name of zone @@ -270,7 +267,7 @@ namespace RoomAir { Real64 E_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 }; - struct UFEData + struct UFADExtData { // Members std::string ZoneName = ""; // Name of zone @@ -394,7 +391,7 @@ namespace RoomAir { Real64 Gradient = 0.0; // result for modeled gradient if using two-gradient interpolation }; - struct AFNLinkagesInfoNested // becomes link + struct AFNLinkInfoNested // becomes link { // Members // user variables @@ -406,7 +403,7 @@ namespace RoomAir { Real64 HumRatIn = 0.0; // humidity ratio of air into control volume }; - struct RoomAFNNodeInternalGains // becomes IntGain + struct AFNNodeInternalGains // becomes IntGain { // Members // user variables @@ -416,7 +413,7 @@ namespace RoomAir { bool FractionCheck = false; // TRUE if a fraction of internal gain for each object is checked }; - struct RoomAFNHVAC // becomes HVAC + struct AFNHVAC // becomes HVAC { // Members // user variables @@ -433,7 +430,7 @@ namespace RoomAir { int CompIndex = 0; // Component index }; - struct RoomAFNAirNodeNested // becomes Node + struct AFNAirNodeNested // becomes Node { // Members // user variables @@ -448,14 +445,14 @@ namespace RoomAir { Array1D intGainsDeviceSpaces; // index pointers to space struct Array1D IntGainsDeviceIndices; // index pointers to internal gains struct Array1D IntGainsFractions; // gain fractions to this node - Array1D IntGain; // Internal gain struct + Array1D IntGain; // Internal gain struct std::string NodeHVACListName = ""; // name of node's HVAC list bool HasHVACAssigned = false; // True if HVAC systems are assigned to this node int NumHVACs = 0; // Number of HVAC systems - Array1D HVAC; // HVAC struct + Array1D HVAC; // HVAC struct int AirflowNetworkNodeID = 0; // pointer to AirflowNetworkNodeData structure int NumOfAirflowLinks = 0; // Number of intra zone links - Array1D Link; // Linkage struct + Array1D Link; // Linkage struct Real64 AirVolume = 0.0; // air volume in control volume associated with this node(m3 / s) Real64 RhoAir = 0.0; // current density of air for nodal control volume Real64 CpAir = 0.0; // current heat capacity of air for nodal control volume @@ -513,7 +510,7 @@ namespace RoomAir { Real64 SumLinkMW = 0.0; // sum of mdor*Cp*T for incoming airflows and source humidity ratio for this node derived from the AirflowNetwork model }; - struct RoomAFNInfoByZone // becomes RoomAirflowNetworkZoneInfo + struct AFNInfoByZone // becomes RoomAirflowNetworkZoneInfo { // Members // user variables @@ -526,7 +523,7 @@ namespace RoomAir { int AvailSchedID = 0; // index of availability schedule int ControlAirNodeID = 0; // index of roomair node that is HVAC control sensor location int NumOfAirNodes = 0; // Number of air nodes - Array1D Node; // Node struct + Array1D Node; // Node struct int ZoneNodeID = 0; // index in system Node array for this zone Real64 TairMean = 0.0; // comes from MAT Real64 Tstat = 0.0; // temperature for thermostat @@ -548,9 +545,9 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ConvectiveFloorSplit; Array1D InfiltratFloorSplit; // UCSD - int TotUCSDDV = 0; // Total number of UCSDDV zones - Array1D DVHcIn; - Array1D_bool IsZoneDV; // Is the air model for the zone UCSDDV? + int TotDispVent3Node = 0; // Total number of UCSDDV zones + Array1D DispVent3NodeHcIn; + Array1D_bool IsZoneDispVent3Node; // Is the air model for the zone UCSDDV? Array1D ZTOC; // Temperature of occupied (lower) zone Array1D AvgTempGrad; // vertical Average Temperature Gradient in the room Array1D ZTMX; // Temperature of the mixing(upper) layer @@ -560,8 +557,8 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ZTFloor; Array1D HeightTransition; Array1D FracMinFlow; - Array1D_int ZoneDVMixedFlag; - Array1D ZoneDVMixedFlagRep; + Array1D_int ZoneDispVent3NodeMixedFlag; + Array1D ZoneDispVent3NodeMixedFlagRep; Array1D_bool ZoneAirSystemON; Array1D TCMF; // comfort temperature Array1D ZoneCeilingHeight; @@ -615,11 +612,11 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ZoneMXMX; // [C] difference equation's Mixed air temp at t minus 1 Array1D ZoneM2MX; // [C] difference equation's Mixed air temp at t minus 2 // UCSD-CV - int TotUCSDCV = 0; // Total number of UCSDDV zones - int CVNumAirflowNetworkSurfaces = 0; // total number of AirFlowNetwork surfaces. - Array1D CVHcIn; - Array1D_bool IsZoneCV; // Is the air model for the zone UCSDDV? - Array1D ZoneCVisMixing; // Zone set to CV is actually using a mixing model + int TotCrossVent = 0; // Total number of UCSDDV zones + int CrossVentNumAFNSurfaces = 0; // total number of AirFlowNetwork surfaces. + Array1D CrossVentHcIn; + Array1D_bool IsZoneCrossVent; // Is the air model for the zone UCSDDV? + Array1D ZoneCrossVentIsMixing; // Zone set to CV is actually using a mixing model Array1D ZTJET; // Jet Temperatures Array1D ZTREC; // Recirculation Temperatures Array1D RoomOutflowTemp; // Temperature of air flowing out of the room @@ -635,23 +632,23 @@ struct RoomAirModelData : BaseGlobalStruct Array1D Dstar; // CV Zone average length, wind direction corrected Array1D Tin; // Inflow air temperature Array1D TotArea; // Sum of the areas of all apertures in the zone - Array2D_int AirflowNetworkSurfaceUCSDCV; // table for AirflowNetwork surfaces organization + Array2D_int AFNSurfaceCrossVent; // table for AirflowNetwork surfaces organization // Interzone surfaces counts twice. Array1D Rfr; // Ration between inflow and recirculation air flows - Array1D ZoneCVhasREC; // Airflow pattern is C = 0, CR(1) + Array1D ZoneCrossVentHasREC; // Airflow pattern is C = 0, CR(1) bool UCSDModelUsed = false; - bool MundtModelUsed = false; + bool DispVent1NodeModelUsed = false; // UCSD-UF - int TotUCSDUI = 0; // total number of UCSDUI zones - int TotUCSDUE = 0; // total number of UCSDUE zones + int TotUFADInt = 0; // total number of UCSDUI zones + int TotUFADExt = 0; // total number of UCSDUE zones Array1D_bool IsZoneUI; // controls program flow, for interior or exterior UFAD model - Array1D_int ZoneUFPtr; - Array1D UFHcIn; - Array1D_int ZoneUFMixedFlag; - Array1D ZoneUFMixedFlagRep; - Array1D ZoneUFGamma; - Array1D ZoneUFPowInPlumes; // [W] - Array1D ZoneUFPowInPlumesfromWindows; // [W] + Array1D_int ZoneUFADPtr; + Array1D UFADHcIn; + Array1D_int ZoneUFADMixedFlag; + Array1D ZoneUFADMixedFlagRep; + Array1D ZoneUFADGamma; + Array1D ZoneUFADPowInPlumes; // [W] + Array1D ZoneUFADPowInPlumesfromWindows; // [W] Array1D Phi; // dimensionless measure of occupied subzone temperature // END UCSD // Begin NREL User-defined patterns @@ -670,15 +667,15 @@ struct RoomAirModelData : BaseGlobalStruct // Object Data Array1D AirModel; Array1D AirNode; - Array1D ZoneUCSDDV; // UCSD - Array1D ZoneUCSDCV; - Array1D ZoneUCSDUI; - Array1D ZoneUCSDUE; - Array2D CVJetRecFlows; // Jet and recirculation zone flows and properties - Array1D SurfParametersCVDV; // Surface parameters - Array1D RoomAirPattern; // user defined patterns ,various types + Array1D ZoneDispVent3Node; // UCSD + Array1D ZoneCrossVent; + Array1D ZoneUFADInt; + Array1D ZoneUFADExt; + Array2D CrossVentJetRecFlows; // Jet and recirculation zone flows and properties + Array1D SurfParametersCrossDispVent; // Surface parameters + Array1D AirPattern; // user defined patterns ,various types Array1D AirPatternZoneInfo; // added zone information for user defined patterns - Array1D RoomAirflowNetworkZoneInfo; // added zone info + Array1D AFNZoneInfo; // added zone info void clear_state() override { @@ -689,9 +686,9 @@ struct RoomAirModelData : BaseGlobalStruct ConvectiveFloorSplit.clear(); InfiltratFloorSplit.clear(); // UCSD - TotUCSDDV = 0; // Total number of UCSDDV zones - DVHcIn.clear(); - IsZoneDV.clear(); // Is the air model for the zone UCSDDV? + TotDispVent3Node = 0; // Total number of UCSDDV zones + DispVent3NodeHcIn.clear(); + IsZoneDispVent3Node.clear(); // Is the air model for the zone UCSDDV? ZTOC.clear(); // Temperature of occupied (lower) zone AvgTempGrad.clear(); // vertical Average Temperature Gradient in the room ZTMX.clear(); // Temperature of the mixing(upper) layer @@ -701,8 +698,8 @@ struct RoomAirModelData : BaseGlobalStruct ZTFloor.clear(); HeightTransition.clear(); FracMinFlow.clear(); - ZoneDVMixedFlag.clear(); - ZoneDVMixedFlagRep.clear(); + ZoneDispVent3NodeMixedFlag.clear(); + ZoneDispVent3NodeMixedFlagRep.clear(); ZoneAirSystemON.clear(); TCMF.clear(); // comfort temperature ZoneCeilingHeight.clear(); @@ -756,11 +753,11 @@ struct RoomAirModelData : BaseGlobalStruct ZoneMXMX.clear(); // [C] difference equation's Mixed air temp at t minus 1 ZoneM2MX.clear(); // [C] difference equation's Mixed air temp at t minus 2 // UCSD-CV - TotUCSDCV = 0; // Total number of UCSDDV zones - CVNumAirflowNetworkSurfaces = 0; // total number of AirFlowNetwork surfaces. - CVHcIn.clear(); - IsZoneCV.clear(); // Is the air model for the zone UCSDDV? - ZoneCVisMixing.clear(); // Zone set to CV is actually using a mixing model + TotCrossVent = 0; // Total number of UCSDDV zones + CrossVentNumAFNSurfaces = 0; // total number of AirFlowNetwork surfaces. + CrossVentHcIn.clear(); + IsZoneCrossVent.clear(); // Is the air model for the zone UCSDDV? + ZoneCrossVentIsMixing.clear(); // Zone set to CV is actually using a mixing model ZTJET.clear(); // Jet Temperatures ZTREC.clear(); // Recirculation Temperatures RoomOutflowTemp.clear(); // Temperature of air flowing out of the room @@ -776,23 +773,23 @@ struct RoomAirModelData : BaseGlobalStruct Dstar.clear(); // CV Zone average length, wind direction corrected Tin.clear(); // Inflow air temperature TotArea.clear(); // Sum of the areas of all apertures in the zone - AirflowNetworkSurfaceUCSDCV.clear(); // table for AirflowNetwork surfaces organization + AFNSurfaceCrossVent.clear(); // table for AirflowNetwork surfaces organization // Interzone surfaces counts twice. Rfr.clear(); // Ration between inflow and recirculation air flows - ZoneCVhasREC.clear(); // Airflow pattern is C = 0, CR(1) + ZoneCrossVentHasREC.clear(); // Airflow pattern is C = 0, CR(1) UCSDModelUsed = false; - MundtModelUsed = false; + DispVent1NodeModelUsed = false; // UCSD-UF - TotUCSDUI = 0; // total number of UCSDUI zones - TotUCSDUE = 0; // total number of UCSDUE zones + TotUFADInt = 0; // total number of UCSDUI zones + TotUFADExt = 0; // total number of UCSDUE zones IsZoneUI.clear(); // controls program flow, for interior or exterior UFAD model - ZoneUFPtr.clear(); - UFHcIn.clear(); - ZoneUFMixedFlag.clear(); - ZoneUFMixedFlagRep.clear(); - ZoneUFGamma.clear(); - ZoneUFPowInPlumes.clear(); // [W] - ZoneUFPowInPlumesfromWindows.clear(); // [W] + ZoneUFADPtr.clear(); + UFADHcIn.clear(); + ZoneUFADMixedFlag.clear(); + ZoneUFADMixedFlagRep.clear(); + ZoneUFADGamma.clear(); + ZoneUFADPowInPlumes.clear(); // [W] + ZoneUFADPowInPlumesfromWindows.clear(); // [W] Phi.clear(); // dimensionless measure of occupied subzone temperature // END UCSD // Begin NREL User-defined patterns @@ -811,15 +808,15 @@ struct RoomAirModelData : BaseGlobalStruct // Object Data AirModel.clear(); AirNode.clear(); - ZoneUCSDDV.clear(); // UCSD - ZoneUCSDCV.clear(); - ZoneUCSDUI.clear(); - ZoneUCSDUE.clear(); - CVJetRecFlows.clear(); // Jet and recirculation zone flows and properties - SurfParametersCVDV.clear(); // Surface parameters - RoomAirPattern.clear(); // user defined patterns ,various types + ZoneDispVent3Node.clear(); // UCSD + ZoneCrossVent.clear(); + ZoneUFADInt.clear(); + ZoneUFADExt.clear(); + CrossVentJetRecFlows.clear(); // Jet and recirculation zone flows and properties + SurfParametersCrossDispVent.clear(); // Surface parameters + AirPattern.clear(); // user defined patterns ,various types AirPatternZoneInfo.clear(); // added zone information for user defined patterns - RoomAirflowNetworkZoneInfo.clear(); // added zone info + AFNZoneInfo.clear(); // added zone info } }; diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index f170cc57266..f7fda7fa4c4 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -199,7 +199,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei auto &SurfTempIn(state.dataHeatBalSurf->SurfTempIn); // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? - if (state.dataRoomAirMod->IsZoneDV(ZoneNum)) { + if (state.dataRoomAirMod->IsZoneDispVent3Node(ZoneNum)) { LayFrac = FractionHeight; LayH = FractionHeight * (state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1)); @@ -217,8 +217,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); } @@ -226,8 +226,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); } @@ -235,11 +235,11 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - HLU = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + HLU = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - HLD = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + HLD = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); @@ -252,7 +252,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HWall(Ctd); + state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataUCSDShared->HWall(Ctd); } // END WALL @@ -271,8 +271,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); @@ -280,8 +280,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); @@ -289,11 +289,11 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - HLU = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + HLU = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - HLD = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + HLD = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); @@ -309,21 +309,21 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } - state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HWindow(Ctd); + state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataUCSDShared->HWindow(Ctd); } // END WINDOW @@ -342,8 +342,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); @@ -351,8 +351,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); @@ -360,11 +360,11 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - HLU = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + HLU = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - HLD = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + HLD = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); @@ -380,21 +380,21 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Door Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Door Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } - state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HDoor(Ctd); + state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataUCSDShared->HDoor(Ctd); } // END DOOR @@ -413,8 +413,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HInternal(Ctd); @@ -422,11 +422,11 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - HLU = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + HLU = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - HLD = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + HLD = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); @@ -439,7 +439,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HInternal(Ctd); + state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataUCSDShared->HInternal(Ctd); } // END INTERNAL // CEILING Hc, HA and HAT CALCULATION @@ -450,11 +450,11 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HCeiling(Ctd); state.dataDispVentMgr->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HCeiling(Ctd); - state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); + state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); } // END CEILING // FLOOR Hc, HA and HAT CALCULATION @@ -465,12 +465,12 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DVHcIn); - state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); + state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_FLOOR += state.dataSurface->Surface(SurfNum).Area * SurfTempIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); state.dataDispVentMgr->HA_FLOOR += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HFloor(Ctd); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); + state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); } // END FLOOR } } @@ -595,18 +595,19 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum MIXFLAG = false; FlagApertures = 1; - state.dataRoomAirMod->DVHcIn = state.dataHeatBalSurf->SurfHConvInt; + state.dataRoomAirMod->DispVent3NodeHcIn = state.dataHeatBalSurf->SurfHConvInt; CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); ZoneMult = zone.Multiplier * zone.ListMultiplier; auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - for (Ctd = 1; Ctd <= state.dataRoomAirMod->TotUCSDDV; ++Ctd) { - if (ZoneNum == state.dataRoomAirMod->ZoneUCSDDV(Ctd).ZonePtr) { - GainsFrac = GetCurrentScheduleValue(state, state.dataRoomAirMod->ZoneUCSDDV(Ctd).SchedGainsPtr); - NumPLPP = state.dataRoomAirMod->ZoneUCSDDV(Ctd).NumPlumesPerOcc; - HeightThermostat = state.dataRoomAirMod->ZoneUCSDDV(Ctd).ThermostatHeight; - HeightComfort = state.dataRoomAirMod->ZoneUCSDDV(Ctd).ComfortHeight; - TempDiffCritRep = state.dataRoomAirMod->ZoneUCSDDV(Ctd).TempTrigger; + for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotDispVent3Node; ++Ctd) { + auto &zoneDV3N = state.dataRoomAirMod->ZoneDispVent3Node(Ctd); + if (ZoneNum == zoneDV3N.ZonePtr) { + GainsFrac = GetCurrentScheduleValue(state, zoneDV3N.SchedGainsPtr); + NumPLPP = zoneDV3N.NumPlumesPerOcc; + HeightThermostat = zoneDV3N.ThermostatHeight; + HeightComfort = zoneDV3N.ComfortHeight; + TempDiffCritRep = zoneDV3N.TempTrigger; } } @@ -682,101 +683,41 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum // have to be located above 1.8m. if (state.afn->NumOfLinksMultiZone > 0) { - for (int Loop = 1; Loop <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Loop) { // direct AirflowNetwork surface - - if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).SurfNum) - .Zone == ZoneNum) { - - if ((state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmax < 0.8 && - state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).VolFLOW > 0)) { + int afnSurfNum = state.dataRoomAirMod->AFNSurfaceCrossVent(Loop, ZoneNum); + auto const &surfParams = state.dataRoomAirMod->SurfParametersCrossDispVent(afnSurfNum); + auto const &afnLinkSimu = state.afn->AirflowNetworkLinkSimu(afnSurfNum); + auto const &afnMzSurfData = state.afn->MultizoneSurfaceData(afnSurfNum); + auto const &afnMzSurf = state.dataSurface->Surface(afnMzSurfData.SurfNum); + if (afnMzSurf.Zone == ZoneNum) { + + if ((surfParams.Zmax < 0.8 && afnLinkSimu.VolFLOW > 0)) { FlagApertures = 0; break; } - if (state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmin > 1.8 && - state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).VolFLOW2 > 0) { + if (surfParams.Zmin > 1.8 && afnLinkSimu.VolFLOW2 > 0) { FlagApertures = 0; break; } - if ((state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmin > 0.8 && - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmin < 1.8) || - (state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmax > 0.8 && - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmax < 1.8)) { + if ((surfParams.Zmin > 0.8 && surfParams.Zmin < 1.8) || (surfParams.Zmax > 0.8 && surfParams.Zmax < 1.8)) { FlagApertures = 0; break; } // indirect AirflowNetwork surface; this is an interzone surface } else { - - if (state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmax + - state.dataHeatBal - ->Zone( - state.dataSurface - ->Surface( - state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).SurfNum) - .Zone) - .OriginZ - - zone.OriginZ < - 0.8 && - state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).VolFLOW2 > 0) { + auto const &afnZone = state.dataHeatBal->Zone(afnMzSurf.Zone); + if (surfParams.Zmax + afnZone.OriginZ - zone.OriginZ < 0.8 && afnLinkSimu.VolFLOW2 > 0) { FlagApertures = 0; break; } - if (state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmin + - state.dataHeatBal - ->Zone( - state.dataSurface - ->Surface( - state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).SurfNum) - .Zone) - .OriginZ - - zone.OriginZ > - 1.8 && - state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).VolFLOW > 0) { + if (surfParams.Zmin + afnZone.OriginZ - zone.OriginZ > 1.8 && afnLinkSimu.VolFLOW > 0) { FlagApertures = 0; break; } - if ((state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmin + - state.dataHeatBal - ->Zone( - state.dataSurface - ->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)) - .SurfNum) - .Zone) - .OriginZ - - zone.OriginZ > - 0.8 && - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmin + - state.dataHeatBal - ->Zone( - state.dataSurface - ->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)) - .SurfNum) - .Zone) - .OriginZ - - zone.OriginZ < - 1.8) || - (state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmax + - state.dataHeatBal - ->Zone( - state.dataSurface - ->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)) - .SurfNum) - .Zone) - .OriginZ - - zone.OriginZ > - 0.8 && - state.dataRoomAirMod->SurfParametersCVDV(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)).Zmax + - state.dataHeatBal - ->Zone( - state.dataSurface - ->Surface(state.afn->MultizoneSurfaceData(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(Loop, ZoneNum)) - .SurfNum) - .Zone) - .OriginZ - - zone.OriginZ < - 1.8)) { + if ((surfParams.Zmin + afnZone.OriginZ - zone.OriginZ > 0.8 && surfParams.Zmin + afnZone.OriginZ - zone.OriginZ < 1.8) || + (surfParams.Zmax + afnZone.OriginZ - zone.OriginZ > 0.8 && surfParams.Zmax + afnZone.OriginZ - zone.OriginZ < 1.8)) { FlagApertures = 0; break; } @@ -1096,10 +1037,10 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum } if (MIXFLAG) { - state.dataRoomAirMod->ZoneDVMixedFlag(ZoneNum) = 1; + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag(ZoneNum) = 1; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; } else { - state.dataRoomAirMod->ZoneDVMixedFlag(ZoneNum) = 0; + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; } @@ -1110,13 +1051,13 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum // Mixed for reporting purposes if ((MIXFLAG) || ((state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAirMod->ZoneDVMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 1.0; state.dataRoomAirMod->FracMinFlow(ZoneNum) = -1.0; state.dataRoomAirMod->HeightTransition(ZoneNum) = -9.999; state.dataRoomAirMod->AvgTempGrad(ZoneNum) = -9.999; state.dataRoomAirMod->MaxTempGrad(ZoneNum) = -9.999; } else { - state.dataRoomAirMod->ZoneDVMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 0.0; } } diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 96688d7b048..4a3fbaf406f 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -4575,8 +4575,8 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if ErrorsFound = true; } if (NumOfAirModels > 0) { - state.dataRoomAirMod->IsZoneDV.dimension(state.dataGlobal->NumOfZones, false); - state.dataRoomAirMod->IsZoneCV.dimension(state.dataGlobal->NumOfZones, false); + state.dataRoomAirMod->IsZoneDispVent3Node.dimension(state.dataGlobal->NumOfZones, false); + state.dataRoomAirMod->IsZoneCrossVent.dimension(state.dataGlobal->NumOfZones, false); state.dataRoomAirMod->IsZoneUI.dimension(state.dataGlobal->NumOfZones, false); } @@ -4620,9 +4620,9 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if // nothing to do here actually break; - case RoomAir::RoomAirModel::Mundt: + case RoomAir::RoomAirModel::DispVent1Node: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->MundtModelUsed = true; + state.dataRoomAirMod->DispVent1NodeModelUsed = true; IsNotOK = false; ValidateComponent(state, "RoomAirSettings:OneNodeDisplacementVentilation", @@ -4636,7 +4636,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case RoomAir::RoomAirModel::UCSDDV: + case RoomAir::RoomAirModel::DispVent3Node: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UCSDModelUsed = true; IsNotOK = false; @@ -4652,7 +4652,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case RoomAir::RoomAirModel::UCSDCV: + case RoomAir::RoomAirModel::CrossVent: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UCSDModelUsed = true; IsNotOK = false; @@ -4668,7 +4668,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case RoomAir::RoomAirModel::UCSDUFI: + case RoomAir::RoomAirModel::UFADInt: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UCSDModelUsed = true; ValidateComponent(state, @@ -4683,7 +4683,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if } break; - case RoomAir::RoomAirModel::UCSDUFE: + case RoomAir::RoomAirModel::UFADExt: state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; state.dataRoomAirMod->UCSDModelUsed = true; ValidateComponent(state, diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index d0e8927a048..dc91a07b29f 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -7342,7 +7342,7 @@ namespace InternalHeatGains { if (state.dataHeatBal->People(Loop).UserSpecSensFrac == Constant::AutoCalculate) { Real64 airTemp = thisZoneHB.MAT; if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDV(NZ) || state.dataRoomAirMod->IsZoneUI(NZ)) { + if (state.dataRoomAirMod->IsZoneDispVent3Node(NZ) || state.dataRoomAirMod->IsZoneUI(NZ)) { airTemp = state.dataRoomAirMod->TCMF(NZ); } } diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index 5b535334d12..dff580c2122 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -190,7 +190,7 @@ namespace RoomAir { ErrorsFound = false; for (ZoneIndex = 1; ZoneIndex <= state.dataGlobal->NumOfZones; ++ZoneIndex) { auto &thisZone = state.dataHeatBal->Zone(ZoneIndex); - if (state.dataRoomAirMod->AirModel(ZoneIndex).AirModel == RoomAir::RoomAirModel::Mundt) { + if (state.dataRoomAirMod->AirModel(ZoneIndex).AirModel == RoomAir::RoomAirModel::DispVent1Node) { // find number of zones using the Mundt model ++NumOfMundtZones; // find maximum number of surfaces in zones using the Mundt model diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 40b69c5cc48..6f535a3b852 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -129,10 +129,9 @@ namespace RoomAir { // calls subroutines (LOL) // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int ThisRoomAirNode; - int RAFNNum; - RAFNNum = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).RAFNNum; + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + int RAFNNum = afnZoneInfo.RAFNNum; if (RAFNNum == 0) { ShowFatalError(state, @@ -144,7 +143,7 @@ namespace RoomAir { thisRAFN.ZoneNum = ZoneNum; // model control volume for each roomAir:node in the zone. - for (ThisRoomAirNode = 1; ThisRoomAirNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes; ++ThisRoomAirNode) { + for (int ThisRoomAirNode = 1; ThisRoomAirNode <= afnZoneInfo.NumOfAirNodes; ++ThisRoomAirNode) { thisRAFN.RoomAirNode = ThisRoomAirNode; @@ -187,14 +186,13 @@ namespace RoomAir { // static bool OneTimeFlag_FindFirstLastPtr( true ); // one time setup flag // // state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag //////////////////////////////////////////////////////////////////////////////////// - int RAFNNum; - if (state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag) { state.dataRoomAirflowNetModel->RAFN.allocate(state.dataRoomAirMod->NumOfRoomAirflowNetControl); state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag = false; } - RAFNNum = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).RAFNNum; + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + int RAFNNum = afnZoneInfo.RAFNNum; if (RAFNNum == 0) { ShowFatalError(state, @@ -262,48 +260,48 @@ namespace RoomAir { // loop over all zones with RoomAirflowNetwork model for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - if (!state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).IsUsed) continue; + if (!state.dataRoomAirMod->AFNZoneInfo(LoopZone).IsUsed) continue; int NumSurfs = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); NumSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; } - for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).NumOfAirNodes; + for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->AFNZoneInfo(LoopZone).NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes // calculate volume of air in node's control volume - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirVolume = + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirVolume = state.dataHeatBal->Zone(LoopZone).Volume * - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).ZoneVolumeFraction; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).ZoneVolumeFraction; SetupOutputVariable(state, "RoomAirflowNetwork Node NonAirSystemResponse", OutputProcessor::Unit::W, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).NonAirSystemResponse, + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).NonAirSystemResponse, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).Name); + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SysDepZoneLoadsLagged", OutputProcessor::Unit::W, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLagged, + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLagged, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).Name); + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SumIntSensibleGain", OutputProcessor::Unit::W, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).SumIntSensibleGain, + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SumIntSensibleGain, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).Name); + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SumIntLatentGain", OutputProcessor::Unit::W, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).SumIntLatentGain, + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SumIntLatentGain, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).Name); + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); } } state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlag = false; @@ -335,17 +333,17 @@ namespace RoomAir { // loop over all zones with RoomAirflowNetwork model for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { if (!state.dataHeatBal->Zone(LoopZone).IsControlled) continue; - if (!state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).IsUsed) continue; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).ActualZoneID = LoopZone; + if (!state.dataRoomAirMod->AFNZoneInfo(LoopZone).IsUsed) continue; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).ActualZoneID = LoopZone; SupplyFrac = 0.0; ReturnFrac = 0.0; NodeFound = false; int numAirDistUnits = 0; // find supply air node number - for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).NumOfAirNodes; + for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->AFNZoneInfo(LoopZone).NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes - for (EquipLoop = 1; EquipLoop <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).NumHVACs; + for (EquipLoop = 1; EquipLoop <= state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).NumHVACs; ++EquipLoop) { // loop over all the equip for a single room air node // Check zone equipment name for (I = 1; I <= state.dataZoneEquip->ZoneEquipList(LoopZone).NumOfEquipTypes; ++I) { // loop over all equip types @@ -360,22 +358,22 @@ namespace RoomAir { for (int AirDistUnitNum = 1; AirDistUnitNum <= numAirDistUnits; ++AirDistUnitNum) { if (state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I) == state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).Name) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name == + if (state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name == state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).EquipName(1)) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + if (state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .EquipConfigIndex == 0) - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .EquipConfigIndex = I; if (!EquipFound(I)) EquipFound(I) = true; - SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .SupplyFraction; - ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .ReturnFraction; @@ -385,21 +383,21 @@ namespace RoomAir { } else { if (UtilityRoutines::SameString( state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I), - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name)) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name)) { + if (state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .EquipConfigIndex == 0) - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .EquipConfigIndex = I; EquipFound(I) = true; - SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .SupplyFraction; - ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .ReturnFraction; @@ -408,11 +406,11 @@ namespace RoomAir { } for (IdNode = 1; IdNode <= state.dataLoopNodes->NumOfNodes; ++IdNode) { // loop over all nodes to find supply node ID if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(IdNode), - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .SupplyNodeName)) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum = IdNode; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum = IdNode; break; } } @@ -428,29 +426,29 @@ namespace RoomAir { } } - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum > 0 && + if (state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum > 0 && UtilityRoutines::SameString( - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnNodeName, + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnNodeName, "")) { // Find matching return node for (int retNode = 1; retNode <= state.dataZoneEquip->ZoneEquipConfig(LoopZone).NumReturnNodes; ++retNode) { if ((state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNodeInletNum(retNode) == inletNodeIndex) && (state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNode(retNode) > 0)) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNode(retNode); // Zone return node break; } } } - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum == 0) { + if (state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum == 0) { for (IdNode = 1; IdNode <= state.dataLoopNodes->NumOfNodes; ++IdNode) { // loop over all nodes to find return node ID if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(IdNode), - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .ReturnNodeName)) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = IdNode; break; } @@ -460,18 +458,18 @@ namespace RoomAir { state, "RoomAirflowNetwork Node HVAC Supply Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupplyFraction, + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupplyFraction, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); SetupOutputVariable( state, "RoomAirflowNetwork Node HVAC Return Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnFraction, + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnFraction, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); } } // Count node with.TRUE. @@ -546,37 +544,37 @@ namespace RoomAir { if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkEnvrnFlag) { for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - if (!state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).IsUsed) continue; - for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).NumOfAirNodes; + if (!state.dataRoomAirMod->AFNZoneInfo(LoopZone).IsUsed) continue; + for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->AFNZoneInfo(LoopZone).NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTemp = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempX1 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempX2 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempX3 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempX4 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX1 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX2 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX3 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX4 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempT1 = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempTMX = 23.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).AirTempTM2 = 23.0; - - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRat = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatX1 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatX2 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatX3 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatX4 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX1 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX2 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX3 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX4 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatW1 = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatWMX = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).HumRatWM2 = 0.0; - - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLagged = 0.0; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLaggedOld = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTemp = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempX1 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempX2 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempX3 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempX4 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX1 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX2 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX3 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX4 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempT1 = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempTMX = 23.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempTM2 = 23.0; + + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRat = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatX1 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatX2 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatX3 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatX4 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX1 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX2 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX3 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX4 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatW1 = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatWMX = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatWM2 = 0.0; + + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLagged = 0.0; + state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLaggedOld = 0.0; } } state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkEnvrnFlag = false; @@ -591,7 +589,8 @@ namespace RoomAir { SumNonAirSystemResponseForNode(state, RoomAirNode); // latent gains. - auto &ThisRAFNNode(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode)); + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &ThisRAFNNode = afnZoneInfo.Node(RoomAirNode); if (allocated(ThisRAFNNode.SurfMask)) { CalcSurfaceMoistureSums(state, RoomAirNode, ThisRAFNNode.SumHmAW, ThisRAFNNode.SumHmARa, ThisRAFNNode.SumHmARaW, ThisRAFNNode.SurfMask); @@ -691,7 +690,8 @@ namespace RoomAir { Real64 AirTempT1; Real64 HumRatW1; - auto &ThisRAFNNode(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode)); + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &ThisRAFNNode = afnZoneInfo.Node(RoomAirNode); if (state.dataHVACGlobal->UseZoneTimeStepHistory) { NodeTempX1 = ThisRAFNNode.AirTempX1; @@ -772,53 +772,43 @@ namespace RoomAir { // AUTHOR B Griffith // DATE WRITTEN November 2009 // MODIFIED Lixing Gu, Aug. 2015 for v8.4 replease - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // update variables - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int AirNodeNum; // nested node structure index int I; - int LoopAirNode; - int EquipLoop; Real64 NodeMass; Real64 SumMass; Real64 SumMassT; Real64 SumMassW; int RetNodeNum; - auto &ThisRAFNZone(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum)); + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); - if (!ThisRAFNZone.IsUsed) return; + if (!afnZoneInfo.IsUsed) return; if (!state.dataGlobal->ZoneSizingCalc) SumSystemDepResponseForNode(state); - AirNodeNum = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).ControlAirNodeID; + AirNodeNum = afnZoneInfo.ControlAirNodeID; // Update return node conditions for (I = 1; I <= state.dataZoneEquip->ZoneEquipList(ZoneNum).NumOfEquipTypes; ++I) { // loop over all equip types SumMass = 0.0; SumMassT = 0.0; SumMassW = 0.0; - for (LoopAirNode = 1; LoopAirNode <= ThisRAFNZone.NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes - for (EquipLoop = 1; EquipLoop <= ThisRAFNZone.Node(LoopAirNode).NumHVACs; - ++EquipLoop) { // loop over all the equip for a single room air node - if (ThisRAFNZone.Node(LoopAirNode).HVAC(EquipLoop).EquipConfigIndex == I) { - if (ThisRAFNZone.Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum > 0 && - ThisRAFNZone.Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum > 0) { - NodeMass = state.dataLoopNodes->Node(ThisRAFNZone.Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum).MassFlowRate * - ThisRAFNZone.Node(LoopAirNode).HVAC(EquipLoop).ReturnFraction; + for (int LoopAirNode = 1; LoopAirNode <= afnZoneInfo.NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes + auto &afnNode = afnZoneInfo.Node(LoopAirNode); + for (int EquipLoop = 1; EquipLoop <= afnNode.NumHVACs; ++EquipLoop) { // loop over all the equip for a single room air node + auto &afnHVAC = afnNode.HVAC(EquipLoop); + if (afnHVAC.EquipConfigIndex == I) { + if (afnHVAC.SupNodeNum > 0 && afnHVAC.RetNodeNum > 0) { + NodeMass = state.dataLoopNodes->Node(afnHVAC.SupNodeNum).MassFlowRate * afnHVAC.ReturnFraction; SumMass += NodeMass; - SumMassT += NodeMass * ThisRAFNZone.Node(LoopAirNode).AirTemp; - SumMassW += NodeMass * ThisRAFNZone.Node(LoopAirNode).HumRat; - RetNodeNum = ThisRAFNZone.Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum; + SumMassT += NodeMass * afnNode.AirTemp; + SumMassW += NodeMass * afnNode.HumRat; + RetNodeNum = afnHVAC.RetNodeNum; } } } @@ -908,30 +898,23 @@ namespace RoomAir { SumLinkM = 0.0; SumLinkMW = 0.0; + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnNode = afnZoneInfo.Node(RoomAirNodeNum); // Sum all convective internal gains: SumIntGain - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumIntSensibleGain = + afnNode.SumIntSensibleGain = SumInternalConvectionGainsByIndices(state, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).NumIntGains, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).intGainsDeviceSpaces, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).IntGainsDeviceIndices, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).IntGainsFractions); + afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumIntLatentGain = + afnNode.SumIntLatentGain = SumInternalLatentGainsByIndices(state, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).NumIntGains, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).intGainsDeviceSpaces, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).IntGainsDeviceIndices, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).IntGainsFractions); + afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); // Add heat to return air if zonal system(no return air) or cycling system(return air frequently very low or zero) if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { // ******************************************* - SumIntGain = SumReturnAirConvectionGainsByIndices( - state, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).NumIntGains, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).intGainsDeviceSpaces, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).IntGainsDeviceIndices, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).IntGainsFractions); - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumIntSensibleGain += SumIntGain; + SumIntGain = + SumReturnAirConvectionGainsByIndices(state, + afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); + afnNode.SumIntSensibleGain += SumIntGain; } // Check to see if this is a controlled zone @@ -960,14 +943,14 @@ namespace RoomAir { // Get node conditions // this next block is of interest to irratic system loads... maybe nodes are not accurate at time of call ? // how can we tell ? predict step must be lagged ? correct step, systems have run. - for (EquipLoop = 1; EquipLoop <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).NumHVACs; + for (EquipLoop = 1; EquipLoop <= afnNode.NumHVACs; ++EquipLoop) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).HVAC(EquipLoop).SupNodeNum == + if (afnNode.HVAC(EquipLoop).SupNodeNum == thisZoneEquipConfig.InletNode(NodeNum)) { NodeTemp = state.dataLoopNodes->Node(thisZoneEquipConfig.InletNode(NodeNum)).Temp; NodeW = state.dataLoopNodes->Node(thisZoneEquipConfig.InletNode(NodeNum)).HumRat; MassFlowRate = state.dataLoopNodes->Node(thisZoneEquipConfig.InletNode(NodeNum)).MassFlowRate * - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).HVAC(EquipLoop).SupplyFraction; + afnNode.HVAC(EquipLoop).SupplyFraction; CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; @@ -1023,18 +1006,18 @@ namespace RoomAir { // Sum all surface convection : SumHA, SumHATsurf, SumHATref(and additional contributions to SumIntGain) // Modified by Gu to include assigned surfaces only shown in the surface lsit - if (!state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).HasSurfacesAssigned) return; + if (!afnNode.HasSurfacesAssigned) return; int surfCount = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { ++surfCount; - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).ControlAirNodeID == RoomAirNodeNum) { + if (afnZoneInfo.ControlAirNodeID == RoomAirNodeNum) { Found = false; - for (Loop = 1; Loop <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes; ++Loop) { + for (Loop = 1; Loop <= afnZoneInfo.NumOfAirNodes; ++Loop) { if (Loop != RoomAirNodeNum) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(Loop).SurfMask(surfCount)) { + if (afnZoneInfo.Node(Loop).SurfMask(surfCount)) { Found = true; break; } @@ -1042,7 +1025,7 @@ namespace RoomAir { } if (Found) continue; } else { - if (!state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SurfMask(surfCount)) continue; + if (!afnNode.SurfMask(surfCount)) continue; } HA = 0.0; @@ -1131,13 +1114,13 @@ namespace RoomAir { } // SurfNum } // Assemble values - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumHA = SumHA; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumHATsurf = SumHATsurf; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumHATref = SumHATref; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumSysMCp = SumSysMCp; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumSysMCpT = SumSysMCpT; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumSysM = SumSysM; - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).SumSysMW = SumSysMW; + afnNode.SumHA = SumHA; + afnNode.SumHATsurf = SumHATsurf; + afnNode.SumHATref = SumHATref; + afnNode.SumSysMCp = SumSysMCp; + afnNode.SumSysMCpT = SumSysMCpT; + afnNode.SumSysM = SumSysM; + afnNode.SumSysMW = SumSysMW; } // CalcNodeSums @@ -1178,6 +1161,8 @@ namespace RoomAir { SumHmARa = 0.0; SumHmARaW = 0.0; + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + int surfCount = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); @@ -1185,12 +1170,12 @@ namespace RoomAir { ++surfCount; if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Window) continue; - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).ControlAirNodeID == RoomAirNode) { + if (afnZoneInfo.ControlAirNodeID == RoomAirNode) { Found = false; - for (Loop = 1; Loop <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes; ++Loop) { + for (Loop = 1; Loop <= afnZoneInfo.NumOfAirNodes; ++Loop) { // None - assigned surfaces belong to the zone node if (Loop != RoomAirNode) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(Loop).SurfMask(surfCount)) { + if (afnZoneInfo.Node(Loop).SurfMask(surfCount)) { Found = true; break; } @@ -1198,7 +1183,7 @@ namespace RoomAir { } if (Found) continue; } else { - if (!state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SurfMask(surfCount)) continue; + if (!afnZoneInfo.Node(RoomAirNode).SurfMask(surfCount)) continue; } auto &HMassConvInFD = state.dataMstBal->HMassConvInFD; @@ -1279,7 +1264,8 @@ namespace RoomAir { Real64 LatOutputProvided; // TODO - auto &roomAFNNode = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RAFNNodeNum); + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &roomAFNNode = afnZoneInfo.Node(RAFNNodeNum); roomAFNNode.NonAirSystemResponse = 0.0; @@ -1372,33 +1358,33 @@ namespace RoomAir { // TODO - auto &ThisRAFNZone(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum)); + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); // SysDepZoneLoads saved to be added to zone heat balance next SysOutputProvided = 0.0; - for (RoomAirNode = 1; RoomAirNode <= ThisRAFNZone.NumOfAirNodes; ++RoomAirNode) { - ThisRAFNZone.Node(RoomAirNode).SysDepZoneLoadsLaggedOld = 0.0; - for (int I = 1; I <= ThisRAFNZone.Node(RoomAirNode).NumHVACs; ++I) { - if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { + for (RoomAirNode = 1; RoomAirNode <= afnZoneInfo.NumOfAirNodes; ++RoomAirNode) { + afnZoneInfo.Node(RoomAirNode).SysDepZoneLoadsLaggedOld = 0.0; + for (int I = 1; I <= afnZoneInfo.Node(RoomAirNode).NumHVACs; ++I) { + if (afnZoneInfo.Node(RoomAirNode).HVAC(I).zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { if (SysOutputProvided == 0.0) SimZoneDehumidifier(state, - ThisRAFNZone.Node(RoomAirNode).HVAC(I).Name, + afnZoneInfo.Node(RoomAirNode).HVAC(I).Name, ZoneNum, false, SysOutputProvided, LatOutputProvided, - ThisRAFNZone.Node(RoomAirNode).HVAC(I).CompIndex); + afnZoneInfo.Node(RoomAirNode).HVAC(I).CompIndex); if (SysOutputProvided > 0.0) break; } } } if (SysOutputProvided > 0.0) { - for (RoomAirNode = 1; RoomAirNode <= ThisRAFNZone.NumOfAirNodes; ++RoomAirNode) { - for (I = 1; I <= ThisRAFNZone.Node(RoomAirNode).NumHVACs; ++I) { - if (ThisRAFNZone.Node(RoomAirNode).HVAC(I).zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { - ThisRAFNZone.Node(RoomAirNode).SysDepZoneLoadsLaggedOld += - ThisRAFNZone.Node(RoomAirNode).HVAC(I).SupplyFraction * SysOutputProvided; + for (RoomAirNode = 1; RoomAirNode <= afnZoneInfo.NumOfAirNodes; ++RoomAirNode) { + for (I = 1; I <= afnZoneInfo.Node(RoomAirNode).NumHVACs; ++I) { + if (afnZoneInfo.Node(RoomAirNode).HVAC(I).zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { + afnZoneInfo.Node(RoomAirNode).SysDepZoneLoadsLaggedOld += + afnZoneInfo.Node(RoomAirNode).HVAC(I).SupplyFraction * SysOutputProvided; } } } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index cc99a4a10b4..0045c2ad69c 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -146,29 +146,29 @@ namespace RoomAir { case RoomAirModel::Mixing: // Mixing air model break; // do nothing - case RoomAirModel::Mundt: // Mundt air model + case RoomAirModel::DispVent1Node: // Mundt air model // simulate room airflow using Mundt model ManageMundtModel(state, ZoneNum); break; - case RoomAirModel::UCSDDV: // UCDV Displacement Ventilation model + case RoomAirModel::DispVent3Node: // UCDV Displacement Ventilation model // simulate room airflow using UCSDDV model ManageUCSDDVModel(state, ZoneNum); break; - case RoomAirModel::UCSDCV: // UCSD Cross Ventilation model + case RoomAirModel::CrossVent: // UCSD Cross Ventilation model // simulate room airflow using UCSDDV model ManageUCSDCVModel(state, ZoneNum); break; - case RoomAirModel::UCSDUFI: // UCSD UFAD interior zone model + case RoomAirModel::UFADInt: // UCSD UFAD interior zone model // simulate room airflow using the UCSDUFI model - ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UCSDUFI); + ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UFADInt); break; - case RoomAirModel::UCSDUFE: // UCSD UFAD exterior zone model + case RoomAirModel::UFADExt: // UCSD UFAD exterior zone model // simulate room airflow using the UCSDUFE model - ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UCSDUFE); + ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UFADExt); break; case RoomAirModel::AirflowNetwork: // RoomAirflowNetwork zone model @@ -376,8 +376,8 @@ namespace RoomAir { } // now get user defined temperature patterns - if (!allocated(state.dataRoomAirMod->RoomAirPattern)) { - state.dataRoomAirMod->RoomAirPattern.allocate(state.dataRoomAirMod->NumAirTempPatterns); + if (!allocated(state.dataRoomAirMod->AirPattern)) { + state.dataRoomAirMod->AirPattern.allocate(state.dataRoomAirMod->NumAirTempPatterns); } // Four different objects to get @@ -397,7 +397,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAirMod->RoomAirPattern(thisPattern); + auto &roomAirPattern = state.dataRoomAirMod->AirPattern(thisPattern); roomAirPattern.Name = ipsc->cAlphaArgs(1); roomAirPattern.PatrnID = ipsc->rNumericArgs(1); roomAirPattern.PatternMode = UserDefinedPatternType::ConstGradTemp; @@ -424,7 +424,7 @@ namespace RoomAir { ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAirMod->RoomAirPattern(thisPattern); + auto &roomAirPattern = state.dataRoomAirMod->AirPattern(thisPattern); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; roomAirPattern.PatternMode = UserDefinedPatternType::TwoGradInterp; roomAirPattern.Name = ipsc->cAlphaArgs(1); @@ -486,7 +486,7 @@ namespace RoomAir { _, ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAirMod->RoomAirPattern(thisPattern); + auto &roomAirPattern = state.dataRoomAirMod->AirPattern(thisPattern); roomAirPattern.PatternMode = UserDefinedPatternType::NonDimenHeight; roomAirPattern.Name = ipsc->cAlphaArgs(1); @@ -540,7 +540,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAirMod->RoomAirPattern(thisPattern); + auto &roomAirPattern = state.dataRoomAirMod->AirPattern(thisPattern); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; roomAirPattern.PatternMode = UserDefinedPatternType::SurfMapTemp; @@ -641,7 +641,7 @@ namespace RoomAir { int NumNumbers; // Number of numbers encountered int Status; // Notes if there was an error in processing the input - if (!state.dataRoomAirMod->MundtModelUsed) return; + if (!state.dataRoomAirMod->DispVent1NodeModelUsed) return; auto &ipsc = state.dataIPShortCut; @@ -783,7 +783,7 @@ namespace RoomAir { for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { auto const &airNode = state.dataRoomAirMod->AirNode(AirNodeNum); // this zone uses other air model so skip the rest - if (state.dataRoomAirMod->AirModel(airNode.ZonePtr).AirModel == RoomAirModel::Mundt) + if (state.dataRoomAirMod->AirModel(airNode.ZonePtr).AirModel == RoomAirModel::DispVent1Node) ++state.dataRoomAirMod->TotNumOfZoneAirNodes(airNode.ZonePtr); } } @@ -816,7 +816,7 @@ namespace RoomAir { auto &ipsc = state.dataIPShortCut; - if (!state.dataRoomAirMod->MundtModelUsed) return; + if (!state.dataRoomAirMod->DispVent1NodeModelUsed) return; // Initialize default values for Mundt model controls state.dataRoomAirMod->ConvectiveFloorSplit.allocate(state.dataGlobal->NumOfZones); @@ -862,7 +862,7 @@ namespace RoomAir { ErrorsFound = true; continue; } - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAirModel::Mundt) { + if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAirModel::DispVent1Node) { ShowSevereError( state, format("Zone specified=\"{}\", Air Model type is not OneNodeDisplacementVentilation.", ipsc->cAlphaArgs(1))); @@ -902,13 +902,13 @@ namespace RoomAir { if (!state.dataRoomAirMod->UCSDModelUsed) return; ipsc->cCurrentModuleObject = "RoomAirSettings:ThreeNodeDisplacementVentilation"; - state.dataRoomAirMod->TotUCSDDV = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAirMod->TotDispVent3Node = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->TotUCSDDV <= 0) return; + if (state.dataRoomAirMod->TotDispVent3Node <= 0) return; - state.dataRoomAirMod->ZoneUCSDDV.allocate(state.dataRoomAirMod->TotUCSDDV); + state.dataRoomAirMod->ZoneDispVent3Node.allocate(state.dataRoomAirMod->TotDispVent3Node); - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDDV; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotDispVent3Node; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, @@ -923,31 +923,31 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &zoneUCSDDV = state.dataRoomAirMod->ZoneUCSDDV(Loop); + auto &zoneDV3N = state.dataRoomAirMod->ZoneDispVent3Node(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // First is Zone Name // zoneUCSDDV.ZoneName = ipsc->cAlphaArgs(1); - zoneUCSDDV.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); - if (zoneUCSDDV.ZonePtr == 0) { + zoneDV3N.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + if (zoneDV3N.ZonePtr == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneDV(zoneUCSDDV.ZonePtr) = true; + state.dataRoomAirMod->IsZoneDispVent3Node(zoneDV3N.ZonePtr) = true; } // Second Alpha is Schedule Name // zoneUCSDDV.SchedGainsName = ipsc->cAlphaArgs(2); if (ipsc->lAlphaFieldBlanks(2)) { ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(2)); ErrorsFound = true; - } else if ((zoneUCSDDV.SchedGainsPtr = GetScheduleIndex(state, ipsc->cAlphaArgs(2))) == 0) { + } else if ((zoneDV3N.SchedGainsPtr = GetScheduleIndex(state, ipsc->cAlphaArgs(2))) == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } - zoneUCSDDV.NumPlumesPerOcc = ipsc->rNumericArgs(1); - zoneUCSDDV.ThermostatHeight = ipsc->rNumericArgs(2); - zoneUCSDDV.ComfortHeight = ipsc->rNumericArgs(3); - zoneUCSDDV.TempTrigger = ipsc->rNumericArgs(4); + zoneDV3N.NumPlumesPerOcc = ipsc->rNumericArgs(1); + zoneDV3N.ThermostatHeight = ipsc->rNumericArgs(2); + zoneDV3N.ComfortHeight = ipsc->rNumericArgs(3); + zoneDV3N.TempTrigger = ipsc->rNumericArgs(4); } } @@ -977,13 +977,13 @@ namespace RoomAir { auto &ipsc = state.dataIPShortCut; if (!state.dataRoomAirMod->UCSDModelUsed) return; ipsc->cCurrentModuleObject = "RoomAirSettings:CrossVentilation"; - state.dataRoomAirMod->TotUCSDCV = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAirMod->TotCrossVent = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->TotUCSDCV <= 0) return; + if (state.dataRoomAirMod->TotCrossVent <= 0) return; - state.dataRoomAirMod->ZoneUCSDCV.allocate(state.dataRoomAirMod->TotUCSDCV); + state.dataRoomAirMod->ZoneCrossVent.allocate(state.dataRoomAirMod->TotCrossVent); - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDCV; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotCrossVent; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, @@ -998,22 +998,22 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &zoneUCSDCV = state.dataRoomAirMod->ZoneUCSDCV(Loop); + auto &zoneCV = state.dataRoomAirMod->ZoneCrossVent(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // First is Zone Name // state.dataRoomAirMod->ZoneUCSDCV(Loop).ZoneName = ipsc->cAlphaArgs(1); - if ((zoneUCSDCV.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone)) == 0) { + if ((zoneCV.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone)) == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneCV(zoneUCSDCV.ZonePtr) = true; + state.dataRoomAirMod->IsZoneCrossVent(zoneCV.ZonePtr) = true; } // Second Alpha is Schedule Name // zoneUCSDCV.SchedGainsName = ipsc->cAlphaArgs(2); if (ipsc->lAlphaFieldBlanks(2)) { ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(2)); ErrorsFound = true; - } else if ((zoneUCSDCV.SchedGainsPtr = GetScheduleIndex(state, ipsc->cAlphaArgs(2))) == 0) { + } else if ((zoneCV.SchedGainsPtr = GetScheduleIndex(state, ipsc->cAlphaArgs(2))) == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } @@ -1021,22 +1021,22 @@ namespace RoomAir { // Third Alpha is a string: JET or RECIRCULATION if (ipsc->lAlphaFieldBlanks(3)) { for (int Loop2 = 1; Loop2 <= state.dataHeatBal->TotPeople; ++Loop2) { - if (state.dataHeatBal->People(Loop2).ZonePtr != zoneUCSDCV.ZonePtr) continue; + if (state.dataHeatBal->People(Loop2).ZonePtr != zoneCV.ZonePtr) continue; if (!state.dataHeatBal->People(Loop2).Fanger) continue; ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(3)); ErrorsFound = true; } - } else if ((zoneUCSDCV.VforComfort = static_cast(getEnumValue(comfortNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(3))))) == + } else if ((zoneCV.VforComfort = static_cast(getEnumValue(comfortNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(3))))) == Comfort::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; } - if (zoneUCSDCV.ZonePtr == 0) continue; + if (zoneCV.ZonePtr == 0) continue; // Following depend on valid zone - if (UtilityRoutines::FindItemInList(state.dataHeatBal->Zone(zoneUCSDCV.ZonePtr).Name, + if (UtilityRoutines::FindItemInList(state.dataHeatBal->Zone(zoneCV.ZonePtr).Name, state.afn->MultizoneZoneData, &AirflowNetwork::MultizoneZoneProp::ZoneName) == 0) { ShowSevereError(state, format("Problem with {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); @@ -1049,16 +1049,16 @@ namespace RoomAir { auto const &mzSurfaceData = state.afn->MultizoneSurfaceData(iLink); int nodeNum1 = mzSurfaceData.NodeNums[0]; int nodeNum2 = mzSurfaceData.NodeNums[1]; - if (state.dataSurface->Surface(mzSurfaceData.SurfNum).Zone == zoneUCSDCV.ZonePtr || - (state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum == zoneUCSDCV.ZonePtr && + if (state.dataSurface->Surface(mzSurfaceData.SurfNum).Zone == zoneCV.ZonePtr || + (state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum == zoneCV.ZonePtr && state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum > 0) || (state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum > 0 && - state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum == zoneUCSDCV.ZonePtr)) { + state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum == zoneCV.ZonePtr)) { int compNum = state.afn->AirflowNetworkLinkageData(iLink).CompNum; int typeNum = state.afn->AirflowNetworkCompData(compNum).TypeNum; if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { if (state.afn->MultizoneSurfaceCrackData(typeNum).exponent != 0.50) { - state.dataRoomAirMod->AirModel(zoneUCSDCV.ZonePtr).AirModel = RoomAirModel::Mixing; + state.dataRoomAirMod->AirModel(zoneCV.ZonePtr).AirModel = RoomAirModel::Mixing; ShowWarningError(state, format("Problem with {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowWarningError(state, format("Roomair model will not be applied for Zone={}.", ipsc->cAlphaArgs(1))); ShowContinueError( @@ -1096,26 +1096,26 @@ namespace RoomAir { int NumNumber; if (!state.dataRoomAirMod->UCSDModelUsed) { - state.dataRoomAirMod->TotUCSDUI = 0; - state.dataRoomAirMod->TotUCSDUE = 0; + state.dataRoomAirMod->TotUFADInt = 0; + state.dataRoomAirMod->TotUFADExt = 0; return; } auto &ipsc = state.dataIPShortCut; ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; - state.dataRoomAirMod->TotUCSDUI = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAirMod->TotUFADInt = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; - state.dataRoomAirMod->TotUCSDUE = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAirMod->TotUFADExt = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->TotUCSDUI <= 0 && state.dataRoomAirMod->TotUCSDUE <= 0) return; + if (state.dataRoomAirMod->TotUFADInt <= 0 && state.dataRoomAirMod->TotUFADExt <= 0) return; - state.dataRoomAirMod->ZoneUCSDUI.allocate(state.dataRoomAirMod->TotUCSDUI); - state.dataRoomAirMod->ZoneUCSDUE.allocate(state.dataRoomAirMod->TotUCSDUE); - state.dataRoomAirMod->ZoneUFPtr.dimension(state.dataGlobal->NumOfZones, 0); + state.dataRoomAirMod->ZoneUFADInt.allocate(state.dataRoomAirMod->TotUFADInt); + state.dataRoomAirMod->ZoneUFADExt.allocate(state.dataRoomAirMod->TotUFADExt); + state.dataRoomAirMod->ZoneUFADPtr.dimension(state.dataGlobal->NumOfZones, 0); ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDUI; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUFADInt; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -1129,55 +1129,55 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); // First is Zone Name - auto &zoneUCSDUI = state.dataRoomAirMod->ZoneUCSDUI(Loop); + auto &zoneUI = state.dataRoomAirMod->ZoneUFADInt(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - zoneUCSDUI.ZoneName = ipsc->cAlphaArgs(1); - zoneUCSDUI.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); - state.dataRoomAirMod->ZoneUFPtr(zoneUCSDUI.ZonePtr) = Loop; - if (zoneUCSDUI.ZonePtr == 0) { + zoneUI.ZoneName = ipsc->cAlphaArgs(1); + zoneUI.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + state.dataRoomAirMod->ZoneUFADPtr(zoneUI.ZonePtr) = Loop; + if (zoneUI.ZonePtr == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneUI(zoneUCSDUI.ZonePtr) = true; + state.dataRoomAirMod->IsZoneUI(zoneUI.ZonePtr) = true; } // 2nd alpha is diffuser type - zoneUCSDUI.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); - if (zoneUCSDUI.DiffuserType == Diffuser::Invalid) { + zoneUI.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + if (zoneUI.DiffuserType == Diffuser::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } // 1st number is Number of Diffusers per Zone - zoneUCSDUI.DiffusersPerZone = ipsc->rNumericArgs(1); + zoneUI.DiffusersPerZone = ipsc->rNumericArgs(1); // 2nd number is Power per Plume - zoneUCSDUI.PowerPerPlume = ipsc->rNumericArgs(2); + zoneUI.PowerPerPlume = ipsc->rNumericArgs(2); // 3rd number is Design Effective Area of Diffuser - zoneUCSDUI.DiffArea = ipsc->rNumericArgs(3); + zoneUI.DiffArea = ipsc->rNumericArgs(3); // 4th number is Diffuser Slot Angle from Vertical - zoneUCSDUI.DiffAngle = ipsc->rNumericArgs(4); + zoneUI.DiffAngle = ipsc->rNumericArgs(4); // 5th number is Thermostat Height - zoneUCSDUI.ThermostatHeight = ipsc->rNumericArgs(5); + zoneUI.ThermostatHeight = ipsc->rNumericArgs(5); // 6th number is Comfort Height - zoneUCSDUI.ComfortHeight = ipsc->rNumericArgs(6); + zoneUI.ComfortHeight = ipsc->rNumericArgs(6); // 7th number is Temperature Difference Threshold for Reporting - zoneUCSDUI.TempTrigger = ipsc->rNumericArgs(7); + zoneUI.TempTrigger = ipsc->rNumericArgs(7); // 8th number user-specified transition height - zoneUCSDUI.TransHeight = ipsc->rNumericArgs(8); + zoneUI.TransHeight = ipsc->rNumericArgs(8); // 9th number is Coefficient A in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUI.A_Kc = ipsc->rNumericArgs(9); + zoneUI.A_Kc = ipsc->rNumericArgs(9); // 10th number is Coefficient B in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUI.B_Kc = ipsc->rNumericArgs(10); + zoneUI.B_Kc = ipsc->rNumericArgs(10); // 11th number is Coefficient C in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUI.C_Kc = ipsc->rNumericArgs(11); + zoneUI.C_Kc = ipsc->rNumericArgs(11); // 12th number is Coefficient D in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUI.D_Kc = ipsc->rNumericArgs(12); + zoneUI.D_Kc = ipsc->rNumericArgs(12); // 13th number is Coefficient E in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUI.E_Kc = ipsc->rNumericArgs(13); + zoneUI.E_Kc = ipsc->rNumericArgs(13); } ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUCSDUE; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUFADExt; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -1191,49 +1191,49 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); // First is Zone Name - auto &zoneUCSDUE = state.dataRoomAirMod->ZoneUCSDUE(Loop); + auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - zoneUCSDUE.ZoneName = ipsc->cAlphaArgs(1); - zoneUCSDUE.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); - if (zoneUCSDUE.ZonePtr == 0) { + zoneUE.ZoneName = ipsc->cAlphaArgs(1); + zoneUE.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); + if (zoneUE.ZonePtr == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneUI(zoneUCSDUE.ZonePtr) = true; - state.dataRoomAirMod->ZoneUFPtr(zoneUCSDUE.ZonePtr) = Loop; + state.dataRoomAirMod->IsZoneUI(zoneUE.ZonePtr) = true; + state.dataRoomAirMod->ZoneUFADPtr(zoneUE.ZonePtr) = Loop; } - zoneUCSDUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); - if (zoneUCSDUE.DiffuserType == Diffuser::Invalid) { + zoneUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + if (zoneUE.DiffuserType == Diffuser::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; } // 1st number is Number of Diffusers per Zone - zoneUCSDUE.DiffusersPerZone = ipsc->rNumericArgs(1); + zoneUE.DiffusersPerZone = ipsc->rNumericArgs(1); // 2nd number is Power per Plume - zoneUCSDUE.PowerPerPlume = ipsc->rNumericArgs(2); + zoneUE.PowerPerPlume = ipsc->rNumericArgs(2); // 3rd number is Design Effective Area of Diffuser - zoneUCSDUE.DiffArea = ipsc->rNumericArgs(3); + zoneUE.DiffArea = ipsc->rNumericArgs(3); // 4th number is Diffuser Slot Angle from Vertical - zoneUCSDUE.DiffAngle = ipsc->rNumericArgs(4); + zoneUE.DiffAngle = ipsc->rNumericArgs(4); // 5th number is Thermostat Height - zoneUCSDUE.ThermostatHeight = ipsc->rNumericArgs(5); + zoneUE.ThermostatHeight = ipsc->rNumericArgs(5); // 6th number is Comfort Height - zoneUCSDUE.ComfortHeight = ipsc->rNumericArgs(6); + zoneUE.ComfortHeight = ipsc->rNumericArgs(6); // 7th number is Temperature Difference Threshold for Reporting - zoneUCSDUE.TempTrigger = ipsc->rNumericArgs(7); + zoneUE.TempTrigger = ipsc->rNumericArgs(7); // 8th number user-specified transition height - zoneUCSDUE.TransHeight = ipsc->rNumericArgs(8); + zoneUE.TransHeight = ipsc->rNumericArgs(8); // 9th number is Coefficient A in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUE.A_Kc = ipsc->rNumericArgs(9); + zoneUE.A_Kc = ipsc->rNumericArgs(9); // 10th number is Coefficient B in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUE.B_Kc = ipsc->rNumericArgs(10); + zoneUE.B_Kc = ipsc->rNumericArgs(10); // 11th number is Coefficient C in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUE.C_Kc = ipsc->rNumericArgs(11); + zoneUE.C_Kc = ipsc->rNumericArgs(11); // 12th number is Coefficient D in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUE.D_Kc = ipsc->rNumericArgs(12); + zoneUE.D_Kc = ipsc->rNumericArgs(12); // 13th number is Coefficient E in formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - zoneUCSDUE.E_Kc = ipsc->rNumericArgs(13); + zoneUE.E_Kc = ipsc->rNumericArgs(13); } } @@ -1275,8 +1275,8 @@ namespace RoomAir { ErrorsFound = true; } - if (!allocated(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo)) { - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo.allocate(state.dataGlobal->NumOfZones); + if (!allocated(state.dataRoomAirMod->AFNZoneInfo)) { + state.dataRoomAirMod->AFNZoneInfo.allocate(state.dataGlobal->NumOfZones); } for (int Loop = 1; Loop <= state.dataRoomAirMod->NumOfRoomAirflowNetControl; ++Loop) { @@ -1311,7 +1311,7 @@ namespace RoomAir { continue; } - auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum); + auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); roomAFNZoneInfo.ZoneID = ZoneNum; roomAFNZoneInfo.RAFNNum = Loop; roomAFNZoneInfo.IsUsed = true; @@ -1372,7 +1372,7 @@ namespace RoomAir { continue; } - auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum); + auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); int RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); if (RAFNNodeNum == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); @@ -1421,11 +1421,11 @@ namespace RoomAir { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { // find surface list int RAFNNodeNum = 0; - auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); if (roomAFNZoneInfo.NumOfAirNodes > 0) { RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, - &RoomAFNAirNodeNested::NodeSurfListName, + &AFNAirNodeNested::NodeSurfListName, roomAFNZoneInfo.NumOfAirNodes); } @@ -1521,13 +1521,13 @@ namespace RoomAir { } for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); // find surface list int RAFNNodeNum = 0; if (roomAFNZoneInfo.NumOfAirNodes > 0) { RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, - &RoomAFNAirNodeNested::NodeIntGainsListName, + &AFNAirNodeNested::NodeIntGainsListName, roomAFNZoneInfo.NumOfAirNodes); } if (RAFNNodeNum == 0) continue; @@ -1624,13 +1624,13 @@ namespace RoomAir { } for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); // find surface list int RAFNNodeNum = 0; if (roomAFNZoneInfo.NumOfAirNodes > 0) { RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, - &RoomAFNAirNodeNested::NodeHVACListName, + &AFNAirNodeNested::NodeHVACListName, roomAFNZoneInfo.NumOfAirNodes); } @@ -1695,7 +1695,7 @@ namespace RoomAir { // do some checks on input data for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); if (roomAFNZoneInfo.NumOfAirNodes == 0) continue; @@ -1751,7 +1751,7 @@ namespace RoomAir { return; for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - auto &roomAFNZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); if (!roomAFNZoneInfo.IsUsed || roomAFNZoneInfo.NumOfAirNodes == 0) continue; for (int iAirNode = 1; iAirNode <= roomAFNZoneInfo.NumOfAirNodes; ++iAirNode) { @@ -1947,18 +1947,18 @@ namespace RoomAir { } // for (ZoneNum) AuxSurf = 0; - state.dataRoomAirMod->CVNumAirflowNetworkSurfaces = 0; + state.dataRoomAirMod->CrossVentNumAFNSurfaces = 0; // calculate maximum number of airflow network surfaces in each zone for (int iMzLink = 1; iMzLink <= state.afn->NumOfLinksMultiZone; ++iMzLink) { auto const &mzSurf = state.dataSurface->Surface(state.afn->MultizoneSurfaceData(iMzLink).SurfNum); ++AuxSurf(mzSurf.Zone); - ++state.dataRoomAirMod->CVNumAirflowNetworkSurfaces; + ++state.dataRoomAirMod->CrossVentNumAFNSurfaces; // Check if this is an interzone airflow network surface if (mzSurf.ExtBoundCond > 0 && (state.afn->MultizoneSurfaceData(iMzLink).SurfNum != mzSurf.ExtBoundCond)) { ++AuxSurf(state.dataSurface->Surface(mzSurf.ExtBoundCond).Zone); - ++state.dataRoomAirMod->CVNumAirflowNetworkSurfaces; + ++state.dataRoomAirMod->CrossVentNumAFNSurfaces; } } // calculate maximum number of airflow network surfaces in a single zone @@ -1967,23 +1967,23 @@ namespace RoomAir { if (AuxSurf(iZone) > MaxSurf) MaxSurf = AuxSurf(iZone); } - if (!allocated(state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV)) { - state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); + if (!allocated(state.dataRoomAirMod->AFNSurfaceCrossVent)) { + state.dataRoomAirMod->AFNSurfaceCrossVent.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); } - if (!allocated(state.dataRoomAirMod->CVJetRecFlows)) { - state.dataRoomAirMod->CVJetRecFlows.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); + if (!allocated(state.dataRoomAirMod->CrossVentJetRecFlows)) { + state.dataRoomAirMod->CrossVentJetRecFlows.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); } AuxAirflowNetworkSurf.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); // Width and Height for airflow network surfaces - if (!allocated(state.dataRoomAirMod->SurfParametersCVDV)) { - state.dataRoomAirMod->SurfParametersCVDV.allocate(state.afn->NumOfLinksMultiZone); + if (!allocated(state.dataRoomAirMod->SurfParametersCrossDispVent)) { + state.dataRoomAirMod->SurfParametersCrossDispVent.allocate(state.afn->NumOfLinksMultiZone); } - state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV = 0; + state.dataRoomAirMod->AFNSurfaceCrossVent = 0; // Organize surfaces in vector AirflowNetworkSurfaceUCSDCV(Zone, surface indexes) for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { // the 0 component of the array has the number of relevant AirflowNetwork surfaces for the zone - state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, iZone) = AuxSurf(iZone); + state.dataRoomAirMod->AFNSurfaceCrossVent(0, iZone) = AuxSurf(iZone); if (AuxSurf(iZone) == 0) continue; @@ -1992,11 +1992,11 @@ namespace RoomAir { for (int iMzLink = 1; iMzLink <= state.afn->NumOfLinksMultiZone; ++iMzLink) { auto const &mzSurf = state.dataSurface->Surface(state.afn->MultizoneSurfaceData(iMzLink).SurfNum); - auto &surfParamsCVDV = state.dataRoomAirMod->SurfParametersCVDV(iMzLink); + auto &surfParams = state.dataRoomAirMod->SurfParametersCrossDispVent(iMzLink); if (mzSurf.Zone == iZone) { // SurfNum has the reference surface number relative to AirflowNetworkSurfaceData - state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(SurfNum, iZone) = iMzLink; + state.dataRoomAirMod->AFNSurfaceCrossVent(SurfNum, iZone) = iMzLink; // calculate the surface width and height int compNum = state.afn->AirflowNetworkLinkageData(iMzLink).CompNum; int typeNum = state.afn->AirflowNetworkCompData(compNum).TypeNum; @@ -2028,17 +2028,17 @@ namespace RoomAir { HeightFactMax = HeightFact; } } - surfParamsCVDV.Width = WidthFactMax * mzSurf.Width; - surfParamsCVDV.Height = HeightFactMax * mzSurf.Height; + surfParams.Width = WidthFactMax * mzSurf.Width; + surfParams.Height = HeightFactMax * mzSurf.Height; } else if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK - surfParamsCVDV.Width = mzSurf.Width / 2; + surfParams.Width = mzSurf.Width / 2; auto const &zoneHeatBal = state.dataZoneTempPredictorCorrector->zoneHeatBalance(iZone); Real64 AinCV = state.afn->MultizoneSurfaceCrackData(typeNum).coefficient / (BaseDischargeCoef * std::sqrt(2.0 / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, zoneHeatBal.MAT, zoneHeatBal.ZoneAirHumRat))); - surfParamsCVDV.Height = AinCV / surfParamsCVDV.Width; + surfParams.Height = AinCV / surfParams.Width; } // calculate the surface Zmin and Zmax @@ -2050,8 +2050,8 @@ namespace RoomAir { z_min = std::min(z_min, z_i); z_max = std::max(z_max, z_i); } - surfParamsCVDV.Zmin = z_min - ceilingHeight; - surfParamsCVDV.Zmax = z_max - ceilingHeight; + surfParams.Zmin = z_min - ceilingHeight; + surfParams.Zmax = z_max - ceilingHeight; } ++SurfNum; @@ -2064,7 +2064,7 @@ namespace RoomAir { state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum > 0) || (state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum > 0 && state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum == iZone)) { - state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(SurfNum, iZone) = iMzLink; + state.dataRoomAirMod->AFNSurfaceCrossVent(SurfNum, iZone) = iMzLink; ++SurfNum; } } @@ -2073,7 +2073,7 @@ namespace RoomAir { AuxSurf.deallocate(); - if (any(state.dataRoomAirMod->IsZoneDV) || any(state.dataRoomAirMod->IsZoneUI)) { + if (any(state.dataRoomAirMod->IsZoneDispVent3Node) || any(state.dataRoomAirMod->IsZoneUI)) { state.dataRoomAirMod->MaxTempGrad.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->AvgTempGrad.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->TCMF.allocate(state.dataGlobal->NumOfZones); @@ -2202,17 +2202,17 @@ namespace RoomAir { state.dataUCSDShared->HDoor = 0.0; } - if (any(state.dataRoomAirMod->IsZoneDV)) { + if (any(state.dataRoomAirMod->IsZoneDispVent3Node)) { - state.dataRoomAirMod->DVHcIn.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->ZoneDVMixedFlagRep.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneDVMixedFlag.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DVHcIn = 0.0; - state.dataRoomAirMod->ZoneDVMixedFlagRep = 0.0; - state.dataRoomAirMod->ZoneDVMixedFlag = 0; + state.dataRoomAirMod->DispVent3NodeHcIn.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->DispVent3NodeHcIn = 0.0; + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep = 0.0; + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag = 0; // Output variables and DV zone flag for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UCSDDV) + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::DispVent3Node) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:ThreeNodeDisplacementVentilation' SetupOutputVariable(state, @@ -2253,7 +2253,7 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneDVMixedFlagRep(iZone), + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); @@ -2289,22 +2289,22 @@ namespace RoomAir { } // if (any(IsZoneDV)) if (any(state.dataRoomAirMod->IsZoneUI)) { - state.dataRoomAirMod->ZoneUFMixedFlag.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneUFMixedFlagRep.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->UFHcIn.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->ZoneUFGamma.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneUFPowInPlumes.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneUFMixedFlag = 0; - state.dataRoomAirMod->ZoneUFMixedFlagRep = 0.0; - state.dataRoomAirMod->UFHcIn = 0.0; - state.dataRoomAirMod->ZoneUFGamma = 0.0; - state.dataRoomAirMod->ZoneUFPowInPlumes = 0.0; - state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows = 0.0; + state.dataRoomAirMod->ZoneUFADMixedFlag.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneUFADMixedFlagRep.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->UFADHcIn.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAirMod->ZoneUFADGamma.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneUFADPowInPlumes.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneUFADMixedFlag = 0; + state.dataRoomAirMod->ZoneUFADMixedFlagRep = 0.0; + state.dataRoomAirMod->UFADHcIn = 0.0; + state.dataRoomAirMod->ZoneUFADGamma = 0.0; + state.dataRoomAirMod->ZoneUFADPowInPlumes = 0.0; + state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows = 0.0; // Output variables and UF zone flag for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UCSDUFI) + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UFADInt) continue; // don't set these up if they don't make sense auto &zone = state.dataHeatBal->Zone(iZone); @@ -2333,7 +2333,7 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFMixedFlagRep(iZone), + state.dataRoomAirMod->ZoneUFADMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); @@ -2361,14 +2361,14 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Transition Height Gamma Value", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFGamma(iZone), + state.dataRoomAirMod->ZoneUFADGamma(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFPowInPlumes(iZone), + state.dataRoomAirMod->ZoneUFADPowInPlumes(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); @@ -2381,12 +2381,12 @@ namespace RoomAir { zone.Name); // set zone equip pointer in the UCSDUI data structure - state.dataRoomAirMod->ZoneUCSDUI(state.dataRoomAirMod->ZoneUFPtr(iZone)).ZoneEquipPtr = iZone; + state.dataRoomAirMod->ZoneUFADInt(state.dataRoomAirMod->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; } // for (iZone) for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UCSDUFE) + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UFADExt) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:UnderFloorAirDistributionExterior' auto const &zone = state.dataHeatBal->Zone(iZone); @@ -2414,7 +2414,7 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFMixedFlagRep(iZone), + state.dataRoomAirMod->ZoneUFADMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); @@ -2442,21 +2442,21 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Transition Height Gamma Value", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFGamma(iZone), + state.dataRoomAirMod->ZoneUFADGamma(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFPowInPlumes(iZone), + state.dataRoomAirMod->ZoneUFADPowInPlumes(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Window Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows(iZone), + state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); @@ -2468,12 +2468,12 @@ namespace RoomAir { OutputProcessor::SOVStoreType::State, zone.Name); // set zone equip pointer in the UCSDUE data structure - state.dataRoomAirMod->ZoneUCSDUE(state.dataRoomAirMod->ZoneUFPtr(iZone)).ZoneEquipPtr = iZone; + state.dataRoomAirMod->ZoneUFADExt(state.dataRoomAirMod->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; } } - if (any(state.dataRoomAirMod->IsZoneCV)) { - state.dataRoomAirMod->CVHcIn.allocate(state.dataSurface->TotSurfaces); + if (any(state.dataRoomAirMod->IsZoneCrossVent)) { + state.dataRoomAirMod->CrossVentHcIn.allocate(state.dataSurface->TotSurfaces); state.dataRoomAirMod->ZTJET.allocate(state.dataGlobal->NumOfZones); // Most ZTJet takes defaults state.dataRoomAirMod->ZTREC.allocate(state.dataGlobal->NumOfZones); @@ -2490,14 +2490,14 @@ namespace RoomAir { state.dataRoomAirMod->Tin.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->Droom.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->Dstar.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneCVisMixing.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneCrossVentIsMixing.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->Rfr.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneCVhasREC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneCrossVentHasREC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->ZTJET = 23.0; state.dataRoomAirMod->RoomOutflowTemp = 23.0; state.dataRoomAirMod->ZTREC = 23.0; - state.dataRoomAirMod->CVHcIn = 0.0; + state.dataRoomAirMod->CrossVentHcIn = 0.0; state.dataRoomAirMod->JetRecAreaRatio = 0.2; state.dataRoomAirMod->Urec = 0.2; state.dataRoomAirMod->Ujet = 0.2; @@ -2506,9 +2506,9 @@ namespace RoomAir { state.dataRoomAirMod->Ain = 1.0; state.dataRoomAirMod->Tin = 23.0; state.dataRoomAirMod->Droom = 6.0; - state.dataRoomAirMod->ZoneCVisMixing = 0.0; + state.dataRoomAirMod->ZoneCrossVentIsMixing = 0.0; state.dataRoomAirMod->Rfr = 10.0; - state.dataRoomAirMod->ZoneCVhasREC = 1.0; + state.dataRoomAirMod->ZoneCrossVentHasREC = 1.0; state.dataUCSDShared->HCeiling = 0.0; state.dataUCSDShared->HWall = 0.0; state.dataUCSDShared->HFloor = 0.0; @@ -2517,7 +2517,7 @@ namespace RoomAir { state.dataUCSDShared->HDoor = 0.0; for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UCSDCV) + if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::CrossVent) continue; // don't set these up if they don't make sense ZoneEquipConfigNum = ZoneNum; // Where does this ZoneNum come from? @@ -2525,7 +2525,7 @@ namespace RoomAir { auto const &zone = state.dataHeatBal->Zone(iZone); // check whether this zone is a controlled zone or not if (state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).IsControlled) { - state.dataRoomAirMod->IsZoneCV(iZone) = false; + state.dataRoomAirMod->IsZoneCrossVent(iZone) = false; state.dataRoomAirMod->AirModel(iZone).SimAirModel = false; ShowSevereError(state, format("Unmixed Flow: Cross Ventilation cannot be applied for Zone={}", zone.Name)); @@ -2586,25 +2586,25 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Is Mixing Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneCVisMixing(iZone), + state.dataRoomAirMod->ZoneCrossVentIsMixing(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Is Recirculating Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneCVhasREC(iZone), + state.dataRoomAirMod->ZoneCrossVentHasREC(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::State, zone.Name); - for (int i = 1; i <= state.dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, ZoneNum); ++i) { + for (int i = 1; i <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++i) { int N = state.afn->AirflowNetworkLinkageData(i).CompNum; if (state.afn->AirflowNetworkCompData(N).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) { SetupOutputVariable( state, "Room Air Window Jet Region Average Air Velocity", OutputProcessor::Unit::m_s, - state.dataRoomAirMod->CVJetRecFlows(i, iZone).Ujet, + state.dataRoomAirMod->CrossVentJetRecFlows(i, iZone).Ujet, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, state.afn->MultizoneSurfaceData(i).SurfName); @@ -2621,7 +2621,7 @@ namespace RoomAir { // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirModelMgr->MyEnvrnFlag(ZoneNum)) { - if (state.dataRoomAirMod->IsZoneDV(ZoneNum) || state.dataRoomAirMod->IsZoneUI(ZoneNum)) { + if (state.dataRoomAirMod->IsZoneDispVent3Node(ZoneNum) || state.dataRoomAirMod->IsZoneUI(ZoneNum)) { state.dataRoomAirMod->MaxTempGrad(ZoneNum) = 0.0; state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; @@ -2689,28 +2689,28 @@ namespace RoomAir { state.dataUCSDShared->HDoor = 0.0; } - if (state.dataRoomAirMod->IsZoneDV(ZoneNum)) { + if (state.dataRoomAirMod->IsZoneDispVent3Node(ZoneNum)) { - state.dataRoomAirMod->DVHcIn = 0.0; - state.dataRoomAirMod->ZoneDVMixedFlagRep(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneDVMixedFlag(ZoneNum) = 0; + state.dataRoomAirMod->DispVent3NodeHcIn = 0.0; + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; } if (state.dataRoomAirMod->IsZoneUI(ZoneNum)) { - state.dataRoomAirMod->UFHcIn = 0.0; - state.dataRoomAirMod->ZoneUFMixedFlag(ZoneNum) = 0; - state.dataRoomAirMod->ZoneUFMixedFlagRep(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFGamma(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFPowInPlumes(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows(ZoneNum) = 0.0; + state.dataRoomAirMod->UFADHcIn = 0.0; + state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 0; + state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows(ZoneNum) = 0.0; } - if (state.dataRoomAirMod->IsZoneCV(ZoneNum)) { + if (state.dataRoomAirMod->IsZoneCrossVent(ZoneNum)) { state.dataRoomAirMod->ZTJET(ZoneNum) = 23.0; state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = 23.0; state.dataRoomAirMod->ZTREC(ZoneNum) = 23.0; - state.dataRoomAirMod->CVHcIn = 0.0; + state.dataRoomAirMod->CrossVentHcIn = 0.0; state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) = 0.2; state.dataRoomAirMod->Urec(ZoneNum) = 0.2; state.dataRoomAirMod->Ujet(ZoneNum) = 0.2; @@ -2719,9 +2719,9 @@ namespace RoomAir { state.dataRoomAirMod->Tin(ZoneNum) = 23.0; state.dataRoomAirMod->Droom(ZoneNum) = 6.0; state.dataRoomAirMod->Dstar(ZoneNum) = 6.0; - state.dataRoomAirMod->ZoneCVisMixing(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 0.0; state.dataRoomAirMod->Rfr(ZoneNum) = 10.0; - state.dataRoomAirMod->ZoneCVhasREC(ZoneNum) = 1.0; + state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 1.0; state.dataUCSDShared->HCeiling = 0.0; state.dataUCSDShared->HWall = 0.0; state.dataUCSDShared->HFloor = 0.0; @@ -2764,10 +2764,9 @@ namespace RoomAir { Errorfound = false; RAFNNodeNum = 0; for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { - if (state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(I).NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList(RAFNNodeName, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(I).Node, - state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(I).NumOfAirNodes); + auto const &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(I); + if (afnZoneInfo.NumOfAirNodes > 0) { + RAFNNodeNum = UtilityRoutines::FindItemInList(RAFNNodeName, afnZoneInfo.Node, afnZoneInfo.NumOfAirNodes); if (RAFNNodeNum > 0) { ZoneNum = I; break; diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index e21958a5595..3ac96986554 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -233,7 +233,7 @@ void CalcTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number CurntPatternKey = GetCurrentScheduleValue(state, state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).PatternSchedID); - CurPatrnID = FindNumberInList(CurntPatternKey, state.dataRoomAirMod->RoomAirPattern, &TemperaturePattern::PatrnID); + CurPatrnID = FindNumberInList(CurntPatternKey, state.dataRoomAirMod->AirPattern, &TemperaturePattern::PatrnID); if (CurPatrnID == 0) { // throw error here ? way to test schedules before getting to this point? @@ -241,7 +241,7 @@ void CalcTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number return; } - switch (state.dataRoomAirMod->RoomAirPattern(CurPatrnID).PatternMode) { + switch (state.dataRoomAirMod->AirPattern(CurPatrnID).PatternMode) { case UserDefinedPatternType::ConstGradTemp: { FigureConstGradPattern(state, CurPatrnID, ZoneNum); } break; @@ -282,29 +282,23 @@ void FigureSurfMapPattern(EnergyPlusData &state, int const PattrnID, int const Z // Using/Aliasing using General::FindNumberInList; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 Tmean; - int found; - int i; - - Tmean = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean; + auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); + auto &pattern = state.dataRoomAirMod->AirPattern(PattrnID); + Real64 Tmean = patternZoneInfo.TairMean; - for (i = 1; i <= state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).totNumSurfs; ++i) { + for (int i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { // cycle through zone surfaces and look for match - found = FindNumberInList(state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).SurfID, - state.dataRoomAirMod->RoomAirPattern(PattrnID).MapPatrn.SurfID, - state.dataRoomAirMod->RoomAirPattern(PattrnID).MapPatrn.NumSurfs); + int found = FindNumberInList(patternZoneInfo.Surf(i).SurfID, pattern.MapPatrn.SurfID, pattern.MapPatrn.NumSurfs); if (found != 0) { // if surf is in map then assign, else give it MAT - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).TadjacentAir = - state.dataRoomAirMod->RoomAirPattern(PattrnID).MapPatrn.DeltaTai(found) + Tmean; + patternZoneInfo.Surf(i).TadjacentAir = pattern.MapPatrn.DeltaTai(found) + Tmean; } else { - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).TadjacentAir = Tmean; + patternZoneInfo.Surf(i).TadjacentAir = Tmean; } } - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tstat = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTstat + Tmean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTleaving + Tmean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Texhaust = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTexhaust + Tmean; + patternZoneInfo.Tstat = pattern.DeltaTstat + Tmean; + patternZoneInfo.Tleaving = pattern.DeltaTleaving + Tmean; + patternZoneInfo.Texhaust = pattern.DeltaTexhaust + Tmean; } void FigureHeightPattern(EnergyPlusData &state, int const PattrnID, int const ZoneNum) @@ -326,50 +320,48 @@ void FigureHeightPattern(EnergyPlusData &state, int const PattrnID, int const Zo using FluidProperties::FindArrayIndex; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 Tmean; int lowSideID; int highSideID; Real64 thisZeta; - int i; Real64 lowSideZeta; Real64 hiSideZeta; Real64 fractBtwn; - Real64 tmpDeltaTai; - tmpDeltaTai = 0.0; - Tmean = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean; + auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); + auto &pattern = state.dataRoomAirMod->AirPattern(PattrnID); + Real64 tmpDeltaTai = 0.0; + Real64 Tmean = patternZoneInfo.TairMean; - for (i = 1; i <= state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).totNumSurfs; ++i) { + for (int i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { - thisZeta = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).Zeta; - lowSideID = FindArrayIndex(thisZeta, state.dataRoomAirMod->RoomAirPattern(PattrnID).VertPatrn.ZetaPatrn); + thisZeta = patternZoneInfo.Surf(i).Zeta; + lowSideID = FindArrayIndex(thisZeta, pattern.VertPatrn.ZetaPatrn); highSideID = lowSideID + 1; if (lowSideID == 0) lowSideID = 1; // protect against array bounds - lowSideZeta = state.dataRoomAirMod->RoomAirPattern(PattrnID).VertPatrn.ZetaPatrn(lowSideID); - if (highSideID <= isize(state.dataRoomAirMod->RoomAirPattern(PattrnID).VertPatrn.ZetaPatrn)) { - hiSideZeta = state.dataRoomAirMod->RoomAirPattern(PattrnID).VertPatrn.ZetaPatrn(highSideID); + lowSideZeta = pattern.VertPatrn.ZetaPatrn(lowSideID); + if (highSideID <= isize(pattern.VertPatrn.ZetaPatrn)) { + hiSideZeta = pattern.VertPatrn.ZetaPatrn(highSideID); } else { // trap array bounds hiSideZeta = lowSideZeta; } if ((hiSideZeta - lowSideZeta) != 0.0) { fractBtwn = (thisZeta - lowSideZeta) / (hiSideZeta - lowSideZeta); - tmpDeltaTai = state.dataRoomAirMod->RoomAirPattern(PattrnID).VertPatrn.DeltaTaiPatrn(lowSideID) + - fractBtwn * (state.dataRoomAirMod->RoomAirPattern(PattrnID).VertPatrn.DeltaTaiPatrn(highSideID) - - state.dataRoomAirMod->RoomAirPattern(PattrnID).VertPatrn.DeltaTaiPatrn(lowSideID)); + tmpDeltaTai = pattern.VertPatrn.DeltaTaiPatrn(lowSideID) + + fractBtwn * (pattern.VertPatrn.DeltaTaiPatrn(highSideID) - pattern.VertPatrn.DeltaTaiPatrn(lowSideID)); } else { // would divide by zero, using low side value - tmpDeltaTai = state.dataRoomAirMod->RoomAirPattern(PattrnID).VertPatrn.DeltaTaiPatrn(lowSideID); + tmpDeltaTai = pattern.VertPatrn.DeltaTaiPatrn(lowSideID); } - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).TadjacentAir = tmpDeltaTai + Tmean; + patternZoneInfo.Surf(i).TadjacentAir = tmpDeltaTai + Tmean; } // surfaces in this zone - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tstat = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTstat + Tmean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTleaving + Tmean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Texhaust = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTexhaust + Tmean; + patternZoneInfo.Tstat = pattern.DeltaTstat + Tmean; + patternZoneInfo.Tleaving = pattern.DeltaTleaving + Tmean; + patternZoneInfo.Texhaust = pattern.DeltaTexhaust + Tmean; } void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int const ZoneNum) @@ -403,6 +395,9 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c Real64 DeltaHeight; // height difference in m Real64 tempDeltaTai; // temporary temperature difference + auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); + auto &pattern = state.dataRoomAirMod->AirPattern(PattrnID); + if (state.dataRoomAirModelTempPattern->MyOneTimeFlag2) { state.dataRoomAirModelTempPattern->SetupOutputFlag.dimension(state.dataGlobal->NumOfZones, true); // init state.dataRoomAirModelTempPattern->MyOneTimeFlag2 = false; @@ -412,115 +407,92 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c SetupOutputVariable(state, "Room Air Zone Vertical Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Gradient, + patternZoneInfo.Gradient, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneName); + patternZoneInfo.ZoneName); state.dataRoomAirModelTempPattern->SetupOutputFlag(ZoneNum) = false; } - Tmean = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean; + Tmean = patternZoneInfo.TairMean; + auto const &twoGrad = pattern.TwoGradPatrn; // determine gradient depending on mode - switch (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.InterpolationMode) { + switch (pattern.TwoGradPatrn.InterpolationMode) { case UserDefinedPatternMode::OutdoorDryBulb: { Grad = OutdoorDryBulbGrad(state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp, - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale, - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient, - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale, - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient); + twoGrad.UpperBoundTempScale, twoGrad.HiGradient, twoGrad.LowerBoundTempScale, twoGrad.LowGradient); } break; case UserDefinedPatternMode::ZoneAirTemp: { - if (Tmean >= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient; - - } else if (Tmean <= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale) { - - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient; - } else { // interpolate - if ((state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale) == 0.0) { - // bad user input, trapped during get input - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient; - } else { - - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient + - ((Tmean - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale) / - (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale)) * - (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient); - } + if (Tmean >= twoGrad.UpperBoundTempScale) { + Grad = twoGrad.HiGradient; + + } else if (Tmean <= twoGrad.LowerBoundTempScale) { + Grad = twoGrad.LowGradient; + } else if ((twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale) == 0.0) { + // bad user input, trapped during get input + Grad = twoGrad.LowGradient; + } else { + Grad = twoGrad.LowGradient + + ((Tmean - twoGrad.LowerBoundTempScale) / (twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } break; case UserDefinedPatternMode::DeltaOutdoorZone: { DeltaT = state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp - Tmean; - if (DeltaT >= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient; + if (DeltaT >= twoGrad.UpperBoundTempScale) { + Grad = twoGrad.HiGradient; - } else if (DeltaT <= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale) { + } else if (DeltaT <= twoGrad.LowerBoundTempScale) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient; + Grad = twoGrad.LowGradient; } else { // interpolate - if ((state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale) == 0.0) { + if ((twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale) == 0.0) { // bad user input, trapped during get input - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient; + Grad = twoGrad.LowGradient; } else { - - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient + - ((DeltaT - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale) / - (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundTempScale)) * - (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient); + Grad = twoGrad.LowGradient + + ((DeltaT - twoGrad.LowerBoundTempScale) / (twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } } break; case UserDefinedPatternMode::SensibleCooling: { CoolLoad = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadCoolRate; - if (CoolLoad >= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundHeatRateScale) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient; + if (CoolLoad >= twoGrad.UpperBoundHeatRateScale) { + Grad = twoGrad.HiGradient; - } else if (CoolLoad <= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundHeatRateScale) { + } else if (CoolLoad <= twoGrad.LowerBoundHeatRateScale) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient; + Grad = twoGrad.LowGradient; } else { // interpolate - if ((state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundHeatRateScale - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundHeatRateScale) == 0.0) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient; + if ((twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale) == 0.0) { + Grad = twoGrad.LowGradient; } else { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient + - ((CoolLoad - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundHeatRateScale) / - (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundHeatRateScale - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundHeatRateScale)) * - (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient); + Grad = twoGrad.LowGradient + + ((CoolLoad - twoGrad.LowerBoundHeatRateScale) / (twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } } break; case UserDefinedPatternMode::SensibleHeating: { HeatLoad = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadHeatRate; - if (HeatLoad >= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundHeatRateScale) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient; + if (HeatLoad >= twoGrad.UpperBoundHeatRateScale) { + Grad = twoGrad.HiGradient; - } else if (HeatLoad <= state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundHeatRateScale) { + } else if (HeatLoad <= twoGrad.LowerBoundHeatRateScale) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient; + Grad = twoGrad.LowGradient; } else { // interpolate - if ((state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundHeatRateScale - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundHeatRateScale) == 0.0) { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient; + if ((twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale) == 0.0) { + Grad = twoGrad.LowGradient; } else { - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient + - ((HeatLoad - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundHeatRateScale) / - (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundHeatRateScale - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowerBoundHeatRateScale)) * - (state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient); + Grad = twoGrad.LowGradient + + ((HeatLoad - twoGrad.LowerBoundHeatRateScale) / (twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } } break; @@ -530,34 +502,22 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c ZetaTmean = 0.5; // by definition, - for (i = 1; i <= state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).totNumSurfs; ++i) { - thisZeta = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).Zeta; + for (i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { + thisZeta = patternZoneInfo.Surf(i).Zeta; - DeltaHeight = -1.0 * (ZetaTmean - thisZeta) * state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneHeight; + DeltaHeight = -1.0 * (ZetaTmean - thisZeta) * patternZoneInfo.ZoneHeight; tempDeltaTai = DeltaHeight * Grad; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).TadjacentAir = tempDeltaTai + Tmean; + patternZoneInfo.Surf(i).TadjacentAir = tempDeltaTai + Tmean; } - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tstat = -1.0 * - (0.5 * state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneHeight - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.TstatHeight) * - Grad + - Tmean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving = -1.0 * - (0.5 * state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneHeight - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.TleavingHeight) * - Grad + - Tmean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Texhaust = -1.0 * - (0.5 * state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneHeight - - state.dataRoomAirMod->RoomAirPattern(PattrnID).TwoGradPatrn.TexhaustHeight) * - Grad + - Tmean; - - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Gradient = Grad; + patternZoneInfo.Tstat = -1.0 * (0.5 * patternZoneInfo.ZoneHeight - twoGrad.TstatHeight) * Grad + Tmean; + patternZoneInfo.Tleaving = -1.0 * (0.5 * patternZoneInfo.ZoneHeight - twoGrad.TleavingHeight) * Grad + Tmean; + patternZoneInfo.Texhaust = -1.0 * (0.5 * patternZoneInfo.ZoneHeight - twoGrad.TexhaustHeight) * Grad + Tmean; + patternZoneInfo.Gradient = Grad; } + Real64 OutdoorDryBulbGrad(Real64 DryBulbTemp, // Zone(ZoneNum).OutDryBulbTemp Real64 UpperBound, // RoomAirPattern(PattrnID).TwoGradPatrn.UpperBoundTempScale Real64 HiGradient, // RoomAirPattern(PattrnID).TwoGradPatrn.HiGradient @@ -602,21 +562,23 @@ void FigureConstGradPattern(EnergyPlusData &state, int const PattrnID, int const Real64 DeltaHeight; // temporary height difference Real64 tempDeltaTai; // temporary Delta Tai - Tmean = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean; - Grad = state.dataRoomAirMod->RoomAirPattern(PattrnID).GradPatrn.Gradient; + auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); + auto &pattern = state.dataRoomAirMod->AirPattern(PattrnID); + Tmean = patternZoneInfo.TairMean; + Grad = pattern.GradPatrn.Gradient; ZetaTmean = 0.5; // by definition, - for (i = 1; i <= state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).totNumSurfs; ++i) { - thisZeta = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).Zeta; - DeltaHeight = -1.0 * (ZetaTmean - thisZeta) * state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneHeight; + for (i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { + thisZeta = patternZoneInfo.Surf(i).Zeta; + DeltaHeight = -1.0 * (ZetaTmean - thisZeta) * patternZoneInfo.ZoneHeight; tempDeltaTai = DeltaHeight * Grad; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(i).TadjacentAir = tempDeltaTai + Tmean; + patternZoneInfo.Surf(i).TadjacentAir = tempDeltaTai + Tmean; } - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tstat = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTstat + Tmean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTleaving + Tmean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Texhaust = state.dataRoomAirMod->RoomAirPattern(PattrnID).DeltaTexhaust + Tmean; + patternZoneInfo.Tstat = pattern.DeltaTstat + Tmean; + patternZoneInfo.Tleaving = pattern.DeltaTleaving + Tmean; + patternZoneInfo.Texhaust = pattern.DeltaTexhaust + Tmean; } //***************************************************************************************** @@ -796,17 +758,19 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // // Need to revisit how to best implement this. Ended up taking code from CalcZoneLeavingConditions // ZoneNum is already equal to ActualZoneNum , changed block of source - if (state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneNodeID != 0) { + auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); + + if (patternZoneInfo.ZoneNodeID != 0) { // the zone system node should get the conditions leaving the zone (but before return air heat gains are added). - state.dataLoopNodes->Node(state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneNodeID).Temp = - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving; + state.dataLoopNodes->Node(patternZoneInfo.ZoneNodeID).Temp = + patternZoneInfo.Tleaving; } auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); for (int nodeCount = 1; nodeCount <= state.dataZoneEquip->ZoneEquipConfig(ZoneNum).NumReturnNodes; ++nodeCount) { // BEGIN BLOCK of code from CalcZoneLeavingConditions********************************* int ReturnNode = state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ReturnNode(nodeCount); - ZoneNode = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ZoneNodeID; + ZoneNode = patternZoneInfo.ZoneNodeID; ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; // RETURN AIR HEAT GAIN from the Lights statement; this heat gain is stored in // Add sensible heat gain from refrigerated cases with under case returns @@ -820,7 +784,7 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // // Correct step through the SysDepZoneLoads variable. MassFlowRA = state.dataLoopNodes->Node(ReturnNode).MassFlowRate / ZoneMult; - TempZoneAir = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving; // key difference from + TempZoneAir = patternZoneInfo.Tleaving; // key difference from TempRetAir = TempZoneAir; WinGapFlowToRA = 0.0; WinGapTtoRA = 0.0; @@ -921,8 +885,8 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // } // set exhaust node leaving temp if present - if (allocated(state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).ExhaustAirNodeID)) { - auto const &APZoneInfo(state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum)); + if (allocated(patternZoneInfo.ExhaustAirNodeID)) { + auto const &APZoneInfo(patternZoneInfo); auto const &EANodeID(APZoneInfo.ExhaustAirNodeID); Real64 const Texhaust(APZoneInfo.Texhaust); for (int i = 1, ie = EANodeID.u(); i <= ie; ++i) { @@ -931,7 +895,7 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // } // set thermostat reading for air system . - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tstat; + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = patternZoneInfo.Tstat; // set results for all surface for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { @@ -939,7 +903,7 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // int j = 0; for (int i = thisSpace.HTSurfaceFirst; i <= thisSpace.HTSurfaceLast; ++i) { ++j; - state.dataHeatBal->SurfTempEffBulkAir(i) = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(j).TadjacentAir; + state.dataHeatBal->SurfTempEffBulkAir(i) = patternZoneInfo.Surf(j).TadjacentAir; } } diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index c0299e0aa42..c1c3452bfc8 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -538,14 +538,14 @@ namespace ThermalComfort { } if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { state.dataThermalComforts->ZoneNum = state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).ZonePtr; - if (state.dataRoomAirMod->IsZoneDV(state.dataThermalComforts->ZoneNum) || + if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 // UCSD-CV - } else if (state.dataRoomAirMod->IsZoneCV(state.dataThermalComforts->ZoneNum)) { - if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { + } else if (state.dataRoomAirMod->IsZoneCrossVent(state.dataThermalComforts->ZoneNum)) { + if (state.dataRoomAirMod->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->ZTJET(state.dataThermalComforts->ZoneNum); - } else if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { + } else if (state.dataRoomAirMod->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->ZTJET(state.dataThermalComforts->ZoneNum); } } @@ -617,10 +617,10 @@ namespace ThermalComfort { state, format("PEOPLE=\"{}\", Incorrect Clothing Type", state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).Name)); } - if (state.dataRoomAirMod->anyNonMixingRoomAirModel && state.dataRoomAirMod->IsZoneCV(state.dataThermalComforts->ZoneNum)) { - if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { + if (state.dataRoomAirMod->anyNonMixingRoomAirModel && state.dataRoomAirMod->IsZoneCrossVent(state.dataThermalComforts->ZoneNum)) { + if (state.dataRoomAirMod->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { state.dataThermalComforts->AirVel = state.dataRoomAirMod->Ujet(state.dataThermalComforts->ZoneNum); - } else if (state.dataRoomAirMod->ZoneUCSDCV(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { + } else if (state.dataRoomAirMod->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { state.dataThermalComforts->AirVel = state.dataRoomAirMod->Urec(state.dataThermalComforts->ZoneNum); } else { state.dataThermalComforts->AirVel = 0.2; @@ -827,7 +827,7 @@ namespace ThermalComfort { // (var TA) state.dataThermalComforts->AirTemp = thisZoneHB.ZTAVComf; if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDV(state.dataThermalComforts->ZoneNum) || + if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 } @@ -1475,7 +1475,7 @@ namespace ThermalComfort { state.dataThermalComforts->AirTemp = thisZoneHB.ZTAVComf; if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDV(state.dataThermalComforts->ZoneNum) || + if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 } @@ -2318,7 +2318,7 @@ namespace ThermalComfort { state.dataThermalComforts->ZoneOccHrs(iZone) += state.dataGlobal->TimeStepZone; CurAirTemp = thisZoneHB.ZTAVComf; if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDV(iZone) || state.dataRoomAirMod->IsZoneUI(iZone)) { + if (state.dataRoomAirMod->IsZoneDispVent3Node(iZone) || state.dataRoomAirMod->IsZoneUI(iZone)) { CurAirTemp = state.dataRoomAirMod->TCMF(iZone); } } @@ -2876,7 +2876,7 @@ namespace ThermalComfort { state.dataThermalComforts->ZoneNum = state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).ZonePtr; state.dataThermalComforts->AirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataThermalComforts->ZoneNum).ZTAVComf; if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDV(state.dataThermalComforts->ZoneNum) || + if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); } @@ -3087,7 +3087,7 @@ namespace ThermalComfort { state.dataThermalComforts->ZoneNum = state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).ZonePtr; state.dataThermalComforts->AirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataThermalComforts->ZoneNum).ZTAVComf; if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDV(state.dataThermalComforts->ZoneNum) || + if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); } diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 0ec74f66e7d..019718633e3 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -141,12 +141,12 @@ void ManageUCSDUFModels(EnergyPlusData &state, InitUCSDUF(state, ZoneNum, ZoneModelType); // initialize some module variables switch (ZoneModelType) { - case RoomAirModel::UCSDUFI: { // UCSD UFAD interior zone model + case RoomAirModel::UFADInt: { // UCSD UFAD interior zone model // simulate room airflow using the UCSDUFI model CalcUCSDUI(state, ZoneNum); } break; - case RoomAirModel::UCSDUFE: { // UCSD UFAD interior zone model - // simulate room airflow using the UCSDUFI model + case RoomAirModel::UFADExt: { // UCSD UFAD exterior zone model + // simulate room airflow using the UCSDUFE model CalcUCSDUE(state, ZoneNum); } break; default: @@ -192,31 +192,33 @@ void InitUCSDUF(EnergyPlusData &state, // initialize these variables every timestep state.dataUFADManager->HeightIntMass = state.dataUFADManager->HeightIntMassDefault; - state.dataRoomAirMod->ZoneUFGamma(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; NumShadesDown = 0.0; for (int Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Window(Ctd); if (SurfNum == 0) continue; - if (state.dataSurface->Surface(SurfNum).ExtBoundCond == ExternalEnvironment || - state.dataSurface->Surface(SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt || - state.dataSurface->Surface(SurfNum).ExtBoundCond == OtherSideCoefCalcExt || - state.dataSurface->Surface(SurfNum).ExtBoundCond == OtherSideCondModeledExt) { + auto &surf = state.dataSurface->Surface(SurfNum); + if (surf.ExtBoundCond == ExternalEnvironment || + surf.ExtBoundCond == OtherSideCoefNoCalcExt || + surf.ExtBoundCond == OtherSideCoefCalcExt || + surf.ExtBoundCond == OtherSideCondModeledExt) { if (ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { ++NumShadesDown; } } } - if (ZoneModelType == RoomAirModel::UCSDUFE) { - UINum = state.dataRoomAirMod->ZoneUFPtr(ZoneNum); - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).NumExtWin > 1.0) { - if (NumShadesDown / state.dataRoomAirMod->ZoneUCSDUE(UINum).NumExtWin >= 0.5) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).ShadeDown = true; + if (ZoneModelType == RoomAirModel::UFADExt) { + UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); + auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(UINum); + if (zoneUE.NumExtWin > 1.0) { + if (NumShadesDown / zoneUE.NumExtWin >= 0.5) { + zoneUE.ShadeDown = true; } else { - state.dataRoomAirMod->ZoneUCSDUE(UINum).ShadeDown = false; + zoneUE.ShadeDown = false; } } else { - state.dataRoomAirMod->ZoneUCSDUE(UINum).ShadeDown = false; + zoneUE.ShadeDown = false; } } } @@ -250,138 +252,140 @@ void SizeUCSDUF(EnergyPlusData &state, Real64 ZoneHWEqConv(0.0); // zone hot water equip design convective gain [W] Real64 ZoneSteamEqConv(0.0); // zone steam equip design convective gain [W] - if (ZoneModelType == RoomAirModel::UCSDUFI) { - UINum = state.dataRoomAirMod->ZoneUFPtr(ZoneNum); + if (ZoneModelType == RoomAirModel::UFADInt) { + UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); NumberOfOccupants = 0.0; for (int Ctd = 1; Ctd <= state.dataHeatBal->TotPeople; ++Ctd) { if (state.dataHeatBal->People(Ctd).ZonePtr == ZoneNum) { NumberOfOccupants += state.dataHeatBal->People(Ctd).NumberOfPeople; } } - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffArea == AutoSize) { - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::Swirl) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffArea = 0.0075; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::VarArea) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffArea = 0.035; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::DisplVent) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffArea = 0.0060; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::LinBarGrille) { + + auto &zoneUI = state.dataRoomAirMod->ZoneUFADInt(UINum); + if (zoneUI.DiffArea == AutoSize) { + if (zoneUI.DiffuserType == Diffuser::Swirl) { + zoneUI.DiffArea = 0.0075; + } else if (zoneUI.DiffuserType == Diffuser::VarArea) { + zoneUI.DiffArea = 0.035; + } else if (zoneUI.DiffuserType == Diffuser::DisplVent) { + zoneUI.DiffArea = 0.0060; + } else if (zoneUI.DiffuserType == Diffuser::LinBarGrille) { // 4 ft x 4 inches; 75 cfm per linear foot; area is .025 m2/m - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffArea = 0.03; + zoneUI.DiffArea = 0.03; } else { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffArea = 0.0075; + zoneUI.DiffArea = 0.0075; } BaseSizer::reportSizerOutput(state, "RoomAirSettings:UnderFloorAirDistributionInterior", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName, + zoneUI.ZoneName, "Design effective area of diffuser", - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffArea); + zoneUI.DiffArea); } - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffAngle == AutoSize) { - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::Swirl) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffAngle = 28.0; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::VarArea) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffAngle = 45.0; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::DisplVent) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffAngle = 73.0; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::LinBarGrille) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffAngle = 15.0; + if (zoneUI.DiffAngle == AutoSize) { + if (zoneUI.DiffuserType == Diffuser::Swirl) { + zoneUI.DiffAngle = 28.0; + } else if (zoneUI.DiffuserType == Diffuser::VarArea) { + zoneUI.DiffAngle = 45.0; + } else if (zoneUI.DiffuserType == Diffuser::DisplVent) { + zoneUI.DiffAngle = 73.0; + } else if (zoneUI.DiffuserType == Diffuser::LinBarGrille) { + zoneUI.DiffAngle = 15.0; } else { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffAngle = 28.0; + zoneUI.DiffAngle = 28.0; } BaseSizer::reportSizerOutput(state, "RoomAirSettings:UnderFloorAirDistributionInterior", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName, + zoneUI.ZoneName, "Angle between diffuser slots and the vertical", - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffAngle); + zoneUI.DiffAngle); } - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).TransHeight == AutoSize) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).CalcTransHeight = true; - state.dataRoomAirMod->ZoneUCSDUI(UINum).TransHeight = 0.0; + if (zoneUI.TransHeight == AutoSize) { + zoneUI.CalcTransHeight = true; + zoneUI.TransHeight = 0.0; } else { - state.dataRoomAirMod->ZoneUCSDUI(UINum).CalcTransHeight = false; + zoneUI.CalcTransHeight = false; } - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::Swirl) { - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc != Constant::AutoCalculate) { + if (zoneUI.DiffuserType == Diffuser::Swirl) { + if (zoneUI.A_Kc != Constant::AutoCalculate || + zoneUI.B_Kc != Constant::AutoCalculate || + zoneUI.C_Kc != Constant::AutoCalculate || + zoneUI.D_Kc != Constant::AutoCalculate || + zoneUI.E_Kc != Constant::AutoCalculate) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " "ignored when Floor Diffuser Type = Swirl.", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName)); + zoneUI.ZoneName)); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } - state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc = 0.6531; - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc = 0.0069; - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc = -0.00004; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::VarArea) { - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc != Constant::AutoCalculate) { + zoneUI.A_Kc = 0.0; + zoneUI.B_Kc = 0.0; + zoneUI.C_Kc = 0.6531; + zoneUI.D_Kc = 0.0069; + zoneUI.E_Kc = -0.00004; + } else if (zoneUI.DiffuserType == Diffuser::VarArea) { + if (zoneUI.A_Kc != Constant::AutoCalculate || + zoneUI.B_Kc != Constant::AutoCalculate || + zoneUI.C_Kc != Constant::AutoCalculate || + zoneUI.D_Kc != Constant::AutoCalculate || + zoneUI.E_Kc != Constant::AutoCalculate) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " "ignored when Floor Diffuser Type = VariableArea.", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName)); + zoneUI.ZoneName)); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } - state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc = 0.88; - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc = 0.0; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::DisplVent) { - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc != Constant::AutoCalculate) { + zoneUI.A_Kc = 0.0; + zoneUI.B_Kc = 0.0; + zoneUI.C_Kc = 0.88; + zoneUI.D_Kc = 0.0; + zoneUI.E_Kc = 0.0; + } else if (zoneUI.DiffuserType == Diffuser::DisplVent) { + if (zoneUI.A_Kc != Constant::AutoCalculate || + zoneUI.B_Kc != Constant::AutoCalculate || + zoneUI.C_Kc != Constant::AutoCalculate || + zoneUI.D_Kc != Constant::AutoCalculate || + zoneUI.E_Kc != Constant::AutoCalculate) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " "ignored when Floor Diffuser Type = HorizontalDisplacement.", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName)); + zoneUI.ZoneName)); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } - state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc = 0.67; - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc = 0.0; - } else if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::LinBarGrille) { - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc != Constant::AutoCalculate) { + zoneUI.A_Kc = 0.0; + zoneUI.B_Kc = 0.0; + zoneUI.C_Kc = 0.67; + zoneUI.D_Kc = 0.0; + zoneUI.E_Kc = 0.0; + } else if (zoneUI.DiffuserType == Diffuser::LinBarGrille) { + if (zoneUI.A_Kc != Constant::AutoCalculate || + zoneUI.B_Kc != Constant::AutoCalculate || + zoneUI.C_Kc != Constant::AutoCalculate || + zoneUI.D_Kc != Constant::AutoCalculate || + zoneUI.E_Kc != Constant::AutoCalculate) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " "ignored when Floor Diffuser Type = LinearBarGrille.", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName)); + zoneUI.ZoneName)); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } - state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc = 0.8; - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc = 0.0; + zoneUI.A_Kc = 0.0; + zoneUI.B_Kc = 0.0; + zoneUI.C_Kc = 0.8; + zoneUI.D_Kc = 0.0; + zoneUI.E_Kc = 0.0; } else { - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc == Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc == Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc == Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc == Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc == Constant::AutoCalculate) { + if (zoneUI.A_Kc == Constant::AutoCalculate || + zoneUI.B_Kc == Constant::AutoCalculate || + zoneUI.C_Kc == Constant::AutoCalculate || + zoneUI.D_Kc == Constant::AutoCalculate || + zoneUI.E_Kc == Constant::AutoCalculate) { ShowFatalError(state, format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E must be " "specified when Floor Diffuser Type = Custom.", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName)); + zoneUI.ZoneName)); } } - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).PowerPerPlume == Constant::AutoCalculate) { + if (zoneUI.PowerPerPlume == Constant::AutoCalculate) { NumberOfPlumes = 0.0; if (NumberOfOccupants > 0.0) { NumberOfPlumes = NumberOfOccupants; @@ -418,47 +422,49 @@ void SizeUCSDUF(EnergyPlusData &state, ZoneSteamEqConv += state.dataHeatBal->ZoneSteamEq(Ctd).DesignLevel * state.dataHeatBal->ZoneSteamEq(Ctd).FractionConvected; } } - state.dataRoomAirMod->ZoneUCSDUI(UINum).PowerPerPlume = + zoneUI.PowerPerPlume = (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; BaseSizer::reportSizerOutput(state, "RoomAirSettings:UnderFloorAirDistributionInterior", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName, + zoneUI.ZoneName, "Power per plume [W]", - state.dataRoomAirMod->ZoneUCSDUI(UINum).PowerPerPlume); + zoneUI.PowerPerPlume); } - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffusersPerZone == AutoSize) { + if (zoneUI.DiffusersPerZone == AutoSize) { if (NumberOfOccupants > 0.0) { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffusersPerZone = NumberOfOccupants; + zoneUI.DiffusersPerZone = NumberOfOccupants; } else { - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffusersPerZone = 1.0; + zoneUI.DiffusersPerZone = 1.0; } BaseSizer::reportSizerOutput(state, "RoomAirSettings:UnderFloorAirDistributionInterior", - state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneName, + zoneUI.ZoneName, "Number of diffusers per zone", - state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffusersPerZone); + zoneUI.DiffusersPerZone); } } - if (ZoneModelType == RoomAirModel::UCSDUFE) { - UINum = state.dataRoomAirMod->ZoneUFPtr(ZoneNum); + if (ZoneModelType == RoomAirModel::UFADExt) { + UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); + auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(UINum); // calculate total window width in zone for (int Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Window(Ctd); if (SurfNum == 0) continue; - if (state.dataSurface->Surface(SurfNum).ExtBoundCond == ExternalEnvironment || - state.dataSurface->Surface(SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt || - state.dataSurface->Surface(SurfNum).ExtBoundCond == OtherSideCoefCalcExt || - state.dataSurface->Surface(SurfNum).ExtBoundCond == OtherSideCondModeledExt) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).WinWidth += state.dataSurface->Surface(SurfNum).Width; - ++state.dataRoomAirMod->ZoneUCSDUE(UINum).NumExtWin; + auto &surf = state.dataSurface->Surface(SurfNum); + if (surf.ExtBoundCond == ExternalEnvironment || + surf.ExtBoundCond == OtherSideCoefNoCalcExt || + surf.ExtBoundCond == OtherSideCoefCalcExt || + surf.ExtBoundCond == OtherSideCondModeledExt) { + zoneUE.WinWidth += surf.Width; + ++zoneUE.NumExtWin; } } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).WinWidth <= 0.0) { + if (zoneUE.WinWidth <= 0.0) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {} there are no exterior windows.", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName)); + zoneUE.ZoneName)); ShowContinueError(state, " The zone will be treated as a UFAD interior zone"); } NumberOfOccupants = 0.0; @@ -467,130 +473,130 @@ void SizeUCSDUF(EnergyPlusData &state, NumberOfOccupants += state.dataHeatBal->People(Ctd).NumberOfPeople; } } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffArea == AutoSize) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::Swirl) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffArea = 0.0075; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::VarArea) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffArea = 0.035; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::DisplVent) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffArea = 0.0060; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::LinBarGrille) { + if (zoneUE.DiffArea == AutoSize) { + if (zoneUE.DiffuserType == Diffuser::Swirl) { + zoneUE.DiffArea = 0.0075; + } else if (zoneUE.DiffuserType == Diffuser::VarArea) { + zoneUE.DiffArea = 0.035; + } else if (zoneUE.DiffuserType == Diffuser::DisplVent) { + zoneUE.DiffArea = 0.0060; + } else if (zoneUE.DiffuserType == Diffuser::LinBarGrille) { // 4 ft x 4 inches; eff area is 50% of total area; 75 cfm per linear foot. - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffArea = 0.03; + zoneUE.DiffArea = 0.03; } else { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffArea = 0.0075; + zoneUE.DiffArea = 0.0075; } BaseSizer::reportSizerOutput(state, "RoomAirSettings:UnderFloorAirDistributionExterior", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName, + zoneUE.ZoneName, "Design effective area of diffuser", - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffArea); + zoneUE.DiffArea); } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffAngle == AutoSize) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::Swirl) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffAngle = 28.0; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::VarArea) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffAngle = 45.0; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::DisplVent) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffAngle = 73.0; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::LinBarGrille) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffAngle = 15.0; + if (zoneUE.DiffAngle == AutoSize) { + if (zoneUE.DiffuserType == Diffuser::Swirl) { + zoneUE.DiffAngle = 28.0; + } else if (zoneUE.DiffuserType == Diffuser::VarArea) { + zoneUE.DiffAngle = 45.0; + } else if (zoneUE.DiffuserType == Diffuser::DisplVent) { + zoneUE.DiffAngle = 73.0; + } else if (zoneUE.DiffuserType == Diffuser::LinBarGrille) { + zoneUE.DiffAngle = 15.0; } else { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffAngle = 28.0; + zoneUE.DiffAngle = 28.0; } BaseSizer::reportSizerOutput(state, "RoomAirSettings:UnderFloorAirDistributionExterior", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName, + zoneUE.ZoneName, "Angle between diffuser slots and the vertical", - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffAngle); + zoneUE.DiffAngle); } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).TransHeight == AutoSize) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).CalcTransHeight = true; - state.dataRoomAirMod->ZoneUCSDUE(UINum).TransHeight = 0.0; + if (zoneUE.TransHeight == AutoSize) { + zoneUE.CalcTransHeight = true; + zoneUE.TransHeight = 0.0; } else { - state.dataRoomAirMod->ZoneUCSDUE(UINum).CalcTransHeight = false; + zoneUE.CalcTransHeight = false; } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::Swirl) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc != Constant::AutoCalculate) { + if (zoneUE.DiffuserType == Diffuser::Swirl) { + if (zoneUE.A_Kc != Constant::AutoCalculate || + zoneUE.B_Kc != Constant::AutoCalculate || + zoneUE.C_Kc != Constant::AutoCalculate || + zoneUE.D_Kc != Constant::AutoCalculate || + zoneUE.E_Kc != Constant::AutoCalculate) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E will be " "ignored when Floor Diffuser Type = Swirl.", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName)); + zoneUE.ZoneName)); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } - state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc = 0.6531; - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc = 0.0069; - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc = -0.00004; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::VarArea) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc != Constant::AutoCalculate) { + zoneUE.A_Kc = 0.0; + zoneUE.B_Kc = 0.0; + zoneUE.C_Kc = 0.6531; + zoneUE.D_Kc = 0.0069; + zoneUE.E_Kc = -0.00004; + } else if (zoneUE.DiffuserType == Diffuser::VarArea) { + if (zoneUE.A_Kc != Constant::AutoCalculate || + zoneUE.B_Kc != Constant::AutoCalculate || + zoneUE.C_Kc != Constant::AutoCalculate || + zoneUE.D_Kc != Constant::AutoCalculate || + zoneUE.E_Kc != Constant::AutoCalculate) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E will be " "ignored when Floor Diffuser Type = VariableArea.", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName)); + zoneUE.ZoneName)); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } - state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc = 0.83; - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc = 0.0; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::DisplVent) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc != Constant::AutoCalculate) { + zoneUE.A_Kc = 0.0; + zoneUE.B_Kc = 0.0; + zoneUE.C_Kc = 0.83; + zoneUE.D_Kc = 0.0; + zoneUE.E_Kc = 0.0; + } else if (zoneUE.DiffuserType == Diffuser::DisplVent) { + if (zoneUE.A_Kc != Constant::AutoCalculate || + zoneUE.B_Kc != Constant::AutoCalculate || + zoneUE.C_Kc != Constant::AutoCalculate || + zoneUE.D_Kc != Constant::AutoCalculate || + zoneUE.E_Kc != Constant::AutoCalculate) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E will be " "ignored when Floor Diffuser Type = HorizontalDisplacement.", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName)); + zoneUE.ZoneName)); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } - state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc = 0.67; - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc = 0.0; - } else if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::LinBarGrille) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc != Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc != Constant::AutoCalculate) { + zoneUE.A_Kc = 0.0; + zoneUE.B_Kc = 0.0; + zoneUE.C_Kc = 0.67; + zoneUE.D_Kc = 0.0; + zoneUE.E_Kc = 0.0; + } else if (zoneUE.DiffuserType == Diffuser::LinBarGrille) { + if (zoneUE.A_Kc != Constant::AutoCalculate || + zoneUE.B_Kc != Constant::AutoCalculate || + zoneUE.C_Kc != Constant::AutoCalculate || + zoneUE.D_Kc != Constant::AutoCalculate || + zoneUE.E_Kc != Constant::AutoCalculate) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E will be " "ignored when Floor Diffuser Type = LinearBarGrille.", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName)); + zoneUE.ZoneName)); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } - state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc = 0.0; - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc = 0.8214; - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc = -0.0263; - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc = 0.0014; + zoneUE.A_Kc = 0.0; + zoneUE.B_Kc = 0.0; + zoneUE.C_Kc = 0.8214; + zoneUE.D_Kc = -0.0263; + zoneUE.E_Kc = 0.0014; } else { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc == Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc == Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc == Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc == Constant::AutoCalculate || - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc == Constant::AutoCalculate) { + if (zoneUE.A_Kc == Constant::AutoCalculate || + zoneUE.B_Kc == Constant::AutoCalculate || + zoneUE.C_Kc == Constant::AutoCalculate || + zoneUE.D_Kc == Constant::AutoCalculate || + zoneUE.E_Kc == Constant::AutoCalculate) { ShowFatalError(state, format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E must be " "specified when Floor Diffuser Type = Custom.", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName)); + zoneUE.ZoneName)); } } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).PowerPerPlume == Constant::AutoCalculate) { + if (zoneUE.PowerPerPlume == Constant::AutoCalculate) { if (NumberOfOccupants > 0) { NumberOfPlumes = NumberOfOccupants; } else { @@ -626,25 +632,25 @@ void SizeUCSDUF(EnergyPlusData &state, ZoneSteamEqConv += state.dataHeatBal->ZoneSteamEq(Ctd).DesignLevel; } } - state.dataRoomAirMod->ZoneUCSDUE(UINum).PowerPerPlume = + zoneUE.PowerPerPlume = (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; BaseSizer::reportSizerOutput(state, "RoomAirSettings:UnderFloorAirDistributionExterior", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName, + zoneUE.ZoneName, "Power per plume [W]", - state.dataRoomAirMod->ZoneUCSDUE(UINum).PowerPerPlume); + zoneUE.PowerPerPlume); } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffusersPerZone == AutoSize) { + if (zoneUE.DiffusersPerZone == AutoSize) { if (NumberOfOccupants > 0.0) { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffusersPerZone = NumberOfOccupants; + zoneUE.DiffusersPerZone = NumberOfOccupants; } else { - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffusersPerZone = 1.0; + zoneUE.DiffusersPerZone = 1.0; } BaseSizer::reportSizerOutput(state, "RoomAirSettings:UnderFloorAirDistributionExterior", - state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneName, + zoneUE.ZoneName, "Number of diffusers per zone", - state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffusersPerZone); + zoneUE.DiffusersPerZone); } } } @@ -701,40 +707,41 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // WALL Hc, HA and HAT calculation for (Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Wall(Ctd); + auto &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; - Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); - Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); + Z1 = minval(surf.Vertex, &Vector::z); + Z2 = maxval(surf.Vertex, &Vector::z); ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataUCSDShared->HWall(Ctd); } // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataUCSDShared->HWall(Ctd); } if (std::abs(ZInfSurf - ZSupSurf) < 1.e-10) { ShowSevereError(state, "RoomAirModelUFAD:HcUCSDUF: Surface values will cause divide by zero."); ShowContinueError(state, format("Zone=\"{}\", Surface=\"{}\".", - state.dataHeatBal->Zone(state.dataSurface->Surface(SurfNum).Zone).Name, - state.dataSurface->Surface(SurfNum).Name)); + state.dataHeatBal->Zone(surf.Zone).Name, + surf.Name)); ShowContinueError(state, format("ZInfSurf=[{:.4R}], LayH=[{:.4R}].", ZInfSurf, LayH)); ShowContinueError(state, format("ZSupSurf=[{:.4R}], LayH=[{:.4R}].", ZSupSurf, LayH)); ShowFatalError(state, "...Previous condition causes termination."); @@ -743,24 +750,24 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - HLU = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + HLU = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - HLD = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + HLD = state.dataRoomAirMod->UFADHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataUFADManager->HAT_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + state.dataUFADManager->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataUFADManager->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HWall(Ctd); + state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataUCSDShared->HWall(Ctd); } // END WALL @@ -770,81 +777,83 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; - if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Window Wall - Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); - Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); + auto &surf = state.dataSurface->Surface(SurfNum); + + if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall + Z1 = minval(surf.Vertex, &Vector::z); + Z2 = maxval(surf.Vertex, &Vector::z); ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HAT_MXWin += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); - state.dataUFADManager->HA_MXWin += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataUFADManager->HA_MXWin += surf.Area * state.dataUCSDShared->HWindow(Ctd); } if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataUCSDShared->HWindow(Ctd); state.dataUFADManager->HAT_OCWin += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); - state.dataUFADManager->HA_OCWin += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataUFADManager->HA_OCWin += surf.Area * state.dataUCSDShared->HWindow(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - HLU = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + HLU = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - HLD = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + HLD = state.dataRoomAirMod->UFADHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataUFADManager->HAT_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_MXWin += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + state.dataUFADManager->HAT_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MXWin += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HA_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + state.dataUFADManager->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataUFADManager->HAT_OCWin += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataUFADManager->HAT_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OCWin += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataUFADManager->HA_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } } - if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling + if (surf.Tilt <= 10.0) { // Window Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataUCSDShared->HWindow(Ctd); } - if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor + if (surf.Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataUCSDShared->HWindow(Ctd); } - state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HWindow(Ctd); + state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataUCSDShared->HWindow(Ctd); } // END WINDOW @@ -855,49 +864,51 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; - Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); - Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); + auto &surf = state.dataSurface->Surface(SurfNum); + + Z1 = minval(surf.Vertex, &Vector::z); + Z2 = maxval(surf.Vertex, &Vector::z); ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataUCSDShared->HDoor(Ctd); } if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataUCSDShared->HDoor(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - HLU = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + HLU = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - HLD = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + HLD = state.dataRoomAirMod->UFADHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataUFADManager->HAT_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + state.dataUFADManager->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataUFADManager->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HDoor(Ctd); + state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataUCSDShared->HDoor(Ctd); } // END DOOR @@ -908,6 +919,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei for (Ctd = state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Internal(Ctd); + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; @@ -916,65 +929,69 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HInternal(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HInternal(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataUCSDShared->HInternal(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - HLU = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + HLU = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - HLD = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + HLD = state.dataRoomAirMod->UFADHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataUCSDShared->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataUFADManager->HAT_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + state.dataUFADManager->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataUFADManager->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HInternal(Ctd); + state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataUCSDShared->HInternal(Ctd); } // END INTERNAL // CEILING Hc, HA and HAT CALCULATION for (Ctd = state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_MX += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HCeiling(Ctd); - state.dataUFADManager->HA_MX += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HCeiling(Ctd); - state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HCeiling(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataUCSDShared->HCeiling(Ctd); + state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); } // END CEILING // FLOOR Hc, HA and HAT CALCULATION for (Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Floor(Ctd); + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFHcIn); - state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); + state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); state.dataUFADManager->HAT_OC += - state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); - state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HFloor(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataUCSDShared->HFloor(Ctd); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); + state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); } // END FLOOR } } @@ -1117,7 +1134,7 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); MIXFLAG = false; - state.dataRoomAirMod->UFHcIn = state.dataHeatBalSurf->SurfHConvInt; + state.dataRoomAirMod->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; SumSysMCp = 0.0; SumSysMCpT = 0.0; TotSysFlow = 0.0; @@ -1125,15 +1142,16 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th SumSysM = 0.0; ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); - UINum = state.dataRoomAirMod->ZoneUFPtr(ZoneNum); - HeightThermostat = state.dataRoomAirMod->ZoneUCSDUI(UINum).ThermostatHeight; - HeightComfort = state.dataRoomAirMod->ZoneUCSDUI(UINum).ComfortHeight; - TempDiffCritRep = state.dataRoomAirMod->ZoneUCSDUI(UINum).TempTrigger; - DiffArea = state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffArea; - ThrowAngle = Constant::DegToRadians * state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffAngle; + UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); + auto &zoneUI = state.dataRoomAirMod->ZoneUFADInt(UINum); + HeightThermostat = zoneUI.ThermostatHeight; + HeightComfort = zoneUI.ComfortHeight; + TempDiffCritRep = zoneUI.TempTrigger; + DiffArea = zoneUI.DiffArea; + ThrowAngle = Constant::DegToRadians * zoneUI.DiffAngle; SourceHeight = 0.0; - NumDiffusers = state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffusersPerZone; - PowerPerPlume = state.dataRoomAirMod->ZoneUCSDUI(UINum).PowerPerPlume; + NumDiffusers = zoneUI.DiffusersPerZone; + PowerPerPlume = zoneUI.PowerPerPlume; // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, // baseboards (nonthermostatic), water heater skin loss ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); @@ -1157,7 +1175,7 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th ConvGainsUpSubzone += RetAirGains; } ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; - ZoneEquipConfigNum = state.dataRoomAirMod->ZoneUCSDUI(UINum).ZoneEquipPtr; + ZoneEquipConfigNum = zoneUI.ZoneEquipPtr; if (ZoneEquipConfigNum > 0) { for (InNodeIndex = 1; InNodeIndex <= state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { NodeTemp = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; @@ -1186,7 +1204,7 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by // (TotSysFlow/(NumDiffusers*.0708))*.035 - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).DiffuserType == Diffuser::VarArea) { + if (zoneUI.DiffuserType == Diffuser::VarArea) { DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); } // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. @@ -1206,10 +1224,10 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th } else { Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).CalcTransHeight) { + if (zoneUI.CalcTransHeight) { HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } else { - HeightFrac = state.dataRoomAirMod->ZoneUCSDUI(UINum).TransHeight / CeilingHeight; + HeightFrac = zoneUI.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); for (Ctd = 1; Ctd <= 4; ++Ctd) { @@ -1226,16 +1244,16 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th if (PowerInPlumes <= 0.0) break; Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); - if (state.dataRoomAirMod->ZoneUCSDUI(UINum).CalcTransHeight) { + if (zoneUI.CalcTransHeight) { HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } else { - HeightFrac = state.dataRoomAirMod->ZoneUCSDUI(UINum).TransHeight / CeilingHeight; + HeightFrac = zoneUI.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); state.dataRoomAirMod->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - GainsFrac = state.dataRoomAirMod->ZoneUCSDUI(UINum).A_Kc * std::pow(Gamma, state.dataRoomAirMod->ZoneUCSDUI(UINum).B_Kc) + - state.dataRoomAirMod->ZoneUCSDUI(UINum).C_Kc + state.dataRoomAirMod->ZoneUCSDUI(UINum).D_Kc * Gamma + - state.dataRoomAirMod->ZoneUCSDUI(UINum).E_Kc * pow_2(Gamma); + GainsFrac = zoneUI.A_Kc * std::pow(Gamma, zoneUI.B_Kc) + + zoneUI.C_Kc + zoneUI.D_Kc * Gamma + + zoneUI.E_Kc * pow_2(Gamma); GainsFrac = max(0.6, min(GainsFrac, 1.0)); state.dataRoomAirMod->AIRRATOC(ZoneNum) = state.dataHeatBal->Zone(ZoneNum).Volume * @@ -1335,12 +1353,12 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th if (PowerInPlumes <= 0.0) { HeightFrac = 0.0; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; - state.dataRoomAirMod->ZoneUFGamma(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; } else { state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->ZoneUFGamma(ZoneNum) = Gamma; - state.dataRoomAirMod->ZoneUFPowInPlumes(ZoneNum) = PowerInPlumes; + state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = Gamma; + state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; } } @@ -1461,10 +1479,10 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th } if (MIXFLAG) { - state.dataRoomAirMod->ZoneUFMixedFlag(ZoneNum) = 1; + state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 1; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; } else { - state.dataRoomAirMod->ZoneUFMixedFlag(ZoneNum) = 0; + state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 0; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; } @@ -1482,11 +1500,11 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th // Mixed for reporting purposes if ((MIXFLAG) || ((state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAirMod->ZoneUFMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; state.dataRoomAirMod->HeightTransition(ZoneNum) = 0.0; state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; } else { - state.dataRoomAirMod->ZoneUFMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; } } @@ -1621,7 +1639,7 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); HeightFrac = 0.0; MIXFLAG = false; - state.dataRoomAirMod->UFHcIn = state.dataHeatBalSurf->SurfHConvInt; + state.dataRoomAirMod->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; SumSysMCp = 0.0; SumSysMCpT = 0.0; TotSysFlow = 0.0; @@ -1632,15 +1650,16 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th Gamma = 0.0; ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); - UINum = state.dataRoomAirMod->ZoneUFPtr(ZoneNum); - HeightThermostat = state.dataRoomAirMod->ZoneUCSDUE(UINum).ThermostatHeight; - HeightComfort = state.dataRoomAirMod->ZoneUCSDUE(UINum).ComfortHeight; - TempDiffCritRep = state.dataRoomAirMod->ZoneUCSDUE(UINum).TempTrigger; - DiffArea = state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffArea; - ThrowAngle = Constant::DegToRadians * state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffAngle; - SourceHeight = state.dataRoomAirMod->ZoneUCSDUE(UINum).HeatSrcHeight; - NumDiffusers = state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffusersPerZone; - PowerPerPlume = state.dataRoomAirMod->ZoneUCSDUE(UINum).PowerPerPlume; + UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); + auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(UINum); + HeightThermostat = zoneUE.ThermostatHeight; + HeightComfort = zoneUE.ComfortHeight; + TempDiffCritRep = zoneUE.TempTrigger; + DiffArea = zoneUE.DiffArea; + ThrowAngle = Constant::DegToRadians * zoneUE.DiffAngle; + SourceHeight = zoneUE.HeatSrcHeight; + NumDiffusers = zoneUE.DiffusersPerZone; + PowerPerPlume = zoneUE.PowerPerPlume; // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, // baseboards (nonthermostatic), water heater skin loss ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); @@ -1663,7 +1682,7 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th ConvGainsUpSubzone += RetAirGains; } ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; - ZoneEquipConfigNum = state.dataRoomAirMod->ZoneUCSDUE(UINum).ZoneEquipPtr; + ZoneEquipConfigNum = zoneUE.ZoneEquipPtr; if (ZoneEquipConfigNum > 0) { for (InNodeIndex = 1; InNodeIndex <= state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { NodeTemp = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; @@ -1693,7 +1712,7 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by // (TotSysFlow/(NumDiffusers*.0708))*.035 - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).DiffuserType == Diffuser::VarArea) { + if (zoneUE.DiffuserType == Diffuser::VarArea) { DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); } // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. @@ -1716,8 +1735,8 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th HeightFrac = 0.0; } else { if (PowerInPlumes > 0.0) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).WinWidth > 0.0) { // exterior zone formula - PowerInPlumesPerMeter = PowerInPlumes / state.dataRoomAirMod->ZoneUCSDUE(UINum).WinWidth; + if (zoneUE.WinWidth > 0.0) { // exterior zone formula + PowerInPlumesPerMeter = PowerInPlumes / zoneUE.WinWidth; Gamma = (TotSysFlow * std::cos(ThrowAngle)) / (NumDiffusers * DiffArea * std::pow(0.0281 * 0.001 * PowerInPlumesPerMeter, 0.333333)); } else { // interior zone formula Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / @@ -1726,24 +1745,24 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th } else { Gamma = 1000.0; } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).CalcTransHeight) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).WinWidth > 0.0) { // use exterior zone formula + if (zoneUE.CalcTransHeight) { + if (zoneUE.WinWidth > 0.0) { // use exterior zone formula HeightFrac = (std::sqrt(DiffArea) * (11.03 * std::log(Gamma) - 10.73) + 0.5 * SourceHeight) / CeilingHeight; } else { // use interior zone formula HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } } else { - HeightFrac = state.dataRoomAirMod->ZoneUCSDUE(UINum).TransHeight / CeilingHeight; + HeightFrac = zoneUE.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); - GainsFrac = state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc * std::pow(Gamma, state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc) + - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc + state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc * Gamma + - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc * pow_2(Gamma); + GainsFrac = zoneUE.A_Kc * std::pow(Gamma, zoneUE.B_Kc) + + zoneUE.C_Kc + zoneUE.D_Kc * Gamma + + zoneUE.E_Kc * pow_2(Gamma); GainsFrac = max(0.7, min(GainsFrac, 1.0)); - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).ShadeDown) { + if (zoneUE.ShadeDown) { GainsFrac -= 0.2; } - state.dataRoomAirMod->ZoneUFPowInPlumes(ZoneNum) = PowerInPlumes; + state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; for (Ctd = 1; Ctd <= 4; ++Ctd) { HcUCSDUF(state, ZoneNum, HeightFrac); ConvGainsWindows = state.dataUFADManager->HAT_MXWin + state.dataUFADManager->HAT_OCWin - @@ -1755,29 +1774,29 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th // NumberOfPlumes = PowerInPlumes / PowerPerPlume NumberOfPlumes = 1.0; if (PowerInPlumes <= 0.0) break; - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).WinWidth > 0.0) { // use exterior zone formula - PowerInPlumesPerMeter = PowerInPlumes / state.dataRoomAirMod->ZoneUCSDUE(UINum).WinWidth; + if (zoneUE.WinWidth > 0.0) { // use exterior zone formula + PowerInPlumesPerMeter = PowerInPlumes / zoneUE.WinWidth; Gamma = (TotSysFlow * std::cos(ThrowAngle)) / (NumDiffusers * DiffArea * std::pow(0.0281 * 0.001 * PowerInPlumesPerMeter, 0.333333)); } else { // use interior zone formula Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); } - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).CalcTransHeight) { - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).WinWidth > 0.0) { // exterior zone formula + if (zoneUE.CalcTransHeight) { + if (zoneUE.WinWidth > 0.0) { // exterior zone formula HeightFrac = (std::sqrt(DiffArea) * (11.03 * std::log(Gamma) - 10.73) + 0.5 * SourceHeight) / CeilingHeight; } else { // interior zone formula HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } } else { - HeightFrac = state.dataRoomAirMod->ZoneUCSDUE(UINum).TransHeight / CeilingHeight; + HeightFrac = zoneUE.TransHeight / CeilingHeight; } HeightFrac = min(1.0, HeightFrac); state.dataRoomAirMod->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - GainsFrac = state.dataRoomAirMod->ZoneUCSDUE(UINum).A_Kc * std::pow(Gamma, state.dataRoomAirMod->ZoneUCSDUE(UINum).B_Kc) + - state.dataRoomAirMod->ZoneUCSDUE(UINum).C_Kc + state.dataRoomAirMod->ZoneUCSDUE(UINum).D_Kc * Gamma + - state.dataRoomAirMod->ZoneUCSDUE(UINum).E_Kc * pow_2(Gamma); + GainsFrac = zoneUE.A_Kc * std::pow(Gamma, zoneUE.B_Kc) + + zoneUE.C_Kc + zoneUE.D_Kc * Gamma + + zoneUE.E_Kc * pow_2(Gamma); GainsFrac = max(0.7, min(GainsFrac, 1.0)); - if (state.dataRoomAirMod->ZoneUCSDUE(UINum).ShadeDown) { + if (zoneUE.ShadeDown) { GainsFrac -= 0.2; } state.dataRoomAirMod->AIRRATOC(ZoneNum) = @@ -1877,14 +1896,14 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th if (PowerInPlumes <= 0.0) { HeightFrac = 0.0; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; - state.dataRoomAirMod->ZoneUFGamma(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFPowInPlumes(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows(ZoneNum) = 0.0; } else { state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->ZoneUFGamma(ZoneNum) = Gamma; - state.dataRoomAirMod->ZoneUFPowInPlumes(ZoneNum) = PowerInPlumes; - state.dataRoomAirMod->ZoneUFPowInPlumesfromWindows(ZoneNum) = ConvGainsWindows; + state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = Gamma; + state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; + state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows(ZoneNum) = ConvGainsWindows; } } @@ -2004,10 +2023,10 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th } if (MIXFLAG) { - state.dataRoomAirMod->ZoneUFMixedFlag(ZoneNum) = 1; + state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 1; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; } else { - state.dataRoomAirMod->ZoneUFMixedFlag(ZoneNum) = 0; + state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 0; state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; } @@ -2025,11 +2044,11 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th // Mixed for reporting purposes if ((MIXFLAG) || ((state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAirMod->ZoneUFMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; state.dataRoomAirMod->HeightTransition(ZoneNum) = 0.0; state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; } else { - state.dataRoomAirMod->ZoneUFMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; } } diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index c4472b39583..6243b877060 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -3588,25 +3588,25 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { // RoomAirflowNetworkModel - make dynamic term independent of TimeStepSys - auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); - if (thisRoomAirflowNetworkZoneInfo.IsUsed) { - int RoomAirNode = thisRoomAirflowNetworkZoneInfo.ControlAirNodeID; + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + if (afnZoneInfo.IsUsed) { + int RoomAirNode = afnZoneInfo.ControlAirNodeID; RoomAir::LoadPredictionRoomAirModelAirflowNetwork(state, zoneNum, RoomAirNode); this->TempDepCoef = - thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumHA + thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumLinkMCp; - this->TempIndCoef = thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumIntSensibleGain + - thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumHATsurf - - thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumHATref + - thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SumLinkMCpT + - thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).SysDepZoneLoadsLagged; - this->AirPowerCap = thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).AirVolume * - state.dataHeatBal->Zone(zoneNum).ZoneVolCapMultpSens * thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).RhoAir * - thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).CpAir / TimeStepSysSec; + afnZoneInfo.Node(RoomAirNode).SumHA + afnZoneInfo.Node(RoomAirNode).SumLinkMCp; + this->TempIndCoef = afnZoneInfo.Node(RoomAirNode).SumIntSensibleGain + + afnZoneInfo.Node(RoomAirNode).SumHATsurf - + afnZoneInfo.Node(RoomAirNode).SumHATref + + afnZoneInfo.Node(RoomAirNode).SumLinkMCpT + + afnZoneInfo.Node(RoomAirNode).SysDepZoneLoadsLagged; + this->AirPowerCap = afnZoneInfo.Node(RoomAirNode).AirVolume * + state.dataHeatBal->Zone(zoneNum).ZoneVolCapMultpSens * afnZoneInfo.Node(RoomAirNode).RhoAir * + afnZoneInfo.Node(RoomAirNode).CpAir / TimeStepSysSec; this->TempHistoryTerm = this->AirPowerCap * (3.0 * this->ZTM[0] - (3.0 / 2.0) * this->ZTM[1] + (1.0 / 3.0) * this->ZTM[2]); this->TempDepZnLd = (11.0 / 6.0) * this->AirPowerCap + this->TempDepCoef; this->TempIndZnLd = this->TempHistoryTerm + this->TempIndCoef; - if (thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).HasHVACAssigned) - RAFNFrac = thisRoomAirflowNetworkZoneInfo.Node(RoomAirNode).HVAC(1).SupplyFraction; + if (afnZoneInfo.Node(RoomAirNode).HasHVACAssigned) + RAFNFrac = afnZoneInfo.Node(RoomAirNode).HVAC(1).SupplyFraction; } } } @@ -3619,20 +3619,20 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( this->ZoneT1 = this->ZoneTM2; this->ZoneW1 = this->ZoneWM2; if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); - for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { - thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempTM2; - thisRoomAirflowNetworkZoneInfo.Node(LoopNode).HumRatW1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).HumRatWM2; + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + for (int LoopNode = 1; LoopNode <= afnZoneInfo.NumOfAirNodes; ++LoopNode) { + afnZoneInfo.Node(LoopNode).AirTempT1 = afnZoneInfo.Node(LoopNode).AirTempTM2; + afnZoneInfo.Node(LoopNode).HumRatW1 = afnZoneInfo.Node(LoopNode).HumRatWM2; } } } else { this->ZoneT1 = this->ZoneTMX; this->ZoneW1 = this->ZoneWMX; if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); - for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { - thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempTMX; - thisRoomAirflowNetworkZoneInfo.Node(LoopNode).HumRatW1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).HumRatWMX; + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + for (int LoopNode = 1; LoopNode <= afnZoneInfo.NumOfAirNodes; ++LoopNode) { + afnZoneInfo.Node(LoopNode).AirTempT1 = afnZoneInfo.Node(LoopNode).AirTempTMX; + afnZoneInfo.Node(LoopNode).HumRatW1 = afnZoneInfo.Node(LoopNode).HumRatWMX; } } } @@ -3641,10 +3641,10 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( this->ZoneT1 = this->ZT; this->ZoneW1 = this->ZoneAirHumRat; if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - auto &thisRoomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); - for (int LoopNode = 1; LoopNode <= thisRoomAirflowNetworkZoneInfo.NumOfAirNodes; ++LoopNode) { - thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTempT1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).AirTemp; - thisRoomAirflowNetworkZoneInfo.Node(LoopNode).HumRatW1 = thisRoomAirflowNetworkZoneInfo.Node(LoopNode).HumRat; + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + for (int LoopNode = 1; LoopNode <= afnZoneInfo.NumOfAirNodes; ++LoopNode) { + afnZoneInfo.Node(LoopNode).AirTempT1 = afnZoneInfo.Node(LoopNode).AirTemp; + afnZoneInfo.Node(LoopNode).HumRatW1 = afnZoneInfo.Node(LoopNode).HumRat; } } } @@ -4120,7 +4120,7 @@ void ZoneSpaceHeatBalanceData::calcPredictedHumidityRatio(EnergyPlusData &state, C = RhoAir * volume * thisZone.ZoneVolCapMultpMoist / TimeStepSysSec; if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - auto &roomAFNInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum); + auto &roomAFNInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); int RoomAirNode = roomAFNInfo.ControlAirNodeID; H2OHtOfVap = Psychrometrics::PsyHgAirFnWTdb(roomAFNInfo.Node(RoomAirNode).HumRat, roomAFNInfo.Node(RoomAirNode).AirTemp); A = roomAFNInfo.Node(RoomAirNode).SumLinkM + roomAFNInfo.Node(RoomAirNode).SumHmARa; @@ -4364,7 +4364,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( state.dataHeatBalFanSys->TempTstatAir(zoneNum) = this->ZT; } state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; - } else if (state.dataRoomAirMod->IsZoneDV(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { + } else if (state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { // UCSDDV: Not fully mixed - calculate factor to correct load for fully mixed assumption // Space HB TODO: Space HB doesn't mix with DV etc. if (this->SumSysMCp > DataHVACGlobals::SmallMassFlow) { @@ -4383,7 +4383,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; } } else if (thisAirModel.SimAirModel && ((thisAirModel.AirModel == RoomAir::RoomAirModel::UserDefined) || - (thisAirModel.AirModel == RoomAir::RoomAirModel::Mundt))) { + (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent1Node))) { if (this->SumSysMCp > DataHVACGlobals::SmallMassFlow) { Real64 TempSupplyAir = this->SumSysMCpT / this->SumSysMCp; // Non-negligible flow, calculate supply air temperature if (std::abs(TempSupplyAir - this->ZT) > state.dataHeatBal->TempConvergTol) { @@ -4401,8 +4401,8 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( } } else if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { // Zone node used in the RoomAirflowNetwork model - this->ZT = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) - .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) + this->ZT = state.dataRoomAirMod->AFNZoneInfo(zoneNum) + .Node(state.dataRoomAirMod->AFNZoneInfo(zoneNum).ControlAirNodeID) .AirTemp; thisSystemNode.Temp = this->ZT; // SpaceHB TODO: What to do here if this is for space @@ -4463,9 +4463,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - this->ZT = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) - .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) - .AirTemp; + this->ZT = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(state.dataRoomAirMod->AFNZoneInfo(zoneNum).ControlAirNodeID).AirTemp; } } @@ -4514,8 +4512,8 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( bool isMixed = true; // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - isMixed = !((state.dataRoomAirMod->IsZoneDV(zoneNum) && !state.dataRoomAirMod->ZoneDVMixedFlag(zoneNum)) || - (state.dataRoomAirMod->IsZoneUI(zoneNum) && !state.dataRoomAirMod->ZoneUFMixedFlag(zoneNum))); + isMixed = !((state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) && !state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag(zoneNum)) || + (state.dataRoomAirMod->IsZoneUI(zoneNum) && !state.dataRoomAirMod->ZoneUFADMixedFlag(zoneNum))); } switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { @@ -4601,9 +4599,9 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDDV || - thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDUFI || - thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDUFE) { + if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || + thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || + thisAirModel.AirModel == RoomAir::RoomAirModel::UFADExt) { state.dataRoomAirMod->XM4TFloor(zoneNum) = state.dataRoomAirMod->XM3TFloor(zoneNum); state.dataRoomAirMod->XM3TFloor(zoneNum) = state.dataRoomAirMod->XM2TFloor(zoneNum); state.dataRoomAirMod->XM2TFloor(zoneNum) = state.dataRoomAirMod->XMATFloor(zoneNum); @@ -4625,17 +4623,17 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in // for RoomAirflowNetwork model if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); - roomAirflowNetworkZoneInfo.AirTempX4 = roomAirflowNetworkZoneInfo.AirTempX3; - roomAirflowNetworkZoneInfo.AirTempX3 = roomAirflowNetworkZoneInfo.AirTempX2; - roomAirflowNetworkZoneInfo.AirTempX2 = roomAirflowNetworkZoneInfo.AirTempX1; - roomAirflowNetworkZoneInfo.AirTempX1 = roomAirflowNetworkZoneInfo.AirTemp; + for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); + afnZoneInfo.AirTempX4 = afnZoneInfo.AirTempX3; + afnZoneInfo.AirTempX3 = afnZoneInfo.AirTempX2; + afnZoneInfo.AirTempX2 = afnZoneInfo.AirTempX1; + afnZoneInfo.AirTempX1 = afnZoneInfo.AirTemp; - roomAirflowNetworkZoneInfo.HumRatX4 = roomAirflowNetworkZoneInfo.HumRatX3; - roomAirflowNetworkZoneInfo.HumRatX3 = roomAirflowNetworkZoneInfo.HumRatX2; - roomAirflowNetworkZoneInfo.HumRatX2 = roomAirflowNetworkZoneInfo.HumRatX1; - roomAirflowNetworkZoneInfo.HumRatX1 = roomAirflowNetworkZoneInfo.HumRat; + afnZoneInfo.HumRatX4 = afnZoneInfo.HumRatX3; + afnZoneInfo.HumRatX3 = afnZoneInfo.HumRatX2; + afnZoneInfo.HumRatX2 = afnZoneInfo.HumRatX1; + afnZoneInfo.HumRatX1 = afnZoneInfo.HumRat; } } } @@ -4647,9 +4645,9 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in this->ZoneWMX = this->ZoneAirHumRatAvg; // using average for whole zone time step. // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDDV || - thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDUFI || - thisAirModel.AirModel == RoomAir::RoomAirModel::UCSDUFE) { + if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || + thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || + thisAirModel.AirModel == RoomAir::RoomAirModel::UFADExt) { state.dataRoomAirMod->ZoneM2Floor(zoneNum) = state.dataRoomAirMod->ZoneMXFloor(zoneNum); state.dataRoomAirMod->ZoneMXFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); // using average for whole zone time step. state.dataRoomAirMod->ZoneM2OC(zoneNum) = state.dataRoomAirMod->ZoneMXOC(zoneNum); @@ -4659,13 +4657,13 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in } if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); - roomAirflowNetworkZoneInfo.AirTempTM2 = roomAirflowNetworkZoneInfo.AirTempTMX; - roomAirflowNetworkZoneInfo.AirTempTMX = roomAirflowNetworkZoneInfo.AirTemp; + for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); + afnZoneInfo.AirTempTM2 = afnZoneInfo.AirTempTMX; + afnZoneInfo.AirTempTMX = afnZoneInfo.AirTemp; - roomAirflowNetworkZoneInfo.HumRatWM2 = roomAirflowNetworkZoneInfo.HumRatWMX; - roomAirflowNetworkZoneInfo.HumRatWMX = roomAirflowNetworkZoneInfo.HumRat; + afnZoneInfo.HumRatWM2 = afnZoneInfo.HumRatWMX; + afnZoneInfo.HumRatWMX = afnZoneInfo.HumRat; } } } @@ -4704,7 +4702,7 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDV(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { + if (state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { state.dataRoomAirMod->DSXM4TFloor(zoneNum) = state.dataRoomAirMod->DSXM3TFloor(zoneNum); state.dataRoomAirMod->DSXM3TFloor(zoneNum) = state.dataRoomAirMod->DSXM2TFloor(zoneNum); state.dataRoomAirMod->DSXM2TFloor(zoneNum) = state.dataRoomAirMod->DSXMATFloor(zoneNum); @@ -4721,17 +4719,17 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->DSXMATMX(zoneNum) = state.dataRoomAirMod->MATMX(zoneNum); } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); - roomAirflowNetworkZoneInfo.AirTempDSX4 = roomAirflowNetworkZoneInfo.AirTempDSX3; - roomAirflowNetworkZoneInfo.AirTempDSX3 = roomAirflowNetworkZoneInfo.AirTempDSX2; - roomAirflowNetworkZoneInfo.AirTempDSX2 = roomAirflowNetworkZoneInfo.AirTempDSX1; - roomAirflowNetworkZoneInfo.AirTempDSX1 = roomAirflowNetworkZoneInfo.AirTemp; + for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); + afnZoneInfo.AirTempDSX4 = afnZoneInfo.AirTempDSX3; + afnZoneInfo.AirTempDSX3 = afnZoneInfo.AirTempDSX2; + afnZoneInfo.AirTempDSX2 = afnZoneInfo.AirTempDSX1; + afnZoneInfo.AirTempDSX1 = afnZoneInfo.AirTemp; - roomAirflowNetworkZoneInfo.HumRatDSX4 = roomAirflowNetworkZoneInfo.HumRatDSX3; - roomAirflowNetworkZoneInfo.HumRatDSX3 = roomAirflowNetworkZoneInfo.HumRatDSX2; - roomAirflowNetworkZoneInfo.HumRatDSX2 = roomAirflowNetworkZoneInfo.HumRatDSX1; - roomAirflowNetworkZoneInfo.HumRatDSX1 = roomAirflowNetworkZoneInfo.HumRat; + afnZoneInfo.HumRatDSX4 = afnZoneInfo.HumRatDSX3; + afnZoneInfo.HumRatDSX3 = afnZoneInfo.HumRatDSX2; + afnZoneInfo.HumRatDSX2 = afnZoneInfo.HumRatDSX1; + afnZoneInfo.HumRatDSX1 = afnZoneInfo.HumRat; } } } @@ -4744,9 +4742,9 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::DispVent3Node || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADInt || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADExt) { state.dataRoomAirMod->ZoneM2Floor(zoneNum) = state.dataRoomAirMod->ZoneMXFloor(zoneNum); state.dataRoomAirMod->ZoneMXFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); // using average for whole zone time step. state.dataRoomAirMod->ZoneM2OC(zoneNum) = state.dataRoomAirMod->ZoneMXOC(zoneNum); @@ -4755,13 +4753,13 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->ZoneMXMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); // using average for whole zone time step. } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); - roomAirflowNetworkZoneInfo.AirTempTM2 = roomAirflowNetworkZoneInfo.AirTempTMX; - roomAirflowNetworkZoneInfo.AirTempTMX = roomAirflowNetworkZoneInfo.AirTemp; + for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); + afnZoneInfo.AirTempTM2 = afnZoneInfo.AirTempTMX; + afnZoneInfo.AirTempTMX = afnZoneInfo.AirTemp; - roomAirflowNetworkZoneInfo.HumRatWM2 = roomAirflowNetworkZoneInfo.HumRatWMX; - roomAirflowNetworkZoneInfo.HumRatWMX = roomAirflowNetworkZoneInfo.HumRat; + afnZoneInfo.HumRatWM2 = afnZoneInfo.HumRatWMX; + afnZoneInfo.HumRatWMX = afnZoneInfo.HumRat; } } } @@ -4798,9 +4796,9 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDDV || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDUFI || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UCSDUFE) { + if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::DispVent3Node || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADInt || + state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADExt) { state.dataRoomAirMod->XMATFloor(zoneNum) = state.dataRoomAirMod->XM2TFloor(zoneNum); state.dataRoomAirMod->XM2TFloor(zoneNum) = state.dataRoomAirMod->XM3TFloor(zoneNum); @@ -4816,15 +4814,15 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &roomAirflowNetworkZoneInfo = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode); - roomAirflowNetworkZoneInfo.AirTempX1 = roomAirflowNetworkZoneInfo.AirTempX2; - roomAirflowNetworkZoneInfo.AirTempX2 = roomAirflowNetworkZoneInfo.AirTempX3; - roomAirflowNetworkZoneInfo.AirTempX3 = roomAirflowNetworkZoneInfo.AirTempX4; + for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); + afnZoneInfo.AirTempX1 = afnZoneInfo.AirTempX2; + afnZoneInfo.AirTempX2 = afnZoneInfo.AirTempX3; + afnZoneInfo.AirTempX3 = afnZoneInfo.AirTempX4; - roomAirflowNetworkZoneInfo.HumRatX1 = roomAirflowNetworkZoneInfo.HumRatX2; - roomAirflowNetworkZoneInfo.HumRatX2 = roomAirflowNetworkZoneInfo.HumRatX3; - roomAirflowNetworkZoneInfo.HumRatX3 = roomAirflowNetworkZoneInfo.HumRatX4; + afnZoneInfo.HumRatX1 = afnZoneInfo.HumRatX2; + afnZoneInfo.HumRatX2 = afnZoneInfo.HumRatX3; + afnZoneInfo.HumRatX3 = afnZoneInfo.HumRatX4; } } } @@ -4956,9 +4954,7 @@ void ZoneSpaceHeatBalanceData::correctHumRat(EnergyPlusData &state, int const zo if (this->ZoneAirHumRatTemp > WZSat) this->ZoneAirHumRatTemp = WZSat; if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - this->ZoneAirHumRatTemp = state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum) - .Node(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).ControlAirNodeID) - .HumRat; + this->ZoneAirHumRatTemp = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(state.dataRoomAirMod->AFNZoneInfo(zoneNum).ControlAirNodeID).HumRat; } // HybridModel with measured humidity ratio begins @@ -7130,7 +7126,7 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, this->ZoneAirHumRat = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, this->WPrevZoneTS, this->DSWPrevZoneTS); if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDV(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { + if (state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, @@ -7164,8 +7160,8 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, state.dataRoomAirMod->DSXM4TMX(zoneNum)); } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &ThisRAFNNode(state.dataRoomAirMod->RoomAirflowNetworkZoneInfo(zoneNum).Node(LoopNode)); + for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { + auto &ThisRAFNNode(state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode)); DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, ThisRAFNNode.AirTempX1, diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 171dfdc71eb..a9ee278ccca 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -1192,7 +1192,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state->dataSurface->surfIntConv(SurfNum).model = Convect::HcInt::SetByZone; state->dataSurface->surfIntConv(SurfNum).userModelNum = 0; - state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::UCSDDV; + state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::DispVent3Node; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; HcIn(1) = 0.0; @@ -1204,7 +1204,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state->dataSurface->surfIntConv(SurfNum).model = Convect::HcInt::SetByZone; state->dataSurface->surfIntConv(SurfNum).userModelNum = 0; - state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::UCSDCV; + state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::CrossVent; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; HcIn(1) = 0.0; diff --git a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc index 6756c1978dd..f20a799113b 100644 --- a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc @@ -79,10 +79,10 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->dataRoomAirMod->RecInflowRatio.allocate(state->dataGlobal->NumOfZones); state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirflowNetworkSurfaceUCSDCV.allocate({0, MaxSurf}, state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(1, 1) = 1; - state->dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, 1) = 1; - state->dataRoomAirMod->AirflowNetworkSurfaceUCSDCV(0, 2) = 2; + state->dataRoomAirMod->AFNSurfaceCrossVent.allocate({0, MaxSurf}, state->dataGlobal->NumOfZones); + state->dataRoomAirMod->AFNSurfaceCrossVent(1, 1) = 1; + state->dataRoomAirMod->AFNSurfaceCrossVent(0, 1) = 1; + state->dataRoomAirMod->AFNSurfaceCrossVent(0, 2) = 2; state->afn->MultizoneSurfaceData.allocate(MaxSurf); state->afn->MultizoneSurfaceData(1).SurfNum = 6; @@ -138,13 +138,13 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->afn->AirflowNetworkCompData(3).TypeNum = 2; state->afn->AirflowNetworkCompData(3).CompTypeNum = AirflowNetwork::iComponentTypeNum::SOP; - state->dataRoomAirMod->SurfParametersCVDV.allocate(2); - state->dataRoomAirMod->SurfParametersCVDV(1).Width = 22.715219999999999; - state->dataRoomAirMod->SurfParametersCVDV(1).Height = 1.3715999999999999; - state->dataRoomAirMod->SurfParametersCVDV(2).Width = 22.869143999999999; - state->dataRoomAirMod->SurfParametersCVDV(2).Height = 1.3715999999999999; + state->dataRoomAirMod->SurfParametersCrossDispVent.allocate(2); + state->dataRoomAirMod->SurfParametersCrossDispVent(1).Width = 22.715219999999999; + state->dataRoomAirMod->SurfParametersCrossDispVent(1).Height = 1.3715999999999999; + state->dataRoomAirMod->SurfParametersCrossDispVent(2).Width = 22.869143999999999; + state->dataRoomAirMod->SurfParametersCrossDispVent(2).Height = 1.3715999999999999; - state->dataRoomAirMod->CVJetRecFlows.allocate({0, MaxSurf}, 1); + state->dataRoomAirMod->CrossVentJetRecFlows.allocate({0, MaxSurf}, 1); state->dataUCSDShared->PosZ_Wall.allocate(2); state->dataUCSDShared->PosZ_Wall(1) = 1; @@ -160,8 +160,8 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->dataRoomAirMod->Droom(1) = 13.631070390838719; state->dataRoomAirMod->Dstar.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->Ain.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZoneUCSDCV.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZoneUCSDCV(1).ZonePtr = 1; + state->dataRoomAirMod->ZoneCrossVent.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAirMod->ZoneCrossVent(1).ZonePtr = 1; state->dataRoomAirMod->JetRecAreaRatio.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->Ujet.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->Urec.allocate(state->dataGlobal->NumOfZones); @@ -171,13 +171,13 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) EvolveParaUCSDCV(*state, 1); - EXPECT_NEAR(27.14, state->dataRoomAirMod->CVJetRecFlows(1, 1).Fin, 0.01); - EXPECT_NEAR(0.871, state->dataRoomAirMod->CVJetRecFlows(1, 1).Uin, 0.001); - EXPECT_NEAR(0.000, state->dataRoomAirMod->CVJetRecFlows(1, 1).Vjet, 0.001); - EXPECT_NEAR(0.243, state->dataRoomAirMod->CVJetRecFlows(1, 1).Yjet, 0.001); - EXPECT_NEAR(0.279, state->dataRoomAirMod->CVJetRecFlows(1, 1).Ujet, 0.001); - EXPECT_NEAR(0.070, state->dataRoomAirMod->CVJetRecFlows(1, 1).Yrec, 0.001); - EXPECT_NEAR(0.080, state->dataRoomAirMod->CVJetRecFlows(1, 1).Urec, 0.001); - EXPECT_NEAR(0.466, state->dataRoomAirMod->CVJetRecFlows(1, 1).YQrec, 0.001); - EXPECT_NEAR(0.535, state->dataRoomAirMod->CVJetRecFlows(1, 1).Qrec, 0.001); + EXPECT_NEAR(27.14, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Fin, 0.01); + EXPECT_NEAR(0.871, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Uin, 0.001); + EXPECT_NEAR(0.000, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Vjet, 0.001); + EXPECT_NEAR(0.243, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Yjet, 0.001); + EXPECT_NEAR(0.279, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Ujet, 0.001); + EXPECT_NEAR(0.070, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Yrec, 0.001); + EXPECT_NEAR(0.080, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Urec, 0.001); + EXPECT_NEAR(0.466, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).YQrec, 0.001); + EXPECT_NEAR(0.535, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Qrec, 0.001); } diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index 4e5626fb605..e67e610b2b3 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -74,12 +74,12 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataGlobal->NumOfZones = 1; int TotSurfaces = 3; - state->dataRoomAirMod->IsZoneDV.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->IsZoneDV(1) = true; + state->dataRoomAirMod->IsZoneDispVent3Node.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAirMod->IsZoneDispVent3Node(1) = true; state->dataSurface->Surface.allocate(TotSurfaces); state->dataHeatBal->SurfTempEffBulkAir.allocate(TotSurfaces); state->dataHeatBalSurf->SurfTempIn.allocate(TotSurfaces); - state->dataRoomAirMod->DVHcIn.allocate(TotSurfaces); + state->dataRoomAirMod->DispVent3NodeHcIn.allocate(TotSurfaces); state->dataRoomAirMod->ZTMX.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->ZTOC.allocate(state->dataGlobal->NumOfZones); @@ -164,7 +164,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataSurface->SurfTAirRefRpt.dimension(TotSurfaces, 0); state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::UCSDDV; + state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::DispVent3Node; state->dataUCSDShared->APos_Wall.allocate(TotSurfaces); state->dataUCSDShared->APos_Floor.allocate(TotSurfaces); @@ -215,8 +215,8 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataUCSDShared->HWindow = 0.0; state->dataUCSDShared->HDoor = 0.0; - state->dataRoomAirMod->ZoneUCSDCV.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZoneUCSDCV(1).ZonePtr = 1; + state->dataRoomAirMod->ZoneCrossVent.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAirMod->ZoneCrossVent(1).ZonePtr = 1; state->dataUCSDShared->PosZ_Door(1) = 1; state->dataUCSDShared->PosZ_Door(2) = 3; state->dataUCSDShared->APos_Door(1) = 1; @@ -231,19 +231,19 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) HcUCSDDV(*state, 1, 0.5); - EXPECT_NEAR(1.889346, state->dataRoomAirMod->DVHcIn(1), 0.0001); - EXPECT_NEAR(1.650496, state->dataRoomAirMod->DVHcIn(2), 0.0001); - EXPECT_NEAR(1.889346, state->dataRoomAirMod->DVHcIn(3), 0.0001); + EXPECT_NEAR(1.889346, state->dataRoomAirMod->DispVent3NodeHcIn(1), 0.0001); + EXPECT_NEAR(1.650496, state->dataRoomAirMod->DispVent3NodeHcIn(2), 0.0001); + EXPECT_NEAR(1.889346, state->dataRoomAirMod->DispVent3NodeHcIn(3), 0.0001); EXPECT_NEAR(379.614212, state->dataDispVentMgr->HAT_OC, 0.0001); EXPECT_NEAR(16.504965, state->dataDispVentMgr->HA_OC, 0.0001); EXPECT_NEAR(869.099591, state->dataDispVentMgr->HAT_MX, 0.0001); EXPECT_NEAR(37.786938, state->dataDispVentMgr->HA_MX, 0.0001); - state->dataRoomAirMod->IsZoneDV.deallocate(); + state->dataRoomAirMod->IsZoneDispVent3Node.deallocate(); state->dataSurface->Surface.deallocate(); state->dataHeatBal->SurfTempEffBulkAir.deallocate(); state->dataHeatBalSurf->SurfTempIn.deallocate(); - state->dataRoomAirMod->DVHcIn.deallocate(); + state->dataRoomAirMod->DispVent3NodeHcIn.deallocate(); state->dataRoomAirMod->ZTMX.deallocate(); state->dataRoomAirMod->ZTOC.deallocate(); state->dataRoomAirMod->AirModel.deallocate(); @@ -267,7 +267,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataUCSDShared->HWindow.deallocate(); state->dataUCSDShared->HDoor.deallocate(); state->dataRoomAirMod->ZoneCeilingHeight.deallocate(); - state->dataRoomAirMod->ZoneUCSDCV.deallocate(); + state->dataRoomAirMod->ZoneCrossVent.deallocate(); } TEST_F(EnergyPlusFixture, DVThirdOrderFloorTempCalculation) diff --git a/tst/EnergyPlus/unit/HybridModel.unit.cc b/tst/EnergyPlus/unit/HybridModel.unit.cc index 93a711a7e0d..e1512a59e32 100644 --- a/tst/EnergyPlus/unit/HybridModel.unit.cc +++ b/tst/EnergyPlus/unit/HybridModel.unit.cc @@ -125,11 +125,10 @@ TEST_F(EnergyPlusFixture, HybridModel_correctZoneAirTempsTest) state->dataSurface->Surface.allocate(2); state->dataHeatBalSurf->SurfHConvInt.allocate(1); state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1); - state->dataRoomAirMod->IsZoneDV.dimension(1, false); - state->dataRoomAirMod->IsZoneCV.dimension(1, false); - state->dataRoomAirMod->IsZoneCV.dimension(1, false); + state->dataRoomAirMod->IsZoneDispVent3Node.dimension(1, false); + state->dataRoomAirMod->IsZoneCrossVent.dimension(1, false); state->dataRoomAirMod->IsZoneUI.dimension(1, false); - state->dataRoomAirMod->ZoneDVMixedFlag.allocate(1); + state->dataRoomAirMod->ZoneDispVent3NodeMixedFlag.allocate(1); state->dataHeatBal->ZnAirRpt.allocate(1); state->dataZoneEquip->ZoneEquipConfig.allocate(1); state->dataHeatBal->ZoneIntGain.allocate(1); @@ -501,10 +500,10 @@ TEST_F(EnergyPlusFixture, HybridModel_CorrectZoneContaminantsTest) state->dataSurface->SurfaceWindow.allocate(1); state->dataSurface->Surface.allocate(2); state->dataHeatBalSurf->SurfHConvInt.allocate(1); - state->dataRoomAirMod->IsZoneDV.dimension(1, false); - state->dataRoomAirMod->IsZoneCV.dimension(1, false); + state->dataRoomAirMod->IsZoneDispVent3Node.dimension(1, false); + state->dataRoomAirMod->IsZoneCrossVent.dimension(1, false); state->dataRoomAirMod->IsZoneUI.dimension(1, false); - state->dataRoomAirMod->ZoneDVMixedFlag.allocate(1); + state->dataRoomAirMod->ZoneDispVent3NodeMixedFlag.allocate(1); state->dataHeatBal->ZnAirRpt.allocate(1); state->dataZoneEquip->ZoneEquipConfig.allocate(1); state->dataSize->ZoneEqSizing.allocate(1); diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 6b948c51b27..8b2c1ad30eb 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -106,7 +106,7 @@ class RoomAirflowNetworkTest : public EnergyPlusFixture state->dataLoopNodes->NumOfNodes = 5; state->dataGlobal->BeginEnvrnFlag = true; int NumOfSurfaces = 2; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAirMod->AFNZoneInfo.allocate(state->dataGlobal->NumOfZones); state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); state->dataHeatBal->space.allocate(state->dataGlobal->numSpaces); state->dataZoneEquip->ZoneEquipConfig.allocate(state->dataGlobal->NumOfZones); @@ -151,67 +151,67 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataEnvrn->OutBaroPress = 101325.0; state->dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).IsUsed = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).ActualZoneID = ZoneNum; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).NumOfAirNodes = NumOfAirNodes; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node.allocate(NumOfAirNodes); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).ControlAirNodeID = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).ZoneVolumeFraction = 0.2; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).ZoneVolumeFraction = 0.8; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC.allocate(1); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC.allocate(1); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).NumHVACs = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).NumHVACs = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyFraction = 0.4; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnFraction = 0.4; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "ZoneHVAC"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "ZoneHVAC"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyNodeName = "Supply"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyNodeName = "Supply"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnNodeName = "Return"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnNodeName = "Return"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "ZoneHVAC"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "ZoneHVAC"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).IntGainsDeviceIndices.allocate(1); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).IntGainsDeviceIndices.allocate(1); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).intGainsDeviceSpaces.allocate(1); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).intGainsDeviceSpaces.allocate(1); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).NumIntGains = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).NumIntGains = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).IntGainsDeviceIndices(1) = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).IntGainsDeviceIndices(1) = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).intGainsDeviceSpaces(1) = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).intGainsDeviceSpaces(1) = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).IntGainsFractions.allocate(1); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).IntGainsFractions.allocate(1); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).IntGainsFractions(1) = 0.4; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).IntGainsFractions(1) = 0.6; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HasIntGainsAssigned = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HasIntGainsAssigned = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HasSurfacesAssigned = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HasSurfacesAssigned = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HasHVACAssigned = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HasHVACAssigned = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).SurfMask.allocate(2); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).SurfMask.allocate(2); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).SurfMask(1) = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).SurfMask(2) = false; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).SurfMask(1) = false; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).SurfMask(2) = true; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).NumOfAirflowLinks = 3; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).Link.allocate(3); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).Link(1).AirflowNetworkLinkSimuID = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).Link(2).AirflowNetworkLinkSimuID = 2; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).Link(3).AirflowNetworkLinkSimuID = 3; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).AirflowNetworkNodeID = 1; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).NumOfAirflowLinks = 3; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).Link.allocate(3); - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).Link(1).AirflowNetworkLinkSimuID = 3; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).Link(2).AirflowNetworkLinkSimuID = 4; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).Link(3).AirflowNetworkLinkSimuID = 5; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).AirflowNetworkNodeID = 2; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).IsUsed = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).ActualZoneID = ZoneNum; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).NumOfAirNodes = NumOfAirNodes; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node.allocate(NumOfAirNodes); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).ControlAirNodeID = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).ZoneVolumeFraction = 0.2; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).ZoneVolumeFraction = 0.8; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC.allocate(1); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC.allocate(1); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).NumHVACs = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).NumHVACs = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyFraction = 0.4; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnFraction = 0.4; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "ZoneHVAC"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "ZoneHVAC"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyNodeName = "Supply"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyNodeName = "Supply"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnNodeName = "Return"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnNodeName = "Return"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "ZoneHVAC"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "ZoneHVAC"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).IntGainsDeviceIndices.allocate(1); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).IntGainsDeviceIndices.allocate(1); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).intGainsDeviceSpaces.allocate(1); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).intGainsDeviceSpaces.allocate(1); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).NumIntGains = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).NumIntGains = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).IntGainsDeviceIndices(1) = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).IntGainsDeviceIndices(1) = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).intGainsDeviceSpaces(1) = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).intGainsDeviceSpaces(1) = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).IntGainsFractions.allocate(1); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).IntGainsFractions.allocate(1); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).IntGainsFractions(1) = 0.4; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).IntGainsFractions(1) = 0.6; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HasIntGainsAssigned = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HasIntGainsAssigned = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HasSurfacesAssigned = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HasSurfacesAssigned = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HasHVACAssigned = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HasHVACAssigned = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).SurfMask.allocate(2); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).SurfMask.allocate(2); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).SurfMask(1) = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).SurfMask(2) = false; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).SurfMask(1) = false; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).SurfMask(2) = true; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).NumOfAirflowLinks = 3; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link.allocate(3); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(1).AirflowNetworkLinkSimuID = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(2).AirflowNetworkLinkSimuID = 2; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(3).AirflowNetworkLinkSimuID = 3; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).AirflowNetworkNodeID = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).NumOfAirflowLinks = 3; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link.allocate(3); + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(1).AirflowNetworkLinkSimuID = 3; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(2).AirflowNetworkLinkSimuID = 4; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(3).AirflowNetworkLinkSimuID = 5; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).AirflowNetworkNodeID = 2; state->afn->AirflowNetworkLinkageData(1).NodeNums[0] = 1; state->afn->AirflowNetworkLinkageData(2).NodeNums[0] = 1; @@ -321,54 +321,54 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); - EXPECT_NEAR(120.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); - EXPECT_NEAR(80.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); - EXPECT_NEAR(1.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHA, 0.00001); - EXPECT_NEAR(25.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHATsurf, 0.00001); - EXPECT_NEAR(0.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHATref, 0.00001); - EXPECT_NEAR(4.0268, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCp, 0.0001); - EXPECT_NEAR(80.536, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCpT, 0.001); - EXPECT_NEAR(0.004, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumSysM, 0.00001); - EXPECT_NEAR(4.0e-6, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMW, 0.00001); - EXPECT_NEAR(30.200968, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCp, 0.0001); - EXPECT_NEAR(744.95722, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCpT, 0.001); - EXPECT_NEAR(0.03, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkM, 0.00001); - EXPECT_NEAR(3.0e-5, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW, 0.00001); - EXPECT_NEAR(-8.431365e-8, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHmAW, 0.0000001); - EXPECT_NEAR(0.0009756833, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); - EXPECT_NEAR(9.0784549e-7, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); + EXPECT_NEAR(120.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); + EXPECT_NEAR(80.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); + EXPECT_NEAR(1.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHA, 0.00001); + EXPECT_NEAR(25.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATsurf, 0.00001); + EXPECT_NEAR(0.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATref, 0.00001); + EXPECT_NEAR(4.0268, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCp, 0.0001); + EXPECT_NEAR(80.536, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCpT, 0.001); + EXPECT_NEAR(0.004, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysM, 0.00001); + EXPECT_NEAR(4.0e-6, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMW, 0.00001); + EXPECT_NEAR(30.200968, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCp, 0.0001); + EXPECT_NEAR(744.95722, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCpT, 0.001); + EXPECT_NEAR(0.03, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkM, 0.00001); + EXPECT_NEAR(3.0e-5, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW, 0.00001); + EXPECT_NEAR(-8.431365e-8, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmAW, 0.0000001); + EXPECT_NEAR(0.0009756833, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); + EXPECT_NEAR(9.0784549e-7, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); thisRAFN.CalcRoomAirModelAirflowNetwork(*state, RoomAirNode); - EXPECT_NEAR(24.907085, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); - EXPECT_NEAR(0.00189601, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); - EXPECT_NEAR(9.770445, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); + EXPECT_NEAR(24.907085, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); + EXPECT_NEAR(0.00189601, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); + EXPECT_NEAR(9.770445, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); RoomAirNode = 2; thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); - EXPECT_NEAR(180.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); - EXPECT_NEAR(120.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); - EXPECT_NEAR(2.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHA, 0.00001); - EXPECT_NEAR(60.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHATsurf, 0.00001); - EXPECT_NEAR(0.0, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHATref, 0.00001); - EXPECT_NEAR(6.04019, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCp, 0.0001); - EXPECT_NEAR(120.803874, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCpT, 0.00001); - EXPECT_NEAR(0.006, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumSysM, 0.00001); - EXPECT_NEAR(6.0e-6, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMW, 0.00001); - EXPECT_NEAR(20.14327, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCp, 0.0001); - EXPECT_NEAR(523.73441, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCpT, 0.001); - EXPECT_NEAR(0.02, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkM, 0.00001); - EXPECT_NEAR(2.5e-5, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW, 0.00001); - EXPECT_NEAR(-3.5644894e-9, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHmAW, 0.0000001); - EXPECT_NEAR(0.0019191284, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); - EXPECT_NEAR(1.98975381e-6, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); + EXPECT_NEAR(180.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); + EXPECT_NEAR(120.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); + EXPECT_NEAR(2.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHA, 0.00001); + EXPECT_NEAR(60.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATsurf, 0.00001); + EXPECT_NEAR(0.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATref, 0.00001); + EXPECT_NEAR(6.04019, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCp, 0.0001); + EXPECT_NEAR(120.803874, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCpT, 0.00001); + EXPECT_NEAR(0.006, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysM, 0.00001); + EXPECT_NEAR(6.0e-6, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMW, 0.00001); + EXPECT_NEAR(20.14327, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCp, 0.0001); + EXPECT_NEAR(523.73441, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCpT, 0.001); + EXPECT_NEAR(0.02, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkM, 0.00001); + EXPECT_NEAR(2.5e-5, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW, 0.00001); + EXPECT_NEAR(-3.5644894e-9, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmAW, 0.0000001); + EXPECT_NEAR(0.0019191284, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); + EXPECT_NEAR(1.98975381e-6, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); thisRAFN.CalcRoomAirModelAirflowNetwork(*state, RoomAirNode); - EXPECT_NEAR(24.057841, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); - EXPECT_NEAR(0.0028697086, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); - EXPECT_NEAR(15.53486185, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); + EXPECT_NEAR(24.057841, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); + EXPECT_NEAR(0.0028697086, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); + EXPECT_NEAR(15.53486185, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); thisRAFN.UpdateRoomAirModelAirflowNetwork(*state); @@ -401,17 +401,17 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataDefineEquipment->AirDistUnit(1).Name = "ADU"; state->dataDefineEquipment->AirDistUnit(1).EquipName.allocate(1); state->dataDefineEquipment->AirDistUnit(1).EquipName(1) = "AirTerminal"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "AirTerminal"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyFraction = 0.4; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnFraction = 0.4; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "AirTerminal"; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; - state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "AirTerminal"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyFraction = 0.4; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnFraction = 0.4; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "AirTerminal"; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); // No errorfound - EXPECT_NEAR(1.1824296, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).RhoAir, 0.00001); - EXPECT_NEAR(1010.1746, state->dataRoomAirMod->RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNode).CpAir, 0.001); + EXPECT_NEAR(1.1824296, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RhoAir, 0.00001); + EXPECT_NEAR(1010.1746, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).CpAir, 0.001); state->dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf = false; } @@ -527,7 +527,7 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) "RoomAirSettings:AirflowNetwork,", " living_unit1, !- Name", " living_unit1, !- Zone Name", - " Node1, !- Control Point RoomAirflowNetwork : Node Name", + " Node1, !- Control Point AFN : Node Name", " Node1; !- RoomAirflowNetwork : Node Name 1", }); diff --git a/tst/EnergyPlus/unit/SQLite.unit.cc b/tst/EnergyPlus/unit/SQLite.unit.cc index 600dcc3a315..cd0bbaf6982 100644 --- a/tst/EnergyPlus/unit/SQLite.unit.cc +++ b/tst/EnergyPlus/unit/SQLite.unit.cc @@ -810,7 +810,7 @@ TEST_F(SQLiteFixture, SQLiteProcedures_createZoneExtendedOutput) roomAirModelData0->Name = "test roomAirModel 1"; auto const roomAirModelData1 = std::make_unique(); roomAirModelData1->Name = "test roomAirModel 2"; - roomAirModelData1->AirModel = RoomAir::RoomAirModel::Mundt; + roomAirModelData1->AirModel = RoomAir::RoomAirModel::DispVent1Node; roomAirModelData1->TempCoupleScheme = RoomAir::CouplingScheme::Direct; // hmm this was set to 3 which wasn't a valid option roomAirModelData1->SimAirModel = true; diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index bfd6ce06417..327c235e891 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -986,7 +986,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortASH55) state->dataGlobal->NumOfZones = 1; state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); state->dataHeatBal->ZoneMRT.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->IsZoneDV.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAirMod->IsZoneDispVent3Node.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->IsZoneUI.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneQdotRadHVACToPerson.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneQHTRadSysToPerson.allocate(state->dataGlobal->NumOfZones); @@ -1011,7 +1011,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortASH55) state->dataHeatBal->People(1).WorkEffPtr = 0; state->dataHeatBal->People(1).clothingType = ClothingType::InsulationSchedule; - state->dataRoomAirMod->IsZoneDV(1) = state->dataRoomAirMod->IsZoneUI(1) = false; + state->dataRoomAirMod->IsZoneDispVent3Node(1) = state->dataRoomAirMod->IsZoneUI(1) = false; state->dataHeatBalFanSys->ZoneQHTRadSysToPerson(1) = 0.0; state->dataHeatBalFanSys->ZoneQCoolingPanelToPerson(1) = 0.0; state->dataHeatBalFanSys->ZoneQHWBaseboardToPerson(1) = 0.0; From 3bcf89c468dd7d75421d0fd9be3ae1b1e322f753 Mon Sep 17 00:00:00 2001 From: amirroth Date: Thu, 22 Jun 2023 19:18:59 -0400 Subject: [PATCH 06/17] BegEnd --- src/EnergyPlus/CrossVentMgr.cc | 22 +++---- src/EnergyPlus/DataRoomAirModel.hh | 6 +- src/EnergyPlus/DataUCSDSharedData.hh | 19 ++++-- src/EnergyPlus/DisplacementVentMgr.cc | 36 +++++------ src/EnergyPlus/RoomAirModelManager.cc | 60 ++++++++++--------- src/EnergyPlus/UFADManager.cc | 41 ++++++------- tst/EnergyPlus/unit/CrossVentMgr.unit.cc | 6 +- .../unit/DisplacementVentMgr.unit.cc | 50 ++++++++-------- 8 files changed, 117 insertions(+), 123 deletions(-) diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index d038af3255e..2bf87b2e045 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -167,8 +167,7 @@ namespace RoomAir { // Is the air flow model for this zone set to UCSDCV Cross Ventilation? if (state.dataRoomAirMod->IsZoneCrossVent(ZoneNum)) { // WALL Hc, HA and HAT calculation - for (int Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Wall(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Wall(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -182,8 +181,7 @@ namespace RoomAir { state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWall(Ctd); } // END WALL // WINDOW Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Window(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Window(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Window(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -246,8 +244,7 @@ namespace RoomAir { state.dataRoomAirMod->CrossVentHcIn(SurfNum) = state.dataUCSDShared->HWindow(Ctd); } // END WINDOW // DOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 2); - ++Ctd) { // DOOR + for (int Ctd = state.dataUCSDShared->PosZ_Door(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR int SurfNum = state.dataUCSDShared->APos_Door(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -261,9 +258,7 @@ namespace RoomAir { state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HDoor(Ctd); } // END DOOR // INTERNAL Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 1); - Ctd <= state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Internal(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Internal(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -278,9 +273,7 @@ namespace RoomAir { } // END INTERNAL // CEILING Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 1); - Ctd <= state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Ceiling(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -308,8 +301,7 @@ namespace RoomAir { state.dataRoomAirMod->CrossVentHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); } // END CEILING // FLOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Floor(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Floor(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -492,7 +484,7 @@ namespace RoomAir { } Real64 const Wroom_2(pow_2(Wroom)); - for (int Ctd = state.dataUCSDShared->PosZ_Wall(2 * ZoneNum - 1); Ctd <= state.dataUCSDShared->PosZ_Wall(2 * ZoneNum); ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Wall(ZoneNum).end; ++Ctd) { if ((state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Sides == 3) || (state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Sides == 4)) { XX_Wall = state.dataSurface->Surface(state.dataUCSDShared->APos_Wall(Ctd)).Centroid.x; diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index 0896981e8d5..453e4ea44a5 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -561,7 +561,8 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ZoneDispVent3NodeMixedFlagRep; Array1D_bool ZoneAirSystemON; Array1D TCMF; // comfort temperature - Array1D ZoneCeilingHeight; + Array1D ZoneCeilingHeight1; + Array1D ZoneCeilingHeight2; Array1D MATFloor; // [C] floor level mean air temp Array1D XMATFloor; // [C] floor level mean air temp at t minus 1 zone time step Array1D XM2TFloor; // [C] floor level mean air temp at t minus 2 zone time step @@ -702,7 +703,8 @@ struct RoomAirModelData : BaseGlobalStruct ZoneDispVent3NodeMixedFlagRep.clear(); ZoneAirSystemON.clear(); TCMF.clear(); // comfort temperature - ZoneCeilingHeight.clear(); + ZoneCeilingHeight1.clear(); + ZoneCeilingHeight2.clear(); MATFloor.clear(); // [C] floor level mean air temp XMATFloor.clear(); // [C] floor level mean air temp at t minus 1 zone time step XM2TFloor.clear(); // [C] floor level mean air temp at t minus 2 zone time step diff --git a/src/EnergyPlus/DataUCSDSharedData.hh b/src/EnergyPlus/DataUCSDSharedData.hh index 1c076069ffa..497faae6210 100644 --- a/src/EnergyPlus/DataUCSDSharedData.hh +++ b/src/EnergyPlus/DataUCSDSharedData.hh @@ -57,6 +57,13 @@ namespace EnergyPlus { +namespace RoomAir { + struct BegEnd { + int beg = 0; + int end = 0; + }; +} // namespace RoomAir + struct UCSDSharedData : BaseGlobalStruct { // The Eplus surface numbers will be stored in the arrays Apos according to the @@ -66,15 +73,15 @@ struct UCSDSharedData : BaseGlobalStruct Array1D_int APos_Wall; Array1D_int APos_Floor; Array1D_int APos_Ceiling; - Array1D_int PosZ_Wall; - Array1D_int PosZ_Floor; - Array1D_int PosZ_Ceiling; + Array1D PosZ_Wall; + Array1D PosZ_Floor; + Array1D PosZ_Ceiling; Array1D_int APos_Window; Array1D_int APos_Door; Array1D_int APos_Internal; - Array1D_int PosZ_Window; - Array1D_int PosZ_Door; - Array1D_int PosZ_Internal; + Array1D PosZ_Window; + Array1D PosZ_Door; + Array1D PosZ_Internal; // Convection coefficients for the various surfaces Array1D HCeiling; Array1D HWall; diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index f7fda7fa4c4..8d38fc3719c 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -201,18 +201,17 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? if (state.dataRoomAirMod->IsZoneDispVent3Node(ZoneNum)) { LayFrac = FractionHeight; - LayH = FractionHeight * - (state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1)); + LayH = FractionHeight * (state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum)); // WALL Hc, HA and HAT calculation - for (int Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2); ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Wall(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Wall(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (SurfNum == 0) continue; Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { @@ -257,8 +256,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } // END WALL // WINDOW Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Window(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Window(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Window(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -266,8 +264,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Window Wall Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); @@ -328,8 +326,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } // END WINDOW // DOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 2); - ++Ctd) { // DOOR + for (int Ctd = state.dataUCSDShared->PosZ_Door(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR int SurfNum = state.dataUCSDShared->APos_Door(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -337,8 +334,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Door Wall Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); @@ -401,9 +398,8 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // INTERNAL Hc, HA and HAT CALCULATION state.dataDispVentMgr->HeightIntMass = min(state.dataDispVentMgr->HeightIntMassDefault, - (state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1))); - for (int Ctd = state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 2); - ++Ctd) { + (state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum))); + for (int Ctd = state.dataUCSDShared->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Internal(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Internal(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -443,8 +439,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } // END INTERNAL // CEILING Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Ceiling(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -458,8 +453,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } // END CEILING // FLOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Floor(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Floor(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -596,7 +590,7 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum MIXFLAG = false; FlagApertures = 1; state.dataRoomAirMod->DispVent3NodeHcIn = state.dataHeatBalSurf->SurfHConvInt; - CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); ZoneMult = zone.Multiplier * zone.ListMultiplier; auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 0045c2ad69c..53e82d77319 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1816,15 +1816,15 @@ namespace RoomAir { state.dataUCSDShared->APos_Wall.allocate(state.dataSurface->TotSurfaces); state.dataUCSDShared->APos_Floor.allocate(state.dataSurface->TotSurfaces); state.dataUCSDShared->APos_Ceiling.allocate(state.dataSurface->TotSurfaces); - state.dataUCSDShared->PosZ_Wall.allocate(state.dataGlobal->NumOfZones * 2); - state.dataUCSDShared->PosZ_Floor.allocate(state.dataGlobal->NumOfZones * 2); - state.dataUCSDShared->PosZ_Ceiling.allocate(state.dataGlobal->NumOfZones * 2); + state.dataUCSDShared->PosZ_Wall.allocate(state.dataGlobal->NumOfZones); + state.dataUCSDShared->PosZ_Floor.allocate(state.dataGlobal->NumOfZones); + state.dataUCSDShared->PosZ_Ceiling.allocate(state.dataGlobal->NumOfZones); state.dataUCSDShared->APos_Window.allocate(state.dataSurface->TotSurfaces); state.dataUCSDShared->APos_Door.allocate(state.dataSurface->TotSurfaces); state.dataUCSDShared->APos_Internal.allocate(state.dataSurface->TotSurfaces); - state.dataUCSDShared->PosZ_Window.allocate(state.dataGlobal->NumOfZones * 2); - state.dataUCSDShared->PosZ_Door.allocate(state.dataGlobal->NumOfZones * 2); - state.dataUCSDShared->PosZ_Internal.allocate(state.dataGlobal->NumOfZones * 2); + state.dataUCSDShared->PosZ_Window.allocate(state.dataGlobal->NumOfZones); + state.dataUCSDShared->PosZ_Door.allocate(state.dataGlobal->NumOfZones); + state.dataUCSDShared->PosZ_Internal.allocate(state.dataGlobal->NumOfZones); state.dataUCSDShared->HCeiling.allocate(state.dataSurface->TotSurfaces); state.dataUCSDShared->HWall.allocate(state.dataSurface->TotSurfaces); state.dataUCSDShared->HFloor.allocate(state.dataSurface->TotSurfaces); @@ -1834,22 +1834,24 @@ namespace RoomAir { AuxSurf.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneCeilingHeight.allocate(state.dataGlobal->NumOfZones * 2); - state.dataRoomAirMod->ZoneCeilingHeight = 0.0; + state.dataRoomAirMod->ZoneCeilingHeight1.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneCeilingHeight2.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAirMod->ZoneCeilingHeight1 = 0.0; + state.dataRoomAirMod->ZoneCeilingHeight2 = 0.0; // Arrays initializations state.dataUCSDShared->APos_Wall = 0; state.dataUCSDShared->APos_Floor = 0; state.dataUCSDShared->APos_Ceiling = 0; - state.dataUCSDShared->PosZ_Wall = 0; - state.dataUCSDShared->PosZ_Floor = 0; - state.dataUCSDShared->PosZ_Ceiling = 0; + std::fill(state.dataUCSDShared->PosZ_Wall.begin(),state.dataUCSDShared->PosZ_Wall.end(), BegEnd()); + std::fill(state.dataUCSDShared->PosZ_Floor.begin(),state.dataUCSDShared->PosZ_Floor.end(), BegEnd()); + std::fill(state.dataUCSDShared->PosZ_Ceiling.begin(),state.dataUCSDShared->PosZ_Ceiling.end(), BegEnd()); state.dataUCSDShared->APos_Window = 0; state.dataUCSDShared->APos_Door = 0; state.dataUCSDShared->APos_Internal = 0; - state.dataUCSDShared->PosZ_Window = 0; - state.dataUCSDShared->PosZ_Door = 0; - state.dataUCSDShared->PosZ_Internal = 0; + std::fill(state.dataUCSDShared->PosZ_Window.begin(),state.dataUCSDShared->PosZ_Window.end(), BegEnd()); + std::fill(state.dataUCSDShared->PosZ_Door.begin(),state.dataUCSDShared->PosZ_Door.end(), BegEnd()); + std::fill(state.dataUCSDShared->PosZ_Internal.begin(),state.dataUCSDShared->PosZ_Internal.end(), BegEnd()); state.dataUCSDShared->HCeiling = 0.0; state.dataUCSDShared->HWall = 0.0; state.dataUCSDShared->HFloor = 0.0; @@ -1921,21 +1923,21 @@ namespace RoomAir { contInternalLast = contInternal; // PosZ_Wall (... + 1) has the Begin Wall reference in Apos_Wall for the ZNum // PosZ_Wall (... + 2) has the End Wall reference in Apos_Wall for the ZNum - state.dataUCSDShared->PosZ_Wall((ZNum - 1) * 2 + 1) = contWallBeg; - state.dataUCSDShared->PosZ_Wall((ZNum - 1) * 2 + 2) = contWallLast; - state.dataUCSDShared->PosZ_Floor((ZNum - 1) * 2 + 1) = contFloorBeg; - state.dataUCSDShared->PosZ_Floor((ZNum - 1) * 2 + 2) = contFloorLast; - state.dataUCSDShared->PosZ_Ceiling((ZNum - 1) * 2 + 1) = contCeilingBeg; - state.dataUCSDShared->PosZ_Ceiling((ZNum - 1) * 2 + 2) = contCeilingLast; - state.dataUCSDShared->PosZ_Window((ZNum - 1) * 2 + 1) = contWindowBeg; - state.dataUCSDShared->PosZ_Window((ZNum - 1) * 2 + 2) = contWindowLast; - state.dataUCSDShared->PosZ_Door((ZNum - 1) * 2 + 1) = contDoorBeg; - state.dataUCSDShared->PosZ_Door((ZNum - 1) * 2 + 2) = contDoorLast; - state.dataUCSDShared->PosZ_Internal((ZNum - 1) * 2 + 1) = contInternalBeg; - state.dataUCSDShared->PosZ_Internal((ZNum - 1) * 2 + 2) = contInternalLast; + state.dataUCSDShared->PosZ_Wall(ZNum).beg = contWallBeg; + state.dataUCSDShared->PosZ_Wall(ZNum).end = contWallLast; + state.dataUCSDShared->PosZ_Floor(ZNum).beg = contFloorBeg; + state.dataUCSDShared->PosZ_Floor(ZNum).end = contFloorLast; + state.dataUCSDShared->PosZ_Ceiling(ZNum).beg = contCeilingBeg; + state.dataUCSDShared->PosZ_Ceiling(ZNum).end = contCeilingLast; + state.dataUCSDShared->PosZ_Window(ZNum).beg = contWindowBeg; + state.dataUCSDShared->PosZ_Window(ZNum).end = contWindowLast; + state.dataUCSDShared->PosZ_Door(ZNum).beg = contDoorBeg; + state.dataUCSDShared->PosZ_Door(ZNum).end = contDoorLast; + state.dataUCSDShared->PosZ_Internal(ZNum).beg = contInternalBeg; + state.dataUCSDShared->PosZ_Internal(ZNum).end = contInternalLast; // Save the highest and lowest height for this zone - state.dataRoomAirMod->ZoneCeilingHeight((ZNum - 1) * 2 + 1) = Z1ofZone; - state.dataRoomAirMod->ZoneCeilingHeight((ZNum - 1) * 2 + 2) = Z2ofZone; + state.dataRoomAirMod->ZoneCeilingHeight1(ZNum) = Z1ofZone; + state.dataRoomAirMod->ZoneCeilingHeight2(ZNum) = Z2ofZone; constexpr Real64 CeilingHeightDiffMaximum = 0.1; if (std::abs((Z2ofZone - Z1ofZone) - state.dataHeatBal->Zone(ZNum).CeilingHeight) > CeilingHeightDiffMaximum) { @@ -1987,7 +1989,7 @@ namespace RoomAir { if (AuxSurf(iZone) == 0) continue; - Real64 const ceilingHeight(state.dataRoomAirMod->ZoneCeilingHeight((iZone - 1) * 2 + 1)); + Real64 const ceilingHeight = state.dataRoomAirMod->ZoneCeilingHeight1(iZone); int SurfNum = 1; for (int iMzLink = 1; iMzLink <= state.afn->NumOfLinksMultiZone; ++iMzLink) { diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 019718633e3..0614d269c6b 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -195,7 +195,7 @@ void InitUCSDUF(EnergyPlusData &state, state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; NumShadesDown = 0.0; - for (int Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Window(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Window(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Window(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); @@ -448,8 +448,7 @@ void SizeUCSDUF(EnergyPlusData &state, UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(UINum); // calculate total window width in zone - for (int Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Window(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Window(ZoneNum).end; ++Ctd) { int SurfNum = state.dataUCSDShared->APos_Window(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); @@ -675,7 +674,6 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei using namespace DataHeatBalance; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Ctd; // DO loop counter for surfaces Real64 HLD; // Convection coefficient for the lower area of surface Real64 TmedDV; // Average temperature for DV Real64 Z1; // auxiliary var for lowest height @@ -703,9 +701,9 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (state.dataRoomAirMod->IsZoneUI(ZoneNum)) { LayFrac = FractionHeight; LayH = FractionHeight * - (state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1)); + (state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum)); // WALL Hc, HA and HAT calculation - for (Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2); ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Wall(ZoneNum).end; ++Ctd) { SurfNum = state.dataUCSDShared->APos_Wall(Ctd); auto &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; @@ -713,8 +711,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (SurfNum == 0) continue; Z1 = minval(surf.Vertex, &Vector::z); Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { @@ -772,7 +770,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } // END WALL // WINDOW Hc, HA and HAT CALCULATION - for (Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Window(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Window(ZoneNum).end; ++Ctd) { SurfNum = state.dataUCSDShared->APos_Window(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -782,8 +780,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall Z1 = minval(surf.Vertex, &Vector::z); Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); @@ -858,8 +856,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } // END WINDOW // DOOR Hc, HA and HAT CALCULATION - for (Ctd = state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 2); - ++Ctd) { // DOOR + for (int Ctd = state.dataUCSDShared->PosZ_Door(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR SurfNum = state.dataUCSDShared->APos_Door(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; @@ -868,8 +865,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei Z1 = minval(surf.Vertex, &Vector::z); Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); @@ -915,9 +912,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // INTERNAL Hc, HA and HAT CALCULATION state.dataUFADManager->HeightIntMass = min(state.dataUFADManager->HeightIntMassDefault, - (state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1))); - for (Ctd = state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 2); - ++Ctd) { + (state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum))); + for (int Ctd = state.dataUCSDShared->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Internal(ZoneNum).end; ++Ctd) { SurfNum = state.dataUCSDShared->APos_Internal(Ctd); auto &surf = state.dataSurface->Surface(SurfNum); @@ -959,8 +955,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } // END INTERNAL // CEILING Hc, HA and HAT CALCULATION - for (Ctd = state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 2); - ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Ceiling(ZoneNum).end; ++Ctd) { SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); auto &surf = state.dataSurface->Surface(SurfNum); @@ -977,7 +972,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } // END CEILING // FLOOR Hc, HA and HAT CALCULATION - for (Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2); ++Ctd) { + for (int Ctd = state.dataUCSDShared->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataUCSDShared->PosZ_Floor(ZoneNum).end; ++Ctd) { SurfNum = state.dataUCSDShared->APos_Floor(Ctd); auto &surf = state.dataSurface->Surface(SurfNum); @@ -1141,7 +1136,7 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th TSupK = 0.0; SumSysM = 0.0; ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; - CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); auto &zoneUI = state.dataRoomAirMod->ZoneUFADInt(UINum); HeightThermostat = zoneUI.ThermostatHeight; @@ -1649,7 +1644,7 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th ConvGainsWindows = 0.0; Gamma = 0.0; ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; - CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 2) - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); + CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(UINum); HeightThermostat = zoneUE.ThermostatHeight; diff --git a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc index f20a799113b..2796c2e5909 100644 --- a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc @@ -146,9 +146,9 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->dataRoomAirMod->CrossVentJetRecFlows.allocate({0, MaxSurf}, 1); - state->dataUCSDShared->PosZ_Wall.allocate(2); - state->dataUCSDShared->PosZ_Wall(1) = 1; - state->dataUCSDShared->PosZ_Wall(2) = 4; + state->dataUCSDShared->PosZ_Wall.allocate(1); + state->dataUCSDShared->PosZ_Wall(1).beg = 1; + state->dataUCSDShared->PosZ_Wall(1).end = 4; state->dataUCSDShared->APos_Wall.allocate(12); state->dataUCSDShared->APos_Wall(1) = 5; diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index e67e610b2b3..5faa5275565 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -169,15 +169,15 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataUCSDShared->APos_Wall.allocate(TotSurfaces); state->dataUCSDShared->APos_Floor.allocate(TotSurfaces); state->dataUCSDShared->APos_Ceiling.allocate(TotSurfaces); - state->dataUCSDShared->PosZ_Wall.allocate(state->dataGlobal->NumOfZones * 2); - state->dataUCSDShared->PosZ_Floor.allocate(state->dataGlobal->NumOfZones * 2); - state->dataUCSDShared->PosZ_Ceiling.allocate(state->dataGlobal->NumOfZones * 2); + state->dataUCSDShared->PosZ_Wall.allocate(state->dataGlobal->NumOfZones); + state->dataUCSDShared->PosZ_Floor.allocate(state->dataGlobal->NumOfZones); + state->dataUCSDShared->PosZ_Ceiling.allocate(state->dataGlobal->NumOfZones); state->dataUCSDShared->APos_Window.allocate(TotSurfaces); state->dataUCSDShared->APos_Door.allocate(TotSurfaces); state->dataUCSDShared->APos_Internal.allocate(TotSurfaces); - state->dataUCSDShared->PosZ_Window.allocate(state->dataGlobal->NumOfZones * 2); - state->dataUCSDShared->PosZ_Door.allocate(state->dataGlobal->NumOfZones * 2); - state->dataUCSDShared->PosZ_Internal.allocate(state->dataGlobal->NumOfZones * 2); + state->dataUCSDShared->PosZ_Window.allocate(state->dataGlobal->NumOfZones); + state->dataUCSDShared->PosZ_Door.allocate(state->dataGlobal->NumOfZones); + state->dataUCSDShared->PosZ_Internal.allocate(state->dataGlobal->NumOfZones); state->dataUCSDShared->HCeiling.allocate(TotSurfaces); state->dataUCSDShared->HWall.allocate(TotSurfaces); state->dataUCSDShared->HFloor.allocate(TotSurfaces); @@ -185,29 +185,30 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataUCSDShared->HWindow.allocate(TotSurfaces); state->dataUCSDShared->HDoor.allocate(TotSurfaces); - state->dataRoomAirMod->ZoneCeilingHeight.allocate(state->dataGlobal->NumOfZones * 2); - state->dataRoomAirMod->ZoneCeilingHeight(1) = 4.9784; - state->dataRoomAirMod->ZoneCeilingHeight(2) = 4.9784; + state->dataRoomAirMod->ZoneCeilingHeight1.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAirMod->ZoneCeilingHeight2.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAirMod->ZoneCeilingHeight1(1) = 4.9784; + state->dataRoomAirMod->ZoneCeilingHeight2(1) = 4.9784; // Arrays initializations state->dataUCSDShared->APos_Wall = 0; state->dataUCSDShared->APos_Floor = 0; state->dataUCSDShared->APos_Ceiling = 0; - state->dataUCSDShared->PosZ_Wall(1) = 1; - state->dataUCSDShared->PosZ_Wall(2) = 0; - state->dataUCSDShared->PosZ_Floor(1) = 1; - state->dataUCSDShared->PosZ_Floor(2) = 0; - state->dataUCSDShared->PosZ_Ceiling(1) = 1; - state->dataUCSDShared->PosZ_Ceiling(2) = 0; + state->dataUCSDShared->PosZ_Wall(1).beg = 1; + state->dataUCSDShared->PosZ_Wall(1).end = 0; + state->dataUCSDShared->PosZ_Floor(1).beg = 1; + state->dataUCSDShared->PosZ_Floor(1).end = 0; + state->dataUCSDShared->PosZ_Ceiling(1).beg = 1; + state->dataUCSDShared->PosZ_Ceiling(1).end = 0; state->dataUCSDShared->APos_Window = 0; state->dataUCSDShared->APos_Door = 0; state->dataUCSDShared->APos_Internal = 0; - state->dataUCSDShared->PosZ_Window(1) = 1; - state->dataUCSDShared->PosZ_Window(2) = 0; - state->dataUCSDShared->PosZ_Door(1) = 1; - state->dataUCSDShared->PosZ_Door(2) = 3; - state->dataUCSDShared->PosZ_Internal(1) = 1; - state->dataUCSDShared->PosZ_Internal(2) = 0; + state->dataUCSDShared->PosZ_Window(1).beg = 1; + state->dataUCSDShared->PosZ_Window(1).end = 0; + state->dataUCSDShared->PosZ_Door(1).beg = 1; + state->dataUCSDShared->PosZ_Door(1).end = 3; + state->dataUCSDShared->PosZ_Internal(1).beg = 1; + state->dataUCSDShared->PosZ_Internal(1).end = 0; state->dataUCSDShared->HCeiling = 0.0; state->dataUCSDShared->HWall = 0.0; state->dataUCSDShared->HFloor = 0.0; @@ -217,8 +218,8 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataRoomAirMod->ZoneCrossVent.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->ZoneCrossVent(1).ZonePtr = 1; - state->dataUCSDShared->PosZ_Door(1) = 1; - state->dataUCSDShared->PosZ_Door(2) = 3; + state->dataUCSDShared->PosZ_Door(1).beg = 1; + state->dataUCSDShared->PosZ_Door(1).end = 3; state->dataUCSDShared->APos_Door(1) = 1; state->dataUCSDShared->APos_Door(2) = 2; state->dataUCSDShared->APos_Door(3) = 3; @@ -266,7 +267,8 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataUCSDShared->HInternal.deallocate(); state->dataUCSDShared->HWindow.deallocate(); state->dataUCSDShared->HDoor.deallocate(); - state->dataRoomAirMod->ZoneCeilingHeight.deallocate(); + state->dataRoomAirMod->ZoneCeilingHeight1.deallocate(); + state->dataRoomAirMod->ZoneCeilingHeight2.deallocate(); state->dataRoomAirMod->ZoneCrossVent.deallocate(); } From 65b200e3647b2bb7170370e5a439a70ee680c714 Mon Sep 17 00:00:00 2001 From: amirroth Date: Sat, 24 Jun 2023 10:28:15 -0400 Subject: [PATCH 07/17] Some array conversions --- src/EnergyPlus/DataRoomAirModel.hh | 60 ++++++++-- src/EnergyPlus/DisplacementVentMgr.cc | 48 ++++---- src/EnergyPlus/RoomAirModelManager.cc | 100 ++++++++++++---- src/EnergyPlus/UFADManager.cc | 64 +++++----- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 116 ++++++++----------- tst/EnergyPlus/unit/HybridModel.unit.cc | 2 +- 6 files changed, 233 insertions(+), 157 deletions(-) diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index 17184396f6b..0642b71b163 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -568,41 +568,59 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ZoneCeilingHeight1; Array1D ZoneCeilingHeight2; Array1D MATFloor; // [C] floor level mean air temp - Array1D XMATFloor; // [C] floor level mean air temp at t minus 1 zone time step + Array1D> XMATFloor; // [C] floor level mean air temp at t minus 1 zone time step +#ifdef GET_OUT Array1D XM2TFloor; // [C] floor level mean air temp at t minus 2 zone time step Array1D XM3TFloor; // [C] floor level mean air temp at t minus 3 zone time step Array1D XM4TFloor; // [C] floor level mean air temp at t minus 4 zone time step - Array1D DSXMATFloor; // [C] floor level mean air temp at t minus 1 system time step +#endif // + Array1D> DSXMATFloor; // [C] floor level mean air temp at t minus 1 system time step +#ifdef GET_OUT Array1D DSXM2TFloor; // [C] floor level mean air temp at t minus 2 system time step Array1D DSXM3TFloor; // [C] floor level mean air temp at t minus 3 system time step Array1D DSXM4TFloor; // [C] floor level mean air temp at t minus 4 system time step +#endif // Array1D MATOC; // [C] occupied mean air temp - Array1D XMATOC; // [C] occupied mean air temp at t minus 1 zone time step + Array1D> XMATOC; // [C] occupied mean air temp at t minus 1 zone time step +#ifdef GET_OUT Array1D XM2TOC; // [C] occupied mean air temp at t minus 2 zone time step Array1D XM3TOC; // [C] occupied mean air temp at t minus 3 zone time step Array1D XM4TOC; // [C] occupied mean air temp at t minus 4 zone time step - Array1D DSXMATOC; // [C] occupied mean air temp at t minus 1 system time step +#endif // + Array1D> DSXMATOC; // [C] occupied mean air temp at t minus 1 system time step +#ifdef GET_OUT Array1D DSXM2TOC; // [C] occupied mean air temp at t minus 2 system time step Array1D DSXM3TOC; // [C] occupied mean air temp at t minus 3 system time step Array1D DSXM4TOC; // [C] occupied mean air temp at t minus 4 system time step +#endif // Array1D MATMX; // [C] mixed (upper) mean air temp - Array1D XMATMX; // [C] mixed (upper) mean air temp at t minus 1 zone time step + Array1D> XMATMX; // [C] mixed (upper) mean air temp at t minus 1 zone time step +#ifdef GET_OUT Array1D XM2TMX; // [C] mixed (upper) mean air temp at t minus 2 zone time step Array1D XM3TMX; // [C] mixed (upper) mean air temp at t minus 3 zone time step Array1D XM4TMX; // [C] mixed (upper) mean air temp at t minus 4 zone time step - Array1D DSXMATMX; // [C] mixed mean air temp at t minus 1 system time step +#endif // + Array1D> DSXMATMX; // [C] mixed mean air temp at t minus 1 system time step +#ifdef GET_OUT Array1D DSXM2TMX; // [C] mixed mean air temp at t minus 2 system time step Array1D DSXM3TMX; // [C] mixed mean air temp at t minus 3 system time step Array1D DSXM4TMX; // [C] mixed mean air temp at t minus 4 system time step - Array1D ZTM1Floor; // [C] difference equation's Floor air temp at t minus 1 +#endif // + Array1D> ZTMFloor; // [C] difference equation's Floor air temp at t minus 1 +#ifdef GET_OUT Array1D ZTM2Floor; // [C] difference equation's Floor air temp at t minus 2 Array1D ZTM3Floor; // [C] difference equation's Floor air temp at t minus 3 - Array1D ZTM1OC; // [C] difference equation's Occupied air temp at t minus 1 +#endif // + Array1D> ZTMOC; // [C] difference equation's Occupied air temp at t minus 1 +#ifdef GET_OUT Array1D ZTM2OC; // [C] difference equation's Occupied air temp at t minus 2 Array1D ZTM3OC; // [C] difference equation's Occupied air temp at t minus 3 - Array1D ZTM1MX; // [C] difference equation's Mixed air temp at t minus 1 +#endif // + Array1D> ZTMMX; // [C] difference equation's Mixed air temp at t minus 1 +#ifdef GET_OUT Array1D ZTM2MX; // [C] difference equation's Mixed air temp at t minus 1 Array1D ZTM3MX; // [C] difference equation's Mixed air temp at t minus 1 +#endif // Array1D AIRRATFloor; Array1D AIRRATOC; Array1D AIRRATMX; @@ -757,40 +775,58 @@ struct RoomAirModelData : BaseGlobalStruct ZoneCeilingHeight2.clear(); MATFloor.clear(); // [C] floor level mean air temp XMATFloor.clear(); // [C] floor level mean air temp at t minus 1 zone time step +#ifdef GET_OUT XM2TFloor.clear(); // [C] floor level mean air temp at t minus 2 zone time step XM3TFloor.clear(); // [C] floor level mean air temp at t minus 3 zone time step XM4TFloor.clear(); // [C] floor level mean air temp at t minus 4 zone time step +#endif // DSXMATFloor.clear(); // [C] floor level mean air temp at t minus 1 system time step +#ifdef GET_OUT DSXM2TFloor.clear(); // [C] floor level mean air temp at t minus 2 system time step DSXM3TFloor.clear(); // [C] floor level mean air temp at t minus 3 system time step DSXM4TFloor.clear(); // [C] floor level mean air temp at t minus 4 system time step +#endif // MATOC.clear(); // [C] occupied mean air temp XMATOC.clear(); // [C] occupied mean air temp at t minus 1 zone time step +#ifdef GET_OUT XM2TOC.clear(); // [C] occupied mean air temp at t minus 2 zone time step XM3TOC.clear(); // [C] occupied mean air temp at t minus 3 zone time step XM4TOC.clear(); // [C] occupied mean air temp at t minus 4 zone time step +#endif // DSXMATOC.clear(); // [C] occupied mean air temp at t minus 1 system time step +#ifdef GET_OUT DSXM2TOC.clear(); // [C] occupied mean air temp at t minus 2 system time step DSXM3TOC.clear(); // [C] occupied mean air temp at t minus 3 system time step DSXM4TOC.clear(); // [C] occupied mean air temp at t minus 4 system time step +#endif // MATMX.clear(); // [C] mixed (upper) mean air temp XMATMX.clear(); // [C] mixed (upper) mean air temp at t minus 1 zone time step +#ifdef GET_OUT XM2TMX.clear(); // [C] mixed (upper) mean air temp at t minus 2 zone time step XM3TMX.clear(); // [C] mixed (upper) mean air temp at t minus 3 zone time step XM4TMX.clear(); // [C] mixed (upper) mean air temp at t minus 4 zone time step +#endif // DSXMATMX.clear(); // [C] mixed mean air temp at t minus 1 system time step +#ifdef GET_OUT DSXM2TMX.clear(); // [C] mixed mean air temp at t minus 2 system time step DSXM3TMX.clear(); // [C] mixed mean air temp at t minus 3 system time step DSXM4TMX.clear(); // [C] mixed mean air temp at t minus 4 system time step - ZTM1Floor.clear(); // [C] difference equation's Floor air temp at t minus 1 +#endif // + ZTMFloor.clear(); // [C] difference equation's Floor air temp at t minus 1 +#ifdef GET_OUT ZTM2Floor.clear(); // [C] difference equation's Floor air temp at t minus 2 ZTM3Floor.clear(); // [C] difference equation's Floor air temp at t minus 3 - ZTM1OC.clear(); // [C] difference equation's Occupied air temp at t minus 1 +#endif // + ZTMOC.clear(); // [C] difference equation's Occupied air temp at t minus 1 +#ifdef GET_OUT ZTM2OC.clear(); // [C] difference equation's Occupied air temp at t minus 2 ZTM3OC.clear(); // [C] difference equation's Occupied air temp at t minus 3 - ZTM1MX.clear(); // [C] difference equation's Mixed air temp at t minus 1 +#endif // + ZTMMX.clear(); // [C] difference equation's Mixed air temp at t minus 1 +#ifdef GET_OUT ZTM2MX.clear(); // [C] difference equation's Mixed air temp at t minus 1 ZTM3MX.clear(); // [C] difference equation's Mixed air temp at t minus 1 +#endif // AIRRATFloor.clear(); AIRRATOC.clear(); AIRRATMX.clear(); diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index 6c4306082dc..944710282dc 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -746,35 +746,35 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAirMod->ZTM3Floor(ZoneNum) = state.dataRoomAirMod->XM3TFloor(ZoneNum); - state.dataRoomAirMod->ZTM2Floor(ZoneNum) = state.dataRoomAirMod->XM2TFloor(ZoneNum); - state.dataRoomAirMod->ZTM1Floor(ZoneNum) = state.dataRoomAirMod->XMATFloor(ZoneNum); + state.dataRoomAirMod->ZTMFloor(ZoneNum)[2] = state.dataRoomAirMod->XMATFloor(ZoneNum)[2]; + state.dataRoomAirMod->ZTMFloor(ZoneNum)[1] = state.dataRoomAirMod->XMATFloor(ZoneNum)[1]; + state.dataRoomAirMod->ZTMFloor(ZoneNum)[0] = state.dataRoomAirMod->XMATFloor(ZoneNum)[0]; - state.dataRoomAirMod->ZTM3OC(ZoneNum) = state.dataRoomAirMod->XM3TOC(ZoneNum); - state.dataRoomAirMod->ZTM2OC(ZoneNum) = state.dataRoomAirMod->XM2TOC(ZoneNum); - state.dataRoomAirMod->ZTM1OC(ZoneNum) = state.dataRoomAirMod->XMATOC(ZoneNum); + state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->XMATOC(ZoneNum)[2]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->XMATOC(ZoneNum)[1]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->XMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTM3MX(ZoneNum) = state.dataRoomAirMod->XM3TMX(ZoneNum); - state.dataRoomAirMod->ZTM2MX(ZoneNum) = state.dataRoomAirMod->XM2TMX(ZoneNum); - state.dataRoomAirMod->ZTM1MX(ZoneNum) = state.dataRoomAirMod->XMATMX(ZoneNum); + state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->XMATMX(ZoneNum)[2]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->XMATMX(ZoneNum)[1]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->XMATMX(ZoneNum)[0]; } else { - state.dataRoomAirMod->ZTM3Floor(ZoneNum) = state.dataRoomAirMod->DSXM3TFloor(ZoneNum); - state.dataRoomAirMod->ZTM2Floor(ZoneNum) = state.dataRoomAirMod->DSXM2TFloor(ZoneNum); - state.dataRoomAirMod->ZTM1Floor(ZoneNum) = state.dataRoomAirMod->DSXMATFloor(ZoneNum); + state.dataRoomAirMod->ZTMFloor(ZoneNum)[2] = state.dataRoomAirMod->DSXMATFloor(ZoneNum)[2]; + state.dataRoomAirMod->ZTMFloor(ZoneNum)[1] = state.dataRoomAirMod->DSXMATFloor(ZoneNum)[1]; + state.dataRoomAirMod->ZTMFloor(ZoneNum)[0] = state.dataRoomAirMod->DSXMATFloor(ZoneNum)[0]; - state.dataRoomAirMod->ZTM3OC(ZoneNum) = state.dataRoomAirMod->DSXM3TOC(ZoneNum); - state.dataRoomAirMod->ZTM2OC(ZoneNum) = state.dataRoomAirMod->DSXM2TOC(ZoneNum); - state.dataRoomAirMod->ZTM1OC(ZoneNum) = state.dataRoomAirMod->DSXMATOC(ZoneNum); + state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[2]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[1]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTM3MX(ZoneNum) = state.dataRoomAirMod->DSXM3TMX(ZoneNum); - state.dataRoomAirMod->ZTM2MX(ZoneNum) = state.dataRoomAirMod->DSXM2TMX(ZoneNum); - state.dataRoomAirMod->ZTM1MX(ZoneNum) = state.dataRoomAirMod->DSXMATMX(ZoneNum); + state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[2]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[1]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[0]; } Real64 AirCap = state.dataRoomAirMod->AIRRATFloor(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTM1Floor(ZoneNum) - (3.0 / 2.0) * state.dataRoomAirMod->ZTM2Floor(ZoneNum) + - OneThird * state.dataRoomAirMod->ZTM3Floor(ZoneNum)); + TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMFloor(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMFloor(ZoneNum)[1] + + OneThird * state.dataRoomAirMod->ZTMFloor(ZoneNum)[2]); TempDepCoef = state.dataDispVentMgr->HA_FLOOR + MCp_Total; TempIndCoef = state.dataDispVentMgr->HAT_FLOOR + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { @@ -805,8 +805,8 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum break; } AirCap = state.dataRoomAirMod->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTM1OC(ZoneNum) - (3.0 / 2.0) * state.dataRoomAirMod->ZTM2OC(ZoneNum) + - OneThird * state.dataRoomAirMod->ZTM3OC(ZoneNum)); + TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[1] + + OneThird * state.dataRoomAirMod->ZTMOC(ZoneNum)[2]); TempDepCoef = state.dataDispVentMgr->HA_OC + MCp_Total; TempIndCoef = ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + state.dataRoomAirMod->ZTFloor(ZoneNum) * MCp_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { @@ -835,8 +835,8 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum break; } AirCap = state.dataRoomAirMod->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTM1MX(ZoneNum) - (3.0 / 2.0) * state.dataRoomAirMod->ZTM2MX(ZoneNum) + - OneThird * state.dataRoomAirMod->ZTM3MX(ZoneNum)); + TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[1] + + OneThird * state.dataRoomAirMod->ZTMMX(ZoneNum)[2]); TempDepCoef = state.dataDispVentMgr->HA_MX + MCp_Total; TempIndCoef = ConvGainsOccupiedSubzone * (1.0 - GainsFrac) + ConvGainsMixedSubzone + state.dataDispVentMgr->HAT_MX + state.dataRoomAirMod->ZTOC(ZoneNum) * MCp_Total; diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index b2fb7cbe623..fc64342b64b 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -2083,40 +2083,58 @@ namespace RoomAir { // Allocate histories of displacement ventilation temperatures PH 3/5/04 state.dataRoomAirMod->MATFloor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XMATFloor.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->XM2TFloor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XM3TFloor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XM4TFloor.allocate(state.dataGlobal->NumOfZones); +#endif // state.dataRoomAirMod->DSXMATFloor.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TFloor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->DSXM3TFloor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->DSXM4TFloor.allocate(state.dataGlobal->NumOfZones); +#endif // state.dataRoomAirMod->MATOC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XMATOC.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->XM2TOC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XM3TOC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XM4TOC.allocate(state.dataGlobal->NumOfZones); +#endif // state.dataRoomAirMod->DSXMATOC.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TOC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->DSXM3TOC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->DSXM4TOC.allocate(state.dataGlobal->NumOfZones); +#endif // state.dataRoomAirMod->MATMX.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XMATMX.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->XM2TMX.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XM3TMX.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XM4TMX.allocate(state.dataGlobal->NumOfZones); +#endif // state.dataRoomAirMod->DSXMATMX.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TMX.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->DSXM3TMX.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->DSXM4TMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTM1Floor.allocate(state.dataGlobal->NumOfZones); +#endif // + state.dataRoomAirMod->ZTMFloor.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->ZTM2Floor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->ZTM3Floor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTM1OC.allocate(state.dataGlobal->NumOfZones); +#endif // + state.dataRoomAirMod->ZTMOC.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->ZTM2OC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->ZTM3OC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTM1MX.allocate(state.dataGlobal->NumOfZones); +#endif // + state.dataRoomAirMod->ZTMMX.allocate(state.dataGlobal->NumOfZones); +#ifdef GET_OUT state.dataRoomAirMod->ZTM2MX.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->ZTM3MX.allocate(state.dataGlobal->NumOfZones); +#endif // state.dataRoomAirMod->AIRRATFloor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->AIRRATOC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->AIRRATMX.allocate(state.dataGlobal->NumOfZones); @@ -2143,41 +2161,59 @@ namespace RoomAir { state.dataRoomAirMod->ZoneAirSystemON = false; // ZoneDVMixedFlag=0 state.dataRoomAirMod->MATFloor = 23.0; - state.dataRoomAirMod->XMATFloor = 23.0; + state.dataRoomAirMod->XMATFloor = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->XM2TFloor = 23.0; state.dataRoomAirMod->XM3TFloor = 23.0; state.dataRoomAirMod->XM4TFloor = 23.0; - state.dataRoomAirMod->DSXMATFloor = 23.0; +#endif // + state.dataRoomAirMod->DSXMATFloor = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TFloor = 23.0; state.dataRoomAirMod->DSXM3TFloor = 23.0; state.dataRoomAirMod->DSXM4TFloor = 23.0; - state.dataRoomAirMod->MATOC = 23.0; - state.dataRoomAirMod->XMATOC = 23.0; +#endif // + state.dataRoomAirMod->MATOC = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAirMod->XMATOC = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->XM2TOC = 23.0; state.dataRoomAirMod->XM3TOC = 23.0; state.dataRoomAirMod->XM4TOC = 23.0; - state.dataRoomAirMod->DSXMATOC = 23.0; +#endif // + state.dataRoomAirMod->DSXMATOC = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TOC = 23.0; state.dataRoomAirMod->DSXM3TOC = 23.0; state.dataRoomAirMod->DSXM4TOC = 23.0; - state.dataRoomAirMod->MATMX = 23.0; - state.dataRoomAirMod->XMATMX = 23.0; +#endif // + state.dataRoomAirMod->MATMX = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAirMod->XMATMX = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->XM2TMX = 23.0; state.dataRoomAirMod->XM3TMX = 23.0; state.dataRoomAirMod->XM4TMX = 23.0; - state.dataRoomAirMod->DSXMATMX = 23.0; +#endif // + state.dataRoomAirMod->DSXMATMX = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TMX = 23.0; state.dataRoomAirMod->DSXM3TMX = 23.0; state.dataRoomAirMod->DSXM4TMX = 23.0; - state.dataRoomAirMod->ZTM1Floor = 23.0; +#endif // + state.dataRoomAirMod->ZTMFloor = {23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->ZTM2Floor = 23.0; state.dataRoomAirMod->ZTM3Floor = 23.0; - state.dataRoomAirMod->ZTM1OC = 23.0; +#endif // + state.dataRoomAirMod->ZTMOC = {23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->ZTM2OC = 23.0; state.dataRoomAirMod->ZTM3OC = 23.0; - state.dataRoomAirMod->ZTM1MX = 23.0; +#endif // + state.dataRoomAirMod->ZTMMX = {23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->ZTM2MX = 23.0; state.dataRoomAirMod->ZTM3MX = 23.0; +#endif // state.dataRoomAirMod->Zone1Floor = 23.0; state.dataRoomAirMod->ZoneMXFloor = 23.0; state.dataRoomAirMod->ZoneM2Floor = 23.0; @@ -2630,47 +2666,65 @@ namespace RoomAir { state.dataRoomAirMod->FracMinFlow(ZoneNum) = 0.0; state.dataRoomAirMod->ZoneAirSystemON(ZoneNum) = false; state.dataRoomAirMod->MATFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->XMATFloor(ZoneNum) = 23.0; + state.dataRoomAirMod->XMATFloor(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->XM2TFloor(ZoneNum) = 23.0; state.dataRoomAirMod->XM3TFloor(ZoneNum) = 23.0; state.dataRoomAirMod->XM4TFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXMATFloor(ZoneNum) = 23.0; +#endif // + state.dataRoomAirMod->DSXMATFloor(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TFloor(ZoneNum) = 23.0; state.dataRoomAirMod->DSXM3TFloor(ZoneNum) = 23.0; state.dataRoomAirMod->DSXM4TFloor(ZoneNum) = 23.0; +#endif // state.dataRoomAirMod->MATOC(ZoneNum) = 23.0; - state.dataRoomAirMod->XMATOC(ZoneNum) = 23.0; + state.dataRoomAirMod->XMATOC(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->XM2TOC(ZoneNum) = 23.0; state.dataRoomAirMod->XM3TOC(ZoneNum) = 23.0; state.dataRoomAirMod->XM4TOC(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXMATOC(ZoneNum) = 23.0; +#endif // + state.dataRoomAirMod->DSXMATOC(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TOC(ZoneNum) = 23.0; state.dataRoomAirMod->DSXM3TOC(ZoneNum) = 23.0; state.dataRoomAirMod->DSXM4TOC(ZoneNum) = 23.0; +#endif // state.dataRoomAirMod->MATMX(ZoneNum) = 23.0; - state.dataRoomAirMod->XMATMX(ZoneNum) = 23.0; + state.dataRoomAirMod->XMATMX(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->XM2TMX(ZoneNum) = 23.0; state.dataRoomAirMod->XM3TMX(ZoneNum) = 23.0; state.dataRoomAirMod->XM4TMX(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXMATMX(ZoneNum) = 23.0; +#endif // + state.dataRoomAirMod->DSXMATMX(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->DSXM2TMX(ZoneNum) = 23.0; state.dataRoomAirMod->DSXM3TMX(ZoneNum) = 23.0; state.dataRoomAirMod->DSXM4TMX(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTM1Floor(ZoneNum) = 23.0; +#endif // + state.dataRoomAirMod->ZTMFloor(ZoneNum) = {23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->ZTM2Floor(ZoneNum) = 23.0; state.dataRoomAirMod->ZTM3Floor(ZoneNum) = 23.0; +#endif // state.dataRoomAirMod->Zone1Floor(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneMXFloor(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneM2Floor(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTM1OC(ZoneNum) = 23.0; + state.dataRoomAirMod->ZTMOC(ZoneNum) = {23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->ZTM2OC(ZoneNum) = 23.0; state.dataRoomAirMod->ZTM3OC(ZoneNum) = 23.0; +#endif // state.dataRoomAirMod->Zone1OC(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneMXOC(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneM2OC(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTM1MX(ZoneNum) = 23.0; + state.dataRoomAirMod->ZTMMX(ZoneNum) = {23.0, 23.0, 23.0}; +#ifdef GET_OUT state.dataRoomAirMod->ZTM2MX(ZoneNum) = 23.0; state.dataRoomAirMod->ZTM3MX(ZoneNum) = 23.0; +#endif // state.dataRoomAirMod->Zone1MX(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneMXMX(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneM2MX(ZoneNum) = 23.0; diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index ab4dc3c8d79..6b955fc05ff 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -1254,27 +1254,27 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAirMod->ZTM3OC(ZoneNum) = state.dataRoomAirMod->XM3TOC(ZoneNum); - state.dataRoomAirMod->ZTM2OC(ZoneNum) = state.dataRoomAirMod->XM2TOC(ZoneNum); - state.dataRoomAirMod->ZTM1OC(ZoneNum) = state.dataRoomAirMod->XMATOC(ZoneNum); + state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->XMATOC(ZoneNum)[2]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->XMATOC(ZoneNum)[1]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->XMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTM3MX(ZoneNum) = state.dataRoomAirMod->XM3TMX(ZoneNum); - state.dataRoomAirMod->ZTM2MX(ZoneNum) = state.dataRoomAirMod->XM2TMX(ZoneNum); - state.dataRoomAirMod->ZTM1MX(ZoneNum) = state.dataRoomAirMod->XMATMX(ZoneNum); + state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->XMATMX(ZoneNum)[2]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->XMATMX(ZoneNum)[1]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->XMATMX(ZoneNum)[0]; } else { - state.dataRoomAirMod->ZTM3OC(ZoneNum) = state.dataRoomAirMod->DSXM3TOC(ZoneNum); - state.dataRoomAirMod->ZTM2OC(ZoneNum) = state.dataRoomAirMod->DSXM2TOC(ZoneNum); - state.dataRoomAirMod->ZTM1OC(ZoneNum) = state.dataRoomAirMod->DSXMATOC(ZoneNum); + state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[2]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[1]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTM3MX(ZoneNum) = state.dataRoomAirMod->DSXM3TMX(ZoneNum); - state.dataRoomAirMod->ZTM2MX(ZoneNum) = state.dataRoomAirMod->DSXM2TMX(ZoneNum); - state.dataRoomAirMod->ZTM1MX(ZoneNum) = state.dataRoomAirMod->DSXMATMX(ZoneNum); + state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[2]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[1]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[0]; } Real64 AirCap = state.dataRoomAirMod->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTM1OC(ZoneNum) - (3.0 / 2.0) * state.dataRoomAirMod->ZTM2OC(ZoneNum) + - (1.0 / 3.0) * state.dataRoomAirMod->ZTM3OC(ZoneNum)); + TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[2]); // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A Real64 TempDepCoef = GainsFrac * state.dataUFADManager->HA_OC + MCp_Total; Real64 TempIndCoef = GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - @@ -1304,8 +1304,8 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th break; } AirCap = state.dataRoomAirMod->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTM1MX(ZoneNum) - (3.0 / 2.0) * state.dataRoomAirMod->ZTM2MX(ZoneNum) + - (1.0 / 3.0) * state.dataRoomAirMod->ZTM3MX(ZoneNum)); + TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[2]); TempDepCoef = (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total; TempIndCoef = (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum)) + @@ -1798,27 +1798,27 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAirMod->ZTM3OC(ZoneNum) = state.dataRoomAirMod->XM3TOC(ZoneNum); - state.dataRoomAirMod->ZTM2OC(ZoneNum) = state.dataRoomAirMod->XM2TOC(ZoneNum); - state.dataRoomAirMod->ZTM1OC(ZoneNum) = state.dataRoomAirMod->XMATOC(ZoneNum); + state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->XMATOC(ZoneNum)[2]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->XMATOC(ZoneNum)[1]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->XMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTM3MX(ZoneNum) = state.dataRoomAirMod->XM3TMX(ZoneNum); - state.dataRoomAirMod->ZTM2MX(ZoneNum) = state.dataRoomAirMod->XM2TMX(ZoneNum); - state.dataRoomAirMod->ZTM1MX(ZoneNum) = state.dataRoomAirMod->XMATMX(ZoneNum); + state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->XMATMX(ZoneNum)[2]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->XMATMX(ZoneNum)[1]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->XMATMX(ZoneNum)[0]; } else { - state.dataRoomAirMod->ZTM3OC(ZoneNum) = state.dataRoomAirMod->DSXM3TOC(ZoneNum); - state.dataRoomAirMod->ZTM2OC(ZoneNum) = state.dataRoomAirMod->DSXM2TOC(ZoneNum); - state.dataRoomAirMod->ZTM1OC(ZoneNum) = state.dataRoomAirMod->DSXMATOC(ZoneNum); + state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[2]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[1]; + state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTM3MX(ZoneNum) = state.dataRoomAirMod->DSXM3TMX(ZoneNum); - state.dataRoomAirMod->ZTM2MX(ZoneNum) = state.dataRoomAirMod->DSXM2TMX(ZoneNum); - state.dataRoomAirMod->ZTM1MX(ZoneNum) = state.dataRoomAirMod->DSXMATMX(ZoneNum); + state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[2]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[1]; + state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[0]; } AirCap = state.dataRoomAirMod->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTM1OC(ZoneNum) - (3.0 / 2.0) * state.dataRoomAirMod->ZTM2OC(ZoneNum) + - (1.0 / 3.0) * state.dataRoomAirMod->ZTM3OC(ZoneNum)); + TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[2]); TempDepCoef = GainsFrac * state.dataUFADManager->HA_OC + MCp_Total; TempIndCoef = GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum)) + @@ -1847,8 +1847,8 @@ void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for th break; } AirCap = state.dataRoomAirMod->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTM1MX(ZoneNum) - (3.0 / 2.0) * state.dataRoomAirMod->ZTM2MX(ZoneNum) + - (1.0 / 3.0) * state.dataRoomAirMod->ZTM3MX(ZoneNum)); + TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[2]); TempDepCoef = (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total; TempIndCoef = (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum)) + diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 6243b877060..4a8dcb6750a 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -4521,8 +4521,8 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( tempChange = max(tempChange, std::abs(this->ZT - this->ZTM[0])); } else { tempChange = max(tempChange, - max(std::abs(state.dataRoomAirMod->ZTOC(zoneNum) - state.dataRoomAirMod->ZTM1OC(zoneNum)), - std::abs(state.dataRoomAirMod->ZTMX(zoneNum) - state.dataRoomAirMod->ZTM1MX(zoneNum)))); + max(std::abs(state.dataRoomAirMod->ZTOC(zoneNum) - state.dataRoomAirMod->ZTMOC(zoneNum)[0]), + std::abs(state.dataRoomAirMod->ZTMX(zoneNum) - state.dataRoomAirMod->ZTMMX(zoneNum)[0]))); } } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: @@ -4602,22 +4602,22 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADExt) { - state.dataRoomAirMod->XM4TFloor(zoneNum) = state.dataRoomAirMod->XM3TFloor(zoneNum); - state.dataRoomAirMod->XM3TFloor(zoneNum) = state.dataRoomAirMod->XM2TFloor(zoneNum); - state.dataRoomAirMod->XM2TFloor(zoneNum) = state.dataRoomAirMod->XMATFloor(zoneNum); - state.dataRoomAirMod->XMATFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); + state.dataRoomAirMod->XMATFloor(zoneNum)[3] = state.dataRoomAirMod->XMATFloor(zoneNum)[2]; + state.dataRoomAirMod->XMATFloor(zoneNum)[2] = state.dataRoomAirMod->XMATFloor(zoneNum)[1]; + state.dataRoomAirMod->XMATFloor(zoneNum)[1] = state.dataRoomAirMod->XMATFloor(zoneNum)[0]; + state.dataRoomAirMod->XMATFloor(zoneNum)[0] = state.dataRoomAirMod->ZTFloor(zoneNum); state.dataRoomAirMod->MATFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); - state.dataRoomAirMod->XM4TOC(zoneNum) = state.dataRoomAirMod->XM3TOC(zoneNum); - state.dataRoomAirMod->XM3TOC(zoneNum) = state.dataRoomAirMod->XM2TOC(zoneNum); - state.dataRoomAirMod->XM2TOC(zoneNum) = state.dataRoomAirMod->XMATOC(zoneNum); - state.dataRoomAirMod->XMATOC(zoneNum) = state.dataRoomAirMod->ZTOC(zoneNum); + state.dataRoomAirMod->XMATOC(zoneNum)[3] = state.dataRoomAirMod->XMATOC(zoneNum)[2]; + state.dataRoomAirMod->XMATOC(zoneNum)[2] = state.dataRoomAirMod->XMATOC(zoneNum)[1]; + state.dataRoomAirMod->XMATOC(zoneNum)[1] = state.dataRoomAirMod->XMATOC(zoneNum)[0]; + state.dataRoomAirMod->XMATOC(zoneNum)[0] = state.dataRoomAirMod->ZTOC(zoneNum); state.dataRoomAirMod->MATOC(zoneNum) = state.dataRoomAirMod->ZTOC(zoneNum); - state.dataRoomAirMod->XM4TMX(zoneNum) = state.dataRoomAirMod->XM3TMX(zoneNum); - state.dataRoomAirMod->XM3TMX(zoneNum) = state.dataRoomAirMod->XM2TMX(zoneNum); - state.dataRoomAirMod->XM2TMX(zoneNum) = state.dataRoomAirMod->XMATMX(zoneNum); - state.dataRoomAirMod->XMATMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); + state.dataRoomAirMod->XMATMX(zoneNum)[3] = state.dataRoomAirMod->XMATMX(zoneNum)[2]; + state.dataRoomAirMod->XMATMX(zoneNum)[2] = state.dataRoomAirMod->XMATMX(zoneNum)[1]; + state.dataRoomAirMod->XMATMX(zoneNum)[1] = state.dataRoomAirMod->XMATMX(zoneNum)[0]; + state.dataRoomAirMod->XMATMX(zoneNum)[0] = state.dataRoomAirMod->ZTMX(zoneNum); state.dataRoomAirMod->MATMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); } @@ -4703,20 +4703,20 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { if (state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { - state.dataRoomAirMod->DSXM4TFloor(zoneNum) = state.dataRoomAirMod->DSXM3TFloor(zoneNum); - state.dataRoomAirMod->DSXM3TFloor(zoneNum) = state.dataRoomAirMod->DSXM2TFloor(zoneNum); - state.dataRoomAirMod->DSXM2TFloor(zoneNum) = state.dataRoomAirMod->DSXMATFloor(zoneNum); - state.dataRoomAirMod->DSXMATFloor(zoneNum) = state.dataRoomAirMod->MATFloor(zoneNum); + state.dataRoomAirMod->DSXMATFloor(zoneNum)[3] = state.dataRoomAirMod->DSXMATFloor(zoneNum)[2]; + state.dataRoomAirMod->DSXMATFloor(zoneNum)[2] = state.dataRoomAirMod->DSXMATFloor(zoneNum)[1]; + state.dataRoomAirMod->DSXMATFloor(zoneNum)[1] = state.dataRoomAirMod->DSXMATFloor(zoneNum)[0]; + state.dataRoomAirMod->DSXMATFloor(zoneNum)[0] = state.dataRoomAirMod->MATFloor(zoneNum); - state.dataRoomAirMod->DSXM4TOC(zoneNum) = state.dataRoomAirMod->DSXM3TOC(zoneNum); - state.dataRoomAirMod->DSXM3TOC(zoneNum) = state.dataRoomAirMod->DSXM2TOC(zoneNum); - state.dataRoomAirMod->DSXM2TOC(zoneNum) = state.dataRoomAirMod->DSXMATOC(zoneNum); - state.dataRoomAirMod->DSXMATOC(zoneNum) = state.dataRoomAirMod->MATOC(zoneNum); + state.dataRoomAirMod->DSXMATOC(zoneNum)[3] = state.dataRoomAirMod->DSXMATOC(zoneNum)[2]; + state.dataRoomAirMod->DSXMATOC(zoneNum)[2] = state.dataRoomAirMod->DSXMATOC(zoneNum)[1]; + state.dataRoomAirMod->DSXMATOC(zoneNum)[1] = state.dataRoomAirMod->DSXMATOC(zoneNum)[0]; + state.dataRoomAirMod->DSXMATOC(zoneNum)[0] = state.dataRoomAirMod->MATOC(zoneNum); - state.dataRoomAirMod->DSXM4TMX(zoneNum) = state.dataRoomAirMod->DSXM3TMX(zoneNum); - state.dataRoomAirMod->DSXM3TMX(zoneNum) = state.dataRoomAirMod->DSXM2TMX(zoneNum); - state.dataRoomAirMod->DSXM2TMX(zoneNum) = state.dataRoomAirMod->DSXMATMX(zoneNum); - state.dataRoomAirMod->DSXMATMX(zoneNum) = state.dataRoomAirMod->MATMX(zoneNum); + state.dataRoomAirMod->DSXMATMX(zoneNum)[3] = state.dataRoomAirMod->DSXMATMX(zoneNum)[2]; + state.dataRoomAirMod->DSXMATMX(zoneNum)[2] = state.dataRoomAirMod->DSXMATMX(zoneNum)[1]; + state.dataRoomAirMod->DSXMATMX(zoneNum)[1] = state.dataRoomAirMod->DSXMATMX(zoneNum)[0]; + state.dataRoomAirMod->DSXMATMX(zoneNum)[0] = state.dataRoomAirMod->MATMX(zoneNum); } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { @@ -4800,17 +4800,17 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADInt || state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADExt) { - state.dataRoomAirMod->XMATFloor(zoneNum) = state.dataRoomAirMod->XM2TFloor(zoneNum); - state.dataRoomAirMod->XM2TFloor(zoneNum) = state.dataRoomAirMod->XM3TFloor(zoneNum); - state.dataRoomAirMod->XM3TFloor(zoneNum) = state.dataRoomAirMod->XM4TFloor(zoneNum); + state.dataRoomAirMod->XMATFloor(zoneNum)[0] = state.dataRoomAirMod->XMATFloor(zoneNum)[1]; + state.dataRoomAirMod->XMATFloor(zoneNum)[1] = state.dataRoomAirMod->XMATFloor(zoneNum)[2]; + state.dataRoomAirMod->XMATFloor(zoneNum)[2] = state.dataRoomAirMod->XMATFloor(zoneNum)[3]; - state.dataRoomAirMod->XMATOC(zoneNum) = state.dataRoomAirMod->XM2TOC(zoneNum); - state.dataRoomAirMod->XM2TOC(zoneNum) = state.dataRoomAirMod->XM3TOC(zoneNum); - state.dataRoomAirMod->XM3TOC(zoneNum) = state.dataRoomAirMod->XM4TOC(zoneNum); + state.dataRoomAirMod->XMATOC(zoneNum)[0] = state.dataRoomAirMod->XMATOC(zoneNum)[1]; + state.dataRoomAirMod->XMATOC(zoneNum)[1] = state.dataRoomAirMod->XMATOC(zoneNum)[2]; + state.dataRoomAirMod->XMATOC(zoneNum)[2] = state.dataRoomAirMod->XMATOC(zoneNum)[3]; - state.dataRoomAirMod->XMATMX(zoneNum) = state.dataRoomAirMod->XM2TMX(zoneNum); - state.dataRoomAirMod->XM2TMX(zoneNum) = state.dataRoomAirMod->XM3TMX(zoneNum); - state.dataRoomAirMod->XM3TMX(zoneNum) = state.dataRoomAirMod->XM4TMX(zoneNum); + state.dataRoomAirMod->XMATMX(zoneNum)[0] = state.dataRoomAirMod->XMATMX(zoneNum)[1]; + state.dataRoomAirMod->XMATMX(zoneNum)[1] = state.dataRoomAirMod->XMATMX(zoneNum)[2]; + state.dataRoomAirMod->XMATMX(zoneNum)[3] = state.dataRoomAirMod->XMATMX(zoneNum)[3]; } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { @@ -7128,36 +7128,22 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { if (state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { - DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - state.dataRoomAirMod->XMATFloor(zoneNum), - state.dataRoomAirMod->XM2TFloor(zoneNum), - state.dataRoomAirMod->XM3TFloor(zoneNum), - state.dataRoomAirMod->MATFloor(zoneNum), - state.dataRoomAirMod->DSXMATFloor(zoneNum), - state.dataRoomAirMod->DSXM2TFloor(zoneNum), - state.dataRoomAirMod->DSXM3TFloor(zoneNum), - state.dataRoomAirMod->DSXM4TFloor(zoneNum)); - DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - state.dataRoomAirMod->XMATOC(zoneNum), - state.dataRoomAirMod->XM2TOC(zoneNum), - state.dataRoomAirMod->XM3TOC(zoneNum), - state.dataRoomAirMod->MATOC(zoneNum), - state.dataRoomAirMod->DSXMATOC(zoneNum), - state.dataRoomAirMod->DSXM2TOC(zoneNum), - state.dataRoomAirMod->DSXM3TOC(zoneNum), - state.dataRoomAirMod->DSXM4TOC(zoneNum)); - DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - state.dataRoomAirMod->XMATMX(zoneNum), - state.dataRoomAirMod->XM2TMX(zoneNum), - state.dataRoomAirMod->XM3TMX(zoneNum), - state.dataRoomAirMod->MATMX(zoneNum), - state.dataRoomAirMod->DSXMATMX(zoneNum), - state.dataRoomAirMod->DSXM2TMX(zoneNum), - state.dataRoomAirMod->DSXM3TMX(zoneNum), - state.dataRoomAirMod->DSXM4TMX(zoneNum)); + state.dataRoomAirMod->MATFloor(zoneNum) = + DownInterpolate4HistoryValues(PriorTimeStep, + TimeStepSys, + state.dataRoomAirMod->XMATFloor(zoneNum), + state.dataRoomAirMod->DSXMATFloor(zoneNum)); + state.dataRoomAirMod->MATOC(zoneNum) = + DownInterpolate4HistoryValues(PriorTimeStep, + TimeStepSys, + state.dataRoomAirMod->XMATOC(zoneNum), + state.dataRoomAirMod->DSXMATOC(zoneNum)); + state.dataRoomAirMod->MATMX(zoneNum) = + DownInterpolate4HistoryValues(PriorTimeStep, + TimeStepSys, + state.dataRoomAirMod->XMATMX(zoneNum), + state.dataRoomAirMod->DSXMATMX(zoneNum)); + } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { diff --git a/tst/EnergyPlus/unit/HybridModel.unit.cc b/tst/EnergyPlus/unit/HybridModel.unit.cc index e1512a59e32..c6540a0fdb0 100644 --- a/tst/EnergyPlus/unit/HybridModel.unit.cc +++ b/tst/EnergyPlus/unit/HybridModel.unit.cc @@ -107,7 +107,7 @@ TEST_F(EnergyPlusFixture, HybridModel_correctZoneAirTempsTest) state->dataRoomAirMod->AirModel.allocate(1); state->dataRoomAirMod->ZTOC.allocate(1); state->dataRoomAirMod->ZTMX.allocate(1); - state->dataRoomAirMod->ZTM1MX.allocate(1); + state->dataRoomAirMod->ZTMMX.allocate(1); state->afn->exchangeData.allocate(1); state->dataLoopNodes->Node.allocate(1); state->dataHeatBalFanSys->TempTstatAir.allocate(1); From 0853d751c2dd06725c61704cef84a81812c74532 Mon Sep 17 00:00:00 2001 From: amirroth Date: Sat, 24 Jun 2023 15:13:51 -0400 Subject: [PATCH 08/17] More array conversions --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 18 +- src/EnergyPlus/DataRoomAirModel.hh | 102 +++------- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 179 ++++++++---------- src/EnergyPlus/RoomAirModelManager.cc | 135 +------------ src/EnergyPlus/ZoneTempPredictorCorrector.cc | 124 ++++++------ .../unit/RoomAirflowNetwork.unit.cc | 16 +- 6 files changed, 181 insertions(+), 393 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 5201bb94b7f..8fa0bd86646 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -4802,7 +4802,7 @@ namespace AirflowNetwork { n = AirflowNetworkNodeData(i).EPlusZoneNum; AirflowNetworkNodeData(i).NumOfLinks = 0; if (n > 0 && AirflowNetworkNodeData(i).RAFNNodeNum > 0) { - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID = i; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID = i; for (j = 1; j <= AirflowNetworkNumOfSurfaces; ++j) { if (AirflowNetworkLinkageData(j).NodeNums[0] == i) { AirflowNetworkNodeData(i).NumOfLinks = AirflowNetworkNodeData(i).NumOfLinks + 1; @@ -4814,20 +4814,20 @@ namespace AirflowNetwork { } if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) { for (j = 1; j <= m_state.dataRoomAirMod->AFNZoneInfo(n).NumOfAirNodes; ++j) { - if (m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).AirflowNetworkNodeID == i) { + if (m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).AFNNodeID == i) { m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).NumOfAirflowLinks = AirflowNetworkNodeData(i).NumOfLinks; m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link.allocate(AirflowNetworkNodeData(i).NumOfLinks); k = 1; for (int m = 1; m <= AirflowNetworkNumOfSurfaces; ++m) { if (AirflowNetworkLinkageData(m).NodeNums[0] == i) { - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkSimuID = m; - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkageDataID = m; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AFNSimuID = m; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AFNDataID = m; k = k + 1; if (k > AirflowNetworkNodeData(i).NumOfLinks) break; } if (AirflowNetworkLinkageData(m).NodeNums[1] == i) { - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkSimuID = m; - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AirflowNetworkLinkageDataID = m; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AFNSimuID = m; + m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AFNDataID = m; k = k + 1; if (k > AirflowNetworkNodeData(i).NumOfLinks) break; } @@ -5471,7 +5471,7 @@ namespace AirflowNetwork { ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum) .Node(AirflowNetworkNodeData(i).RAFNNodeNum) - .AirflowNetworkNodeID == i) { + .AFNNodeID == i) { AirflowNetworkNodeSimu(i).TZ = m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp; AirflowNetworkNodeSimu(i).WZ = @@ -7736,7 +7736,7 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) { MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10; ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID == + if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) { MV(i) = m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp * 1.0e10; } @@ -8030,7 +8030,7 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) { MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10; ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirflowNetworkNodeID == + if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) { MV(i) = m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat * 1.0e10; } diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index 0642b71b163..a53f7a6911c 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -395,9 +395,9 @@ namespace RoomAir { { // Members // user variables - int AirflowNetworkLinkSimuID = 0; // point to this linkage in AirflowNetworkLinkSimu structure - int AirflowNetworkLinkageDataID = 0; // point to this linkage in AirflowNetworkLinkageData structure - int AirflowNetworkLinkReportID = 0; // point to this linkage in AirflowNetworkLinkReport structure + int AFNSimuID = 0; // point to this linkage in AirflowNetworkLinkSimu structure + int AFNDataID = 0; // point to this linkage in AirflowNetworkLinkageData structure + int AFNReportID = 0; // point to this linkage in AirflowNetworkLinkReport structure Real64 MdotIn = 0.0; // mass flow rate of air into control volume(neg means leaving control volume) (kg / s) Real64 TempIn = 0.0; // drybulb temperature of air into control volume Real64 HumRatIn = 0.0; // humidity ratio of air into control volume @@ -450,7 +450,7 @@ namespace RoomAir { bool HasHVACAssigned = false; // True if HVAC systems are assigned to this node int NumHVACs = 0; // Number of HVAC systems Array1D HVAC; // HVAC struct - int AirflowNetworkNodeID = 0; // pointer to AirflowNetworkNodeData structure + int AFNNodeID = 0; // pointer to AirflowNetworkNodeData structure int NumOfAirflowLinks = 0; // Number of intra zone links Array1D Link; // Linkage struct Real64 AirVolume = 0.0; // air volume in control volume associated with this node(m3 / s) @@ -458,30 +458,18 @@ namespace RoomAir { Real64 CpAir = 0.0; // current heat capacity of air for nodal control volume Real64 AirTemp = 0.0; // node air temperature - Real64 AirTempX1 = 0.0; // node air temperature at t minus 1 zone timestep - Real64 AirTempX2 = 0.0; // node air temperature at t minus 2 zone timestep - Real64 AirTempX3 = 0.0; // node air temperature at t minus 3 zone timestep - Real64 AirTempX4 = 0.0; // node air temperature at t minus 4 zone timestep - Real64 AirTempDSX1 = 0.0; // node air temperature at t minus 1 system timestep - Real64 AirTempDSX2 = 0.0; // node air temperature at t minus 2 system timestep - Real64 AirTempDSX3 = 0.0; // node air temperature at t minus 3 system timestep - Real64 AirTempDSX4 = 0.0; // node air temperature at t minus 4 system timestep + std::array AirTempX = {0.0, 0.0, 0.0, 0.0}; // node air temperature at t minus X zone timestep + std::array AirTempDSX = {0.0, 0.0, 0.0, 0.0}; // node air temperature at t minus X system timestep Real64 AirTempT1 = 0.0; // node air temperature at the previous time step used in Exact and Euler method - Real64 AirTempTMX = 0.0; // temporary node air temperature to test convergence used in Exact and Euler method - Real64 AirTempTM2 = 0.0; // node air temperature at time step t-2 used in Exact and Euler method + Real64 AirTempTX = 0.0; // temporary node air temperature to test convergence used in Exact and Euler method + Real64 AirTempT2 = 0.0; // node air temperature at time step t-2 used in Exact and Euler method Real64 HumRat = 0.0; // node air humidity ratio - Real64 HumRatX1 = 0.0; // node air humidity ratio at t minus 1 zone timestep - Real64 HumRatX2 = 0.0; // node air humidity ratio at t minus 2 zone timestep - Real64 HumRatX3 = 0.0; // node air humidity ratio at t minus 3 zone timestep - Real64 HumRatX4 = 0.0; // node air humidity ratio at t minus 4 zone timestep - Real64 HumRatDSX1 = 0.0; // node air humidity ratio at t minus 1 system timestep - Real64 HumRatDSX2 = 0.0; // node air humidity ratio at t minus 2 system timestep - Real64 HumRatDSX3 = 0.0; // node air humidity ratio at t minus 3 system timestep - Real64 HumRatDSX4 = 0.0; // node air humidity ratio at t minus 4 system timestep - Real64 HumRatW1 = 0.0; // node air humidity ratio at the previous time step used in Exact and Euler method - Real64 HumRatWMX = 0.0; // temporary node air humidity ratio to test convergence used in Exact and Euler method - Real64 HumRatWM2 = 0.0; // node air humidity ratio at time step t-2 used in Exact and Euler method + std::array HumRatX = {0.0, 0.0, 0.0, 0.0}; // node air humidity ratio at t minus X zone timestep + std::array HumRatDSX = {0.0, 0.0, 0.0, 0.0}; // node air humidity ratio at t minus 1 system timestep + Real64 HumRatT1 = 0.0; // node air humidity ratio at the previous time step used in Exact and Euler method + Real64 HumRatTX = 0.0; // temporary node air humidity ratio to test convergence used in Exact and Euler method + Real64 HumRatT2 = 0.0; // node air humidity ratio at time step t-2 used in Exact and Euler method Real64 RelHumidity = 0.0; // node air relative humidity @@ -568,59 +556,17 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ZoneCeilingHeight1; Array1D ZoneCeilingHeight2; Array1D MATFloor; // [C] floor level mean air temp - Array1D> XMATFloor; // [C] floor level mean air temp at t minus 1 zone time step -#ifdef GET_OUT - Array1D XM2TFloor; // [C] floor level mean air temp at t minus 2 zone time step - Array1D XM3TFloor; // [C] floor level mean air temp at t minus 3 zone time step - Array1D XM4TFloor; // [C] floor level mean air temp at t minus 4 zone time step -#endif // - Array1D> DSXMATFloor; // [C] floor level mean air temp at t minus 1 system time step -#ifdef GET_OUT - Array1D DSXM2TFloor; // [C] floor level mean air temp at t minus 2 system time step - Array1D DSXM3TFloor; // [C] floor level mean air temp at t minus 3 system time step - Array1D DSXM4TFloor; // [C] floor level mean air temp at t minus 4 system time step -#endif // + Array1D> XMATFloor; // [C] floor level mean air temp at t minus X zone time step + Array1D> DSXMATFloor; // [C] floor level mean air temp at t minus X system time step Array1D MATOC; // [C] occupied mean air temp - Array1D> XMATOC; // [C] occupied mean air temp at t minus 1 zone time step -#ifdef GET_OUT - Array1D XM2TOC; // [C] occupied mean air temp at t minus 2 zone time step - Array1D XM3TOC; // [C] occupied mean air temp at t minus 3 zone time step - Array1D XM4TOC; // [C] occupied mean air temp at t minus 4 zone time step -#endif // - Array1D> DSXMATOC; // [C] occupied mean air temp at t minus 1 system time step -#ifdef GET_OUT - Array1D DSXM2TOC; // [C] occupied mean air temp at t minus 2 system time step - Array1D DSXM3TOC; // [C] occupied mean air temp at t minus 3 system time step - Array1D DSXM4TOC; // [C] occupied mean air temp at t minus 4 system time step -#endif // + Array1D> XMATOC; // [C] occupied mean air temp at t minus X zone time step + Array1D> DSXMATOC; // [C] occupied mean air temp at t minus X system time step Array1D MATMX; // [C] mixed (upper) mean air temp - Array1D> XMATMX; // [C] mixed (upper) mean air temp at t minus 1 zone time step -#ifdef GET_OUT - Array1D XM2TMX; // [C] mixed (upper) mean air temp at t minus 2 zone time step - Array1D XM3TMX; // [C] mixed (upper) mean air temp at t minus 3 zone time step - Array1D XM4TMX; // [C] mixed (upper) mean air temp at t minus 4 zone time step -#endif // - Array1D> DSXMATMX; // [C] mixed mean air temp at t minus 1 system time step -#ifdef GET_OUT - Array1D DSXM2TMX; // [C] mixed mean air temp at t minus 2 system time step - Array1D DSXM3TMX; // [C] mixed mean air temp at t minus 3 system time step - Array1D DSXM4TMX; // [C] mixed mean air temp at t minus 4 system time step -#endif // - Array1D> ZTMFloor; // [C] difference equation's Floor air temp at t minus 1 -#ifdef GET_OUT - Array1D ZTM2Floor; // [C] difference equation's Floor air temp at t minus 2 - Array1D ZTM3Floor; // [C] difference equation's Floor air temp at t minus 3 -#endif // - Array1D> ZTMOC; // [C] difference equation's Occupied air temp at t minus 1 -#ifdef GET_OUT - Array1D ZTM2OC; // [C] difference equation's Occupied air temp at t minus 2 - Array1D ZTM3OC; // [C] difference equation's Occupied air temp at t minus 3 -#endif // - Array1D> ZTMMX; // [C] difference equation's Mixed air temp at t minus 1 -#ifdef GET_OUT - Array1D ZTM2MX; // [C] difference equation's Mixed air temp at t minus 1 - Array1D ZTM3MX; // [C] difference equation's Mixed air temp at t minus 1 -#endif // + Array1D> XMATMX; // [C] mixed (upper) mean air temp at t minus X zone time step + Array1D> DSXMATMX; // [C] mixed mean air temp at t minus X system time step + Array1D> ZTMFloor; // [C] difference equation's Floor air temp at t minus X + Array1D> ZTMOC; // [C] difference equation's Occupied air temp at t minus X + Array1D> ZTMMX; // [C] difference equation's Mixed air temp at t minus X Array1D AIRRATFloor; Array1D AIRRATOC; Array1D AIRRATMX; @@ -711,7 +657,7 @@ struct RoomAirModelData : BaseGlobalStruct // End User-defined patterns // RoomAirflowNetwork - int NumOfRoomAirflowNetControl = 0; // count of RoomAirSettings:AirflowNetwork + int NumOfRoomAFNControl = 0; // count of RoomAirSettings:AirflowNetwork // Object Data Array1D AirModel; @@ -891,7 +837,7 @@ struct RoomAirModelData : BaseGlobalStruct // End User-defined patterns // RoomAirflowNetwork - NumOfRoomAirflowNetControl = 0; // count of RoomAirSettings:AirflowNetwork + NumOfRoomAFNControl = 0; // count of RoomAirSettings:AirflowNetwork // Object Data AirModel.clear(); diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 6f535a3b852..99f6c425f97 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -187,7 +187,7 @@ namespace RoomAir { // state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag //////////////////////////////////////////////////////////////////////////////////// if (state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag) { - state.dataRoomAirflowNetModel->RAFN.allocate(state.dataRoomAirMod->NumOfRoomAirflowNetControl); + state.dataRoomAirflowNetModel->RAFN.allocate(state.dataRoomAirMod->NumOfRoomAFNControl); state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag = false; } @@ -543,38 +543,27 @@ namespace RoomAir { } // End of InitRoomAirModelAirflowNetworkOneTimeFlagConf if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkEnvrnFlag) { - for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - if (!state.dataRoomAirMod->AFNZoneInfo(LoopZone).IsUsed) continue; - for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->AFNZoneInfo(LoopZone).NumOfAirNodes; - ++LoopAirNode) { // loop over all the modeled room air nodes - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTemp = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempX1 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempX2 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempX3 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempX4 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX1 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX2 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX3 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempDSX4 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempT1 = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempTMX = 23.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirTempTM2 = 23.0; - - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRat = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatX1 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatX2 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatX3 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatX4 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX1 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX2 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX3 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatDSX4 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatW1 = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatWMX = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HumRatWM2 = 0.0; - - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLagged = 0.0; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLaggedOld = 0.0; + for (int LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { + auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(LoopZone); + if (!afnZoneInfo.IsUsed) continue; + for (int LoopAirNode = 1; LoopAirNode <= afnZoneInfo.NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes + auto &afnNode = afnZoneInfo.Node(LoopAirNode); + afnNode.AirTemp = 23.0; + afnNode.AirTempX = {23.0, 23.0, 23.0, 23.0}; + afnNode.AirTempDSX = {23.0, 23.0, 23.0, 23.0}; + afnNode.AirTempT1 = 23.0; + afnNode.AirTempTX = 23.0; + afnNode.AirTempT2 = 23.0; + + afnNode.HumRat = 0.0; + afnNode.HumRatX = {0.0, 0.0, 0.0, 0.0}; + afnNode.HumRatDSX = {0.0, 0.0, 0.0, 0.0}; + afnNode.HumRatT1 = 0.0; + afnNode.HumRatTX = 0.0; + afnNode.HumRatT2 = 0.0; + + afnNode.SysDepZoneLoadsLagged = 0.0; + afnNode.SysDepZoneLoadsLaggedOld = 0.0; } } state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkEnvrnFlag = false; @@ -590,10 +579,10 @@ namespace RoomAir { // latent gains. auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); - auto &ThisRAFNNode = afnZoneInfo.Node(RoomAirNode); + auto &afnNode = afnZoneInfo.Node(RoomAirNode); - if (allocated(ThisRAFNNode.SurfMask)) { - CalcSurfaceMoistureSums(state, RoomAirNode, ThisRAFNNode.SumHmAW, ThisRAFNNode.SumHmARa, ThisRAFNNode.SumHmARaW, ThisRAFNNode.SurfMask); + if (allocated(afnNode.SurfMask)) { + CalcSurfaceMoistureSums(state, RoomAirNode, afnNode.SumHmAW, afnNode.SumHmARa, afnNode.SumHmARaW, afnNode.SurfMask); } // prepare AirflowNetwor flow rates and temperatures @@ -602,28 +591,28 @@ namespace RoomAir { SumLinkM = 0.0; SumLinkMW = 0.0; - NodeNum = ThisRAFNNode.AirflowNetworkNodeID; + NodeNum = afnNode.AFNNodeID; if (NodeNum > 0) { - for (linkNum = 1; linkNum <= ThisRAFNNode.NumOfAirflowLinks; ++linkNum) { - Link = ThisRAFNNode.Link(linkNum).AirflowNetworkLinkSimuID; + for (linkNum = 1; linkNum <= afnNode.NumOfAirflowLinks; ++linkNum) { + Link = afnNode.Link(linkNum).AFNSimuID; if (state.afn->AirflowNetworkLinkageData(Link).NodeNums[0] == NodeNum) { // incoming flow NodeIn = state.afn->AirflowNetworkLinkageData(Link).NodeNums[1]; - ThisRAFNNode.Link(linkNum).TempIn = state.afn->AirflowNetworkNodeSimu(NodeIn).TZ; - ThisRAFNNode.Link(linkNum).HumRatIn = state.afn->AirflowNetworkNodeSimu(NodeIn).WZ; - ThisRAFNNode.Link(linkNum).MdotIn = state.afn->AirflowNetworkLinkSimu(Link).FLOW2; + afnNode.Link(linkNum).TempIn = state.afn->AirflowNetworkNodeSimu(NodeIn).TZ; + afnNode.Link(linkNum).HumRatIn = state.afn->AirflowNetworkNodeSimu(NodeIn).WZ; + afnNode.Link(linkNum).MdotIn = state.afn->AirflowNetworkLinkSimu(Link).FLOW2; } if (state.afn->AirflowNetworkLinkageData(Link).NodeNums[1] == NodeNum) { // outgoing flow NodeIn = state.afn->AirflowNetworkLinkageData(Link).NodeNums[0]; - ThisRAFNNode.Link(linkNum).TempIn = state.afn->AirflowNetworkNodeSimu(NodeIn).TZ; - ThisRAFNNode.Link(linkNum).HumRatIn = state.afn->AirflowNetworkNodeSimu(NodeIn).WZ; - ThisRAFNNode.Link(linkNum).MdotIn = state.afn->AirflowNetworkLinkSimu(Link).FLOW; + afnNode.Link(linkNum).TempIn = state.afn->AirflowNetworkNodeSimu(NodeIn).TZ; + afnNode.Link(linkNum).HumRatIn = state.afn->AirflowNetworkNodeSimu(NodeIn).WZ; + afnNode.Link(linkNum).MdotIn = state.afn->AirflowNetworkLinkSimu(Link).FLOW; } } - for (linkNum = 1; linkNum <= ThisRAFNNode.NumOfAirflowLinks; ++linkNum) { - LinkInTemp = ThisRAFNNode.Link(linkNum).TempIn; - LinkInHumRat = ThisRAFNNode.Link(linkNum).HumRatIn; - LinkInMdot = ThisRAFNNode.Link(linkNum).MdotIn; + for (linkNum = 1; linkNum <= afnNode.NumOfAirflowLinks; ++linkNum) { + LinkInTemp = afnNode.Link(linkNum).TempIn; + LinkInHumRat = afnNode.Link(linkNum).HumRatIn; + LinkInMdot = afnNode.Link(linkNum).MdotIn; CpAir = PsyCpAirFnW(LinkInHumRat); SumLinkMCp = SumLinkMCp + CpAir * LinkInMdot; SumLinkMCpT = SumLinkMCpT + CpAir * LinkInMdot * LinkInTemp; @@ -632,16 +621,16 @@ namespace RoomAir { } } - ThisRAFNNode.SumLinkMCp = SumLinkMCp; - ThisRAFNNode.SumLinkMCpT = SumLinkMCpT; - ThisRAFNNode.SumLinkM = SumLinkM; - ThisRAFNNode.SumLinkMW = SumLinkMW; - ThisRAFNNode.SysDepZoneLoadsLagged = ThisRAFNNode.SysDepZoneLoadsLaggedOld; + afnNode.SumLinkMCp = SumLinkMCp; + afnNode.SumLinkMCpT = SumLinkMCpT; + afnNode.SumLinkM = SumLinkM; + afnNode.SumLinkMW = SumLinkMW; + afnNode.SysDepZoneLoadsLagged = afnNode.SysDepZoneLoadsLaggedOld; - ThisRAFNNode.RhoAir = - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, ThisRAFNNode.AirTemp, ThisRAFNNode.HumRat, "InitRoomAirModelAirflowNetwork"); + afnNode.RhoAir = + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, afnNode.AirTemp, afnNode.HumRat, "InitRoomAirModelAirflowNetwork"); - ThisRAFNNode.CpAir = PsyCpAirFnW(ThisRAFNNode.HumRat); + afnNode.CpAir = PsyCpAirFnW(afnNode.HumRat); } // InitRoomAirModelAirflowNetwork @@ -674,12 +663,8 @@ namespace RoomAir { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 H2OHtOfVap; Real64 HumRatTmp; - Real64 NodeTempX1; - Real64 NodeTempX2; - Real64 NodeTempX3; - Real64 NodeHumRatX1; - Real64 NodeHumRatX2; - Real64 NodeHumRatX3; + std::array NodeTempX; + std::array NodeHumRatX; Real64 TempDepCoef; Real64 TempIndCoef; Real64 AirCap; @@ -688,39 +673,39 @@ namespace RoomAir { Real64 B; Real64 C; Real64 AirTempT1; - Real64 HumRatW1; + Real64 HumRatT1; auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); - auto &ThisRAFNNode = afnZoneInfo.Node(RoomAirNode); + auto &afnNode = afnZoneInfo.Node(RoomAirNode); if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - NodeTempX1 = ThisRAFNNode.AirTempX1; - NodeTempX2 = ThisRAFNNode.AirTempX2; - NodeTempX3 = ThisRAFNNode.AirTempX3; + NodeTempX[0] = afnNode.AirTempX[0]; + NodeTempX[1] = afnNode.AirTempX[1]; + NodeTempX[2] = afnNode.AirTempX[2]; - NodeHumRatX1 = ThisRAFNNode.HumRatX1; - NodeHumRatX2 = ThisRAFNNode.HumRatX2; - NodeHumRatX3 = ThisRAFNNode.HumRatX3; + NodeHumRatX[0] = afnNode.HumRatX[0]; + NodeHumRatX[1] = afnNode.HumRatX[1]; + NodeHumRatX[2] = afnNode.HumRatX[2]; } else { // use down - stepped history - NodeTempX1 = ThisRAFNNode.AirTempDSX1; - NodeTempX2 = ThisRAFNNode.AirTempDSX2; - NodeTempX3 = ThisRAFNNode.AirTempDSX3; + NodeTempX[0] = afnNode.AirTempDSX[0]; + NodeTempX[1] = afnNode.AirTempDSX[1]; + NodeTempX[2] = afnNode.AirTempDSX[2]; - NodeHumRatX1 = ThisRAFNNode.HumRatDSX1; - NodeHumRatX2 = ThisRAFNNode.HumRatDSX2; - NodeHumRatX3 = ThisRAFNNode.HumRatDSX3; + NodeHumRatX[0] = afnNode.HumRatDSX[0]; + NodeHumRatX[1] = afnNode.HumRatDSX[1]; + NodeHumRatX[2] = afnNode.HumRatDSX[2]; } if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { - AirTempT1 = ThisRAFNNode.AirTempT1; - HumRatW1 = ThisRAFNNode.HumRatW1; + AirTempT1 = afnNode.AirTempT1; + HumRatT1 = afnNode.HumRatT1; } // solve for node drybulb temperature - TempDepCoef = ThisRAFNNode.SumHA + ThisRAFNNode.SumLinkMCp + ThisRAFNNode.SumSysMCp; - TempIndCoef = ThisRAFNNode.SumIntSensibleGain + ThisRAFNNode.SumHATsurf - ThisRAFNNode.SumHATref + ThisRAFNNode.SumLinkMCpT + - ThisRAFNNode.SumSysMCpT + ThisRAFNNode.NonAirSystemResponse + ThisRAFNNode.SysDepZoneLoadsLagged; + TempDepCoef = afnNode.SumHA + afnNode.SumLinkMCp + afnNode.SumSysMCp; + TempIndCoef = afnNode.SumIntSensibleGain + afnNode.SumHATsurf - afnNode.SumHATref + afnNode.SumLinkMCpT + + afnNode.SumSysMCpT + afnNode.NonAirSystemResponse + afnNode.SysDepZoneLoadsLagged; AirCap = - ThisRAFNNode.AirVolume * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * ThisRAFNNode.RhoAir * ThisRAFNNode.CpAir / TimeStepSysSec; + afnNode.AirVolume * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * afnNode.RhoAir * afnNode.CpAir / TimeStepSysSec; if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::AnalyticalSolution) { if (TempDepCoef == 0.0) { // B=0 @@ -731,37 +716,37 @@ namespace RoomAir { } else if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::EulerMethod) { TempTmp = (AirCap * AirTempT1 + TempIndCoef) / (AirCap + TempDepCoef); } else { - TempTmp = (TempIndCoef + AirCap * (3.0 * NodeTempX1 - (3.0 / 2.0) * NodeTempX2 + (1.0 / 3.0) * NodeTempX3)) / + TempTmp = (TempIndCoef + AirCap * (3.0 * NodeTempX[0] - (3.0 / 2.0) * NodeTempX[1] + (1.0 / 3.0) * NodeTempX[2])) / ((11.0 / 6.0) * AirCap + TempDepCoef); } - ThisRAFNNode.AirTemp = TempTmp; + afnNode.AirTemp = TempTmp; // solve for node humidity ratio using 3 algorithms - 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 * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpMoist / TimeStepSysSec; + H2OHtOfVap = PsyHgAirFnWTdb(afnNode.HumRat, afnNode.AirTemp); + A = afnNode.SumLinkM + afnNode.SumHmARa + afnNode.SumSysM; + B = (afnNode.SumIntLatentGain / H2OHtOfVap) + afnNode.SumSysMW + afnNode.SumLinkMW + afnNode.SumHmARaW; + C = afnNode.RhoAir * afnNode.AirVolume * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpMoist / TimeStepSysSec; // Exact solution if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::AnalyticalSolution) { if (A == 0.0) { // B=0 - HumRatTmp = HumRatW1 + B / C; + HumRatTmp = HumRatT1 + B / C; } else { - HumRatTmp = (HumRatW1 - B / A) * std::exp(min(700., -A / C)) + B / A; + HumRatTmp = (HumRatT1 - B / A) * std::exp(min(700., -A / C)) + B / A; } } else if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::EulerMethod) { - HumRatTmp = (C * HumRatW1 + B) / (C + A); + HumRatTmp = (C * HumRatT1 + B) / (C + A); } else { - HumRatTmp = (B + C * (3.0 * NodeHumRatX1 - (3.0 / 2.0) * NodeHumRatX2 + (1.0 / 3.0) * NodeHumRatX3)) / ((11.0 / 6.0) * C + A); + HumRatTmp = (B + C * (3.0 * NodeHumRatX[0] - (3.0 / 2.0) * NodeHumRatX[1] + (1.0 / 3.0) * NodeHumRatX[2])) / ((11.0 / 6.0) * C + A); } - ThisRAFNNode.HumRat = HumRatTmp; + afnNode.HumRat = HumRatTmp; - ThisRAFNNode.AirCap = AirCap; - ThisRAFNNode.AirHumRat = C; + afnNode.AirCap = AirCap; + afnNode.AirHumRat = C; - ThisRAFNNode.RelHumidity = PsyRhFnTdbWPb(state, TempTmp, HumRatTmp, state.dataEnvrn->OutBaroPress, "CalcRoomAirModelAirflowNetwork") * 100.0; + afnNode.RelHumidity = PsyRhFnTdbWPb(state, TempTmp, HumRatTmp, state.dataEnvrn->OutBaroPress, "CalcRoomAirModelAirflowNetwork") * 100.0; } // CalcRoomAirModelAirflowNetwork diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index fc64342b64b..ae60a9e02a7 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1266,9 +1266,9 @@ namespace RoomAir { auto &ipsc = state.dataIPShortCut; ipsc->cCurrentModuleObject = "RoomAirSettings:AirflowNetwork"; - state.dataRoomAirMod->NumOfRoomAirflowNetControl = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->NumOfRoomAirflowNetControl == 0) return; - if (state.dataRoomAirMod->NumOfRoomAirflowNetControl > state.dataGlobal->NumOfZones) { + state.dataRoomAirMod->NumOfRoomAFNControl = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + if (state.dataRoomAirMod->NumOfRoomAFNControl == 0) return; + if (state.dataRoomAirMod->NumOfRoomAFNControl > state.dataGlobal->NumOfZones) { ShowSevereError(state, format("Too many {} objects in input file", ipsc->cCurrentModuleObject)); ShowContinueError(state, format("There cannot be more {} objects than number of zones.", ipsc->cCurrentModuleObject)); ErrorsFound = true; @@ -1277,8 +1277,7 @@ namespace RoomAir { if (!allocated(state.dataRoomAirMod->AFNZoneInfo)) { state.dataRoomAirMod->AFNZoneInfo.allocate(state.dataGlobal->NumOfZones); } - - for (int Loop = 1; Loop <= state.dataRoomAirMod->NumOfRoomAirflowNetControl; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAirMod->NumOfRoomAFNControl; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -2083,58 +2082,16 @@ namespace RoomAir { // Allocate histories of displacement ventilation temperatures PH 3/5/04 state.dataRoomAirMod->MATFloor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XMATFloor.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->XM2TFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XM3TFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XM4TFloor.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->DSXMATFloor.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXM3TFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXM4TFloor.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->MATOC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XMATOC.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->XM2TOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XM3TOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XM4TOC.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->DSXMATOC.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXM3TOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXM4TOC.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->MATMX.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->XMATMX.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->XM2TMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XM3TMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XM4TMX.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->DSXMATMX.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXM3TMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXM4TMX.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->ZTMFloor.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2Floor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTM3Floor.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->ZTMOC.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2OC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTM3OC.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->ZTMMX.allocate(state.dataGlobal->NumOfZones); -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2MX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTM3MX.allocate(state.dataGlobal->NumOfZones); -#endif // state.dataRoomAirMod->AIRRATFloor.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->AIRRATOC.allocate(state.dataGlobal->NumOfZones); state.dataRoomAirMod->AIRRATMX.allocate(state.dataGlobal->NumOfZones); @@ -2162,58 +2119,16 @@ namespace RoomAir { // ZoneDVMixedFlag=0 state.dataRoomAirMod->MATFloor = 23.0; state.dataRoomAirMod->XMATFloor = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->XM2TFloor = 23.0; - state.dataRoomAirMod->XM3TFloor = 23.0; - state.dataRoomAirMod->XM4TFloor = 23.0; -#endif // state.dataRoomAirMod->DSXMATFloor = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TFloor = 23.0; - state.dataRoomAirMod->DSXM3TFloor = 23.0; - state.dataRoomAirMod->DSXM4TFloor = 23.0; -#endif // state.dataRoomAirMod->MATOC = {23.0, 23.0, 23.0, 23.0}; state.dataRoomAirMod->XMATOC = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->XM2TOC = 23.0; - state.dataRoomAirMod->XM3TOC = 23.0; - state.dataRoomAirMod->XM4TOC = 23.0; -#endif // state.dataRoomAirMod->DSXMATOC = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TOC = 23.0; - state.dataRoomAirMod->DSXM3TOC = 23.0; - state.dataRoomAirMod->DSXM4TOC = 23.0; -#endif // state.dataRoomAirMod->MATMX = {23.0, 23.0, 23.0, 23.0}; state.dataRoomAirMod->XMATMX = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->XM2TMX = 23.0; - state.dataRoomAirMod->XM3TMX = 23.0; - state.dataRoomAirMod->XM4TMX = 23.0; -#endif // state.dataRoomAirMod->DSXMATMX = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TMX = 23.0; - state.dataRoomAirMod->DSXM3TMX = 23.0; - state.dataRoomAirMod->DSXM4TMX = 23.0; -#endif // state.dataRoomAirMod->ZTMFloor = {23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2Floor = 23.0; - state.dataRoomAirMod->ZTM3Floor = 23.0; -#endif // state.dataRoomAirMod->ZTMOC = {23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2OC = 23.0; - state.dataRoomAirMod->ZTM3OC = 23.0; -#endif // state.dataRoomAirMod->ZTMMX = {23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2MX = 23.0; - state.dataRoomAirMod->ZTM3MX = 23.0; -#endif // state.dataRoomAirMod->Zone1Floor = 23.0; state.dataRoomAirMod->ZoneMXFloor = 23.0; state.dataRoomAirMod->ZoneM2Floor = 23.0; @@ -2667,64 +2582,22 @@ namespace RoomAir { state.dataRoomAirMod->ZoneAirSystemON(ZoneNum) = false; state.dataRoomAirMod->MATFloor(ZoneNum) = 23.0; state.dataRoomAirMod->XMATFloor(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->XM2TFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->XM3TFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->XM4TFloor(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->DSXMATFloor(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXM3TFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXM4TFloor(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->MATOC(ZoneNum) = 23.0; state.dataRoomAirMod->XMATOC(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->XM2TOC(ZoneNum) = 23.0; - state.dataRoomAirMod->XM3TOC(ZoneNum) = 23.0; - state.dataRoomAirMod->XM4TOC(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->DSXMATOC(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TOC(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXM3TOC(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXM4TOC(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->MATMX(ZoneNum) = 23.0; state.dataRoomAirMod->XMATMX(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->XM2TMX(ZoneNum) = 23.0; - state.dataRoomAirMod->XM3TMX(ZoneNum) = 23.0; - state.dataRoomAirMod->XM4TMX(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->DSXMATMX(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->DSXM2TMX(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXM3TMX(ZoneNum) = 23.0; - state.dataRoomAirMod->DSXM4TMX(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->ZTMFloor(ZoneNum) = {23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2Floor(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTM3Floor(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->Zone1Floor(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneMXFloor(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneM2Floor(ZoneNum) = 23.0; state.dataRoomAirMod->ZTMOC(ZoneNum) = {23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2OC(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTM3OC(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->Zone1OC(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneMXOC(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneM2OC(ZoneNum) = 23.0; state.dataRoomAirMod->ZTMMX(ZoneNum) = {23.0, 23.0, 23.0}; -#ifdef GET_OUT - state.dataRoomAirMod->ZTM2MX(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTM3MX(ZoneNum) = 23.0; -#endif // state.dataRoomAirMod->Zone1MX(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneMXMX(ZoneNum) = 23.0; state.dataRoomAirMod->ZoneM2MX(ZoneNum) = 23.0; diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 4a8dcb6750a..2203a1d948e 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -3620,9 +3620,9 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( this->ZoneW1 = this->ZoneWM2; if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); - for (int LoopNode = 1; LoopNode <= afnZoneInfo.NumOfAirNodes; ++LoopNode) { - afnZoneInfo.Node(LoopNode).AirTempT1 = afnZoneInfo.Node(LoopNode).AirTempTM2; - afnZoneInfo.Node(LoopNode).HumRatW1 = afnZoneInfo.Node(LoopNode).HumRatWM2; + for (auto &afnNode : afnZoneInfo.Node) { + afnNode.AirTempT1 = afnNode.AirTempT2; + afnNode.HumRatT1 = afnNode.HumRatT2; } } } else { @@ -3630,9 +3630,9 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( this->ZoneW1 = this->ZoneWMX; if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); - for (int LoopNode = 1; LoopNode <= afnZoneInfo.NumOfAirNodes; ++LoopNode) { - afnZoneInfo.Node(LoopNode).AirTempT1 = afnZoneInfo.Node(LoopNode).AirTempTMX; - afnZoneInfo.Node(LoopNode).HumRatW1 = afnZoneInfo.Node(LoopNode).HumRatWMX; + for (auto &afnNode : afnZoneInfo.Node) { + afnNode.AirTempT1 = afnNode.AirTempTX; + afnNode.HumRatT1 = afnNode.HumRatTX; } } } @@ -3642,9 +3642,9 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( this->ZoneW1 = this->ZoneAirHumRat; if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); - for (int LoopNode = 1; LoopNode <= afnZoneInfo.NumOfAirNodes; ++LoopNode) { - afnZoneInfo.Node(LoopNode).AirTempT1 = afnZoneInfo.Node(LoopNode).AirTemp; - afnZoneInfo.Node(LoopNode).HumRatW1 = afnZoneInfo.Node(LoopNode).HumRat; + for (auto &afnNode : afnZoneInfo.Node) { + afnNode.AirTempT1 = afnNode.AirTemp; + afnNode.HumRatT1 = afnNode.HumRat; } } } @@ -4623,17 +4623,16 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in // for RoomAirflowNetwork model if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); - afnZoneInfo.AirTempX4 = afnZoneInfo.AirTempX3; - afnZoneInfo.AirTempX3 = afnZoneInfo.AirTempX2; - afnZoneInfo.AirTempX2 = afnZoneInfo.AirTempX1; - afnZoneInfo.AirTempX1 = afnZoneInfo.AirTemp; + for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + afnNode.AirTempX[3] = afnNode.AirTempX[2]; + afnNode.AirTempX[2] = afnNode.AirTempX[1]; + afnNode.AirTempX[1] = afnNode.AirTempX[0]; + afnNode.AirTempX[0] = afnNode.AirTemp; - afnZoneInfo.HumRatX4 = afnZoneInfo.HumRatX3; - afnZoneInfo.HumRatX3 = afnZoneInfo.HumRatX2; - afnZoneInfo.HumRatX2 = afnZoneInfo.HumRatX1; - afnZoneInfo.HumRatX1 = afnZoneInfo.HumRat; + afnNode.HumRatX[3] = afnNode.HumRatX[2]; + afnNode.HumRatX[2] = afnNode.HumRatX[1]; + afnNode.HumRatX[1] = afnNode.HumRatX[0]; + afnNode.HumRatX[0] = afnNode.HumRat; } } } @@ -4657,13 +4656,12 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in } if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); - afnZoneInfo.AirTempTM2 = afnZoneInfo.AirTempTMX; - afnZoneInfo.AirTempTMX = afnZoneInfo.AirTemp; + for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + afnNode.AirTempT2 = afnNode.AirTempTX; + afnNode.AirTempTX = afnNode.AirTemp; - afnZoneInfo.HumRatWM2 = afnZoneInfo.HumRatWMX; - afnZoneInfo.HumRatWMX = afnZoneInfo.HumRat; + afnNode.HumRatT2 = afnNode.HumRatTX; + afnNode.HumRatTX = afnNode.HumRat; } } } @@ -4719,17 +4717,16 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, state.dataRoomAirMod->DSXMATMX(zoneNum)[0] = state.dataRoomAirMod->MATMX(zoneNum); } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); - afnZoneInfo.AirTempDSX4 = afnZoneInfo.AirTempDSX3; - afnZoneInfo.AirTempDSX3 = afnZoneInfo.AirTempDSX2; - afnZoneInfo.AirTempDSX2 = afnZoneInfo.AirTempDSX1; - afnZoneInfo.AirTempDSX1 = afnZoneInfo.AirTemp; + for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + afnNode.AirTempDSX[3] = afnNode.AirTempDSX[2]; + afnNode.AirTempDSX[2] = afnNode.AirTempDSX[1]; + afnNode.AirTempDSX[1] = afnNode.AirTempDSX[0]; + afnNode.AirTempDSX[0] = afnNode.AirTemp; - afnZoneInfo.HumRatDSX4 = afnZoneInfo.HumRatDSX3; - afnZoneInfo.HumRatDSX3 = afnZoneInfo.HumRatDSX2; - afnZoneInfo.HumRatDSX2 = afnZoneInfo.HumRatDSX1; - afnZoneInfo.HumRatDSX1 = afnZoneInfo.HumRat; + afnNode.HumRatDSX[3] = afnNode.HumRatDSX[2]; + afnNode.HumRatDSX[2] = afnNode.HumRatDSX[1]; + afnNode.HumRatDSX[1] = afnNode.HumRatDSX[0]; + afnNode.HumRatDSX[0] = afnNode.HumRat; } } } @@ -4754,12 +4751,12 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); - afnZoneInfo.AirTempTM2 = afnZoneInfo.AirTempTMX; - afnZoneInfo.AirTempTMX = afnZoneInfo.AirTemp; + auto &afnNode = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); + afnNode.AirTempT2 = afnNode.AirTempTX; + afnNode.AirTempTX = afnNode.AirTemp; - afnZoneInfo.HumRatWM2 = afnZoneInfo.HumRatWMX; - afnZoneInfo.HumRatWMX = afnZoneInfo.HumRat; + afnNode.HumRatT2 = afnNode.HumRatTX; + afnNode.HumRatTX = afnNode.HumRat; } } } @@ -4814,15 +4811,14 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); - afnZoneInfo.AirTempX1 = afnZoneInfo.AirTempX2; - afnZoneInfo.AirTempX2 = afnZoneInfo.AirTempX3; - afnZoneInfo.AirTempX3 = afnZoneInfo.AirTempX4; + for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + afnNode.AirTempX[0] = afnNode.AirTempX[1]; + afnNode.AirTempX[1] = afnNode.AirTempX[2]; + afnNode.AirTempX[2] = afnNode.AirTempX[3]; - afnZoneInfo.HumRatX1 = afnZoneInfo.HumRatX2; - afnZoneInfo.HumRatX2 = afnZoneInfo.HumRatX3; - afnZoneInfo.HumRatX3 = afnZoneInfo.HumRatX4; + afnNode.HumRatX[0] = afnNode.HumRatX[1]; + afnNode.HumRatX[1] = afnNode.HumRatX[2]; + afnNode.HumRatX[2] = afnNode.HumRatX[3]; } } } @@ -7146,28 +7142,16 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, } if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &ThisRAFNNode(state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode)); - DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - ThisRAFNNode.AirTempX1, - ThisRAFNNode.AirTempX2, - ThisRAFNNode.AirTempX3, - ThisRAFNNode.AirTemp, - ThisRAFNNode.AirTempDSX1, - ThisRAFNNode.AirTempDSX2, - ThisRAFNNode.AirTempDSX3, - ThisRAFNNode.AirTempDSX4); - DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - ThisRAFNNode.HumRatX1, - ThisRAFNNode.HumRatX2, - ThisRAFNNode.HumRatX3, - ThisRAFNNode.HumRat, - ThisRAFNNode.HumRatDSX1, - ThisRAFNNode.HumRatDSX2, - ThisRAFNNode.HumRatDSX3, - ThisRAFNNode.HumRatDSX4); + for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + afnNode.AirTemp = DownInterpolate4HistoryValues(PriorTimeStep, + TimeStepSys, + afnNode.AirTempX, + afnNode.AirTempDSX); + + afnNode.HumRat = DownInterpolate4HistoryValues(PriorTimeStep, + TimeStepSys, + afnNode.HumRatX, + afnNode.HumRatDSX); } } } diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 8b2c1ad30eb..1ee74f10e90 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -202,16 +202,16 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).SurfMask(2) = true; state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).NumOfAirflowLinks = 3; state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link.allocate(3); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(1).AirflowNetworkLinkSimuID = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(2).AirflowNetworkLinkSimuID = 2; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(3).AirflowNetworkLinkSimuID = 3; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).AirflowNetworkNodeID = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(1).AFNSimuID = 1; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(2).AFNSimuID = 2; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(3).AFNSimuID = 3; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).AFNNodeID = 1; state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).NumOfAirflowLinks = 3; state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link.allocate(3); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(1).AirflowNetworkLinkSimuID = 3; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(2).AirflowNetworkLinkSimuID = 4; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(3).AirflowNetworkLinkSimuID = 5; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).AirflowNetworkNodeID = 2; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(1).AFNSimuID = 3; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(2).AFNSimuID = 4; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(3).AFNSimuID = 5; + state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).AFNNodeID = 2; state->afn->AirflowNetworkLinkageData(1).NodeNums[0] = 1; state->afn->AirflowNetworkLinkageData(2).NodeNums[0] = 1; From b68ee9c4cf6ce69a520802cc77905e3eeac0b5e4 Mon Sep 17 00:00:00 2001 From: amirroth Date: Sat, 24 Jun 2023 19:08:04 -0400 Subject: [PATCH 09/17] Some renaming --- src/EnergyPlus/CrossVentMgr.cc | 24 ++++++++--------- src/EnergyPlus/CrossVentMgr.hh | 12 ++++----- src/EnergyPlus/DisplacementVentMgr.cc | 16 ++++++------ src/EnergyPlus/DisplacementVentMgr.hh | 8 +++--- src/EnergyPlus/MundtSimMgr.cc | 22 ++++++++-------- src/EnergyPlus/MundtSimMgr.hh | 12 ++++----- src/EnergyPlus/RoomAirModelManager.cc | 10 +++---- src/EnergyPlus/UFADManager.cc | 26 +++++++++---------- src/EnergyPlus/UFADManager.hh | 24 ++++++++--------- tst/EnergyPlus/unit/CrossVentMgr.unit.cc | 2 +- .../unit/DisplacementVentMgr.unit.cc | 2 +- 11 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 348763778c8..36ba7abcc0b 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -96,7 +96,7 @@ namespace RoomAir { Real64 constexpr CrecFlow1(0.415); // First correlation constant for the recirculation flow rate Real64 constexpr CrecFlow2(0.466); // Second correlation constant for the recirculation flow rate - void ManageUCSDCVModel(EnergyPlusData &state, + void ManageCrossVent(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { @@ -107,13 +107,13 @@ namespace RoomAir { // PURPOSE OF THIS SUBROUTINE: // manage the UCSD Cross Ventilation model - InitUCSDCV(state, ZoneNum); + InitCrossVent(state, ZoneNum); // perform Cross Ventilation model calculations - CalcUCSDCV(state, ZoneNum); + CalcCrossVent(state, ZoneNum); } - void InitUCSDCV(EnergyPlusData &state, int const ZoneNum) + void InitCrossVent(EnergyPlusData &state, int const ZoneNum) { // SUBROUTINE INFORMATION: @@ -142,7 +142,7 @@ namespace RoomAir { } } - void HcUCSDCV(EnergyPlusData &state, int const ZoneNum) + void HcCrossVent(EnergyPlusData &state, int const ZoneNum) { // SUBROUTINE INFORMATION: @@ -325,7 +325,7 @@ namespace RoomAir { } } - void EvolveParaUCSDCV(EnergyPlusData &state, int const ZoneNum) + void EvolveParaCrossVent(EnergyPlusData &state, int const ZoneNum) { // SUBROUTINE INFORMATION: @@ -712,8 +712,8 @@ namespace RoomAir { } } - void CalcUCSDCV(EnergyPlusData &state, - int const ZoneNum) // Which Zonenum + void CalcCrossVent(EnergyPlusData &state, + int const ZoneNum) // Which Zonenum { // SUBROUTINE INFORMATION: @@ -765,7 +765,7 @@ namespace RoomAir { state.afn->exchangeData(ZoneNum).SumMCpT + state.afn->exchangeData(ZoneNum).SumMVCpT + state.afn->exchangeData(ZoneNum).SumMMCpT; } - EvolveParaUCSDCV(state, ZoneNum); + EvolveParaCrossVent(state, ZoneNum); // Real64 L = state.dataRoomAirMod->Droom(ZoneNum); if (state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel) { @@ -773,7 +773,7 @@ namespace RoomAir { state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 0.0; state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 1.0; for (int Ctd = 1; Ctd <= 4; ++Ctd) { - HcUCSDCV(state, ZoneNum); + HcCrossVent(state, ZoneNum); if (state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) != 1.0) { state.dataRoomAirMod->ZTREC(ZoneNum) = (ConvGainsRec * CrecTemp + CrecTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAirMod->Tin(ZoneNum) * MCp_Total) / @@ -817,7 +817,7 @@ namespace RoomAir { state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - HcUCSDCV(state, ZoneNum); + HcCrossVent(state, ZoneNum); ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; @@ -849,7 +849,7 @@ namespace RoomAir { state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - HcUCSDCV(state, ZoneNum); + HcCrossVent(state, ZoneNum); ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; diff --git a/src/EnergyPlus/CrossVentMgr.hh b/src/EnergyPlus/CrossVentMgr.hh index 09104e4c757..82987f4cb8b 100644 --- a/src/EnergyPlus/CrossVentMgr.hh +++ b/src/EnergyPlus/CrossVentMgr.hh @@ -59,15 +59,15 @@ struct EnergyPlusData; namespace RoomAir { - void ManageUCSDCVModel(EnergyPlusData &state, int ZoneNum); + void ManageCrossVent(EnergyPlusData &state, int ZoneNum); - void InitUCSDCV(EnergyPlusData &state, int ZoneNum); + void InitCrossVent(EnergyPlusData &state, int ZoneNum); - void HcUCSDCV(EnergyPlusData &state, int ZoneNum); + void HcCrossVent(EnergyPlusData &state, int ZoneNum); - void EvolveParaUCSDCV(EnergyPlusData &state, int ZoneNum); + void EvolveParaCrossVent(EnergyPlusData &state, int ZoneNum); - void CalcUCSDCV(EnergyPlusData &state, int ZoneNum); + void CalcCrossVent(EnergyPlusData &state, int ZoneNum); } // namespace RoomAir @@ -83,7 +83,7 @@ struct CrossVentMgrData : BaseGlobalStruct void clear_state() override { - *this = CrossVentMgrData(); + new (this) CrossVentMgrData(); } }; diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index 944710282dc..ead62715dd1 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -94,7 +94,7 @@ using namespace DataHeatBalSurface; using namespace DataSurfaces; using Convect::CalcDetailedHcInForDVModel; -void ManageUCSDDVModel(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone +void ManageDispVent3Node(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: @@ -105,15 +105,15 @@ void ManageUCSDDVModel(EnergyPlusData &state, int const ZoneNum) // index number // manage the UCSD Displacement Ventilation model // initialize Displacement Ventilation model - InitUCSDDV(state, ZoneNum); + InitDispVent3Node(state, ZoneNum); // perform Displacement Ventilation model calculations - CalcUCSDDV(state, ZoneNum); + CalcDispVent3Node(state, ZoneNum); } //************************************************************************************************** -void InitUCSDDV(EnergyPlusData &state, int const ZoneNum) +void InitDispVent3Node(EnergyPlusData &state, int const ZoneNum) { // SUBROUTINE INFORMATION: @@ -158,7 +158,7 @@ void InitUCSDDV(EnergyPlusData &state, int const ZoneNum) //************************************************************************************************** -void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight) +void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight) { // SUBROUTINE INFORMATION: @@ -485,7 +485,7 @@ Real64 calculateThirdOrderFloorTemperature(Real64 temperatureHistoryTerm, (elevenOverSix * airCap + HA_floor + 1.6 * MCp_Total); } -void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum +void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenum { // SUBROUTINE INFORMATION: @@ -725,7 +725,7 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum Real64 const plume_fac(NumberOfPlumes * std::pow(PowerPerPlume, OneThird)); HeightFrac = min(24.55 * std::pow(MCp_Total * 0.000833 / plume_fac, 0.6) / CeilingHeight, 1.0); for (Ctd = 1; Ctd <= 4; ++Ctd) { - HcUCSDDV(state, ZoneNum, HeightFrac); + HcDispVent3Node(state, ZoneNum, HeightFrac); // HeightFrac = min( 24.55 * std::pow( MCp_Total * 0.000833 / ( NumberOfPlumes * std::pow( PowerPerPlume, OneThird ) ), 0.6 ) / // CeilingHeight, 1.0 ); //Tuned This does not vary in loop EPTeam-replaces above (cause diffs) HeightFrac = // MIN(24.55d0*(MCp_Total*0.000833d0/(NumberOfPlumes*PowerPerPlume**(1.0d0/3.d0)))**0.6 / CeilingHeight , 1.0d0) @@ -916,7 +916,7 @@ void CalcUCSDDV(EnergyPlusData &state, int const ZoneNum) // Which Zonenum state.dataRoomAirMod->ZTOC(ZoneNum) = ZTAveraged; state.dataRoomAirMod->ZTMX(ZoneNum) = ZTAveraged; state.dataRoomAirMod->ZTFloor(ZoneNum) = ZTAveraged; - HcUCSDDV(state, ZoneNum, HeightFrac); + HcDispVent3Node(state, ZoneNum, HeightFrac); TempDepCoef = state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + state.dataDispVentMgr->HA_FLOOR + MCp_Total; TempIndCoef = ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + state.dataDispVentMgr->HAT_FLOOR + MCpT_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { diff --git a/src/EnergyPlus/DisplacementVentMgr.hh b/src/EnergyPlus/DisplacementVentMgr.hh index b4cfa7caf93..a750cc76407 100644 --- a/src/EnergyPlus/DisplacementVentMgr.hh +++ b/src/EnergyPlus/DisplacementVentMgr.hh @@ -60,11 +60,11 @@ struct EnergyPlusData; namespace RoomAir { - void ManageUCSDDVModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone + void ManageDispVent3Node(EnergyPlusData &state, int ZoneNum); // index number for the specified zone - void InitUCSDDV(EnergyPlusData &state, int ZoneNum); + void InitDispVent3Node(EnergyPlusData &state, int ZoneNum); - void HcUCSDDV(EnergyPlusData &state, int ZoneNum, Real64 FractionHeight); + void HcDispVent3Node(EnergyPlusData &state, int ZoneNum, Real64 FractionHeight); Real64 calculateThirdOrderFloorTemperature(Real64 temperatureHistoryTerm, Real64 HAT_floor, @@ -76,7 +76,7 @@ namespace RoomAir { Real64 zoneMultiplier, Real64 airCap); - void CalcUCSDDV(EnergyPlusData &state, int ZoneNum); // Which Zonenum + void CalcDispVent3Node(EnergyPlusData &state, int ZoneNum); // Which Zonenum static constexpr std::array IntGainTypesOccupied = { DataHeatBalance::IntGainType::People, diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index dff580c2122..bc9fda79b5f 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -101,7 +101,7 @@ namespace RoomAir { // MODULE VARIABLE DECLARATIONS: - void ManageMundtModel(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone + void ManageDispVent1Node(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: @@ -117,7 +117,7 @@ namespace RoomAir { // initialize Mundt model data if (state.dataHeatBal->MundtFirstTimeFlag) { - InitMundtModel(state); + InitDispVent1Node(state); state.dataHeatBal->MundtFirstTimeFlag = false; } @@ -125,27 +125,27 @@ namespace RoomAir { state.dataMundtSimMgr->MundtZoneNum = state.dataMundtSimMgr->ZoneData(ZoneNum).MundtZoneIndex; // transfer data from surface domain to air domain for the specified zone - GetSurfHBDataForMundtModel(state, ZoneNum); + GetSurfHBDataForDispVent1Node(state, ZoneNum); // use the Mundt model only for cooling case if ((state.dataMundtSimMgr->SupplyAirVolumeRate > 0.0001) && (state.dataMundtSimMgr->QsysCoolTot > 0.0001)) { // setup Mundt model ErrorsFound = false; - SetupMundtModel(state, ZoneNum, ErrorsFound); + SetupDispVent1Node(state, ZoneNum, ErrorsFound); if (ErrorsFound) ShowFatalError(state, "ManageMundtModel: Errors in setting up Mundt Model. Preceding condition(s) cause termination."); // perform Mundt model calculations - CalcMundtModel(state, ZoneNum); + CalcDispVent1Node(state, ZoneNum); } // transfer data from air domain back to surface domain for the specified zone - SetSurfHBDataForMundtModel(state, ZoneNum); + SetSurfHBDataForDispVent1Node(state, ZoneNum); } //***************************************************************************************** - void InitMundtModel(EnergyPlusData &state) + void InitDispVent1Node(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -320,7 +320,7 @@ namespace RoomAir { //***************************************************************************************** - void GetSurfHBDataForMundtModel(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone + void GetSurfHBDataForDispVent1Node(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: @@ -426,7 +426,7 @@ namespace RoomAir { //***************************************************************************************** - void SetupMundtModel(EnergyPlusData &state, + void SetupDispVent1Node(EnergyPlusData &state, int const ZoneNum, // index number for the specified zone bool &ErrorsFound // true if problems setting up model ) @@ -525,7 +525,7 @@ namespace RoomAir { //***************************************************************************************** - void CalcMundtModel(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone + void CalcDispVent1Node(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: @@ -717,7 +717,7 @@ namespace RoomAir { //***************************************************************************************** - void SetSurfHBDataForMundtModel(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone + void SetSurfHBDataForDispVent1Node(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: diff --git a/src/EnergyPlus/MundtSimMgr.hh b/src/EnergyPlus/MundtSimMgr.hh index 7e98855f327..539f65b8ba8 100644 --- a/src/EnergyPlus/MundtSimMgr.hh +++ b/src/EnergyPlus/MundtSimMgr.hh @@ -95,26 +95,26 @@ namespace RoomAir { // Functions - void ManageMundtModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone + void ManageDispVent1Node(EnergyPlusData &state, int ZoneNum); // index number for the specified zone //***************************************************************************************** - void InitMundtModel(EnergyPlusData &state); + void InitDispVent1Node(EnergyPlusData &state); //***************************************************************************************** - void GetSurfHBDataForMundtModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone + void GetSurfHBDataForDispVent1Node(EnergyPlusData &state, int ZoneNum); // index number for the specified zone //***************************************************************************************** - void SetupMundtModel(EnergyPlusData &state, + void SetupDispVent1Node(EnergyPlusData &state, int ZoneNum, // index number for the specified zone bool &ErrorsFound // true if problems setting up model ); //***************************************************************************************** - void CalcMundtModel(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone + void CalcDispVent1Node(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone //***************************************************************************************** @@ -132,7 +132,7 @@ namespace RoomAir { //***************************************************************************************** - void SetSurfHBDataForMundtModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone + void SetSurfHBDataForDispVent1Node(EnergyPlusData &state, int ZoneNum); // index number for the specified zone //***************************************************************************************** diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index ae60a9e02a7..9f2f1fd3784 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -147,27 +147,27 @@ namespace RoomAir { case RoomAirModel::DispVent1Node: // Mundt air model // simulate room airflow using Mundt model - ManageMundtModel(state, ZoneNum); + ManageDispVent1Node(state, ZoneNum); break; case RoomAirModel::DispVent3Node: // UCDV Displacement Ventilation model // simulate room airflow using UCSDDV model - ManageUCSDDVModel(state, ZoneNum); + ManageDispVent3Node(state, ZoneNum); break; case RoomAirModel::CrossVent: // UCSD Cross Ventilation model // simulate room airflow using UCSDDV model - ManageUCSDCVModel(state, ZoneNum); + ManageCrossVent(state, ZoneNum); break; case RoomAirModel::UFADInt: // UCSD UFAD interior zone model // simulate room airflow using the UCSDUFI model - ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UFADInt); + ManageUFAD(state, ZoneNum, RoomAirModel::UFADInt); break; case RoomAirModel::UFADExt: // UCSD UFAD exterior zone model // simulate room airflow using the UCSDUFE model - ManageUCSDUFModels(state, ZoneNum, RoomAirModel::UFADExt); + ManageUFAD(state, ZoneNum, RoomAirModel::UFADExt); break; case RoomAirModel::AirflowNetwork: // RoomAirflowNetwork zone model diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 6b955fc05ff..80711acc3db 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -107,9 +107,9 @@ using namespace DataHeatBalSurface; using namespace DataSurfaces; using Convect::CalcDetailedHcInForDVModel; -void ManageUCSDUFModels(EnergyPlusData &state, - int const ZoneNum, // index number for the specified zone - RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 +void ManageUFAD(EnergyPlusData &state, + int const ZoneNum, // index number for the specified zone + RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ) { @@ -137,23 +137,23 @@ void ManageUCSDUFModels(EnergyPlusData &state, // input was obtained in RoomAirManager, GetUFADIntZoneData - InitUCSDUF(state, ZoneNum, ZoneModelType); // initialize some module variables + InitUFAD(state, ZoneNum, ZoneModelType); // initialize some module variables switch (ZoneModelType) { case RoomAirModel::UFADInt: { // UCSD UFAD interior zone model // simulate room airflow using the UCSDUFI model - CalcUCSDUI(state, ZoneNum); + CalcUFADInt(state, ZoneNum); } break; case RoomAirModel::UFADExt: { // UCSD UFAD exterior zone model // simulate room airflow using the UCSDUFE model - CalcUCSDUE(state, ZoneNum); + CalcUFADExt(state, ZoneNum); } break; default: break; } } -void InitUCSDUF(EnergyPlusData &state, +void InitUFAD(EnergyPlusData &state, int const ZoneNum, RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ) @@ -184,7 +184,7 @@ void InitUCSDUF(EnergyPlusData &state, } if (state.dataUFADManager->MySizeFlag(ZoneNum)) { - SizeUCSDUF(state, ZoneNum, ZoneModelType); + SizeUFAD(state, ZoneNum, ZoneModelType); state.dataUFADManager->MySizeFlag(ZoneNum) = false; } @@ -222,9 +222,9 @@ void InitUCSDUF(EnergyPlusData &state, } } -void SizeUCSDUF(EnergyPlusData &state, - int const ZoneNum, - RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 +void SizeUFAD(EnergyPlusData &state, + int const ZoneNum, + RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ) { @@ -982,7 +982,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } } -void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone +void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: @@ -1494,7 +1494,7 @@ void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum) // index number for th } } -void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone +void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: diff --git a/src/EnergyPlus/UFADManager.hh b/src/EnergyPlus/UFADManager.hh index 131f999a07e..b7eb3133755 100644 --- a/src/EnergyPlus/UFADManager.hh +++ b/src/EnergyPlus/UFADManager.hh @@ -59,26 +59,26 @@ struct EnergyPlusData; namespace RoomAir { - void ManageUCSDUFModels(EnergyPlusData &state, - int const ZoneNum, // index number for the specified zone - RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + void ManageUFAD(EnergyPlusData &state, + int const ZoneNum, // index number for the specified zone + RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ); - void InitUCSDUF(EnergyPlusData &state, - int const ZoneNum, - RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + void InitUFAD(EnergyPlusData &state, + int const ZoneNum, + RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ); - void SizeUCSDUF(EnergyPlusData &state, - int const ZoneNum, - RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + void SizeUFAD(EnergyPlusData &state, + int const ZoneNum, + RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ); - void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight); + void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight); - void CalcUCSDUI(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone + void CalcUFADInt(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone - void CalcUCSDUE(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone + void CalcUFADExt(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone } // namespace RoomAir diff --git a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc index d942604e25e..d9b520416c2 100644 --- a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc @@ -168,7 +168,7 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->dataRoomAirMod->Qtot.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->Tin.allocate(state->dataGlobal->NumOfZones); - EvolveParaUCSDCV(*state, 1); + EvolveParaCrossVent(*state, 1); EXPECT_NEAR(27.14, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Fin, 0.01); EXPECT_NEAR(0.871, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Uin, 0.001); diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index efc3f43b7b3..a8c1d7068ac 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -229,7 +229,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataHeatBalSurf->SurfTempIn(2) = 23.0; state->dataHeatBalSurf->SurfTempIn(3) = 23.0; - HcUCSDDV(*state, 1, 0.5); + HcDispVent3Node(*state, 1, 0.5); EXPECT_NEAR(1.889346, state->dataRoomAirMod->DispVent3NodeHcIn(1), 0.0001); EXPECT_NEAR(1.650496, state->dataRoomAirMod->DispVent3NodeHcIn(2), 0.0001); From bf386e56dec44ff4d2f2d0fbeeb415e65392222d Mon Sep 17 00:00:00 2001 From: amirroth Date: Sun, 25 Jun 2023 10:38:44 -0400 Subject: [PATCH 10/17] More renaming --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 36 +- src/EnergyPlus/ConvectionCoefficients.cc | 10 +- src/EnergyPlus/CrossVentMgr.cc | 486 +++++----- src/EnergyPlus/Data/EnergyPlusData.cc | 6 +- src/EnergyPlus/Data/EnergyPlusData.hh | 4 +- src/EnergyPlus/DataRoomAirModel.hh | 4 + src/EnergyPlus/DisplacementVentMgr.cc | 502 +++++----- src/EnergyPlus/HeatBalanceAirManager.cc | 68 +- src/EnergyPlus/HybridModel.cc | 4 +- src/EnergyPlus/InternalHeatGains.cc | 6 +- src/EnergyPlus/MundtSimMgr.cc | 32 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 98 +- src/EnergyPlus/RoomAirModelManager.cc | 918 +++++++++--------- src/EnergyPlus/RoomAirModelManager.hh | 14 - src/EnergyPlus/RoomAirModelUserTempPattern.cc | 462 ++++----- src/EnergyPlus/SQLiteProcedures.cc | 2 +- src/EnergyPlus/ThermalComfort.cc | 70 +- src/EnergyPlus/UFADManager.cc | 662 ++++++------- src/EnergyPlus/ZoneEquipmentManager.cc | 6 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 222 ++--- .../unit/ConvectionCoefficients.unit.cc | 6 +- tst/EnergyPlus/unit/CrossVentMgr.unit.cc | 90 +- .../unit/DisplacementVentMgr.unit.cc | 182 ++-- tst/EnergyPlus/unit/HybridModel.unit.cc | 28 +- .../unit/RoomAirflowNetwork.unit.cc | 220 ++--- tst/EnergyPlus/unit/ThermalComfort.unit.cc | 14 +- .../unit/ZoneTempPredictorCorrector.unit.cc | 2 +- 27 files changed, 2007 insertions(+), 2147 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 8fa0bd86646..fdf2c13aa01 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -4802,7 +4802,7 @@ namespace AirflowNetwork { n = AirflowNetworkNodeData(i).EPlusZoneNum; AirflowNetworkNodeData(i).NumOfLinks = 0; if (n > 0 && AirflowNetworkNodeData(i).RAFNNodeNum > 0) { - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID = i; + m_state.dataRoomAir->AFNZoneInfo(n).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID = i; for (j = 1; j <= AirflowNetworkNumOfSurfaces; ++j) { if (AirflowNetworkLinkageData(j).NodeNums[0] == i) { AirflowNetworkNodeData(i).NumOfLinks = AirflowNetworkNodeData(i).NumOfLinks + 1; @@ -4813,21 +4813,21 @@ namespace AirflowNetwork { } } if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) { - for (j = 1; j <= m_state.dataRoomAirMod->AFNZoneInfo(n).NumOfAirNodes; ++j) { - if (m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).AFNNodeID == i) { - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).NumOfAirflowLinks = AirflowNetworkNodeData(i).NumOfLinks; - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link.allocate(AirflowNetworkNodeData(i).NumOfLinks); + for (j = 1; j <= m_state.dataRoomAir->AFNZoneInfo(n).NumOfAirNodes; ++j) { + if (m_state.dataRoomAir->AFNZoneInfo(n).Node(j).AFNNodeID == i) { + m_state.dataRoomAir->AFNZoneInfo(n).Node(j).NumOfAirflowLinks = AirflowNetworkNodeData(i).NumOfLinks; + m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link.allocate(AirflowNetworkNodeData(i).NumOfLinks); k = 1; for (int m = 1; m <= AirflowNetworkNumOfSurfaces; ++m) { if (AirflowNetworkLinkageData(m).NodeNums[0] == i) { - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AFNSimuID = m; - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AFNDataID = m; + m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link(k).AFNSimuID = m; + m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link(k).AFNDataID = m; k = k + 1; if (k > AirflowNetworkNodeData(i).NumOfLinks) break; } if (AirflowNetworkLinkageData(m).NodeNums[1] == i) { - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AFNSimuID = m; - m_state.dataRoomAirMod->AFNZoneInfo(n).Node(j).Link(k).AFNDataID = m; + m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link(k).AFNSimuID = m; + m_state.dataRoomAir->AFNZoneInfo(n).Node(j).Link(k).AFNDataID = m; k = k + 1; if (k > AirflowNetworkNodeData(i).NumOfLinks) break; } @@ -5386,8 +5386,8 @@ namespace AirflowNetwork { } if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) { ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp = 23.0; - m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat = 0.0; + m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp = 23.0; + m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat = 0.0; } } @@ -5469,13 +5469,13 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) { ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum) + if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum) .Node(AirflowNetworkNodeData(i).RAFNNodeNum) .AFNNodeID == i) { AirflowNetworkNodeSimu(i).TZ = - m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp; + m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp; AirflowNetworkNodeSimu(i).WZ = - m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat; + m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat; } } } @@ -7736,9 +7736,9 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) { MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10; ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == + if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) { - MV(i) = m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp * 1.0e10; + MV(i) = m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp * 1.0e10; } } } @@ -8030,9 +8030,9 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) { MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10; ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == + if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) { - MV(i) = m_state.dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat * 1.0e10; + MV(i) = m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat * 1.0e10; } } } diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 8bc1af11509..5539808b791 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -1980,10 +1980,10 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, } } - assert(state.dataRoomAirMod->AirModel.allocated()); - if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::DispVent3Node || - state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UFADInt || - state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UFADExt) { + assert(state.dataRoomAir->AirModel.allocated()); + if (state.dataRoomAir->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::DispVent3Node || + state.dataRoomAir->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UFADInt || + state.dataRoomAir->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::UFADExt) { // Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf if (state.dataSurface->surfIntConv(SurfNum).userModelNum != 0) { @@ -1996,7 +1996,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, -surface.CosTilt); // negative CosTilt because CosTilt is relative to exterior } - } else if (state.dataRoomAirMod->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent) { + } else if (state.dataRoomAir->AirModel(surface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent) { Hf = 4.3 * Vhc()(surface.Zone); diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 36ba7abcc0b..86654982494 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -164,163 +164,163 @@ namespace RoomAir { state.dataCrossVentMgr->HA_R = 0.0; // Is the air flow model for this zone set to UCSDCV Cross Ventilation? - if (state.dataRoomAirMod->IsZoneCrossVent(ZoneNum)) { + if (state.dataRoomAir->IsZoneCrossVent(ZoneNum)) { - Real64 zoneJetRecAreaRatio = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum); + Real64 zoneJetRecAreaRatio = state.dataRoomAir->JetRecAreaRatio(ZoneNum); // WALL Hc, HA and HAT calculation - for (int Ctd = state.dataRoomAirMod->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Wall(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Wall(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Wall(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); - state.dataRoomAirMod->HWall(Ctd) = state.dataRoomAirMod->CrossVentHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += - surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWall(Ctd); - state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAirMod->HWall(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HWall(Ctd); } // END WALL // WINDOW Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Window(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Window(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->CrossVentHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum); state.dataCrossVentMgr->HAT_R += - surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (surf.Tilt <= 10.0) { // Window Ceiling - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Ujet); - Real64 Hjet = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet); + Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); - Real64 Hrec = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataRoomAirMod->HWindow(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); + Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataRoomAir->HWindow(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = zoneJetRecAreaRatio * state.dataRoomAirMod->ZTJET(ZoneNum) + - (1 - zoneJetRecAreaRatio) * state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); } if (surf.Tilt >= 170.0) { // Window Floor - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Ujet); - Real64 Hjet = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet); + Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); - Real64 Hrec = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataRoomAirMod->HWindow(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); + Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataRoomAir->HWindow(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = - zoneJetRecAreaRatio * state.dataRoomAirMod->ZTJET(ZoneNum) + - (1 - zoneJetRecAreaRatio) * state.dataRoomAirMod->ZTREC(ZoneNum); + zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); } - state.dataRoomAirMod->CrossVentHcIn(SurfNum) = state.dataRoomAirMod->HWindow(Ctd); + state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); } // END WINDOW // DOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR - int SurfNum = state.dataRoomAirMod->APos_Door(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR + int SurfNum = state.dataRoomAir->APos_Door(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); - state.dataRoomAirMod->HDoor(Ctd) = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HDoor(Ctd); - state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAirMod->HDoor(Ctd); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HDoor(Ctd); } // END DOOR // INTERNAL Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Internal(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Internal(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Internal(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); - state.dataRoomAirMod->HInternal(Ctd) = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HInternal(Ctd); - state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAirMod->HInternal(Ctd); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); + state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); + state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HInternal(Ctd); } // END INTERNAL // CEILING Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Ceiling(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Ceiling(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Ujet); - Real64 Hjet = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet); + Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); - Real64 Hrec = state.dataRoomAirMod->CrossVentHcIn(SurfNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); + Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum); - state.dataRoomAirMod->HCeiling(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; + state.dataRoomAir->HCeiling(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_R += surf.Area * (1 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += surf.Area * (1 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = zoneJetRecAreaRatio * state.dataRoomAirMod->ZTJET(ZoneNum) + - (1 - zoneJetRecAreaRatio) * state.dataRoomAirMod->ZTREC(ZoneNum); - state.dataRoomAirMod->CrossVentHcIn(SurfNum) = state.dataRoomAirMod->HCeiling(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); + state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); } // END CEILING // FLOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Floor(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Floor(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Floor(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Ujet); - Real64 Hjet = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet); + Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( - state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->CrossVentHcIn, state.dataRoomAirMod->Urec); - Real64 Hrec = state.dataRoomAirMod->CrossVentHcIn(SurfNum); - state.dataRoomAirMod->HFloor(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; + state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); + Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum); + state.dataRoomAir->HFloor(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_R += surf.Area * (1 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += surf.Area * (1 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = - zoneJetRecAreaRatio * state.dataRoomAirMod->ZTJET(ZoneNum) + - (1 - zoneJetRecAreaRatio) * state.dataRoomAirMod->ZTREC(ZoneNum); - state.dataRoomAirMod->CrossVentHcIn(SurfNum) = state.dataRoomAirMod->HFloor(Ctd); + zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); + state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); } // END FLOOR } } @@ -351,16 +351,16 @@ namespace RoomAir { Real64 Wroom; // Room width Real64 Aroom; // Room area cross section - assert(state.dataRoomAirMod->AirModel.allocated()); - state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0; + assert(state.dataRoomAir->AirModel.allocated()); + state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0; auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); // Identify the dominant aperture: - MaxSurf = state.dataRoomAirMod->AFNSurfaceCrossVent(1, ZoneNum); + MaxSurf = state.dataRoomAir->AFNSurfaceCrossVent(1, ZoneNum); int const surfNum = state.afn->MultizoneSurfaceData(MaxSurf).SurfNum; auto const &thisSurface = state.dataSurface->Surface(surfNum); - int afnSurfNum1 = state.dataRoomAirMod->AFNSurfaceCrossVent(1, ZoneNum); + int afnSurfNum1 = state.dataRoomAir->AFNSurfaceCrossVent(1, ZoneNum); if (thisSurface.Zone == ZoneNum) { // this is a direct airflow network aperture @@ -372,8 +372,8 @@ namespace RoomAir { MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW; } - for (int Ctd2 = 2; Ctd2 <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd2) { - int afnSurfNum = state.dataRoomAirMod->AFNSurfaceCrossVent(Ctd2, ZoneNum); + for (int Ctd2 = 2; Ctd2 <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd2) { + int afnSurfNum = state.dataRoomAir->AFNSurfaceCrossVent(Ctd2, ZoneNum); if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(afnSurfNum).SurfNum).Zone == ZoneNum) { if (state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2 > MaxFlux) { MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2; @@ -393,39 +393,39 @@ namespace RoomAir { SurfNorm = thisSurface.Azimuth; CosPhi = std::cos((state.dataEnvrn->WindDir - SurfNorm) * Constant::DegToRadians); if (CosPhi <= 0) { - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; - auto flows(state.dataRoomAirMod->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) for (int i = 1, u = flows.u(); i <= u; ++i) { auto &e(flows(i)); e.Ujet = e.Urec = 0.0; } - state.dataRoomAirMod->Urec(ZoneNum) = 0.0; - state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; - state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; + state.dataRoomAir->Urec(ZoneNum) = 0.0; + state.dataRoomAir->Ujet(ZoneNum) = 0.0; + state.dataRoomAir->Qrec(ZoneNum) = 0.0; if (thisSurface.ExtBoundCond > 0) { - state.dataRoomAirMod->Tin(ZoneNum) = + state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT; } else if (thisSurface.ExtBoundCond == ExternalEnvironment) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (thisSurface.ExtBoundCond == Ground) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) { auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr); thisOSC.OSCTempCalc = (thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) + thisOSC.ConstTempCoef * thisOSC.ConstTemp + thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp + thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum)); - state.dataRoomAirMod->Tin(ZoneNum) = thisOSC.OSCTempCalc; + state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc; } else { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } return; } // Calculate the opening area for all apertures - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { - auto &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); - auto const &surfParams = state.dataRoomAirMod->SurfParametersCrossDispVent(Ctd); + for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum); + auto const &surfParams = state.dataRoomAir->SurfParametersCrossDispVent(Ctd); int cCompNum = state.afn->AirflowNetworkLinkageData(Ctd).CompNum; if (state.afn->AirflowNetworkCompData(cCompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) { jetRecFlows.Area = surfParams.Width * surfParams.Height * state.afn->MultizoneSurfaceData(Ctd).OpenFactor; @@ -469,42 +469,42 @@ namespace RoomAir { Vector3 wallCentroid; Real64 const Wroom_2(pow_2(Wroom)); - for (int Ctd = state.dataRoomAirMod->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Wall(ZoneNum).end; ++Ctd) { - if ((state.dataSurface->Surface(state.dataRoomAirMod->APos_Wall(Ctd)).Sides == 3) || - (state.dataSurface->Surface(state.dataRoomAirMod->APos_Wall(Ctd)).Sides == 4)) { - wallCentroid = state.dataSurface->Surface(state.dataRoomAirMod->APos_Wall(Ctd)).Centroid; + for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { + if ((state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides == 3) || + (state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides == 4)) { + wallCentroid = state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Centroid; } else { - NSides = state.dataSurface->Surface(state.dataRoomAirMod->APos_Wall(Ctd)).Sides; + NSides = state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides; assert(NSides > 0); wallCentroid = {0.0, 0.0, 0.0}; for (int i = 1; i <= NSides; ++i) { - wallCentroid += state.dataSurface->Surface(state.dataRoomAirMod->APos_Wall(Ctd)).Vertex(i); + wallCentroid += state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Vertex(i); } wallCentroid /= double(NSides); } double DroomTemp = std::sqrt(pow_2(baseCentroid.x - wallCentroid.x) + pow_2(baseCentroid.y - wallCentroid.y) + pow_2(baseCentroid.z - wallCentroid.z)); - if (DroomTemp > state.dataRoomAirMod->Droom(ZoneNum)) { - state.dataRoomAirMod->Droom(ZoneNum) = DroomTemp; + if (DroomTemp > state.dataRoomAir->Droom(ZoneNum)) { + state.dataRoomAir->Droom(ZoneNum) = DroomTemp; } - state.dataRoomAirMod->Dstar(ZoneNum) = - min(state.dataRoomAirMod->Droom(ZoneNum) / CosPhi, std::sqrt(Wroom_2 + pow_2(state.dataRoomAirMod->Droom(ZoneNum)))); + state.dataRoomAir->Dstar(ZoneNum) = + min(state.dataRoomAir->Droom(ZoneNum) / CosPhi, std::sqrt(Wroom_2 + pow_2(state.dataRoomAir->Droom(ZoneNum)))); } // Room area - Aroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataRoomAirMod->Droom(ZoneNum); + Aroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataRoomAir->Droom(ZoneNum); // Populate an array of inflow volume fluxes (Fin) for all apertures in the zone // Calculate inflow velocity (%Uin) for each aperture in the zone - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { - auto &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); + for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum); if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(Ctd).SurfNum).Zone == ZoneNum) { // this is a direct airflow network aperture - jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW2; + jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAir->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW2; } else { // this is an indirect airflow network aperture - jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAirMod->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW; + jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAir->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW; } if (jetRecFlows.Area != 0) { jetRecFlows.Uin = jetRecFlows.Fin / jetRecFlows.Area; @@ -517,39 +517,39 @@ namespace RoomAir { // Create a flow flag for each aperture // Calculate the total area of all active apertures ActiveSurfNum = 0.0; - state.dataRoomAirMod->Ain(ZoneNum) = 0.0; - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { - auto &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); + state.dataRoomAir->Ain(ZoneNum) = 0.0; + for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum); jetRecFlows.FlowFlag = (int)(jetRecFlows.Uin > MinUin); ActiveSurfNum += jetRecFlows.FlowFlag; - state.dataRoomAirMod->Ain(ZoneNum) += jetRecFlows.Area * jetRecFlows.FlowFlag; + state.dataRoomAir->Ain(ZoneNum) += jetRecFlows.Area * jetRecFlows.FlowFlag; } // Verify if any of the apertures have minimum flow if (ActiveSurfNum == 0) { - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; if (thisSurface.ExtBoundCond > 0) { - state.dataRoomAirMod->Tin(ZoneNum) = + state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT; } else if (thisSurface.ExtBoundCond == ExternalEnvironment) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (thisSurface.ExtBoundCond == Ground) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) { auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr); thisOSC.OSCTempCalc = (thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) + thisOSC.ConstTempCoef * thisOSC.ConstTemp + thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp + thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum)); - state.dataRoomAirMod->Tin(ZoneNum) = thisOSC.OSCTempCalc; + state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc; } else { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } - state.dataRoomAirMod->Urec(ZoneNum) = 0.0; - state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; - state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; - auto flows(state.dataRoomAirMod->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) + state.dataRoomAir->Urec(ZoneNum) = 0.0; + state.dataRoomAir->Ujet(ZoneNum) = 0.0; + state.dataRoomAir->Qrec(ZoneNum) = 0.0; + auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) for (int i = 1, u = flows.u(); i <= u; ++i) { auto &e(flows(i)); e.Ujet = e.Urec = 0.0; @@ -561,108 +561,108 @@ namespace RoomAir { // Calculate Qtot, the total volumetric flow rate through all active openings in the zone Uin = 0.0; - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { - auto const &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); - Uin += jetRecFlows.Area * jetRecFlows.Uin * jetRecFlows.FlowFlag / state.dataRoomAirMod->Ain(ZoneNum); + for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto const &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum); + Uin += jetRecFlows.Area * jetRecFlows.Uin * jetRecFlows.FlowFlag / state.dataRoomAir->Ain(ZoneNum); } // Verify if Uin is higher than minimum: if (Uin < MinUin) { - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; - state.dataRoomAirMod->Urec(ZoneNum) = 0.0; - state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; - state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; - state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0; - auto flows(state.dataRoomAirMod->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->Urec(ZoneNum) = 0.0; + state.dataRoomAir->Ujet(ZoneNum) = 0.0; + state.dataRoomAir->Qrec(ZoneNum) = 0.0; + state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0; + auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) for (int i = 1, u = flows.u(); i <= u; ++i) { auto &e(flows(i)); e.Ujet = e.Urec = 0.0; } if (thisSurface.ExtBoundCond > 0) { - state.dataRoomAirMod->Tin(ZoneNum) = + state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT; } else if (thisSurface.ExtBoundCond == ExternalEnvironment) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (thisSurface.ExtBoundCond == Ground) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) { auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr); thisOSC.OSCTempCalc = (thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) + thisOSC.ConstTempCoef * thisOSC.ConstTemp + thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp + thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum)); - state.dataRoomAirMod->Tin(ZoneNum) = thisOSC.OSCTempCalc; + state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc; } else { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } return; } // Evaluate parameter that determines whether recirculations are present - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotCrossVent; ++Ctd) { - if (ZoneNum == state.dataRoomAirMod->ZoneCrossVent(Ctd).ZonePtr) { - if (state.dataRoomAirMod->Ain(ZoneNum) / Aroom > 1.0 / 2.0) { - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) = 1.0; + for (int Ctd = 1; Ctd <= state.dataRoomAir->TotCrossVent; ++Ctd) { + if (ZoneNum == state.dataRoomAir->ZoneCrossVent(Ctd).ZonePtr) { + if (state.dataRoomAir->Ain(ZoneNum) / Aroom > 1.0 / 2.0) { + state.dataRoomAir->JetRecAreaRatio(ZoneNum) = 1.0; } else { - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) = std::sqrt(state.dataRoomAirMod->Ain(ZoneNum) / Aroom); + state.dataRoomAir->JetRecAreaRatio(ZoneNum) = std::sqrt(state.dataRoomAir->Ain(ZoneNum) / Aroom); } } } - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; // Calculate jet and recirculation velocities for all active apertures - state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; - state.dataRoomAirMod->Urec(ZoneNum) = 0.0; - state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; - state.dataRoomAirMod->Qtot(ZoneNum) = 0.0; - auto flows(state.dataRoomAirMod->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) + state.dataRoomAir->Ujet(ZoneNum) = 0.0; + state.dataRoomAir->Urec(ZoneNum) = 0.0; + state.dataRoomAir->Qrec(ZoneNum) = 0.0; + state.dataRoomAir->Qtot(ZoneNum) = 0.0; + auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK) for (int i = 1, u = flows.u(); i <= u; ++i) { auto &e(flows(i)); e.Ujet = e.Urec = e.Qrec = 0.0; } - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { - auto &jetRecFlows = state.dataRoomAirMod->CrossVentJetRecFlows(Ctd, ZoneNum); + for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { + auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum); if (jetRecFlows.Uin == 0) continue; - Real64 dstarexp = max(state.dataRoomAirMod->Dstar(ZoneNum) / (6.0 * std::sqrt(jetRecFlows.Area)), 1.0); - jetRecFlows.Vjet = jetRecFlows.Uin * std::sqrt(jetRecFlows.Area) * 6.3 * std::log(dstarexp) / state.dataRoomAirMod->Dstar(ZoneNum); + Real64 dstarexp = max(state.dataRoomAir->Dstar(ZoneNum) / (6.0 * std::sqrt(jetRecFlows.Area)), 1.0); + jetRecFlows.Vjet = jetRecFlows.Uin * std::sqrt(jetRecFlows.Area) * 6.3 * std::log(dstarexp) / state.dataRoomAir->Dstar(ZoneNum); jetRecFlows.Yjet = Cjet1 * std::sqrt(jetRecFlows.Area / Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + Cjet2; jetRecFlows.Yrec = Crec1 * std::sqrt(jetRecFlows.Area / Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + Crec2; jetRecFlows.YQrec = CrecFlow1 * std::sqrt(jetRecFlows.Area * Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + CrecFlow2; jetRecFlows.Ujet = jetRecFlows.FlowFlag * jetRecFlows.Yjet / jetRecFlows.Uin; jetRecFlows.Urec = jetRecFlows.FlowFlag * jetRecFlows.Yrec / jetRecFlows.Uin; jetRecFlows.Qrec = jetRecFlows.FlowFlag * jetRecFlows.YQrec / jetRecFlows.Uin; - state.dataRoomAirMod->Ujet(ZoneNum) += jetRecFlows.Area * jetRecFlows.Ujet / state.dataRoomAirMod->Ain(ZoneNum); - state.dataRoomAirMod->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAirMod->Ain(ZoneNum); - state.dataRoomAirMod->Qrec(ZoneNum) += jetRecFlows.Qrec; - state.dataRoomAirMod->Qtot(ZoneNum) += jetRecFlows.Fin * jetRecFlows.FlowFlag; - state.dataRoomAirMod->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAirMod->Ain(ZoneNum); + state.dataRoomAir->Ujet(ZoneNum) += jetRecFlows.Area * jetRecFlows.Ujet / state.dataRoomAir->Ain(ZoneNum); + state.dataRoomAir->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAir->Ain(ZoneNum); + state.dataRoomAir->Qrec(ZoneNum) += jetRecFlows.Qrec; + state.dataRoomAir->Qtot(ZoneNum) += jetRecFlows.Fin * jetRecFlows.FlowFlag; + state.dataRoomAir->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAir->Ain(ZoneNum); } // Ratio between recirculation flow rate and total inflow rate - if (state.dataRoomAirMod->Qtot(ZoneNum) != 0) { - state.dataRoomAirMod->RecInflowRatio(ZoneNum) = state.dataRoomAirMod->Qrec(ZoneNum) / state.dataRoomAirMod->Qtot(ZoneNum); + if (state.dataRoomAir->Qtot(ZoneNum) != 0) { + state.dataRoomAir->RecInflowRatio(ZoneNum) = state.dataRoomAir->Qrec(ZoneNum) / state.dataRoomAir->Qtot(ZoneNum); } else { - state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0; + state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0; } // Set Tin based on external conditions of the dominant aperture if (thisSurface.ExtBoundCond <= 0) { if (thisSurface.ExtBoundCond == ExternalEnvironment) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (thisSurface.ExtBoundCond == Ground) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) { auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr); thisOSC.OSCTempCalc = (thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) + thisOSC.ConstTempCoef * thisOSC.ConstTemp + thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp + thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum)); - state.dataRoomAirMod->Tin(ZoneNum) = thisOSC.OSCTempCalc; + state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc; } else { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); } } else { // adiabatic surface @@ -671,42 +671,42 @@ namespace RoomAir { int NodeNum2 = state.afn->AirflowNetworkLinkageData(MaxSurf).NodeNums[1]; if (thisSurface.Zone == ZoneNum) { if (state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum <= 0) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); - } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModel == + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + } else if (state.dataRoomAir->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModel == RoomAir::RoomAirModel::CrossVent) { - state.dataRoomAirMod->Tin(ZoneNum) = - state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum); + state.dataRoomAir->Tin(ZoneNum) = + state.dataRoomAir->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum); } else { - state.dataRoomAirMod->Tin(ZoneNum) = + state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).MAT; } } else { if (state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum <= 0) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); - } else if (state.dataRoomAirMod->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModel == + state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum); + } else if (state.dataRoomAir->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModel == RoomAir::RoomAirModel::CrossVent) { - state.dataRoomAirMod->Tin(ZoneNum) = - state.dataRoomAirMod->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum); + state.dataRoomAir->Tin(ZoneNum) = + state.dataRoomAir->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum); } else { - state.dataRoomAirMod->Tin(ZoneNum) = + state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).MAT; } } } else if ((thisSurface.Zone == ZoneNum) && - (state.dataRoomAirMod->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModel == + (state.dataRoomAir->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModel == RoomAir::RoomAirModel::CrossVent)) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone); + state.dataRoomAir->Tin(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone); } else if ((thisSurface.Zone != ZoneNum) && - (state.dataRoomAirMod->AirModel(thisSurface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent)) { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(surfNum); + (state.dataRoomAir->AirModel(thisSurface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent)) { + state.dataRoomAir->Tin(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(surfNum); } else { if (thisSurface.Zone == ZoneNum) { - state.dataRoomAirMod->Tin(ZoneNum) = + state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT; } else { - state.dataRoomAirMod->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(thisSurface.Zone).MAT; + state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(thisSurface.Zone).MAT; } } } @@ -736,9 +736,9 @@ namespace RoomAir { Real64 ZoneMult = zone.Multiplier * zone.ListMultiplier; // total zone multiplier auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotCrossVent; ++Ctd) { - if (ZoneNum == state.dataRoomAirMod->ZoneCrossVent(Ctd).ZonePtr) { - GainsFrac = ScheduleManager::GetCurrentScheduleValue(state, state.dataRoomAirMod->ZoneCrossVent(Ctd).SchedGainsPtr); + for (int Ctd = 1; Ctd <= state.dataRoomAir->TotCrossVent; ++Ctd) { + if (ZoneNum == state.dataRoomAir->ZoneCrossVent(Ctd).ZonePtr) { + GainsFrac = ScheduleManager::GetCurrentScheduleValue(state, state.dataRoomAir->ZoneCrossVent(Ctd).SchedGainsPtr); } } @@ -766,98 +766,98 @@ namespace RoomAir { } EvolveParaCrossVent(state, ZoneNum); - // Real64 L = state.dataRoomAirMod->Droom(ZoneNum); + // Real64 L = state.dataRoomAir->Droom(ZoneNum); - if (state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel) { + if (state.dataRoomAir->AirModel(ZoneNum).SimAirModel) { //=============================== CROSS VENTILATION Calculation ============================================== - state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 1.0; + state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 0.0; + state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 1.0; for (int Ctd = 1; Ctd <= 4; ++Ctd) { HcCrossVent(state, ZoneNum); - if (state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) != 1.0) { - state.dataRoomAirMod->ZTREC(ZoneNum) = - (ConvGainsRec * CrecTemp + CrecTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAirMod->Tin(ZoneNum) * MCp_Total) / + if (state.dataRoomAir->JetRecAreaRatio(ZoneNum) != 1.0) { + state.dataRoomAir->ZTREC(ZoneNum) = + (ConvGainsRec * CrecTemp + CrecTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total) / (CrecTemp * state.dataCrossVentMgr->HA_R + MCp_Total); } - state.dataRoomAirMod->ZTJET(ZoneNum) = (ConvGainsJet * CjetTemp + ConvGainsRec * CjetTemp + CjetTemp * state.dataCrossVentMgr->HAT_J + - CjetTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAirMod->Tin(ZoneNum) * MCp_Total - - CjetTemp * state.dataCrossVentMgr->HA_R * state.dataRoomAirMod->ZTREC(ZoneNum)) / + state.dataRoomAir->ZTJET(ZoneNum) = (ConvGainsJet * CjetTemp + ConvGainsRec * CjetTemp + CjetTemp * state.dataCrossVentMgr->HAT_J + + CjetTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total - + CjetTemp * state.dataCrossVentMgr->HA_R * state.dataRoomAir->ZTREC(ZoneNum)) / (CjetTemp * state.dataCrossVentMgr->HA_J + MCp_Total); - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = (ConvGainsJet + ConvGainsRec + state.dataCrossVentMgr->HAT_J + state.dataCrossVentMgr->HAT_R + - state.dataRoomAirMod->Tin(ZoneNum) * MCp_Total - state.dataCrossVentMgr->HA_J * state.dataRoomAirMod->ZTJET(ZoneNum) - - state.dataCrossVentMgr->HA_R * state.dataRoomAirMod->ZTREC(ZoneNum)) / + state.dataRoomAir->Tin(ZoneNum) * MCp_Total - state.dataCrossVentMgr->HA_J * state.dataRoomAir->ZTJET(ZoneNum) - + state.dataCrossVentMgr->HA_R * state.dataRoomAir->ZTREC(ZoneNum)) / MCp_Total; } - if (state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) == 1.0) { - state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 0.0; - state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->RoomOutflowTemp(ZoneNum); - state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->ZTJET(ZoneNum); - state.dataRoomAirMod->ZTREC(ZoneNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + if (state.dataRoomAir->JetRecAreaRatio(ZoneNum) == 1.0) { + state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0; + state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(ZoneNum); + state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->ZTJET(ZoneNum); + state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->ZTJET(ZoneNum); } // If temperature increase is above 1.5C then go to mixing - if (state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) - state.dataRoomAirMod->Tin(ZoneNum) > 1.5) { - state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 1.0; - state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 0.0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; - state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; - state.dataRoomAirMod->Urec(ZoneNum) = 0.0; - state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; - state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0; - for (auto &e : state.dataRoomAirMod->CrossVentJetRecFlows) { + if (state.dataRoomAir->RoomOutflowTemp(ZoneNum) - state.dataRoomAir->Tin(ZoneNum) > 1.5) { + state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 1.0; + state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->Ujet(ZoneNum) = 0.0; + state.dataRoomAir->Urec(ZoneNum) = 0.0; + state.dataRoomAir->Qrec(ZoneNum) = 0.0; + state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0; + for (auto &e : state.dataRoomAir->CrossVentJetRecFlows) { e.Ujet = 0.0; e.Urec = 0.0; } for (int Ctd = 1; Ctd <= 3; ++Ctd) { Real64 ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; HcCrossVent(state, ZoneNum); ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; } } } else { //=============================== M I X E D Calculation ====================================================== - state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 1.0; - state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 0.0; - state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; - state.dataRoomAirMod->Urec(ZoneNum) = 0.0; - state.dataRoomAirMod->Qrec(ZoneNum) = 0.0; - state.dataRoomAirMod->RecInflowRatio(ZoneNum) = 0.0; - for (auto &e : state.dataRoomAirMod->CrossVentJetRecFlows) { + state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 1.0; + state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0; + state.dataRoomAir->Ujet(ZoneNum) = 0.0; + state.dataRoomAir->Urec(ZoneNum) = 0.0; + state.dataRoomAir->Qrec(ZoneNum) = 0.0; + state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0; + for (auto &e : state.dataRoomAir->CrossVentJetRecFlows) { e.Ujet = 0.0; e.Urec = 0.0; } for (int Ctd = 1; Ctd <= 3; ++Ctd) { Real64 ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; HcCrossVent(state, ZoneNum); ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTJET(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged; } } } diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index d3ee05291c6..b6402a9df35 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -226,8 +226,7 @@ EnergyPlusData::EnergyPlusData() this->dataRetAirPathMrg = std::make_unique(); this->dataExhAirSystemMrg = std::make_unique(); this->dataExhCtrlSystemMrg = std::make_unique(); - this->dataRoomAirMod = std::make_unique(); - this->dataRoomAirModelMgr = std::make_unique(); + this->dataRoomAir = std::make_unique(); this->dataRoomAirModelTempPattern = std::make_unique(); this->dataRoomAirflowNetModel = std::make_unique(); this->dataRootFinder = std::make_unique(); @@ -483,8 +482,7 @@ void EnergyPlusData::clear_state() this->dataRetAirPathMrg->clear_state(); this->dataExhAirSystemMrg->clear_state(); this->dataExhCtrlSystemMrg->clear_state(); - this->dataRoomAirMod->clear_state(); - this->dataRoomAirModelMgr->clear_state(); + this->dataRoomAir->clear_state(); this->dataRoomAirModelTempPattern->clear_state(); this->dataRoomAirflowNetModel->clear_state(); this->dataRootFinder->clear_state(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index 94db43ea363..b13040e86fe 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -244,7 +244,6 @@ struct ExhaustAirSystemMgr; struct ExhaustControlSystemMgr; struct RoomAirModelAirflowNetworkData; struct RoomAirModelData; -struct RoomAirModelManagerData; struct RoomAirModelUserTempPatternData; struct RootFindingData; struct RuntimeLanguageData; @@ -501,8 +500,7 @@ struct EnergyPlusData : BaseGlobalStruct std::unique_ptr dataExhAirSystemMrg; std::unique_ptr dataExhCtrlSystemMrg; std::unique_ptr dataRoomAirflowNetModel; - std::unique_ptr dataRoomAirMod; - std::unique_ptr dataRoomAirModelMgr; + std::unique_ptr dataRoomAir; std::unique_ptr dataRoomAirModelTempPattern; std::unique_ptr dataRootFinder; std::unique_ptr dataRuntimeLang; diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index a53f7a6911c..7a2fb8e85fe 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -530,6 +530,10 @@ namespace RoomAir { struct RoomAirModelData : BaseGlobalStruct { + bool GetAirModelData = true; // Used to "get" all air model data + bool MyOneTimeFlag = true; + Array1D_bool MyEnvrnFlag; + bool anyNonMixingRoomAirModel = false; // True if any zone RoomAirModelType is not Mixing int TotNumOfAirNodes = 0; int TotNumOfRoomAFNNodes = 0; diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index ead62715dd1..50476f4c848 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -198,12 +198,12 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac auto &SurfTempIn(state.dataHeatBalSurf->SurfTempIn); // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? - if (state.dataRoomAirMod->IsZoneDispVent3Node(ZoneNum)) { + if (state.dataRoomAir->IsZoneDispVent3Node(ZoneNum)) { LayFrac = FractionHeight; - LayH = FractionHeight * (state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum)); + LayH = FractionHeight * (state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum)); // WALL Hc, HA and HAT calculation - for (int Ctd = state.dataRoomAirMod->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Wall(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Wall(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Wall(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); @@ -211,38 +211,38 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; Z1 = minval(surf.Vertex, &Vector::z); Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZSupSurf = Z2 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HWall(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HWall(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAirMod->HWall(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); } // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HWall(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HWall(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAirMod->HWall(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); } // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - HLU = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - HLD = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLU = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAirMod->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; @@ -250,13 +250,13 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataRoomAirMod->HWall(Ctd); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HWall(Ctd); } // END WALL // WINDOW Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Window(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Window(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); @@ -265,35 +265,35 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall Z1 = minval(surf.Vertex, &Vector::z); Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZSupSurf = Z2 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - HLU = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - HLD = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLU = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAirMod->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; @@ -303,28 +303,28 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac } if (surf.Tilt <= 10.0) { // Window Ceiling - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (surf.Tilt >= 170.0) { // Window Floor - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); } - state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataRoomAirMod->HWindow(Ctd); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); } // END WINDOW // DOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR - int SurfNum = state.dataRoomAirMod->APos_Door(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR + int SurfNum = state.dataRoomAir->APos_Door(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); @@ -333,35 +333,35 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Door Wall Z1 = minval(surf.Vertex, &Vector::z); Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); - ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + ZSupSurf = Z2 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HDoor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HDoor(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAirMod->HDoor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); } if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HDoor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HDoor(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAirMod->HDoor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - HLU = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - HLD = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLU = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAirMod->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; @@ -371,31 +371,31 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac } if (surf.Tilt <= 10.0) { // Door Ceiling - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HDoor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HDoor(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAirMod->HDoor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); } if (surf.Tilt >= 170.0) { // Door Floor - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HDoor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HDoor(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAirMod->HDoor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); } - state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataRoomAirMod->HDoor(Ctd); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HDoor(Ctd); } // END DOOR // INTERNAL Hc, HA and HAT CALCULATION state.dataDispVentMgr->HeightIntMass = min(state.dataDispVentMgr->HeightIntMassDefault, - (state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum))); - for (int Ctd = state.dataRoomAirMod->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Internal(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Internal(Ctd); + (state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum))); + for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Internal(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); @@ -405,24 +405,24 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac ZInfSurf = 0.0; if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HInternal(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += - surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HInternal(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAirMod->HInternal(Ctd); + surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - HLU = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - HLD = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLU = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAirMod->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; @@ -430,40 +430,40 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataRoomAirMod->HInternal(Ctd); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HInternal(Ctd); } // END INTERNAL // CEILING Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Ceiling(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Ceiling(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HCeiling(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HCeiling(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAirMod->HCeiling(Ctd); - state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataRoomAirMod->HCeiling(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); } // END CEILING // FLOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Floor(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Floor(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Floor(Ctd); if (SurfNum == 0) continue; auto const &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAirMod->DispVent3NodeHcIn); - state.dataRoomAirMod->HFloor(Ctd) = state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_FLOOR += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAirMod->HFloor(Ctd); - state.dataDispVentMgr->HA_FLOOR += surf.Area * state.dataRoomAirMod->HFloor(Ctd); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - state.dataRoomAirMod->DispVent3NodeHcIn(SurfNum) = state.dataRoomAirMod->HFloor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_FLOOR += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); + state.dataDispVentMgr->HA_FLOOR += surf.Area * state.dataRoomAir->HFloor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); } // END FLOOR } } @@ -563,24 +563,24 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu auto &TempIndCoef = state.dataDispVentMgr->TempIndCoef; Real64 RetAirGain; - assert(state.dataRoomAirMod->AirModel.allocated()); + assert(state.dataRoomAir->AirModel.allocated()); // Exact solution or Euler method if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { - state.dataRoomAirMod->Zone1Floor(ZoneNum) = state.dataRoomAirMod->ZoneM2Floor(ZoneNum); - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZoneM2OC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZoneM2MX(ZoneNum); + state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZoneM2Floor(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); } else { - state.dataRoomAirMod->Zone1Floor(ZoneNum) = state.dataRoomAirMod->ZoneMXFloor(ZoneNum); - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZoneMXOC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZoneMXMX(ZoneNum); + state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZoneMXFloor(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); } } else { - state.dataRoomAirMod->Zone1Floor(ZoneNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } } @@ -588,13 +588,13 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu MIXFLAG = false; FlagApertures = 1; - state.dataRoomAirMod->DispVent3NodeHcIn = state.dataHeatBalSurf->SurfHConvInt; - CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); + state.dataRoomAir->DispVent3NodeHcIn = state.dataHeatBalSurf->SurfHConvInt; + CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); ZoneMult = zone.Multiplier * zone.ListMultiplier; auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - for (int Ctd = 1; Ctd <= state.dataRoomAirMod->TotDispVent3Node; ++Ctd) { - auto &zoneDV3N = state.dataRoomAirMod->ZoneDispVent3Node(Ctd); + for (int Ctd = 1; Ctd <= state.dataRoomAir->TotDispVent3Node; ++Ctd) { + auto &zoneDV3N = state.dataRoomAir->ZoneDispVent3Node(Ctd); if (ZoneNum == zoneDV3N.ZonePtr) { GainsFrac = GetCurrentScheduleValue(state, zoneDV3N.SchedGainsPtr); NumPLPP = zoneDV3N.NumPlumesPerOcc; @@ -676,10 +676,10 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu // have to be located above 1.8m. if (state.afn->NumOfLinksMultiZone > 0) { - for (int Loop = 1; Loop <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Loop) { // direct AirflowNetwork surface - int afnSurfNum = state.dataRoomAirMod->AFNSurfaceCrossVent(Loop, ZoneNum); - auto const &surfParams = state.dataRoomAirMod->SurfParametersCrossDispVent(afnSurfNum); + int afnSurfNum = state.dataRoomAir->AFNSurfaceCrossVent(Loop, ZoneNum); + auto const &surfParams = state.dataRoomAir->SurfParametersCrossDispVent(afnSurfNum); auto const &afnLinkSimu = state.afn->AirflowNetworkLinkSimu(afnSurfNum); auto const &afnMzSurfData = state.afn->MultizoneSurfaceData(afnSurfNum); auto const &afnMzSurf = state.dataSurface->Surface(afnMzSurfData.SurfNum); @@ -729,138 +729,138 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu // HeightFrac = min( 24.55 * std::pow( MCp_Total * 0.000833 / ( NumberOfPlumes * std::pow( PowerPerPlume, OneThird ) ), 0.6 ) / // CeilingHeight, 1.0 ); //Tuned This does not vary in loop EPTeam-replaces above (cause diffs) HeightFrac = // MIN(24.55d0*(MCp_Total*0.000833d0/(NumberOfPlumes*PowerPerPlume**(1.0d0/3.d0)))**0.6 / CeilingHeight , 1.0d0) - state.dataRoomAirMod->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - state.dataRoomAirMod->AIRRATFloor(ZoneNum) = - zone.Volume * min(state.dataRoomAirMod->HeightTransition(ZoneNum), state.dataDispVentMgr->HeightFloorSubzoneTop) / CeilingHeight * + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + state.dataRoomAir->AIRRATFloor(ZoneNum) = + zone.Volume * min(state.dataRoomAir->HeightTransition(ZoneNum), state.dataDispVentMgr->HeightFloorSubzoneTop) / CeilingHeight * zone.ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAirMod->MATFloor(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATFloor(ZoneNum), thisZoneHB.ZoneAirHumRat) * PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - state.dataRoomAirMod->AIRRATOC(ZoneNum) = - zone.Volume * (state.dataRoomAirMod->HeightTransition(ZoneNum) - min(state.dataRoomAirMod->HeightTransition(ZoneNum), 0.2)) / + state.dataRoomAir->AIRRATOC(ZoneNum) = + zone.Volume * (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * zone.ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAirMod->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - state.dataRoomAirMod->AIRRATMX(ZoneNum) = - zone.Volume * (CeilingHeight - state.dataRoomAirMod->HeightTransition(ZoneNum)) / CeilingHeight * zone.ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAirMod->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * + state.dataRoomAir->AIRRATMX(ZoneNum) = + zone.Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * zone.ZoneVolCapMultpSens * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAirMod->ZTMFloor(ZoneNum)[2] = state.dataRoomAirMod->XMATFloor(ZoneNum)[2]; - state.dataRoomAirMod->ZTMFloor(ZoneNum)[1] = state.dataRoomAirMod->XMATFloor(ZoneNum)[1]; - state.dataRoomAirMod->ZTMFloor(ZoneNum)[0] = state.dataRoomAirMod->XMATFloor(ZoneNum)[0]; + state.dataRoomAir->ZTMFloor(ZoneNum)[2] = state.dataRoomAir->XMATFloor(ZoneNum)[2]; + state.dataRoomAir->ZTMFloor(ZoneNum)[1] = state.dataRoomAir->XMATFloor(ZoneNum)[1]; + state.dataRoomAir->ZTMFloor(ZoneNum)[0] = state.dataRoomAir->XMATFloor(ZoneNum)[0]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->XMATOC(ZoneNum)[2]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->XMATOC(ZoneNum)[1]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->XMATOC(ZoneNum)[0]; + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->XMATMX(ZoneNum)[2]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->XMATMX(ZoneNum)[1]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->XMATMX(ZoneNum)[0]; + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; } else { - state.dataRoomAirMod->ZTMFloor(ZoneNum)[2] = state.dataRoomAirMod->DSXMATFloor(ZoneNum)[2]; - state.dataRoomAirMod->ZTMFloor(ZoneNum)[1] = state.dataRoomAirMod->DSXMATFloor(ZoneNum)[1]; - state.dataRoomAirMod->ZTMFloor(ZoneNum)[0] = state.dataRoomAirMod->DSXMATFloor(ZoneNum)[0]; + state.dataRoomAir->ZTMFloor(ZoneNum)[2] = state.dataRoomAir->DSXMATFloor(ZoneNum)[2]; + state.dataRoomAir->ZTMFloor(ZoneNum)[1] = state.dataRoomAir->DSXMATFloor(ZoneNum)[1]; + state.dataRoomAir->ZTMFloor(ZoneNum)[0] = state.dataRoomAir->DSXMATFloor(ZoneNum)[0]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[2]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[1]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[0]; + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[2]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[1]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[0]; + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; } - Real64 AirCap = state.dataRoomAirMod->AIRRATFloor(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMFloor(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMFloor(ZoneNum)[1] + - OneThird * state.dataRoomAirMod->ZTMFloor(ZoneNum)[2]); + Real64 AirCap = state.dataRoomAir->AIRRATFloor(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMFloor(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMFloor(ZoneNum)[1] + + OneThird * state.dataRoomAir->ZTMFloor(ZoneNum)[2]); TempDepCoef = state.dataDispVentMgr->HA_FLOOR + MCp_Total; TempIndCoef = state.dataDispVentMgr->HAT_FLOOR + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAirMod->ZTFloor(ZoneNum) = calculateThirdOrderFloorTemperature(TempHistTerm, + state.dataRoomAir->ZTFloor(ZoneNum) = calculateThirdOrderFloorTemperature(TempHistTerm, state.dataDispVentMgr->HAT_FLOOR, state.dataDispVentMgr->HA_FLOOR, MCpT_Total, MCp_Total, - state.dataRoomAirMod->ZTOC(ZoneNum), + state.dataRoomAir->ZTOC(ZoneNum), thisZoneHB.NonAirSystemResponse, ZoneMult, AirCap); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAirMod->ZTFloor(ZoneNum) = state.dataRoomAirMod->Zone1Floor(ZoneNum) + TempIndCoef / AirCap; + state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->Zone1Floor(ZoneNum) + TempIndCoef / AirCap; } else { - state.dataRoomAirMod->ZTFloor(ZoneNum) = - (state.dataRoomAirMod->Zone1Floor(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + state.dataRoomAir->ZTFloor(ZoneNum) = + (state.dataRoomAir->Zone1Floor(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } } break; case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAirMod->ZTFloor(ZoneNum) = (AirCap * state.dataRoomAirMod->Zone1Floor(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + state.dataRoomAir->ZTFloor(ZoneNum) = (AirCap * state.dataRoomAir->Zone1Floor(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); } break; default: break; } - AirCap = state.dataRoomAirMod->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[1] + - OneThird * state.dataRoomAirMod->ZTMOC(ZoneNum)[2]); + AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + + OneThird * state.dataRoomAir->ZTMOC(ZoneNum)[2]); TempDepCoef = state.dataDispVentMgr->HA_OC + MCp_Total; - TempIndCoef = ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + state.dataRoomAirMod->ZTFloor(ZoneNum) * MCp_Total; + TempIndCoef = ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + state.dataRoomAir->ZTFloor(ZoneNum) * MCp_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAirMod->ZTOC(ZoneNum) = (TempHistTerm + ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + - 1.6 * state.dataRoomAirMod->ZTFloor(ZoneNum) * MCp_Total) / + state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + + 1.6 * state.dataRoomAir->ZTFloor(ZoneNum) * MCp_Total) / ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_OC + 1.6 * MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAirMod->ZTOC(ZoneNum) = state.dataRoomAirMod->Zone1OC(ZoneNum) + TempIndCoef / AirCap; + state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; } else { if (AirCap == 0.0) { - state.dataRoomAirMod->ZTOC(ZoneNum) = TempIndCoef / TempDepCoef; + state.dataRoomAir->ZTOC(ZoneNum) = TempIndCoef / TempDepCoef; } else { - state.dataRoomAirMod->ZTOC(ZoneNum) = - (state.dataRoomAirMod->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + state.dataRoomAir->ZTOC(ZoneNum) = + (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } } } break; case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAirMod->ZTOC(ZoneNum) = (AirCap * state.dataRoomAirMod->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); } break; default: break; } - AirCap = state.dataRoomAirMod->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[1] + - OneThird * state.dataRoomAirMod->ZTMMX(ZoneNum)[2]); + AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + + OneThird * state.dataRoomAir->ZTMMX(ZoneNum)[2]); TempDepCoef = state.dataDispVentMgr->HA_MX + MCp_Total; TempIndCoef = ConvGainsOccupiedSubzone * (1.0 - GainsFrac) + ConvGainsMixedSubzone + state.dataDispVentMgr->HAT_MX + - state.dataRoomAirMod->ZTOC(ZoneNum) * MCp_Total; + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAirMod->ZTMX(ZoneNum) = (TempHistTerm + ConvGainsOccupiedSubzone * (1.0 - GainsFrac) + ConvGainsMixedSubzone + - state.dataDispVentMgr->HAT_MX + state.dataRoomAirMod->ZTOC(ZoneNum) * MCp_Total) / + state.dataRoomAir->ZTMX(ZoneNum) = (TempHistTerm + ConvGainsOccupiedSubzone * (1.0 - GainsFrac) + ConvGainsMixedSubzone + + state.dataDispVentMgr->HAT_MX + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_MX + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAirMod->ZTMX(ZoneNum) = state.dataRoomAirMod->Zone1MX(ZoneNum) + TempIndCoef / AirCap; + state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; } else { if (AirCap == 0.0) { - state.dataRoomAirMod->ZTMX(ZoneNum) = TempIndCoef / TempDepCoef; + state.dataRoomAir->ZTMX(ZoneNum) = TempIndCoef / TempDepCoef; } else { - state.dataRoomAirMod->ZTMX(ZoneNum) = - (state.dataRoomAirMod->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + state.dataRoomAir->ZTMX(ZoneNum) = + (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } } } break; case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAirMod->ZTMX(ZoneNum) = (AirCap * state.dataRoomAirMod->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); } break; default: break; @@ -871,21 +871,21 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu MinFlow = MinFlow_pow_fac * plume_fac; // EPTeam above replaces (cause diffs?) MinFlow = (1.0d0/24.55d0*1.0d0)**(1.0d0/0.6d0)*NumberOfPlumes*PowerPerPlume**(1.0/3.0) if (MinFlow != 0.0) { - state.dataRoomAirMod->FracMinFlow(ZoneNum) = MCp_Total * 0.000833 / MinFlow; + state.dataRoomAir->FracMinFlow(ZoneNum) = MCp_Total * 0.000833 / MinFlow; } else { - state.dataRoomAirMod->FracMinFlow(ZoneNum) = 9.999; + state.dataRoomAir->FracMinFlow(ZoneNum) = 9.999; } - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; } //=============================== M I X E D Calculation ============================================== - if (state.dataRoomAirMod->ZTMX(ZoneNum) < state.dataRoomAirMod->ZTOC(ZoneNum) || MCp_Total <= 0.0 || + if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || HeightFrac * CeilingHeight < (state.dataDispVentMgr->HeightFloorSubzoneTop + state.dataDispVentMgr->ThickOccupiedSubzoneMin)) { MIXFLAG = true; HeightFrac = 0.0; - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; - state.dataRoomAirMod->MaxTempGrad(ZoneNum) = 0.0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; Real64 const thisZoneT1 = thisZoneHB.ZoneT1; Real64 AirCap = thisZoneHB.AirPowerCap; TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + OneThird * thisZoneHB.ZTM[2]); @@ -913,9 +913,9 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu default: break; } - state.dataRoomAirMod->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTFloor(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; HcDispVent3Node(state, ZoneNum, HeightFrac); TempDepCoef = state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + state.dataDispVentMgr->HA_FLOOR + MCp_Total; TempIndCoef = ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + state.dataDispVentMgr->HAT_FLOOR + MCpT_Total; @@ -939,41 +939,41 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu default: break; } - state.dataRoomAirMod->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTFloor(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; } } //========================================================================================= // Comfort temperature and temperature at the thermostat/temperature control sensor - state.dataRoomAirMod->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - HeightMixedSubzoneAve = (CeilingHeight + state.dataRoomAirMod->HeightTransition(ZoneNum)) / 2.0; - HeightOccupiedSubzoneAve = (state.dataDispVentMgr->HeightFloorSubzoneTop + state.dataRoomAirMod->HeightTransition(ZoneNum)) / 2.0; + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + HeightMixedSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + HeightOccupiedSubzoneAve = (state.dataDispVentMgr->HeightFloorSubzoneTop + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; HeightFloorSubzoneAve = state.dataDispVentMgr->HeightFloorSubzoneTop / 2.0; // Comfort temperature if (MIXFLAG) { - state.dataRoomAirMod->TCMF(ZoneNum) = ZTAveraged; + state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; } else { if (HeightComfort >= 0.0 && HeightComfort < HeightFloorSubzoneAve) { ShowWarningError(state, format("Displacement ventilation comfort height is in floor subzone in Zone: {}", zone.Name)); - state.dataRoomAirMod->TCMF(ZoneNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); } else if (HeightComfort >= HeightFloorSubzoneAve && HeightComfort < HeightOccupiedSubzoneAve) { - state.dataRoomAirMod->TCMF(ZoneNum) = (state.dataRoomAirMod->ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightComfort) + - state.dataRoomAirMod->ZTOC(ZoneNum) * (HeightComfort - HeightFloorSubzoneAve)) / + state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightComfort) + + state.dataRoomAir->ZTOC(ZoneNum) * (HeightComfort - HeightFloorSubzoneAve)) / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); //! TCMF(ZoneNum) = (ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightComfort) & //! + ZTMX(ZoneNum) * (HeightComfort - HeightFloorSubzoneAve)) & //! / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightMixedSubzoneAve) { - state.dataRoomAirMod->TCMF(ZoneNum) = (state.dataRoomAirMod->ZTOC(ZoneNum) * (HeightMixedSubzoneAve - HeightComfort) + - state.dataRoomAirMod->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / + state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightMixedSubzoneAve - HeightComfort) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); } else if (HeightComfort >= HeightMixedSubzoneAve && HeightComfort <= CeilingHeight) { - state.dataRoomAirMod->TCMF(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } else { ShowFatalError(state, format("Displacement ventilation comfort height is above ceiling or below floor in Zone: {}", zone.Name)); } @@ -986,20 +986,20 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu } else { if (HeightThermostat >= 0.0 && HeightThermostat < HeightFloorSubzoneAve) { ShowWarningError(state, format("Displacement thermostat is in floor subzone in Zone: {}", zone.Name)); - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); } else if (HeightThermostat >= HeightFloorSubzoneAve && HeightThermostat < HeightOccupiedSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAirMod->ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightThermostat) + - state.dataRoomAirMod->ZTOC(ZoneNum) * (HeightThermostat - HeightFloorSubzoneAve)) / + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightThermostat) + + state.dataRoomAir->ZTOC(ZoneNum) * (HeightThermostat - HeightFloorSubzoneAve)) / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); //! TempTstatAir(ZoneNum) = (ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightThermostat) & //! + ZTMX(ZoneNum) * (HeightThermostat - HeightFloorSubzoneAve)) & //! / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightMixedSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAirMod->ZTOC(ZoneNum) * (HeightMixedSubzoneAve - HeightThermostat) + - state.dataRoomAirMod->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightMixedSubzoneAve - HeightThermostat) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); } else if (HeightThermostat >= HeightMixedSubzoneAve && HeightThermostat <= CeilingHeight) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } else { ShowFatalError(state, format("Displacement ventilation thermostat height is above ceiling or below floor in Zone: {}", zone.Name)); } @@ -1008,49 +1008,49 @@ void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenu // Temperature gradients if ((HeightMixedSubzoneAve - HeightFloorSubzoneAve) > 0.1) { - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = - (state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTFloor(ZoneNum)) / (HeightMixedSubzoneAve - HeightFloorSubzoneAve); + state.dataRoomAir->AvgTempGrad(ZoneNum) = + (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTFloor(ZoneNum)) / (HeightMixedSubzoneAve - HeightFloorSubzoneAve); } else { - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = -9.999; + state.dataRoomAir->AvgTempGrad(ZoneNum) = -9.999; } if ((HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) > 0.1) { - state.dataRoomAirMod->MaxTempGrad(ZoneNum) = - (state.dataRoomAirMod->ZTOC(ZoneNum) - state.dataRoomAirMod->ZTFloor(ZoneNum)) / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); + state.dataRoomAir->MaxTempGrad(ZoneNum) = + (state.dataRoomAir->ZTOC(ZoneNum) - state.dataRoomAir->ZTFloor(ZoneNum)) / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); } else { - state.dataRoomAirMod->MaxTempGrad(ZoneNum) = -9.999; + state.dataRoomAir->MaxTempGrad(ZoneNum) = -9.999; } if ((HeightMixedSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { - MTGAUX = (state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) / (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); + MTGAUX = (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); } else { MTGAUX = -9.999; } - if (MTGAUX > state.dataRoomAirMod->MaxTempGrad(ZoneNum)) { - state.dataRoomAirMod->MaxTempGrad(ZoneNum) = MTGAUX; + if (MTGAUX > state.dataRoomAir->MaxTempGrad(ZoneNum)) { + state.dataRoomAir->MaxTempGrad(ZoneNum) = MTGAUX; } if (MIXFLAG) { - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag(ZoneNum) = 1; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->ZoneDispVent3NodeMixedFlag(ZoneNum) = 1; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; } else { - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; } if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) { int ZoneNodeNum = zone.SystemZoneNodeNumber; - state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); } // Mixed for reporting purposes - if ((MIXFLAG) || ((state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 1.0; - state.dataRoomAirMod->FracMinFlow(ZoneNum) = -1.0; - state.dataRoomAirMod->HeightTransition(ZoneNum) = -9.999; - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = -9.999; - state.dataRoomAirMod->MaxTempGrad(ZoneNum) = -9.999; + if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { + state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAir->FracMinFlow(ZoneNum) = -1.0; + state.dataRoomAir->HeightTransition(ZoneNum) = -9.999; + state.dataRoomAir->AvgTempGrad(ZoneNum) = -9.999; + state.dataRoomAir->MaxTempGrad(ZoneNum) = -9.999; } else { - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 0.0; } } diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 4a3fbaf406f..cd0d678d98d 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -4563,7 +4563,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if bool IsNotOK; // Initialize default values for air model parameters - state.dataRoomAirMod->AirModel.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->AirModel.allocate(state.dataGlobal->NumOfZones); bool ErrorsFound = false; auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject; @@ -4575,9 +4575,9 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if ErrorsFound = true; } if (NumOfAirModels > 0) { - state.dataRoomAirMod->IsZoneDispVent3Node.dimension(state.dataGlobal->NumOfZones, false); - state.dataRoomAirMod->IsZoneCrossVent.dimension(state.dataGlobal->NumOfZones, false); - state.dataRoomAirMod->IsZoneUI.dimension(state.dataGlobal->NumOfZones, false); + state.dataRoomAir->IsZoneDispVent3Node.dimension(state.dataGlobal->NumOfZones, false); + state.dataRoomAir->IsZoneCrossVent.dimension(state.dataGlobal->NumOfZones, false); + state.dataRoomAir->IsZoneUI.dimension(state.dataGlobal->NumOfZones, false); } for (AirModelNum = 1; AirModelNum <= NumOfAirModels; ++AirModelNum) { @@ -4595,7 +4595,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if state.dataIPShortCut->cNumericFieldNames); ZoneNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); if (ZoneNum != 0) { - if (!state.dataRoomAirMod->AirModel(ZoneNum).Name.empty()) { + if (!state.dataRoomAir->AirModel(ZoneNum).Name.empty()) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, "Duplicate zone name, only one type of roomair model is allowed per zone"); @@ -4603,26 +4603,26 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if format("Zone {} was already assigned a roomair model by {} = {}", state.dataIPShortCut->cAlphaArgs(2), cCurrentModuleObject, - roomAirModelNamesUC[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel])); + roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); ShowContinueError(state, format("Air Model Type for zone already set to {}", - roomAirModelNamesUC[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel])); + roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); ShowContinueError(state, format("Trying to overwrite with model type = {}", state.dataIPShortCut->cAlphaArgs(3))); ErrorsFound = true; } - state.dataRoomAirMod->AirModel(ZoneNum).ZoneName = state.dataIPShortCut->cAlphaArgs(2); + state.dataRoomAir->AirModel(ZoneNum).ZoneName = state.dataIPShortCut->cAlphaArgs(2); - // state.dataRoomAirMod->AirModel(ZoneNum).AirModelName = state.dataIPShortCut->cAlphaArgs(1); - state.dataRoomAirMod->AirModel(ZoneNum).AirModel = + // state.dataRoomAir->AirModel(ZoneNum).AirModelName = state.dataIPShortCut->cAlphaArgs(1); + state.dataRoomAir->AirModel(ZoneNum).AirModel = static_cast(getEnumValue(roomAirModelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); // is this arg1 or arg3? - switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModel) { + switch (state.dataRoomAir->AirModel(ZoneNum).AirModel) { case RoomAir::RoomAirModel::Mixing: // nothing to do here actually break; case RoomAir::RoomAirModel::DispVent1Node: - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->DispVent1NodeModelUsed = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->DispVent1NodeModelUsed = true; IsNotOK = false; ValidateComponent(state, "RoomAirSettings:OneNodeDisplacementVentilation", @@ -4637,8 +4637,8 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if break; case RoomAir::RoomAirModel::DispVent3Node: - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->UCSDModelUsed = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->UCSDModelUsed = true; IsNotOK = false; ValidateComponent(state, "RoomAirSettings:ThreeNodeDisplacementVentilation", @@ -4653,8 +4653,8 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if break; case RoomAir::RoomAirModel::CrossVent: - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->UCSDModelUsed = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->UCSDModelUsed = true; IsNotOK = false; ValidateComponent(state, "RoomAirSettings:CrossVentilation", @@ -4669,8 +4669,8 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if break; case RoomAir::RoomAirModel::UFADInt: - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->UCSDModelUsed = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->UCSDModelUsed = true; ValidateComponent(state, "RoomAirSettings:UnderFloorAirDistributionInterior", "zone_name", @@ -4684,8 +4684,8 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if break; case RoomAir::RoomAirModel::UFADExt: - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->UCSDModelUsed = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->UCSDModelUsed = true; ValidateComponent(state, "RoomAirSettings:UnderFloorAirDistributionExterior", "zone_name", @@ -4699,12 +4699,12 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if break; case RoomAir::RoomAirModel::UserDefined: - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->UserDefinedUsed = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->UserDefinedUsed = true; break; case RoomAir::RoomAirModel::AirflowNetwork: - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; if (state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "AirflowNetwork:SimulationControl") == 0) { ShowSevereError(state, format("In {} = {}: {} = AIRFLOWNETWORK.", @@ -4723,16 +4723,16 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if ShowWarningError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("The mixing air model will be used for Zone ={}", state.dataIPShortCut->cAlphaArgs(2))); - state.dataRoomAirMod->AirModel(ZoneNum).AirModel = RoomAir::RoomAirModel::Mixing; + state.dataRoomAir->AirModel(ZoneNum).AirModel = RoomAir::RoomAirModel::Mixing; } - state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme = + state.dataRoomAir->AirModel(ZoneNum).TempCoupleScheme = static_cast(getEnumValue(couplingSchemeNamesUC, state.dataIPShortCut->cAlphaArgs(4))); - if (state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme == RoomAir::CouplingScheme::Invalid) { + if (state.dataRoomAir->AirModel(ZoneNum).TempCoupleScheme == RoomAir::CouplingScheme::Invalid) { ShowWarningError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4))); ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("The direct coupling scheme will be used for Zone ={}", state.dataIPShortCut->cAlphaArgs(2))); - state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme = RoomAir::CouplingScheme::Direct; + state.dataRoomAir->AirModel(ZoneNum).TempCoupleScheme = RoomAir::CouplingScheme::Direct; } } else { // Zone Not Found @@ -4744,15 +4744,15 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { // this used to be an if (NumOfAirModels == 0) block, but both the IF and the ELSE had the same content, these two lines: - state.dataRoomAirMod->AirModel(ZoneNum).Name = "MIXING AIR MODEL FOR " + state.dataHeatBal->Zone(ZoneNum).Name; - state.dataRoomAirMod->AirModel(ZoneNum).ZoneName = state.dataHeatBal->Zone(ZoneNum).Name; + state.dataRoomAir->AirModel(ZoneNum).Name = "MIXING AIR MODEL FOR " + state.dataHeatBal->Zone(ZoneNum).Name; + state.dataRoomAir->AirModel(ZoneNum).ZoneName = state.dataHeatBal->Zone(ZoneNum).Name; // set global flag for non-mixing model - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAir::RoomAirModel::Mixing) { - state.dataRoomAirMod->anyNonMixingRoomAirModel = true; + if (state.dataRoomAir->AirModel(ZoneNum).AirModel != RoomAir::RoomAirModel::Mixing) { + state.dataRoomAir->anyNonMixingRoomAirModel = true; } } - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->anyNonMixingRoomAirModel) { if (state.dataHeatBal->doSpaceHeatBalanceSimulation || state.dataHeatBal->doSpaceHeatBalanceSizing) { ShowSevereError(state, "Non-Mixing RoomAirModelType is not supported with ZoneAirHeatBalanceAlgorithm Space Heat Balance."); ErrorsFound = true; @@ -4772,7 +4772,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if print(state.files.eio, "RoomAir Model,{},{}\n", state.dataHeatBal->Zone(ZoneNum).Name, - roomAirModelStrings[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel]); + roomAirModelStrings[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel]); } if (ErrorsFound) { diff --git a/src/EnergyPlus/HybridModel.cc b/src/EnergyPlus/HybridModel.cc index d0f9bb3efae..14c9ff4a727 100644 --- a/src/EnergyPlus/HybridModel.cc +++ b/src/EnergyPlus/HybridModel.cc @@ -494,8 +494,8 @@ namespace HybridModel { for (ZonePtr = 1; ZonePtr <= state.dataGlobal->NumOfZones; ZonePtr++) { if ((state.dataHybridModel->HybridModelZone(ZonePtr).InternalThermalMassCalc_T || state.dataHybridModel->HybridModelZone(ZonePtr).InfiltrationCalc_T) && - (state.dataRoomAirMod->AirModel(ZonePtr).AirModel != RoomAir::RoomAirModel::Mixing)) { - state.dataRoomAirMod->AirModel(ZonePtr).AirModel = RoomAir::RoomAirModel::Mixing; + (state.dataRoomAir->AirModel(ZonePtr).AirModel != RoomAir::RoomAirModel::Mixing)) { + state.dataRoomAir->AirModel(ZonePtr).AirModel = RoomAir::RoomAirModel::Mixing; ShowWarningError(state, "Room Air Model Type should be Mixing if Hybrid Modeling is performed for the zone."); } } diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 2ba0627edec..91f953ed6c6 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -7341,9 +7341,9 @@ namespace InternalHeatGains { // if the user did not specify a sensible fraction, calculate the sensible heat gain if (state.dataHeatBal->People(Loop).UserSpecSensFrac == Constant::AutoCalculate) { Real64 airTemp = thisZoneHB.MAT; - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDispVent3Node(NZ) || state.dataRoomAirMod->IsZoneUI(NZ)) { - airTemp = state.dataRoomAirMod->TCMF(NZ); + if (state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->IsZoneDispVent3Node(NZ) || state.dataRoomAir->IsZoneUI(NZ)) { + airTemp = state.dataRoomAir->TCMF(NZ); } } SensiblePeopleGain = diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index bc9fda79b5f..f2874bcbb0b 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -190,7 +190,7 @@ namespace RoomAir { ErrorsFound = false; for (ZoneIndex = 1; ZoneIndex <= state.dataGlobal->NumOfZones; ++ZoneIndex) { auto &thisZone = state.dataHeatBal->Zone(ZoneIndex); - if (state.dataRoomAirMod->AirModel(ZoneIndex).AirModel == RoomAir::RoomAirModel::DispVent1Node) { + if (state.dataRoomAir->AirModel(ZoneIndex).AirModel == RoomAir::RoomAirModel::DispVent1Node) { // find number of zones using the Mundt model ++NumOfMundtZones; // find maximum number of surfaces in zones using the Mundt model @@ -203,7 +203,7 @@ namespace RoomAir { } MaxNumOfSurfs = max(MaxNumOfSurfs, NumOfSurfs); // find maximum number of air nodes in zones using the Mundt model - NumOfAirNodes = state.dataRoomAirMod->TotNumOfZoneAirNodes(ZoneIndex); + NumOfAirNodes = state.dataRoomAir->TotNumOfZoneAirNodes(ZoneIndex); MaxNumOfAirNodes = max(MaxNumOfAirNodes, NumOfAirNodes); // assign zone data state.dataMundtSimMgr->ZoneData(ZoneIndex).NumOfSurfs = NumOfSurfs; @@ -246,7 +246,7 @@ namespace RoomAir { // get air node data RoomNodesCount = 0; FloorSurfCount = 0; - for (NodeNum = 1; NodeNum <= state.dataRoomAirMod->TotNumOfZoneAirNodes(ZoneIndex); ++NodeNum) { + for (NodeNum = 1; NodeNum <= state.dataRoomAir->TotNumOfZoneAirNodes(ZoneIndex); ++NodeNum) { state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex) .SurfMask.allocate(state.dataMundtSimMgr->ZoneData(ZoneIndex).NumOfSurfs); @@ -256,19 +256,19 @@ namespace RoomAir { } // error check for debugging - if (AirNodeBeginNum > state.dataRoomAirMod->TotNumOfAirNodes) { + if (AirNodeBeginNum > state.dataRoomAir->TotNumOfAirNodes) { ShowFatalError(state, "An array bound exceeded. Error in InitMundtModel subroutine of MundtSimMgr."); } AirNodeFoundFlag = false; - for (AirNodeNum = AirNodeBeginNum; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { - if (UtilityRoutines::SameString(state.dataRoomAirMod->AirNode(AirNodeNum).ZoneName, thisZone.Name)) { + for (AirNodeNum = AirNodeBeginNum; AirNodeNum <= state.dataRoomAir->TotNumOfAirNodes; ++AirNodeNum) { + if (UtilityRoutines::SameString(state.dataRoomAir->AirNode(AirNodeNum).ZoneName, thisZone.Name)) { state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType = - state.dataRoomAirMod->AirNode(AirNodeNum).ClassType; - state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).AirNodeName = state.dataRoomAirMod->AirNode(AirNodeNum).Name; - state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).Height = state.dataRoomAirMod->AirNode(AirNodeNum).Height; + state.dataRoomAir->AirNode(AirNodeNum).ClassType; + state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).AirNodeName = state.dataRoomAir->AirNode(AirNodeNum).Name; + state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).Height = state.dataRoomAir->AirNode(AirNodeNum).Height; state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).SurfMask = - state.dataRoomAirMod->AirNode(AirNodeNum).SurfMask; + state.dataRoomAir->AirNode(AirNodeNum).SurfMask; SetupOutputVariable(state, "Room Air Node Air Temperature", OutputProcessor::Unit::C, @@ -467,7 +467,7 @@ namespace RoomAir { // set up air node ID state.dataMundtSimMgr->NumRoomNodes = 0; - for (NodeNum = 1; NodeNum <= state.dataRoomAirMod->TotNumOfZoneAirNodes(ZoneNum); ++NodeNum) { + for (NodeNum = 1; NodeNum <= state.dataRoomAir->TotNumOfZoneAirNodes(ZoneNum); ++NodeNum) { switch (state.dataMundtSimMgr->LineNode(NodeNum, state.dataMundtSimMgr->MundtZoneNum).ClassType) { case RoomAir::AirNodeType::Inlet: { // inlet state.dataMundtSimMgr->SupplyNodeID = NodeNum; @@ -559,8 +559,8 @@ namespace RoomAir { int SurfCounted; // number of surfaces assciated with an air node // apply floor splits - QequipConvFloor = state.dataRoomAirMod->ConvectiveFloorSplit(ZoneNum) * state.dataMundtSimMgr->ConvIntGain; - QSensInfilFloor = -state.dataRoomAirMod->InfiltratFloorSplit(ZoneNum) * state.dataMundtSimMgr->QventCool; + QequipConvFloor = state.dataRoomAir->ConvectiveFloorSplit(ZoneNum) * state.dataMundtSimMgr->ConvIntGain; + QSensInfilFloor = -state.dataRoomAir->InfiltratFloorSplit(ZoneNum) * state.dataMundtSimMgr->QventCool; // Begin computations for Mundt model @@ -739,7 +739,7 @@ namespace RoomAir { if ((state.dataMundtSimMgr->SupplyAirVolumeRate > 0.0001) && (state.dataMundtSimMgr->QsysCoolTot > 0.0001)) { // Controlled zone when the system is on - if (state.dataRoomAirMod->AirModel(ZoneNum).TempCoupleScheme == RoomAir::CouplingScheme::Direct) { + if (state.dataRoomAir->AirModel(ZoneNum).TempCoupleScheme == RoomAir::CouplingScheme::Direct) { // Use direct coupling scheme to report air temperatures back to surface/system domains // a) Bulk air temperatures -> TempEffBulkAir(SurfNum) for (int SurfNum = 1; SurfNum <= NumOfSurfs; ++SurfNum) { @@ -788,7 +788,7 @@ namespace RoomAir { .ZT; // for indirect coupling, control air temp is equal to mean air temp? } // set flag to indicate that Mundt model is used for this zone at the present time - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; } else { // Controlled zone when the system is off --> Use the mixing model instead of the Mundt model // Bulk air temperatures -> TempEffBulkAir(SurfNum) for (int SurfNum = 1; SurfNum <= NumOfSurfs; ++SurfNum) { @@ -799,7 +799,7 @@ namespace RoomAir { state.dataSurface->SurfTAirRefRpt(hbSurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(hbSurfNum)]; } // set flag to indicate that Mundt model is NOT used for this zone at the present time - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; } } diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 99f6c425f97..bfa7a85f96e 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -130,7 +130,7 @@ namespace RoomAir { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); int RAFNNum = afnZoneInfo.RAFNNum; if (RAFNNum == 0) { @@ -187,11 +187,11 @@ namespace RoomAir { // state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag //////////////////////////////////////////////////////////////////////////////////// if (state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag) { - state.dataRoomAirflowNetModel->RAFN.allocate(state.dataRoomAirMod->NumOfRoomAFNControl); + state.dataRoomAirflowNetModel->RAFN.allocate(state.dataRoomAir->NumOfRoomAFNControl); state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag = false; } - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); int RAFNNum = afnZoneInfo.RAFNNum; if (RAFNNum == 0) { @@ -260,48 +260,48 @@ namespace RoomAir { // loop over all zones with RoomAirflowNetwork model for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - if (!state.dataRoomAirMod->AFNZoneInfo(LoopZone).IsUsed) continue; + if (!state.dataRoomAir->AFNZoneInfo(LoopZone).IsUsed) continue; int NumSurfs = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); NumSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; } - for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->AFNZoneInfo(LoopZone).NumOfAirNodes; + for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAir->AFNZoneInfo(LoopZone).NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes // calculate volume of air in node's control volume - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirVolume = + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirVolume = state.dataHeatBal->Zone(LoopZone).Volume * - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).ZoneVolumeFraction; + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).ZoneVolumeFraction; SetupOutputVariable(state, "RoomAirflowNetwork Node NonAirSystemResponse", OutputProcessor::Unit::W, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).NonAirSystemResponse, + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).NonAirSystemResponse, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SysDepZoneLoadsLagged", OutputProcessor::Unit::W, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLagged, + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLagged, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SumIntSensibleGain", OutputProcessor::Unit::W, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SumIntSensibleGain, + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).SumIntSensibleGain, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SumIntLatentGain", OutputProcessor::Unit::W, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).SumIntLatentGain, + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).SumIntLatentGain, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); } } state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlag = false; @@ -333,17 +333,17 @@ namespace RoomAir { // loop over all zones with RoomAirflowNetwork model for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { if (!state.dataHeatBal->Zone(LoopZone).IsControlled) continue; - if (!state.dataRoomAirMod->AFNZoneInfo(LoopZone).IsUsed) continue; - state.dataRoomAirMod->AFNZoneInfo(LoopZone).ActualZoneID = LoopZone; + if (!state.dataRoomAir->AFNZoneInfo(LoopZone).IsUsed) continue; + state.dataRoomAir->AFNZoneInfo(LoopZone).ActualZoneID = LoopZone; SupplyFrac = 0.0; ReturnFrac = 0.0; NodeFound = false; int numAirDistUnits = 0; // find supply air node number - for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAirMod->AFNZoneInfo(LoopZone).NumOfAirNodes; + for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAir->AFNZoneInfo(LoopZone).NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes - for (EquipLoop = 1; EquipLoop <= state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).NumHVACs; + for (EquipLoop = 1; EquipLoop <= state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).NumHVACs; ++EquipLoop) { // loop over all the equip for a single room air node // Check zone equipment name for (I = 1; I <= state.dataZoneEquip->ZoneEquipList(LoopZone).NumOfEquipTypes; ++I) { // loop over all equip types @@ -358,22 +358,22 @@ namespace RoomAir { for (int AirDistUnitNum = 1; AirDistUnitNum <= numAirDistUnits; ++AirDistUnitNum) { if (state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I) == state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).Name) { - if (state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name == + if (state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name == state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).EquipName(1)) { - if (state.dataRoomAirMod->AFNZoneInfo(LoopZone) + if (state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .EquipConfigIndex == 0) - state.dataRoomAirMod->AFNZoneInfo(LoopZone) + state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .EquipConfigIndex = I; if (!EquipFound(I)) EquipFound(I) = true; - SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) + SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .SupplyFraction; - ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) + ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .ReturnFraction; @@ -383,21 +383,21 @@ namespace RoomAir { } else { if (UtilityRoutines::SameString( state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I), - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name)) { - if (state.dataRoomAirMod->AFNZoneInfo(LoopZone) + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name)) { + if (state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .EquipConfigIndex == 0) - state.dataRoomAirMod->AFNZoneInfo(LoopZone) + state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .EquipConfigIndex = I; EquipFound(I) = true; - SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) + SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .SupplyFraction; - ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAirMod->AFNZoneInfo(LoopZone) + ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .ReturnFraction; @@ -406,11 +406,11 @@ namespace RoomAir { } for (IdNode = 1; IdNode <= state.dataLoopNodes->NumOfNodes; ++IdNode) { // loop over all nodes to find supply node ID if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(IdNode), - state.dataRoomAirMod->AFNZoneInfo(LoopZone) + state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .SupplyNodeName)) { - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum = IdNode; + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum = IdNode; break; } } @@ -426,29 +426,29 @@ namespace RoomAir { } } - if (state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum > 0 && + if (state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum > 0 && UtilityRoutines::SameString( - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnNodeName, + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnNodeName, "")) { // Find matching return node for (int retNode = 1; retNode <= state.dataZoneEquip->ZoneEquipConfig(LoopZone).NumReturnNodes; ++retNode) { if ((state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNodeInletNum(retNode) == inletNodeIndex) && (state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNode(retNode) > 0)) { - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNode(retNode); // Zone return node break; } } } - if (state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum == 0) { + if (state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum == 0) { for (IdNode = 1; IdNode <= state.dataLoopNodes->NumOfNodes; ++IdNode) { // loop over all nodes to find return node ID if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(IdNode), - state.dataRoomAirMod->AFNZoneInfo(LoopZone) + state.dataRoomAir->AFNZoneInfo(LoopZone) .Node(LoopAirNode) .HVAC(EquipLoop) .ReturnNodeName)) { - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = IdNode; break; } @@ -458,18 +458,18 @@ namespace RoomAir { state, "RoomAirflowNetwork Node HVAC Supply Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupplyFraction, + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupplyFraction, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); SetupOutputVariable( state, "RoomAirflowNetwork Node HVAC Return Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnFraction, + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnFraction, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAirMod->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); + state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); } } // Count node with.TRUE. @@ -544,7 +544,7 @@ namespace RoomAir { if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkEnvrnFlag) { for (int LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(LoopZone); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(LoopZone); if (!afnZoneInfo.IsUsed) continue; for (int LoopAirNode = 1; LoopAirNode <= afnZoneInfo.NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes auto &afnNode = afnZoneInfo.Node(LoopAirNode); @@ -578,7 +578,7 @@ namespace RoomAir { SumNonAirSystemResponseForNode(state, RoomAirNode); // latent gains. - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); auto &afnNode = afnZoneInfo.Node(RoomAirNode); if (allocated(afnNode.SurfMask)) { @@ -675,7 +675,7 @@ namespace RoomAir { Real64 AirTempT1; Real64 HumRatT1; - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); auto &afnNode = afnZoneInfo.Node(RoomAirNode); if (state.dataHVACGlobal->UseZoneTimeStepHistory) { @@ -770,7 +770,7 @@ namespace RoomAir { Real64 SumMassW; int RetNodeNum; - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); if (!afnZoneInfo.IsUsed) return; @@ -883,7 +883,7 @@ namespace RoomAir { SumLinkM = 0.0; SumLinkMW = 0.0; - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); auto &afnNode = afnZoneInfo.Node(RoomAirNodeNum); // Sum all convective internal gains: SumIntGain afnNode.SumIntSensibleGain = @@ -1146,7 +1146,7 @@ namespace RoomAir { SumHmARa = 0.0; SumHmARaW = 0.0; - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); int surfCount = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { @@ -1249,7 +1249,7 @@ namespace RoomAir { Real64 LatOutputProvided; // TODO - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); auto &roomAFNNode = afnZoneInfo.Node(RAFNNodeNum); roomAFNNode.NonAirSystemResponse = 0.0; @@ -1343,7 +1343,7 @@ namespace RoomAir { // TODO - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); // SysDepZoneLoads saved to be added to zone heat balance next SysOutputProvided = 0.0; diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 9f2f1fd3784..7e6c57d2c26 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -126,18 +126,18 @@ namespace RoomAir { // PURPOSE OF THIS SUBROUTINE: // manage room air models. - if (state.dataRoomAirModelMgr->GetAirModelData) { + if (state.dataRoomAir->GetAirModelData) { GetAirModelDatas(state); - state.dataRoomAirModelMgr->GetAirModelData = false; + state.dataRoomAir->GetAirModelData = false; } - if (!state.dataRoomAirMod->anyNonMixingRoomAirModel) return; + if (!state.dataRoomAir->anyNonMixingRoomAirModel) return; - if (state.dataRoomAirMod->UCSDModelUsed) { + if (state.dataRoomAir->UCSDModelUsed) { SharedDVCVUFDataInit(state, ZoneNum); } - switch (state.dataRoomAirMod->AirModel(ZoneNum).AirModel) { + switch (state.dataRoomAir->AirModel(ZoneNum).AirModel) { case RoomAirModel::UserDefined: ManageUserDefinedPatterns(state, ZoneNum); break; @@ -258,22 +258,22 @@ namespace RoomAir { auto &ipsc = state.dataIPShortCut; // access input file and setup - state.dataRoomAirMod->numTempDistContrldZones = + state.dataRoomAir->numTempDistContrldZones = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cUserDefinedControlObject); - state.dataRoomAirMod->NumConstantGradient = + state.dataRoomAir->NumConstantGradient = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternConstGradientObject); - state.dataRoomAirMod->NumTwoGradientInterp = + state.dataRoomAir->NumTwoGradientInterp = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternTwoGradientObject); - state.dataRoomAirMod->NumNonDimensionalHeight = + state.dataRoomAir->NumNonDimensionalHeight = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternNDHeightObject); - state.dataRoomAirMod->NumSurfaceMapping = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternSurfMapObject); + state.dataRoomAir->NumSurfaceMapping = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternSurfMapObject); - state.dataRoomAirMod->NumAirTempPatterns = state.dataRoomAirMod->NumConstantGradient + state.dataRoomAirMod->NumTwoGradientInterp + - state.dataRoomAirMod->NumNonDimensionalHeight + state.dataRoomAirMod->NumSurfaceMapping; + state.dataRoomAir->NumAirTempPatterns = state.dataRoomAir->NumConstantGradient + state.dataRoomAir->NumTwoGradientInterp + + state.dataRoomAir->NumNonDimensionalHeight + state.dataRoomAir->NumSurfaceMapping; ipsc->cCurrentModuleObject = cUserDefinedControlObject; - if (state.dataRoomAirMod->numTempDistContrldZones == 0) { - if (state.dataRoomAirMod->NumAirTempPatterns != 0) { // user may have missed control object + if (state.dataRoomAir->numTempDistContrldZones == 0) { + if (state.dataRoomAir->NumAirTempPatterns != 0) { // user may have missed control object ShowWarningError(state, format("Missing {} object needed to use roomair temperature patterns", ipsc->cCurrentModuleObject)); // ErrorsFound = .TRUE. } @@ -281,11 +281,11 @@ namespace RoomAir { } // now allocate AirPatternZoneInfo to length of all zones for easy indexing - if (!allocated(state.dataRoomAirMod->AirPatternZoneInfo)) { - state.dataRoomAirMod->AirPatternZoneInfo.allocate(state.dataGlobal->NumOfZones); + if (!allocated(state.dataRoomAir->AirPatternZoneInfo)) { + state.dataRoomAir->AirPatternZoneInfo.allocate(state.dataGlobal->NumOfZones); } - for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->numTempDistContrldZones; ++ObjNum) { + for (int ObjNum = 1; ObjNum <= state.dataRoomAir->numTempDistContrldZones; ++ObjNum) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, @@ -309,7 +309,7 @@ namespace RoomAir { return; // halt to avoid hard crash } - auto &airPatternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); + auto &airPatternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); airPatternZoneInfo.IsUsed = true; airPatternZoneInfo.Name = ipsc->cAlphaArgs(1); // Name of this Control Object airPatternZoneInfo.ZoneName = ipsc->cAlphaArgs(2); // Zone Name @@ -366,8 +366,8 @@ namespace RoomAir { // Check against AirModel. Make sure there is a match here. for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UserDefined) continue; - if (state.dataRoomAirMod->AirPatternZoneInfo(iZone).IsUsed) continue; // There is a Room Air Temperatures object for this zone + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::UserDefined) continue; + if (state.dataRoomAir->AirPatternZoneInfo(iZone).IsUsed) continue; // There is a Room Air Temperatures object for this zone ShowSevereError(state, format("{}AirModel for Zone=[{}] is indicated as \"User Defined\".", routineName, state.dataHeatBal->Zone(iZone).Name)); ShowContinueError(state, format("...but missing a {} object for control.", ipsc->cCurrentModuleObject)); @@ -375,13 +375,13 @@ namespace RoomAir { } // now get user defined temperature patterns - if (!allocated(state.dataRoomAirMod->AirPattern)) { - state.dataRoomAirMod->AirPattern.allocate(state.dataRoomAirMod->NumAirTempPatterns); + if (!allocated(state.dataRoomAir->AirPattern)) { + state.dataRoomAir->AirPattern.allocate(state.dataRoomAir->NumAirTempPatterns); } // Four different objects to get ipsc->cCurrentModuleObject = cTempPatternConstGradientObject; - for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumConstantGradient; ++ObjNum) { + for (int ObjNum = 1; ObjNum <= state.dataRoomAir->NumConstantGradient; ++ObjNum) { int thisPattern = ObjNum; state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, @@ -396,7 +396,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAirMod->AirPattern(thisPattern); + auto &roomAirPattern = state.dataRoomAir->AirPattern(thisPattern); roomAirPattern.Name = ipsc->cAlphaArgs(1); roomAirPattern.PatrnID = ipsc->rNumericArgs(1); roomAirPattern.PatternMode = UserDefinedPatternType::ConstGradTemp; @@ -407,8 +407,8 @@ namespace RoomAir { } ipsc->cCurrentModuleObject = cTempPatternTwoGradientObject; - for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumTwoGradientInterp; ++ObjNum) { - int thisPattern = state.dataRoomAirMod->NumConstantGradient + ObjNum; + for (int ObjNum = 1; ObjNum <= state.dataRoomAir->NumTwoGradientInterp; ++ObjNum) { + int thisPattern = state.dataRoomAir->NumConstantGradient + ObjNum; state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, ObjNum, @@ -423,7 +423,7 @@ namespace RoomAir { ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAirMod->AirPattern(thisPattern); + auto &roomAirPattern = state.dataRoomAir->AirPattern(thisPattern); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; roomAirPattern.PatternMode = UserDefinedPatternType::TwoGradInterp; roomAirPattern.Name = ipsc->cAlphaArgs(1); @@ -471,8 +471,8 @@ namespace RoomAir { } ipsc->cCurrentModuleObject = cTempPatternNDHeightObject; - for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumNonDimensionalHeight; ++ObjNum) { - int thisPattern = state.dataRoomAirMod->NumConstantGradient + state.dataRoomAirMod->NumTwoGradientInterp + ObjNum; + for (int ObjNum = 1; ObjNum <= state.dataRoomAir->NumNonDimensionalHeight; ++ObjNum) { + int thisPattern = state.dataRoomAir->NumConstantGradient + state.dataRoomAir->NumTwoGradientInterp + ObjNum; state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, ObjNum, @@ -485,7 +485,7 @@ namespace RoomAir { _, ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAirMod->AirPattern(thisPattern); + auto &roomAirPattern = state.dataRoomAir->AirPattern(thisPattern); roomAirPattern.PatternMode = UserDefinedPatternType::NonDimenHeight; roomAirPattern.Name = ipsc->cAlphaArgs(1); @@ -522,9 +522,9 @@ namespace RoomAir { } ipsc->cCurrentModuleObject = cTempPatternSurfMapObject; - for (int ObjNum = 1; ObjNum <= state.dataRoomAirMod->NumSurfaceMapping; ++ObjNum) { - int thisPattern = state.dataRoomAirMod->NumConstantGradient + state.dataRoomAirMod->NumTwoGradientInterp + - state.dataRoomAirMod->NumNonDimensionalHeight + ObjNum; + for (int ObjNum = 1; ObjNum <= state.dataRoomAir->NumSurfaceMapping; ++ObjNum) { + int thisPattern = state.dataRoomAir->NumConstantGradient + state.dataRoomAir->NumTwoGradientInterp + + state.dataRoomAir->NumNonDimensionalHeight + ObjNum; state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, @@ -539,7 +539,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAirMod->AirPattern(thisPattern); + auto &roomAirPattern = state.dataRoomAir->AirPattern(thisPattern); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; roomAirPattern.PatternMode = UserDefinedPatternType::SurfMapTemp; @@ -599,22 +599,22 @@ namespace RoomAir { // Find and set return and exhaust node ids for (int i = 1; i <= state.dataGlobal->NumOfZones; ++i) { - if (state.dataRoomAirMod->AirPatternZoneInfo(i).IsUsed) { + if (state.dataRoomAir->AirPatternZoneInfo(i).IsUsed) { // first get return and exhaust air node index int found = UtilityRoutines::FindItemInList( - state.dataRoomAirMod->AirPatternZoneInfo(i).ZoneName, state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); + state.dataRoomAir->AirPatternZoneInfo(i).ZoneName, state.dataZoneEquip->ZoneEquipConfig, &EquipConfiguration::ZoneName); if (found != 0) { - state.dataRoomAirMod->AirPatternZoneInfo(i).ZoneNodeID = state.dataZoneEquip->ZoneEquipConfig(found).ZoneNode; + state.dataRoomAir->AirPatternZoneInfo(i).ZoneNodeID = state.dataZoneEquip->ZoneEquipConfig(found).ZoneNode; if (allocated(state.dataZoneEquip->ZoneEquipConfig(found).ExhaustNode)) { - state.dataRoomAirMod->AirPatternZoneInfo(i).ExhaustAirNodeID.allocate( + state.dataRoomAir->AirPatternZoneInfo(i).ExhaustAirNodeID.allocate( state.dataZoneEquip->ZoneEquipConfig(found).NumExhaustNodes); - state.dataRoomAirMod->AirPatternZoneInfo(i).ExhaustAirNodeID = state.dataZoneEquip->ZoneEquipConfig(found).ExhaustNode; + state.dataRoomAir->AirPatternZoneInfo(i).ExhaustAirNodeID = state.dataZoneEquip->ZoneEquipConfig(found).ExhaustNode; } // exhaust nodes present } // found ZoneEquipConf // second get zone height values - state.dataRoomAirMod->AirPatternZoneInfo(i).ZoneHeight = state.dataHeatBal->Zone(i).CeilingHeight; + state.dataRoomAir->AirPatternZoneInfo(i).ZoneHeight = state.dataHeatBal->Zone(i).CeilingHeight; } // air pattern is used } @@ -640,18 +640,18 @@ namespace RoomAir { int NumNumbers; // Number of numbers encountered int Status; // Notes if there was an error in processing the input - if (!state.dataRoomAirMod->DispVent1NodeModelUsed) return; + if (!state.dataRoomAir->DispVent1NodeModelUsed) return; auto &ipsc = state.dataIPShortCut; // Initialize default values for air nodes - state.dataRoomAirMod->TotNumOfZoneAirNodes.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->TotNumOfAirNodes = 0; - state.dataRoomAirMod->TotNumOfZoneAirNodes = 0; + state.dataRoomAir->TotNumOfZoneAirNodes.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->TotNumOfAirNodes = 0; + state.dataRoomAir->TotNumOfZoneAirNodes = 0; ipsc->cCurrentModuleObject = "RoomAir:Node"; - state.dataRoomAirMod->TotNumOfAirNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAir->TotNumOfAirNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->TotNumOfAirNodes <= 0) { + if (state.dataRoomAir->TotNumOfAirNodes <= 0) { // no air node object is found, terminate the program ShowSevereError(state, format("No {} objects found in input.", ipsc->cCurrentModuleObject)); ShowContinueError(state, format("The OneNodeDisplacementVentilation model requires {} objects", ipsc->cCurrentModuleObject)); @@ -659,10 +659,10 @@ namespace RoomAir { return; } else { // air node objects are found so allocate airnode variable - state.dataRoomAirMod->AirNode.allocate(state.dataRoomAirMod->TotNumOfAirNodes); + state.dataRoomAir->AirNode.allocate(state.dataRoomAir->TotNumOfAirNodes); } - for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { + for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAir->TotNumOfAirNodes; ++AirNodeNum) { // get air node objects state.dataInputProcessing->inputProcessor->getObjectItem(state, @@ -678,7 +678,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &airNode = state.dataRoomAirMod->AirNode(AirNodeNum); + auto &airNode = state.dataRoomAir->AirNode(AirNodeNum); airNode.Name = ipsc->cAlphaArgs(1); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, airNode.Name}; @@ -779,11 +779,11 @@ namespace RoomAir { } // for (AirNodeNum) // get number of air nodes in each zone - for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAirMod->TotNumOfAirNodes; ++AirNodeNum) { - auto const &airNode = state.dataRoomAirMod->AirNode(AirNodeNum); + for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAir->TotNumOfAirNodes; ++AirNodeNum) { + auto const &airNode = state.dataRoomAir->AirNode(AirNodeNum); // this zone uses other air model so skip the rest - if (state.dataRoomAirMod->AirModel(airNode.ZonePtr).AirModel == RoomAirModel::DispVent1Node) - ++state.dataRoomAirMod->TotNumOfZoneAirNodes(airNode.ZonePtr); + if (state.dataRoomAir->AirModel(airNode.ZonePtr).AirModel == RoomAirModel::DispVent1Node) + ++state.dataRoomAir->TotNumOfZoneAirNodes(airNode.ZonePtr); } } @@ -815,13 +815,13 @@ namespace RoomAir { auto &ipsc = state.dataIPShortCut; - if (!state.dataRoomAirMod->DispVent1NodeModelUsed) return; + if (!state.dataRoomAir->DispVent1NodeModelUsed) return; // Initialize default values for Mundt model controls - state.dataRoomAirMod->ConvectiveFloorSplit.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->InfiltratFloorSplit.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ConvectiveFloorSplit = 0.0; - state.dataRoomAirMod->InfiltratFloorSplit = 0.0; + state.dataRoomAir->ConvectiveFloorSplit.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->InfiltratFloorSplit.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ConvectiveFloorSplit = 0.0; + state.dataRoomAir->InfiltratFloorSplit = 0.0; auto &cCurrentModuleObject = ipsc->cCurrentModuleObject; cCurrentModuleObject = "RoomAirSettings:OneNodeDisplacementVentilation"; NumOfMundtContrl = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); @@ -861,17 +861,17 @@ namespace RoomAir { ErrorsFound = true; continue; } - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAirModel::DispVent1Node) { + if (state.dataRoomAir->AirModel(ZoneNum).AirModel != RoomAirModel::DispVent1Node) { ShowSevereError( state, format("Zone specified=\"{}\", Air Model type is not OneNodeDisplacementVentilation.", ipsc->cAlphaArgs(1))); ShowContinueError( - state, format("Air Model Type for zone={}", roomAirModelNamesUC[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel])); + state, format("Air Model Type for zone={}", roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); ErrorsFound = true; continue; } - state.dataRoomAirMod->ConvectiveFloorSplit(ZoneNum) = ipsc->rNumericArgs(1); - state.dataRoomAirMod->InfiltratFloorSplit(ZoneNum) = ipsc->rNumericArgs(2); + state.dataRoomAir->ConvectiveFloorSplit(ZoneNum) = ipsc->rNumericArgs(1); + state.dataRoomAir->InfiltratFloorSplit(ZoneNum) = ipsc->rNumericArgs(2); } } @@ -899,15 +899,15 @@ namespace RoomAir { auto &ipsc = state.dataIPShortCut; - if (!state.dataRoomAirMod->UCSDModelUsed) return; + if (!state.dataRoomAir->UCSDModelUsed) return; ipsc->cCurrentModuleObject = "RoomAirSettings:ThreeNodeDisplacementVentilation"; - state.dataRoomAirMod->TotDispVent3Node = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAir->TotDispVent3Node = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->TotDispVent3Node <= 0) return; + if (state.dataRoomAir->TotDispVent3Node <= 0) return; - state.dataRoomAirMod->ZoneDispVent3Node.allocate(state.dataRoomAirMod->TotDispVent3Node); + state.dataRoomAir->ZoneDispVent3Node.allocate(state.dataRoomAir->TotDispVent3Node); - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotDispVent3Node; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAir->TotDispVent3Node; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, @@ -922,7 +922,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &zoneDV3N = state.dataRoomAirMod->ZoneDispVent3Node(Loop); + auto &zoneDV3N = state.dataRoomAir->ZoneDispVent3Node(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // First is Zone Name // zoneUCSDDV.ZoneName = ipsc->cAlphaArgs(1); @@ -931,7 +931,7 @@ namespace RoomAir { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneDispVent3Node(zoneDV3N.ZonePtr) = true; + state.dataRoomAir->IsZoneDispVent3Node(zoneDV3N.ZonePtr) = true; } // Second Alpha is Schedule Name // zoneUCSDDV.SchedGainsName = ipsc->cAlphaArgs(2); @@ -974,15 +974,15 @@ namespace RoomAir { int NumNumber; auto &ipsc = state.dataIPShortCut; - if (!state.dataRoomAirMod->UCSDModelUsed) return; + if (!state.dataRoomAir->UCSDModelUsed) return; ipsc->cCurrentModuleObject = "RoomAirSettings:CrossVentilation"; - state.dataRoomAirMod->TotCrossVent = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAir->TotCrossVent = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->TotCrossVent <= 0) return; + if (state.dataRoomAir->TotCrossVent <= 0) return; - state.dataRoomAirMod->ZoneCrossVent.allocate(state.dataRoomAirMod->TotCrossVent); + state.dataRoomAir->ZoneCrossVent.allocate(state.dataRoomAir->TotCrossVent); - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotCrossVent; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAir->TotCrossVent; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, @@ -997,15 +997,15 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &zoneCV = state.dataRoomAirMod->ZoneCrossVent(Loop); + auto &zoneCV = state.dataRoomAir->ZoneCrossVent(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; // First is Zone Name - // state.dataRoomAirMod->ZoneUCSDCV(Loop).ZoneName = ipsc->cAlphaArgs(1); + // state.dataRoomAir->ZoneUCSDCV(Loop).ZoneName = ipsc->cAlphaArgs(1); if ((zoneCV.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone)) == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneCrossVent(zoneCV.ZonePtr) = true; + state.dataRoomAir->IsZoneCrossVent(zoneCV.ZonePtr) = true; } // Second Alpha is Schedule Name // zoneUCSDCV.SchedGainsName = ipsc->cAlphaArgs(2); @@ -1057,7 +1057,7 @@ namespace RoomAir { int typeNum = state.afn->AirflowNetworkCompData(compNum).TypeNum; if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { if (state.afn->MultizoneSurfaceCrackData(typeNum).exponent != 0.50) { - state.dataRoomAirMod->AirModel(zoneCV.ZonePtr).AirModel = RoomAirModel::Mixing; + state.dataRoomAir->AirModel(zoneCV.ZonePtr).AirModel = RoomAirModel::Mixing; ShowWarningError(state, format("Problem with {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowWarningError(state, format("Roomair model will not be applied for Zone={}.", ipsc->cAlphaArgs(1))); ShowContinueError( @@ -1094,27 +1094,27 @@ namespace RoomAir { int NumAlpha; int NumNumber; - if (!state.dataRoomAirMod->UCSDModelUsed) { - state.dataRoomAirMod->TotUFADInt = 0; - state.dataRoomAirMod->TotUFADExt = 0; + if (!state.dataRoomAir->UCSDModelUsed) { + state.dataRoomAir->TotUFADInt = 0; + state.dataRoomAir->TotUFADExt = 0; return; } auto &ipsc = state.dataIPShortCut; ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; - state.dataRoomAirMod->TotUFADInt = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAir->TotUFADInt = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; - state.dataRoomAirMod->TotUFADExt = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + state.dataRoomAir->TotUFADExt = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->TotUFADInt <= 0 && state.dataRoomAirMod->TotUFADExt <= 0) return; + if (state.dataRoomAir->TotUFADInt <= 0 && state.dataRoomAir->TotUFADExt <= 0) return; - state.dataRoomAirMod->ZoneUFADInt.allocate(state.dataRoomAirMod->TotUFADInt); - state.dataRoomAirMod->ZoneUFADExt.allocate(state.dataRoomAirMod->TotUFADExt); - state.dataRoomAirMod->ZoneUFADPtr.dimension(state.dataGlobal->NumOfZones, 0); + state.dataRoomAir->ZoneUFADInt.allocate(state.dataRoomAir->TotUFADInt); + state.dataRoomAir->ZoneUFADExt.allocate(state.dataRoomAir->TotUFADExt); + state.dataRoomAir->ZoneUFADPtr.dimension(state.dataGlobal->NumOfZones, 0); ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUFADInt; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAir->TotUFADInt; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -1128,17 +1128,17 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); // First is Zone Name - auto &zoneUI = state.dataRoomAirMod->ZoneUFADInt(Loop); + auto &zoneUI = state.dataRoomAir->ZoneUFADInt(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; zoneUI.ZoneName = ipsc->cAlphaArgs(1); zoneUI.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); - state.dataRoomAirMod->ZoneUFADPtr(zoneUI.ZonePtr) = Loop; + state.dataRoomAir->ZoneUFADPtr(zoneUI.ZonePtr) = Loop; if (zoneUI.ZonePtr == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneUI(zoneUI.ZonePtr) = true; + state.dataRoomAir->IsZoneUI(zoneUI.ZonePtr) = true; } // 2nd alpha is diffuser type @@ -1176,7 +1176,7 @@ namespace RoomAir { } ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotUFADExt; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAir->TotUFADExt; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -1190,7 +1190,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); // First is Zone Name - auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(Loop); + auto &zoneUE = state.dataRoomAir->ZoneUFADExt(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; zoneUE.ZoneName = ipsc->cAlphaArgs(1); zoneUE.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); @@ -1198,8 +1198,8 @@ namespace RoomAir { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAirMod->IsZoneUI(zoneUE.ZonePtr) = true; - state.dataRoomAirMod->ZoneUFADPtr(zoneUE.ZonePtr) = Loop; + state.dataRoomAir->IsZoneUI(zoneUE.ZonePtr) = true; + state.dataRoomAir->ZoneUFADPtr(zoneUE.ZonePtr) = Loop; } zoneUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); @@ -1266,18 +1266,18 @@ namespace RoomAir { auto &ipsc = state.dataIPShortCut; ipsc->cCurrentModuleObject = "RoomAirSettings:AirflowNetwork"; - state.dataRoomAirMod->NumOfRoomAFNControl = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - if (state.dataRoomAirMod->NumOfRoomAFNControl == 0) return; - if (state.dataRoomAirMod->NumOfRoomAFNControl > state.dataGlobal->NumOfZones) { + state.dataRoomAir->NumOfRoomAFNControl = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + if (state.dataRoomAir->NumOfRoomAFNControl == 0) return; + if (state.dataRoomAir->NumOfRoomAFNControl > state.dataGlobal->NumOfZones) { ShowSevereError(state, format("Too many {} objects in input file", ipsc->cCurrentModuleObject)); ShowContinueError(state, format("There cannot be more {} objects than number of zones.", ipsc->cCurrentModuleObject)); ErrorsFound = true; } - if (!allocated(state.dataRoomAirMod->AFNZoneInfo)) { - state.dataRoomAirMod->AFNZoneInfo.allocate(state.dataGlobal->NumOfZones); + if (!allocated(state.dataRoomAir->AFNZoneInfo)) { + state.dataRoomAir->AFNZoneInfo.allocate(state.dataGlobal->NumOfZones); } - for (int Loop = 1; Loop <= state.dataRoomAirMod->NumOfRoomAFNControl; ++Loop) { + for (int Loop = 1; Loop <= state.dataRoomAir->NumOfRoomAFNControl; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -1299,17 +1299,17 @@ namespace RoomAir { ErrorsFound = true; continue; } - if (state.dataRoomAirMod->AirModel(ZoneNum).AirModel != RoomAirModel::AirflowNetwork) { + if (state.dataRoomAir->AirModel(ZoneNum).AirModel != RoomAirModel::AirflowNetwork) { ShowSevereError(state, format("GetRoomAirflowNetworkData: Zone specified='{}', Air Model type is not AirflowNetwork.", ipsc->cAlphaArgs(1))); ShowContinueError( - state, format("Air Model Type for zone ={}", roomAirModelNamesUC[(int)state.dataRoomAirMod->AirModel(ZoneNum).AirModel])); + state, format("Air Model Type for zone ={}", roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); ErrorsFound = true; continue; } - auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); roomAFNZoneInfo.ZoneID = ZoneNum; roomAFNZoneInfo.RAFNNum = Loop; roomAFNZoneInfo.IsUsed = true; @@ -1347,8 +1347,8 @@ namespace RoomAir { } // for (Loop) ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork"; - state.dataRoomAirMod->TotNumOfRoomAFNNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); - for (int Loop = 1; Loop <= state.dataRoomAirMod->TotNumOfRoomAFNNodes; ++Loop) { + state.dataRoomAir->TotNumOfRoomAFNNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); + for (int Loop = 1; Loop <= state.dataRoomAir->TotNumOfRoomAFNNodes; ++Loop) { state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, Loop, @@ -1370,7 +1370,7 @@ namespace RoomAir { continue; } - auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(ZoneNum); + auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); int RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); if (RAFNNodeNum == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); @@ -1419,7 +1419,7 @@ namespace RoomAir { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { // find surface list int RAFNNodeNum = 0; - auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); if (roomAFNZoneInfo.NumOfAirNodes > 0) { RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, @@ -1519,7 +1519,7 @@ namespace RoomAir { } for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); // find surface list int RAFNNodeNum = 0; if (roomAFNZoneInfo.NumOfAirNodes > 0) { @@ -1622,7 +1622,7 @@ namespace RoomAir { } for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); // find surface list int RAFNNodeNum = 0; if (roomAFNZoneInfo.NumOfAirNodes > 0) { @@ -1693,7 +1693,7 @@ namespace RoomAir { // do some checks on input data for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); if (roomAFNZoneInfo.NumOfAirNodes == 0) continue; @@ -1749,7 +1749,7 @@ namespace RoomAir { return; for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - auto &roomAFNZoneInfo = state.dataRoomAirMod->AFNZoneInfo(iZone); + auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); if (!roomAFNZoneInfo.IsUsed || roomAFNZoneInfo.NumOfAirNodes == 0) continue; for (int iAirNode = 1; iAirNode <= roomAFNZoneInfo.NumOfAirNodes; ++iAirNode) { @@ -1807,55 +1807,55 @@ namespace RoomAir { int ZoneEquipConfigNum; // counter // Do the one time initializations - if (state.dataRoomAirModelMgr->MyOneTimeFlag) { - - state.dataRoomAirModelMgr->MyEnvrnFlag.allocate(state.dataGlobal->NumOfZones); - - state.dataRoomAirMod->APos_Wall.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->APos_Floor.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->APos_Ceiling.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->PosZ_Wall.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->PosZ_Floor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->PosZ_Ceiling.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->APos_Window.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->APos_Door.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->APos_Internal.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->PosZ_Window.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->PosZ_Door.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->PosZ_Internal.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->HCeiling.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->HWall.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->HFloor.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->HInternal.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->HWindow.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->HDoor.allocate(state.dataSurface->TotSurfaces); + if (state.dataRoomAir->MyOneTimeFlag) { + + state.dataRoomAir->MyEnvrnFlag.allocate(state.dataGlobal->NumOfZones); + + state.dataRoomAir->APos_Wall.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->APos_Floor.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->APos_Ceiling.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->PosZ_Wall.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->PosZ_Floor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->PosZ_Ceiling.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->APos_Window.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->APos_Door.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->APos_Internal.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->PosZ_Window.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->PosZ_Door.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->PosZ_Internal.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->HCeiling.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->HWall.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->HFloor.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->HInternal.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->HWindow.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->HDoor.allocate(state.dataSurface->TotSurfaces); AuxSurf.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneCeilingHeight1.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneCeilingHeight2.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneCeilingHeight1 = 0.0; - state.dataRoomAirMod->ZoneCeilingHeight2 = 0.0; + state.dataRoomAir->ZoneCeilingHeight1.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneCeilingHeight2.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneCeilingHeight1 = 0.0; + state.dataRoomAir->ZoneCeilingHeight2 = 0.0; // Arrays initializations - state.dataRoomAirMod->APos_Wall = 0; - state.dataRoomAirMod->APos_Floor = 0; - state.dataRoomAirMod->APos_Ceiling = 0; - std::fill(state.dataRoomAirMod->PosZ_Wall.begin(),state.dataRoomAirMod->PosZ_Wall.end(), BegEnd()); - std::fill(state.dataRoomAirMod->PosZ_Floor.begin(),state.dataRoomAirMod->PosZ_Floor.end(), BegEnd()); - std::fill(state.dataRoomAirMod->PosZ_Ceiling.begin(),state.dataRoomAirMod->PosZ_Ceiling.end(), BegEnd()); - state.dataRoomAirMod->APos_Window = 0; - state.dataRoomAirMod->APos_Door = 0; - state.dataRoomAirMod->APos_Internal = 0; - std::fill(state.dataRoomAirMod->PosZ_Window.begin(),state.dataRoomAirMod->PosZ_Window.end(), BegEnd()); - std::fill(state.dataRoomAirMod->PosZ_Door.begin(),state.dataRoomAirMod->PosZ_Door.end(), BegEnd()); - std::fill(state.dataRoomAirMod->PosZ_Internal.begin(),state.dataRoomAirMod->PosZ_Internal.end(), BegEnd()); - state.dataRoomAirMod->HCeiling = 0.0; - state.dataRoomAirMod->HWall = 0.0; - state.dataRoomAirMod->HFloor = 0.0; - state.dataRoomAirMod->HInternal = 0.0; - state.dataRoomAirMod->HWindow = 0.0; - state.dataRoomAirMod->HDoor = 0.0; + state.dataRoomAir->APos_Wall = 0; + state.dataRoomAir->APos_Floor = 0; + state.dataRoomAir->APos_Ceiling = 0; + std::fill(state.dataRoomAir->PosZ_Wall.begin(),state.dataRoomAir->PosZ_Wall.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Floor.begin(),state.dataRoomAir->PosZ_Floor.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Ceiling.begin(),state.dataRoomAir->PosZ_Ceiling.end(), BegEnd()); + state.dataRoomAir->APos_Window = 0; + state.dataRoomAir->APos_Door = 0; + state.dataRoomAir->APos_Internal = 0; + std::fill(state.dataRoomAir->PosZ_Window.begin(),state.dataRoomAir->PosZ_Window.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Door.begin(),state.dataRoomAir->PosZ_Door.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Internal.begin(),state.dataRoomAir->PosZ_Internal.end(), BegEnd()); + state.dataRoomAir->HCeiling = 0.0; + state.dataRoomAir->HWall = 0.0; + state.dataRoomAir->HFloor = 0.0; + state.dataRoomAir->HInternal = 0.0; + state.dataRoomAir->HWindow = 0.0; + state.dataRoomAir->HDoor = 0.0; int contWall = 0, contFloor = 0, contCeiling = 0, contWindow = 0, contInternal = 0, contDoor = 0; int contWallBeg = 0, contFloorBeg = 0, contCeilingBeg = 0, contWindowBeg = 0, contInternalBeg = 0, contDoorBeg = 0; @@ -1893,22 +1893,22 @@ namespace RoomAir { // Put the reference to this surface in the appropriate array if (surf.Class == SurfaceClass::Floor) { ++contFloor; - state.dataRoomAirMod->APos_Floor(contFloor) = SurfNum; + state.dataRoomAir->APos_Floor(contFloor) = SurfNum; } else if (surf.Class == SurfaceClass::Wall) { ++contWall; - state.dataRoomAirMod->APos_Wall(contWall) = SurfNum; + state.dataRoomAir->APos_Wall(contWall) = SurfNum; } else if (surf.Class == SurfaceClass::Window) { ++contWindow; - state.dataRoomAirMod->APos_Window(contWindow) = SurfNum; + state.dataRoomAir->APos_Window(contWindow) = SurfNum; } else if (surf.Class == SurfaceClass::IntMass) { ++contInternal; - state.dataRoomAirMod->APos_Internal(contInternal) = SurfNum; + state.dataRoomAir->APos_Internal(contInternal) = SurfNum; } else if (surf.Class == SurfaceClass::Door) { ++contDoor; - state.dataRoomAirMod->APos_Door(contDoor) = SurfNum; + state.dataRoomAir->APos_Door(contDoor) = SurfNum; } else { ++contCeiling; - state.dataRoomAirMod->APos_Ceiling(contCeiling) = SurfNum; + state.dataRoomAir->APos_Ceiling(contCeiling) = SurfNum; } } } // for (SurfNum) @@ -1921,21 +1921,21 @@ namespace RoomAir { contInternalLast = contInternal; // PosZ_Wall (... + 1) has the Begin Wall reference in Apos_Wall for the ZNum // PosZ_Wall (... + 2) has the End Wall reference in Apos_Wall for the ZNum - state.dataRoomAirMod->PosZ_Wall(ZNum).beg = contWallBeg; - state.dataRoomAirMod->PosZ_Wall(ZNum).end = contWallLast; - state.dataRoomAirMod->PosZ_Floor(ZNum).beg = contFloorBeg; - state.dataRoomAirMod->PosZ_Floor(ZNum).end = contFloorLast; - state.dataRoomAirMod->PosZ_Ceiling(ZNum).beg = contCeilingBeg; - state.dataRoomAirMod->PosZ_Ceiling(ZNum).end = contCeilingLast; - state.dataRoomAirMod->PosZ_Window(ZNum).beg = contWindowBeg; - state.dataRoomAirMod->PosZ_Window(ZNum).end = contWindowLast; - state.dataRoomAirMod->PosZ_Door(ZNum).beg = contDoorBeg; - state.dataRoomAirMod->PosZ_Door(ZNum).end = contDoorLast; - state.dataRoomAirMod->PosZ_Internal(ZNum).beg = contInternalBeg; - state.dataRoomAirMod->PosZ_Internal(ZNum).end = contInternalLast; + state.dataRoomAir->PosZ_Wall(ZNum).beg = contWallBeg; + state.dataRoomAir->PosZ_Wall(ZNum).end = contWallLast; + state.dataRoomAir->PosZ_Floor(ZNum).beg = contFloorBeg; + state.dataRoomAir->PosZ_Floor(ZNum).end = contFloorLast; + state.dataRoomAir->PosZ_Ceiling(ZNum).beg = contCeilingBeg; + state.dataRoomAir->PosZ_Ceiling(ZNum).end = contCeilingLast; + state.dataRoomAir->PosZ_Window(ZNum).beg = contWindowBeg; + state.dataRoomAir->PosZ_Window(ZNum).end = contWindowLast; + state.dataRoomAir->PosZ_Door(ZNum).beg = contDoorBeg; + state.dataRoomAir->PosZ_Door(ZNum).end = contDoorLast; + state.dataRoomAir->PosZ_Internal(ZNum).beg = contInternalBeg; + state.dataRoomAir->PosZ_Internal(ZNum).end = contInternalLast; // Save the highest and lowest height for this zone - state.dataRoomAirMod->ZoneCeilingHeight1(ZNum) = Z1ofZone; - state.dataRoomAirMod->ZoneCeilingHeight2(ZNum) = Z2ofZone; + state.dataRoomAir->ZoneCeilingHeight1(ZNum) = Z1ofZone; + state.dataRoomAir->ZoneCeilingHeight2(ZNum) = Z2ofZone; constexpr Real64 CeilingHeightDiffMaximum = 0.1; if (std::abs((Z2ofZone - Z1ofZone) - state.dataHeatBal->Zone(ZNum).CeilingHeight) > CeilingHeightDiffMaximum) { @@ -1947,18 +1947,18 @@ namespace RoomAir { } // for (ZoneNum) AuxSurf = 0; - state.dataRoomAirMod->CrossVentNumAFNSurfaces = 0; + state.dataRoomAir->CrossVentNumAFNSurfaces = 0; // calculate maximum number of airflow network surfaces in each zone for (int iMzLink = 1; iMzLink <= state.afn->NumOfLinksMultiZone; ++iMzLink) { auto const &mzSurf = state.dataSurface->Surface(state.afn->MultizoneSurfaceData(iMzLink).SurfNum); ++AuxSurf(mzSurf.Zone); - ++state.dataRoomAirMod->CrossVentNumAFNSurfaces; + ++state.dataRoomAir->CrossVentNumAFNSurfaces; // Check if this is an interzone airflow network surface if (mzSurf.ExtBoundCond > 0 && (state.afn->MultizoneSurfaceData(iMzLink).SurfNum != mzSurf.ExtBoundCond)) { ++AuxSurf(state.dataSurface->Surface(mzSurf.ExtBoundCond).Zone); - ++state.dataRoomAirMod->CrossVentNumAFNSurfaces; + ++state.dataRoomAir->CrossVentNumAFNSurfaces; } } // calculate maximum number of airflow network surfaces in a single zone @@ -1967,36 +1967,36 @@ namespace RoomAir { if (AuxSurf(iZone) > MaxSurf) MaxSurf = AuxSurf(iZone); } - if (!allocated(state.dataRoomAirMod->AFNSurfaceCrossVent)) { - state.dataRoomAirMod->AFNSurfaceCrossVent.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); + if (!allocated(state.dataRoomAir->AFNSurfaceCrossVent)) { + state.dataRoomAir->AFNSurfaceCrossVent.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); } - if (!allocated(state.dataRoomAirMod->CrossVentJetRecFlows)) { - state.dataRoomAirMod->CrossVentJetRecFlows.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); + if (!allocated(state.dataRoomAir->CrossVentJetRecFlows)) { + state.dataRoomAir->CrossVentJetRecFlows.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); } AuxAirflowNetworkSurf.allocate({0, MaxSurf}, state.dataGlobal->NumOfZones); // Width and Height for airflow network surfaces - if (!allocated(state.dataRoomAirMod->SurfParametersCrossDispVent)) { - state.dataRoomAirMod->SurfParametersCrossDispVent.allocate(state.afn->NumOfLinksMultiZone); + if (!allocated(state.dataRoomAir->SurfParametersCrossDispVent)) { + state.dataRoomAir->SurfParametersCrossDispVent.allocate(state.afn->NumOfLinksMultiZone); } - state.dataRoomAirMod->AFNSurfaceCrossVent = 0; + state.dataRoomAir->AFNSurfaceCrossVent = 0; // Organize surfaces in vector AirflowNetworkSurfaceUCSDCV(Zone, surface indexes) for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { // the 0 component of the array has the number of relevant AirflowNetwork surfaces for the zone - state.dataRoomAirMod->AFNSurfaceCrossVent(0, iZone) = AuxSurf(iZone); + state.dataRoomAir->AFNSurfaceCrossVent(0, iZone) = AuxSurf(iZone); if (AuxSurf(iZone) == 0) continue; - Real64 const ceilingHeight = state.dataRoomAirMod->ZoneCeilingHeight1(iZone); + Real64 const ceilingHeight = state.dataRoomAir->ZoneCeilingHeight1(iZone); int SurfNum = 1; for (int iMzLink = 1; iMzLink <= state.afn->NumOfLinksMultiZone; ++iMzLink) { auto const &mzSurf = state.dataSurface->Surface(state.afn->MultizoneSurfaceData(iMzLink).SurfNum); - auto &surfParams = state.dataRoomAirMod->SurfParametersCrossDispVent(iMzLink); + auto &surfParams = state.dataRoomAir->SurfParametersCrossDispVent(iMzLink); if (mzSurf.Zone == iZone) { // SurfNum has the reference surface number relative to AirflowNetworkSurfaceData - state.dataRoomAirMod->AFNSurfaceCrossVent(SurfNum, iZone) = iMzLink; + state.dataRoomAir->AFNSurfaceCrossVent(SurfNum, iZone) = iMzLink; // calculate the surface width and height int compNum = state.afn->AirflowNetworkLinkageData(iMzLink).CompNum; int typeNum = state.afn->AirflowNetworkCompData(compNum).TypeNum; @@ -2064,7 +2064,7 @@ namespace RoomAir { state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum > 0) || (state.afn->AirflowNetworkNodeData(nodeNum2).EPlusZoneNum > 0 && state.afn->AirflowNetworkNodeData(nodeNum1).EPlusZoneNum == iZone)) { - state.dataRoomAirMod->AFNSurfaceCrossVent(SurfNum, iZone) = iMzLink; + state.dataRoomAir->AFNSurfaceCrossVent(SurfNum, iZone) = iMzLink; ++SurfNum; } } @@ -2073,160 +2073,160 @@ namespace RoomAir { AuxSurf.deallocate(); - if (any(state.dataRoomAirMod->IsZoneDispVent3Node) || any(state.dataRoomAirMod->IsZoneUI)) { - state.dataRoomAirMod->MaxTempGrad.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->AvgTempGrad.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->TCMF.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->FracMinFlow.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneAirSystemON.allocate(state.dataGlobal->NumOfZones); + if (any(state.dataRoomAir->IsZoneDispVent3Node) || any(state.dataRoomAir->IsZoneUI)) { + state.dataRoomAir->MaxTempGrad.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->AvgTempGrad.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->TCMF.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->FracMinFlow.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneAirSystemON.allocate(state.dataGlobal->NumOfZones); // Allocate histories of displacement ventilation temperatures PH 3/5/04 - state.dataRoomAirMod->MATFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XMATFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXMATFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->MATOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XMATOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXMATOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->MATMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->XMATMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DSXMATMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTMFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTMOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTMMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->AIRRATFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->AIRRATOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->AIRRATMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZTFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->HeightTransition.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Phi.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Zone1Floor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneMXFloor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneM2Floor.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Zone1OC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneMXOC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneM2OC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Zone1MX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneMXMX.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneM2MX.allocate(state.dataGlobal->NumOfZones); - - state.dataRoomAirMod->MaxTempGrad = 0.0; - state.dataRoomAirMod->AvgTempGrad = 0.0; - state.dataRoomAirMod->TCMF = 23.0; - state.dataRoomAirMod->FracMinFlow = 0.0; + state.dataRoomAir->MATFloor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->XMATFloor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->DSXMATFloor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->MATOC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->XMATOC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->DSXMATOC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->MATMX.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->XMATMX.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->DSXMATMX.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZTMFloor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZTMOC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZTMMX.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->AIRRATFloor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->AIRRATOC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->AIRRATMX.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZTOC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZTMX.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZTFloor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->HeightTransition.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Phi.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Zone1Floor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneMXFloor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneM2Floor.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Zone1OC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneMXOC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneM2OC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Zone1MX.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneMXMX.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneM2MX.allocate(state.dataGlobal->NumOfZones); + + state.dataRoomAir->MaxTempGrad = 0.0; + state.dataRoomAir->AvgTempGrad = 0.0; + state.dataRoomAir->TCMF = 23.0; + state.dataRoomAir->FracMinFlow = 0.0; // ZoneDVMixedFlagRep = 0.0 - state.dataRoomAirMod->ZoneAirSystemON = false; + state.dataRoomAir->ZoneAirSystemON = false; // ZoneDVMixedFlag=0 - state.dataRoomAirMod->MATFloor = 23.0; - state.dataRoomAirMod->XMATFloor = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->DSXMATFloor = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->MATOC = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->XMATOC = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->DSXMATOC = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->MATMX = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->XMATMX = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->DSXMATMX = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->ZTMFloor = {23.0, 23.0, 23.0}; - state.dataRoomAirMod->ZTMOC = {23.0, 23.0, 23.0}; - state.dataRoomAirMod->ZTMMX = {23.0, 23.0, 23.0}; - state.dataRoomAirMod->Zone1Floor = 23.0; - state.dataRoomAirMod->ZoneMXFloor = 23.0; - state.dataRoomAirMod->ZoneM2Floor = 23.0; - state.dataRoomAirMod->Zone1OC = 23.0; - state.dataRoomAirMod->ZoneMXOC = 23.0; - state.dataRoomAirMod->ZoneM2OC = 23.0; - state.dataRoomAirMod->Zone1MX = 23.0; - state.dataRoomAirMod->ZoneMXMX = 23.0; - state.dataRoomAirMod->ZoneM2MX = 23.0; - state.dataRoomAirMod->AIRRATFloor = 0.0; - state.dataRoomAirMod->AIRRATOC = 0.0; - state.dataRoomAirMod->AIRRATMX = 0.0; - state.dataRoomAirMod->ZTOC = 23.0; - state.dataRoomAirMod->ZTMX = 23.0; - state.dataRoomAirMod->ZTFloor = 23.0; - state.dataRoomAirMod->HeightTransition = 0.0; - state.dataRoomAirMod->Phi = 0.0; - state.dataRoomAirMod->HCeiling = 0.0; - state.dataRoomAirMod->HWall = 0.0; - state.dataRoomAirMod->HFloor = 0.0; - state.dataRoomAirMod->HInternal = 0.0; - state.dataRoomAirMod->HWindow = 0.0; - state.dataRoomAirMod->HDoor = 0.0; + state.dataRoomAir->MATFloor = 23.0; + state.dataRoomAir->XMATFloor = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->DSXMATFloor = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->MATOC = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->XMATOC = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->DSXMATOC = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->MATMX = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->XMATMX = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->DSXMATMX = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->ZTMFloor = {23.0, 23.0, 23.0}; + state.dataRoomAir->ZTMOC = {23.0, 23.0, 23.0}; + state.dataRoomAir->ZTMMX = {23.0, 23.0, 23.0}; + state.dataRoomAir->Zone1Floor = 23.0; + state.dataRoomAir->ZoneMXFloor = 23.0; + state.dataRoomAir->ZoneM2Floor = 23.0; + state.dataRoomAir->Zone1OC = 23.0; + state.dataRoomAir->ZoneMXOC = 23.0; + state.dataRoomAir->ZoneM2OC = 23.0; + state.dataRoomAir->Zone1MX = 23.0; + state.dataRoomAir->ZoneMXMX = 23.0; + state.dataRoomAir->ZoneM2MX = 23.0; + state.dataRoomAir->AIRRATFloor = 0.0; + state.dataRoomAir->AIRRATOC = 0.0; + state.dataRoomAir->AIRRATMX = 0.0; + state.dataRoomAir->ZTOC = 23.0; + state.dataRoomAir->ZTMX = 23.0; + state.dataRoomAir->ZTFloor = 23.0; + state.dataRoomAir->HeightTransition = 0.0; + state.dataRoomAir->Phi = 0.0; + state.dataRoomAir->HCeiling = 0.0; + state.dataRoomAir->HWall = 0.0; + state.dataRoomAir->HFloor = 0.0; + state.dataRoomAir->HInternal = 0.0; + state.dataRoomAir->HWindow = 0.0; + state.dataRoomAir->HDoor = 0.0; } - if (any(state.dataRoomAirMod->IsZoneDispVent3Node)) { + if (any(state.dataRoomAir->IsZoneDispVent3Node)) { - state.dataRoomAirMod->DispVent3NodeHcIn.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->DispVent3NodeHcIn = 0.0; - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep = 0.0; - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag = 0; + state.dataRoomAir->DispVent3NodeHcIn.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneDispVent3NodeMixedFlag.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->DispVent3NodeHcIn = 0.0; + state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep = 0.0; + state.dataRoomAir->ZoneDispVent3NodeMixedFlag = 0; // Output variables and DV zone flag for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::DispVent3Node) + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::DispVent3Node) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:ThreeNodeDisplacementVentilation' SetupOutputVariable(state, "Room Air Zone Mixed Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTMX(iZone), + state.dataRoomAir->ZTMX(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Occupied Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTOC(iZone), + state.dataRoomAir->ZTOC(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Floor Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTFloor(iZone), + state.dataRoomAir->ZTFloor(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Transition Height", OutputProcessor::Unit::m, - state.dataRoomAirMod->HeightTransition(iZone), + state.dataRoomAir->HeightTransition(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Recommended Minimum Flow Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->FracMinFlow(iZone), + state.dataRoomAir->FracMinFlow(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep(iZone), + state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Average Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->AvgTempGrad(iZone), + state.dataRoomAir->AvgTempGrad(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Maximum Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->MaxTempGrad(iZone), + state.dataRoomAir->MaxTempGrad(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); SetupOutputVariable(state, "Room Air Zone Thermal Comfort Effective Air Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->TCMF(iZone), + state.dataRoomAir->TCMF(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); @@ -2240,23 +2240,23 @@ namespace RoomAir { } // for (iZone) } // if (any(IsZoneDV)) - if (any(state.dataRoomAirMod->IsZoneUI)) { - state.dataRoomAirMod->ZoneUFADMixedFlag.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneUFADMixedFlagRep.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->UFADHcIn.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->ZoneUFADGamma.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneUFADPowInPlumes.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneUFADMixedFlag = 0; - state.dataRoomAirMod->ZoneUFADMixedFlagRep = 0.0; - state.dataRoomAirMod->UFADHcIn = 0.0; - state.dataRoomAirMod->ZoneUFADGamma = 0.0; - state.dataRoomAirMod->ZoneUFADPowInPlumes = 0.0; - state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows = 0.0; + if (any(state.dataRoomAir->IsZoneUI)) { + state.dataRoomAir->ZoneUFADMixedFlag.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneUFADMixedFlagRep.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->UFADHcIn.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->ZoneUFADGamma.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneUFADPowInPlumes.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneUFADPowInPlumesfromWindows.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneUFADMixedFlag = 0; + state.dataRoomAir->ZoneUFADMixedFlagRep = 0.0; + state.dataRoomAir->UFADHcIn = 0.0; + state.dataRoomAir->ZoneUFADGamma = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumes = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumesfromWindows = 0.0; // Output variables and UF zone flag for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UFADInt) + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::UFADInt) continue; // don't set these up if they don't make sense auto &zone = state.dataHeatBal->Zone(iZone); @@ -2264,42 +2264,42 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Mixed Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTMX(iZone), + state.dataRoomAir->ZTMX(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Occupied Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTOC(iZone), + state.dataRoomAir->ZTOC(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Transition Height", OutputProcessor::Unit::m, - state.dataRoomAirMod->HeightTransition(iZone), + state.dataRoomAir->HeightTransition(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFADMixedFlagRep(iZone), + state.dataRoomAir->ZoneUFADMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Average Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->AvgTempGrad(iZone), + state.dataRoomAir->AvgTempGrad(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Effective Comfort Air Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->TCMF(iZone), + state.dataRoomAir->TCMF(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); @@ -2313,74 +2313,74 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Transition Height Gamma Value", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFADGamma(iZone), + state.dataRoomAir->ZoneUFADGamma(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFADPowInPlumes(iZone), + state.dataRoomAir->ZoneUFADPowInPlumes(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Temperature Stratification Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->Phi(iZone), + state.dataRoomAir->Phi(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); // set zone equip pointer in the UCSDUI data structure - state.dataRoomAirMod->ZoneUFADInt(state.dataRoomAirMod->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; + state.dataRoomAir->ZoneUFADInt(state.dataRoomAir->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; } // for (iZone) for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::UFADExt) + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::UFADExt) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:UnderFloorAirDistributionExterior' auto const &zone = state.dataHeatBal->Zone(iZone); SetupOutputVariable(state, "Room Air Zone Mixed Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTMX(iZone), + state.dataRoomAir->ZTMX(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Occupied Subzone Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTOC(iZone), + state.dataRoomAir->ZTOC(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Transition Height", OutputProcessor::Unit::m, - state.dataRoomAirMod->HeightTransition(iZone), + state.dataRoomAir->HeightTransition(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Is Mixed Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFADMixedFlagRep(iZone), + state.dataRoomAir->ZoneUFADMixedFlagRep(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Average Temperature Gradient", OutputProcessor::Unit::K_m, - state.dataRoomAirMod->AvgTempGrad(iZone), + state.dataRoomAir->AvgTempGrad(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Effective Comfort Air Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->TCMF(iZone), + state.dataRoomAir->TCMF(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); @@ -2394,82 +2394,82 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Transition Height Gamma Value", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneUFADGamma(iZone), + state.dataRoomAir->ZoneUFADGamma(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFADPowInPlumes(iZone), + state.dataRoomAir->ZoneUFADPowInPlumes(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Window Plume Heat Transfer Rate", OutputProcessor::Unit::W, - state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows(iZone), + state.dataRoomAir->ZoneUFADPowInPlumesfromWindows(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Temperature Stratification Fraction", OutputProcessor::Unit::None, - state.dataRoomAirMod->Phi(iZone), + state.dataRoomAir->Phi(iZone), OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::State, zone.Name); // set zone equip pointer in the UCSDUE data structure - state.dataRoomAirMod->ZoneUFADExt(state.dataRoomAirMod->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; + state.dataRoomAir->ZoneUFADExt(state.dataRoomAir->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; } } - if (any(state.dataRoomAirMod->IsZoneCrossVent)) { - state.dataRoomAirMod->CrossVentHcIn.allocate(state.dataSurface->TotSurfaces); - state.dataRoomAirMod->ZTJET.allocate(state.dataGlobal->NumOfZones); + if (any(state.dataRoomAir->IsZoneCrossVent)) { + state.dataRoomAir->CrossVentHcIn.allocate(state.dataSurface->TotSurfaces); + state.dataRoomAir->ZTJET.allocate(state.dataGlobal->NumOfZones); // Most ZTJet takes defaults - state.dataRoomAirMod->ZTREC.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->RoomOutflowTemp.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZTREC.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->RoomOutflowTemp.allocate(state.dataGlobal->NumOfZones); // Most ZTREC takes defaults - state.dataRoomAirMod->JetRecAreaRatio.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Urec.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Ujet.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Qrec.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Qtot.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->RecInflowRatio.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Uhc.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Ain.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Tin.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Droom.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Dstar.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneCrossVentIsMixing.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->Rfr.allocate(state.dataGlobal->NumOfZones); - state.dataRoomAirMod->ZoneCrossVentHasREC.allocate(state.dataGlobal->NumOfZones); - - state.dataRoomAirMod->ZTJET = 23.0; - state.dataRoomAirMod->RoomOutflowTemp = 23.0; - state.dataRoomAirMod->ZTREC = 23.0; - state.dataRoomAirMod->CrossVentHcIn = 0.0; - state.dataRoomAirMod->JetRecAreaRatio = 0.2; - state.dataRoomAirMod->Urec = 0.2; - state.dataRoomAirMod->Ujet = 0.2; - state.dataRoomAirMod->Qrec = 0.2; - state.dataRoomAirMod->Uhc = 0.2; - state.dataRoomAirMod->Ain = 1.0; - state.dataRoomAirMod->Tin = 23.0; - state.dataRoomAirMod->Droom = 6.0; - state.dataRoomAirMod->ZoneCrossVentIsMixing = 0.0; - state.dataRoomAirMod->Rfr = 10.0; - state.dataRoomAirMod->ZoneCrossVentHasREC = 1.0; - state.dataRoomAirMod->HCeiling = 0.0; - state.dataRoomAirMod->HWall = 0.0; - state.dataRoomAirMod->HFloor = 0.0; - state.dataRoomAirMod->HInternal = 0.0; - state.dataRoomAirMod->HWindow = 0.0; - state.dataRoomAirMod->HDoor = 0.0; + state.dataRoomAir->JetRecAreaRatio.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Urec.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Ujet.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Qrec.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Qtot.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->RecInflowRatio.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Uhc.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Ain.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Tin.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Droom.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Dstar.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneCrossVentIsMixing.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->Rfr.allocate(state.dataGlobal->NumOfZones); + state.dataRoomAir->ZoneCrossVentHasREC.allocate(state.dataGlobal->NumOfZones); + + state.dataRoomAir->ZTJET = 23.0; + state.dataRoomAir->RoomOutflowTemp = 23.0; + state.dataRoomAir->ZTREC = 23.0; + state.dataRoomAir->CrossVentHcIn = 0.0; + state.dataRoomAir->JetRecAreaRatio = 0.2; + state.dataRoomAir->Urec = 0.2; + state.dataRoomAir->Ujet = 0.2; + state.dataRoomAir->Qrec = 0.2; + state.dataRoomAir->Uhc = 0.2; + state.dataRoomAir->Ain = 1.0; + state.dataRoomAir->Tin = 23.0; + state.dataRoomAir->Droom = 6.0; + state.dataRoomAir->ZoneCrossVentIsMixing = 0.0; + state.dataRoomAir->Rfr = 10.0; + state.dataRoomAir->ZoneCrossVentHasREC = 1.0; + state.dataRoomAir->HCeiling = 0.0; + state.dataRoomAir->HWall = 0.0; + state.dataRoomAir->HFloor = 0.0; + state.dataRoomAir->HInternal = 0.0; + state.dataRoomAir->HWindow = 0.0; + state.dataRoomAir->HDoor = 0.0; for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAirModel::CrossVent) + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::CrossVent) continue; // don't set these up if they don't make sense ZoneEquipConfigNum = ZoneNum; // Where does this ZoneNum come from? @@ -2477,8 +2477,8 @@ namespace RoomAir { auto const &zone = state.dataHeatBal->Zone(iZone); // check whether this zone is a controlled zone or not if (state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).IsControlled) { - state.dataRoomAirMod->IsZoneCrossVent(iZone) = false; - state.dataRoomAirMod->AirModel(iZone).SimAirModel = false; + state.dataRoomAir->IsZoneCrossVent(iZone) = false; + state.dataRoomAir->AirModel(iZone).SimAirModel = false; ShowSevereError(state, format("Unmixed Flow: Cross Ventilation cannot be applied for Zone={}", zone.Name)); ShowContinueError(state, @@ -2489,74 +2489,74 @@ namespace RoomAir { SetupOutputVariable(state, "Room Air Zone Jet Region Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTJET(iZone), + state.dataRoomAir->ZTJET(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, zone.Name); SetupOutputVariable(state, "Room Air Zone Recirculation Region Temperature", OutputProcessor::Unit::C, - state.dataRoomAirMod->ZTREC(iZone), + state.dataRoomAir->ZTREC(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, zone.Name); SetupOutputVariable(state, "Room Air Zone Jet Region Average Air Velocity", OutputProcessor::Unit::m_s, - state.dataRoomAirMod->Ujet(iZone), + state.dataRoomAir->Ujet(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, zone.Name); SetupOutputVariable(state, "Room Air Zone Recirculation Region Average Air Velocity", OutputProcessor::Unit::m_s, - state.dataRoomAirMod->Urec(iZone), + state.dataRoomAir->Urec(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, zone.Name); SetupOutputVariable(state, "Room Air Zone Recirculation and Inflow Rate Ratio", OutputProcessor::Unit::None, - state.dataRoomAirMod->RecInflowRatio(iZone), + state.dataRoomAir->RecInflowRatio(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, zone.Name); SetupOutputVariable(state, "Room Air Zone Inflow Opening Area", OutputProcessor::Unit::m2, - state.dataRoomAirMod->Ain(iZone), + state.dataRoomAir->Ain(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, zone.Name); SetupOutputVariable(state, "Room Air Zone Room Length", OutputProcessor::Unit::m, - state.dataRoomAirMod->Dstar(iZone), + state.dataRoomAir->Dstar(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, zone.Name); SetupOutputVariable(state, "Room Air Zone Is Mixing Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneCrossVentIsMixing(iZone), + state.dataRoomAir->ZoneCrossVentIsMixing(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::State, zone.Name); SetupOutputVariable(state, "Room Air Zone Is Recirculating Status", OutputProcessor::Unit::None, - state.dataRoomAirMod->ZoneCrossVentHasREC(iZone), + state.dataRoomAir->ZoneCrossVentHasREC(iZone), OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::State, zone.Name); - for (int i = 1; i <= state.dataRoomAirMod->AFNSurfaceCrossVent(0, ZoneNum); ++i) { + for (int i = 1; i <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++i) { int N = state.afn->AirflowNetworkLinkageData(i).CompNum; if (state.afn->AirflowNetworkCompData(N).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) { SetupOutputVariable( state, "Room Air Window Jet Region Average Air Velocity", OutputProcessor::Unit::m_s, - state.dataRoomAirMod->CrossVentJetRecFlows(i, iZone).Ujet, + state.dataRoomAir->CrossVentJetRecFlows(i, iZone).Ujet, OutputProcessor::SOVTimeStepType::Zone, OutputProcessor::SOVStoreType::Average, state.afn->MultizoneSurfaceData(i).SurfName); @@ -2565,104 +2565,104 @@ namespace RoomAir { } // for (iZone) } // if (any(isZoneCV)) - state.dataRoomAirModelMgr->MyEnvrnFlag = true; + state.dataRoomAir->MyEnvrnFlag = true; - state.dataRoomAirModelMgr->MyOneTimeFlag = false; + state.dataRoomAir->MyOneTimeFlag = false; } // if (myOneTimeFlag) // Do the Begin Environment initializations - if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirModelMgr->MyEnvrnFlag(ZoneNum)) { - - if (state.dataRoomAirMod->IsZoneDispVent3Node(ZoneNum) || state.dataRoomAirMod->IsZoneUI(ZoneNum)) { - - state.dataRoomAirMod->MaxTempGrad(ZoneNum) = 0.0; - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; - state.dataRoomAirMod->TCMF(ZoneNum) = 23.0; - state.dataRoomAirMod->FracMinFlow(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneAirSystemON(ZoneNum) = false; - state.dataRoomAirMod->MATFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->XMATFloor(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->DSXMATFloor(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->MATOC(ZoneNum) = 23.0; - state.dataRoomAirMod->XMATOC(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->DSXMATOC(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->MATMX(ZoneNum) = 23.0; - state.dataRoomAirMod->XMATMX(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->DSXMATMX(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAirMod->ZTMFloor(ZoneNum) = {23.0, 23.0, 23.0}; - state.dataRoomAirMod->Zone1Floor(ZoneNum) = 23.0; - state.dataRoomAirMod->ZoneMXFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->ZoneM2Floor(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTMOC(ZoneNum) = {23.0, 23.0, 23.0}; - state.dataRoomAirMod->Zone1OC(ZoneNum) = 23.0; - state.dataRoomAirMod->ZoneMXOC(ZoneNum) = 23.0; - state.dataRoomAirMod->ZoneM2OC(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTMMX(ZoneNum) = {23.0, 23.0, 23.0}; - state.dataRoomAirMod->Zone1MX(ZoneNum) = 23.0; - state.dataRoomAirMod->ZoneMXMX(ZoneNum) = 23.0; - state.dataRoomAirMod->ZoneM2MX(ZoneNum) = 23.0; - state.dataRoomAirMod->AIRRATFloor(ZoneNum) = 0.0; - state.dataRoomAirMod->AIRRATOC(ZoneNum) = 0.0; - state.dataRoomAirMod->AIRRATMX(ZoneNum) = 0.0; - state.dataRoomAirMod->ZTOC(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTMX(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTFloor(ZoneNum) = 23.0; - state.dataRoomAirMod->HeightTransition(ZoneNum) = 0.0; - state.dataRoomAirMod->Phi(ZoneNum) = 0.0; - state.dataRoomAirMod->HCeiling = 0.0; - state.dataRoomAirMod->HWall = 0.0; - state.dataRoomAirMod->HFloor = 0.0; - state.dataRoomAirMod->HInternal = 0.0; - state.dataRoomAirMod->HWindow = 0.0; - state.dataRoomAirMod->HDoor = 0.0; + if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAir->MyEnvrnFlag(ZoneNum)) { + + if (state.dataRoomAir->IsZoneDispVent3Node(ZoneNum) || state.dataRoomAir->IsZoneUI(ZoneNum)) { + + state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->TCMF(ZoneNum) = 23.0; + state.dataRoomAir->FracMinFlow(ZoneNum) = 0.0; + state.dataRoomAir->ZoneAirSystemON(ZoneNum) = false; + state.dataRoomAir->MATFloor(ZoneNum) = 23.0; + state.dataRoomAir->XMATFloor(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->DSXMATFloor(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->MATOC(ZoneNum) = 23.0; + state.dataRoomAir->XMATOC(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->DSXMATOC(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->MATMX(ZoneNum) = 23.0; + state.dataRoomAir->XMATMX(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->DSXMATMX(ZoneNum) = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->ZTMFloor(ZoneNum) = {23.0, 23.0, 23.0}; + state.dataRoomAir->Zone1Floor(ZoneNum) = 23.0; + state.dataRoomAir->ZoneMXFloor(ZoneNum) = 23.0; + state.dataRoomAir->ZoneM2Floor(ZoneNum) = 23.0; + state.dataRoomAir->ZTMOC(ZoneNum) = {23.0, 23.0, 23.0}; + state.dataRoomAir->Zone1OC(ZoneNum) = 23.0; + state.dataRoomAir->ZoneMXOC(ZoneNum) = 23.0; + state.dataRoomAir->ZoneM2OC(ZoneNum) = 23.0; + state.dataRoomAir->ZTMMX(ZoneNum) = {23.0, 23.0, 23.0}; + state.dataRoomAir->Zone1MX(ZoneNum) = 23.0; + state.dataRoomAir->ZoneMXMX(ZoneNum) = 23.0; + state.dataRoomAir->ZoneM2MX(ZoneNum) = 23.0; + state.dataRoomAir->AIRRATFloor(ZoneNum) = 0.0; + state.dataRoomAir->AIRRATOC(ZoneNum) = 0.0; + state.dataRoomAir->AIRRATMX(ZoneNum) = 0.0; + state.dataRoomAir->ZTOC(ZoneNum) = 23.0; + state.dataRoomAir->ZTMX(ZoneNum) = 23.0; + state.dataRoomAir->ZTFloor(ZoneNum) = 23.0; + state.dataRoomAir->HeightTransition(ZoneNum) = 0.0; + state.dataRoomAir->Phi(ZoneNum) = 0.0; + state.dataRoomAir->HCeiling = 0.0; + state.dataRoomAir->HWall = 0.0; + state.dataRoomAir->HFloor = 0.0; + state.dataRoomAir->HInternal = 0.0; + state.dataRoomAir->HWindow = 0.0; + state.dataRoomAir->HDoor = 0.0; } - if (state.dataRoomAirMod->IsZoneDispVent3Node(ZoneNum)) { + if (state.dataRoomAir->IsZoneDispVent3Node(ZoneNum)) { - state.dataRoomAirMod->DispVent3NodeHcIn = 0.0; - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; + state.dataRoomAir->DispVent3NodeHcIn = 0.0; + state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAir->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; } - if (state.dataRoomAirMod->IsZoneUI(ZoneNum)) { + if (state.dataRoomAir->IsZoneUI(ZoneNum)) { - state.dataRoomAirMod->UFADHcIn = 0.0; - state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 0; - state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows(ZoneNum) = 0.0; + state.dataRoomAir->UFADHcIn = 0.0; + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 0; + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumesfromWindows(ZoneNum) = 0.0; } - if (state.dataRoomAirMod->IsZoneCrossVent(ZoneNum)) { - state.dataRoomAirMod->ZTJET(ZoneNum) = 23.0; - state.dataRoomAirMod->RoomOutflowTemp(ZoneNum) = 23.0; - state.dataRoomAirMod->ZTREC(ZoneNum) = 23.0; - state.dataRoomAirMod->CrossVentHcIn = 0.0; - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) = 0.2; - state.dataRoomAirMod->Urec(ZoneNum) = 0.2; - state.dataRoomAirMod->Ujet(ZoneNum) = 0.2; - state.dataRoomAirMod->Uhc(ZoneNum) = 0.2; - state.dataRoomAirMod->Ain(ZoneNum) = 1.0; - state.dataRoomAirMod->Tin(ZoneNum) = 23.0; - state.dataRoomAirMod->Droom(ZoneNum) = 6.0; - state.dataRoomAirMod->Dstar(ZoneNum) = 6.0; - state.dataRoomAirMod->ZoneCrossVentIsMixing(ZoneNum) = 0.0; - state.dataRoomAirMod->Rfr(ZoneNum) = 10.0; - state.dataRoomAirMod->ZoneCrossVentHasREC(ZoneNum) = 1.0; - state.dataRoomAirMod->HCeiling = 0.0; - state.dataRoomAirMod->HWall = 0.0; - state.dataRoomAirMod->HFloor = 0.0; - state.dataRoomAirMod->HInternal = 0.0; - state.dataRoomAirMod->HWindow = 0.0; - state.dataRoomAirMod->HDoor = 0.0; + if (state.dataRoomAir->IsZoneCrossVent(ZoneNum)) { + state.dataRoomAir->ZTJET(ZoneNum) = 23.0; + state.dataRoomAir->RoomOutflowTemp(ZoneNum) = 23.0; + state.dataRoomAir->ZTREC(ZoneNum) = 23.0; + state.dataRoomAir->CrossVentHcIn = 0.0; + state.dataRoomAir->JetRecAreaRatio(ZoneNum) = 0.2; + state.dataRoomAir->Urec(ZoneNum) = 0.2; + state.dataRoomAir->Ujet(ZoneNum) = 0.2; + state.dataRoomAir->Uhc(ZoneNum) = 0.2; + state.dataRoomAir->Ain(ZoneNum) = 1.0; + state.dataRoomAir->Tin(ZoneNum) = 23.0; + state.dataRoomAir->Droom(ZoneNum) = 6.0; + state.dataRoomAir->Dstar(ZoneNum) = 6.0; + state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 0.0; + state.dataRoomAir->Rfr(ZoneNum) = 10.0; + state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 1.0; + state.dataRoomAir->HCeiling = 0.0; + state.dataRoomAir->HWall = 0.0; + state.dataRoomAir->HFloor = 0.0; + state.dataRoomAir->HInternal = 0.0; + state.dataRoomAir->HWindow = 0.0; + state.dataRoomAir->HDoor = 0.0; } - state.dataRoomAirModelMgr->MyEnvrnFlag(ZoneNum) = false; + state.dataRoomAir->MyEnvrnFlag(ZoneNum) = false; } // end one time inits if (!state.dataGlobal->BeginEnvrnFlag) { - state.dataRoomAirModelMgr->MyEnvrnFlag(ZoneNum) = true; + state.dataRoomAir->MyEnvrnFlag(ZoneNum) = true; } } @@ -2684,15 +2684,15 @@ namespace RoomAir { // as zero. // Obtains and Allocates RoomAirSettings : AirflowNetwork - if (state.dataRoomAirModelMgr->GetAirModelData) { + if (state.dataRoomAir->GetAirModelData) { GetAirModelDatas(state); - state.dataRoomAirModelMgr->GetAirModelData = false; + state.dataRoomAir->GetAirModelData = false; } Errorfound = false; RAFNNodeNum = 0; for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { - auto const &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(I); + auto const &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(I); if (afnZoneInfo.NumOfAirNodes > 0) { RAFNNodeNum = UtilityRoutines::FindItemInList(RAFNNodeName, afnZoneInfo.Node, afnZoneInfo.NumOfAirNodes); if (RAFNNodeNum > 0) { diff --git a/src/EnergyPlus/RoomAirModelManager.hh b/src/EnergyPlus/RoomAirModelManager.hh index c0bfe2fcd06..d7dc0182c03 100644 --- a/src/EnergyPlus/RoomAirModelManager.hh +++ b/src/EnergyPlus/RoomAirModelManager.hh @@ -94,20 +94,6 @@ namespace RoomAir { } // namespace RoomAir -struct RoomAirModelManagerData : BaseGlobalStruct -{ - - bool GetUCSDDVDataFlag = true; // UCSD - bool GetAirModelData = true; // Used to "get" all air model data - bool MyOneTimeFlag = true; - Array1D_bool MyEnvrnFlag; - - void clear_state() override - { - new (this) RoomAirModelManagerData(); - } -}; - } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index 3ac96986554..ec8fb812f8e 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -108,9 +108,6 @@ void ManageUserDefinedPatterns(EnergyPlusData &state, int const ZoneNum) // inde // PURPOSE OF THIS SUBROUTINE: // manage the user-defined air temp. distribution model - // METHODOLOGY EMPLOYED: - // calls subroutines - // transfer data from surface domain to air domain for the specified zone InitTempDistModel(state, ZoneNum); @@ -131,24 +128,21 @@ void InitTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number // SUBROUTINE INFORMATION: // AUTHOR // DATE WRITTEN - // MODIFIED na - // RE-ENGINEERED na - - int SurfNum; // do loop counter if (state.dataRoomAirModelTempPattern->MyOneTimeFlag) { state.dataRoomAirModelTempPattern->MyEnvrnFlag.dimension(state.dataGlobal->NumOfZones, true); state.dataRoomAirModelTempPattern->MyOneTimeFlag = false; } + auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirModelTempPattern->MyEnvrnFlag(ZoneNum)) { - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean = 23.0; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tstat = 23.0; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving = 23.0; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Texhaust = 23.0; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Gradient = 0.0; - for (SurfNum = 1; SurfNum <= state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).totNumSurfs; ++SurfNum) { - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(SurfNum).TadjacentAir = 23.0; + patternZoneInfo.TairMean = 23.0; + patternZoneInfo.Tstat = 23.0; + patternZoneInfo.Tleaving = 23.0; + patternZoneInfo.Texhaust = 23.0; + patternZoneInfo.Gradient = 0.0; + for (int SurfNum = 1; SurfNum <= patternZoneInfo.totNumSurfs; ++SurfNum) { + patternZoneInfo.Surf(SurfNum).TadjacentAir = 23.0; } state.dataRoomAirModelTempPattern->MyEnvrnFlag(ZoneNum) = false; } @@ -156,7 +150,7 @@ void InitTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number if (!state.dataGlobal->BeginEnvrnFlag) state.dataRoomAirModelTempPattern->MyEnvrnFlag(ZoneNum) = true; // init report variable - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Gradient = 0.0; + patternZoneInfo.Gradient = 0.0; } void GetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone @@ -165,8 +159,6 @@ void GetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // // SUBROUTINE INFORMATION: // AUTHOR B. Griffith // DATE WRITTEN August 2005 - // MODIFIED - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // map data from Heat Balance domain to Room Air Modeling Domain @@ -176,18 +168,17 @@ void GetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // // METHODOLOGY EMPLOYED: // use ZT from DataHeatBalFanSys - // Using/Aliasing - + auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); + auto const &zoneHeatBal = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); // intialize in preperation for calculations - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tstat = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Texhaust = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; - for (auto &e : state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf) - e.TadjacentAir = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; + patternZoneInfo.Tstat = zoneHeatBal.MAT; + patternZoneInfo.Tleaving = zoneHeatBal.MAT; + patternZoneInfo.Texhaust = zoneHeatBal.MAT; + for (auto &e : patternZoneInfo.Surf) + e.TadjacentAir = zoneHeatBal.MAT; // the only input this method needs is the zone MAT or ZT or ZTAV ? (original was ZT) - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean = - state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT; // this is lagged from previous corrector result + patternZoneInfo.TairMean = zoneHeatBal.MAT; // this is lagged from previous corrector result } //***************************************************************************************** @@ -209,31 +200,26 @@ void CalcTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number using General::FindNumberInList; using ScheduleManager::GetCurrentScheduleValue; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // unused INTEGER :: thisZoneInfo - Real64 AvailTest; - int CurntPatternKey; - int CurPatrnID; - + auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); // first determine availability - AvailTest = GetCurrentScheduleValue(state, state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).AvailSchedID); + Real64 AvailTest = GetCurrentScheduleValue(state, patternZoneInfo.AvailSchedID); - if ((AvailTest != 1.0) || (!state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).IsUsed)) { + if ((AvailTest != 1.0) || (!patternZoneInfo.IsUsed)) { // model not to be used. Use complete mixing method - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tstat = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean; - state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Texhaust = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean; - for (auto &e : state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf) - e.TadjacentAir = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).TairMean; + patternZoneInfo.Tstat = patternZoneInfo.TairMean; + patternZoneInfo.Tleaving = patternZoneInfo.TairMean; + patternZoneInfo.Texhaust = patternZoneInfo.TairMean; + for (auto &e : patternZoneInfo.Surf) + e.TadjacentAir = patternZoneInfo.TairMean; return; } else { // choose pattern and call subroutine - CurntPatternKey = GetCurrentScheduleValue(state, state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).PatternSchedID); + int CurntPatternKey = GetCurrentScheduleValue(state, patternZoneInfo.PatternSchedID); - CurPatrnID = FindNumberInList(CurntPatternKey, state.dataRoomAirMod->AirPattern, &TemperaturePattern::PatrnID); + int CurPatrnID = FindNumberInList(CurntPatternKey, state.dataRoomAir->AirPattern, &TemperaturePattern::PatrnID); if (CurPatrnID == 0) { // throw error here ? way to test schedules before getting to this point? @@ -241,7 +227,7 @@ void CalcTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number return; } - switch (state.dataRoomAirMod->AirPattern(CurPatrnID).PatternMode) { + switch (state.dataRoomAir->AirPattern(CurPatrnID).PatternMode) { case UserDefinedPatternType::ConstGradTemp: { FigureConstGradPattern(state, CurPatrnID, ZoneNum); } break; @@ -251,13 +237,12 @@ void CalcTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number case UserDefinedPatternType::NonDimenHeight: { FigureHeightPattern(state, CurPatrnID, ZoneNum); } break; - case UserDefinedPatternType::SurfMapTemp: + case UserDefinedPatternType::SurfMapTemp: { FigureSurfMapPattern(state, CurPatrnID, ZoneNum); - break; + } break; default: { - // should not come here - break; - } + assert(false); + } break; } } // availability control construct } @@ -282,8 +267,8 @@ void FigureSurfMapPattern(EnergyPlusData &state, int const PattrnID, int const Z // Using/Aliasing using General::FindNumberInList; - auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); - auto &pattern = state.dataRoomAirMod->AirPattern(PattrnID); + auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); + auto &pattern = state.dataRoomAir->AirPattern(PattrnID); Real64 Tmean = patternZoneInfo.TairMean; for (int i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { @@ -307,8 +292,6 @@ void FigureHeightPattern(EnergyPlusData &state, int const PattrnID, int const Zo // SUBROUTINE INFORMATION: // AUTHOR B Griffith // DATE WRITTEN August 2005 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculate the pattern for non-dimensional vertical profile @@ -320,33 +303,24 @@ void FigureHeightPattern(EnergyPlusData &state, int const PattrnID, int const Zo using FluidProperties::FindArrayIndex; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int lowSideID; - int highSideID; - Real64 thisZeta; - Real64 lowSideZeta; - Real64 hiSideZeta; - Real64 fractBtwn; - - auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); - auto &pattern = state.dataRoomAirMod->AirPattern(PattrnID); + + auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); + auto &pattern = state.dataRoomAir->AirPattern(PattrnID); Real64 tmpDeltaTai = 0.0; Real64 Tmean = patternZoneInfo.TairMean; for (int i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { - thisZeta = patternZoneInfo.Surf(i).Zeta; - lowSideID = FindArrayIndex(thisZeta, pattern.VertPatrn.ZetaPatrn); - highSideID = lowSideID + 1; + Real64 zeta = patternZoneInfo.Surf(i).Zeta; + int lowSideID = FindArrayIndex(zeta, pattern.VertPatrn.ZetaPatrn); + int highSideID = lowSideID + 1; if (lowSideID == 0) lowSideID = 1; // protect against array bounds - lowSideZeta = pattern.VertPatrn.ZetaPatrn(lowSideID); - if (highSideID <= isize(pattern.VertPatrn.ZetaPatrn)) { - hiSideZeta = pattern.VertPatrn.ZetaPatrn(highSideID); - } else { // trap array bounds - hiSideZeta = lowSideZeta; - } + Real64 lowSideZeta = pattern.VertPatrn.ZetaPatrn(lowSideID); + Real64 hiSideZeta = (highSideID <= isize(pattern.VertPatrn.ZetaPatrn)) ? pattern.VertPatrn.ZetaPatrn(highSideID) : lowSideZeta; + if ((hiSideZeta - lowSideZeta) != 0.0) { - fractBtwn = (thisZeta - lowSideZeta) / (hiSideZeta - lowSideZeta); + Real64 fractBtwn = (zeta - lowSideZeta) / (hiSideZeta - lowSideZeta); tmpDeltaTai = pattern.VertPatrn.DeltaTaiPatrn(lowSideID) + fractBtwn * (pattern.VertPatrn.DeltaTaiPatrn(highSideID) - pattern.VertPatrn.DeltaTaiPatrn(lowSideID)); @@ -370,8 +344,6 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c // SUBROUTINE INFORMATION: // AUTHOR B Griffith // DATE WRITTEN Aug 2005 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculate two gradient interpolation pattern @@ -381,22 +353,11 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c // based on user selected mode. // calculations vary by mode - // Using/Aliasing - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 Tmean; // MAT deg C Real64 Grad; // vertical temperature gradient C/m - Real64 DeltaT; // temperature difference - Real64 CoolLoad; // sensible cooling load - Real64 HeatLoad; // sensible heating load - Real64 ZetaTmean; // non-dimensional height for mean air temp - int i; // do loop index - Real64 thisZeta; // non-dimensional height - Real64 DeltaHeight; // height difference in m - Real64 tempDeltaTai; // temporary temperature difference - - auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); - auto &pattern = state.dataRoomAirMod->AirPattern(PattrnID); + + auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); + auto &pattern = state.dataRoomAir->AirPattern(PattrnID); if (state.dataRoomAirModelTempPattern->MyOneTimeFlag2) { state.dataRoomAirModelTempPattern->SetupOutputFlag.dimension(state.dataGlobal->NumOfZones, true); // init @@ -415,7 +376,7 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c state.dataRoomAirModelTempPattern->SetupOutputFlag(ZoneNum) = false; } - Tmean = patternZoneInfo.TairMean; + Real64 Tmean = patternZoneInfo.TairMean; auto const &twoGrad = pattern.TwoGradPatrn; // determine gradient depending on mode @@ -427,7 +388,6 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c case UserDefinedPatternMode::ZoneAirTemp: { if (Tmean >= twoGrad.UpperBoundTempScale) { Grad = twoGrad.HiGradient; - } else if (Tmean <= twoGrad.LowerBoundTempScale) { Grad = twoGrad.LowGradient; } else if ((twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale) == 0.0) { @@ -440,26 +400,21 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c } } break; case UserDefinedPatternMode::DeltaOutdoorZone: { - DeltaT = state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp - Tmean; + Real64 DeltaT = state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp - Tmean; if (DeltaT >= twoGrad.UpperBoundTempScale) { Grad = twoGrad.HiGradient; - } else if (DeltaT <= twoGrad.LowerBoundTempScale) { - Grad = twoGrad.LowGradient; - } else { // interpolate - if ((twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale) == 0.0) { - // bad user input, trapped during get input - Grad = twoGrad.LowGradient; - } else { - Grad = twoGrad.LowGradient + - ((DeltaT - twoGrad.LowerBoundTempScale) / (twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale)) * - (twoGrad.HiGradient - twoGrad.LowGradient); - } + } else if ((twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale) == 0.0) { + Grad = twoGrad.LowGradient; + } else { + Grad = twoGrad.LowGradient + + ((DeltaT - twoGrad.LowerBoundTempScale) / (twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } break; case UserDefinedPatternMode::SensibleCooling: { - CoolLoad = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadCoolRate; + Real64 CoolLoad = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadCoolRate; if (CoolLoad >= twoGrad.UpperBoundHeatRateScale) { Grad = twoGrad.HiGradient; @@ -478,38 +433,29 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c } } break; case UserDefinedPatternMode::SensibleHeating: { - HeatLoad = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadHeatRate; + Real64 HeatLoad = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNum).ZoneSNLoadHeatRate; if (HeatLoad >= twoGrad.UpperBoundHeatRateScale) { Grad = twoGrad.HiGradient; - } else if (HeatLoad <= twoGrad.LowerBoundHeatRateScale) { - Grad = twoGrad.LowGradient; - } else { // interpolate - if ((twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale) == 0.0) { - Grad = twoGrad.LowGradient; - } else { - - Grad = twoGrad.LowGradient + - ((HeatLoad - twoGrad.LowerBoundHeatRateScale) / (twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale)) * - (twoGrad.HiGradient - twoGrad.LowGradient); - } + } else if ((twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale) == 0.0) { + Grad = twoGrad.LowGradient; + } else { + Grad = twoGrad.LowGradient + + ((HeatLoad - twoGrad.LowerBoundHeatRateScale) / (twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } break; default: break; } - ZetaTmean = 0.5; // by definition, - - for (i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { - thisZeta = patternZoneInfo.Surf(i).Zeta; + Real64 ZetaTmean = 0.5; // by definition, - DeltaHeight = -1.0 * (ZetaTmean - thisZeta) * patternZoneInfo.ZoneHeight; - - tempDeltaTai = DeltaHeight * Grad; - - patternZoneInfo.Surf(i).TadjacentAir = tempDeltaTai + Tmean; + for (int i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { + Real64 zeta = patternZoneInfo.Surf(i).Zeta; + Real64 DeltaHeight = -1.0 * (ZetaTmean - zeta) * patternZoneInfo.ZoneHeight; + patternZoneInfo.Surf(i).TadjacentAir = (DeltaHeight * Grad) + Tmean; } patternZoneInfo.Tstat = -1.0 * (0.5 * patternZoneInfo.ZoneHeight - twoGrad.TstatHeight) * Grad + Tmean; @@ -525,24 +471,15 @@ Real64 OutdoorDryBulbGrad(Real64 DryBulbTemp, // Zone(ZoneNum).OutDryBulbTemp Real64 LowGradient // RoomAirPattern(PattrnID).TwoGradPatrn.LowGradient ) { - Real64 Grad; if (DryBulbTemp >= UpperBound) { - Grad = HiGradient; - + return HiGradient; } else if (DryBulbTemp <= LowerBound) { - - Grad = LowGradient; - } else { // interpolate - - if ((UpperBound - LowerBound) == 0.0) { - // bad user input. should be trapped during get input in RoomAirManager.cc - Grad = LowGradient; - } else { - - Grad = LowGradient + ((DryBulbTemp - LowerBound) / (UpperBound - LowerBound)) * (HiGradient - LowGradient); - } + return LowGradient; + } else if ((UpperBound - LowerBound) == 0.0) { + return LowGradient; + } else { + return LowGradient + ((DryBulbTemp - LowerBound) / (UpperBound - LowerBound)) * (HiGradient - LowGradient); } - return Grad; } void FigureConstGradPattern(EnergyPlusData &state, int const PattrnID, int const ZoneNum) @@ -551,29 +488,18 @@ void FigureConstGradPattern(EnergyPlusData &state, int const PattrnID, int const // SUBROUTINE INFORMATION: // AUTHOR B. Griffith // DATE WRITTEN August 2005 - // MODIFIED na - // RE-ENGINEERED na - Real64 Tmean; // MAT - int i; // loop counter - Real64 Grad; // vertical temperature gradient - Real64 ZetaTmean; // non-dimens. height for MAT, 0.5 - Real64 thisZeta; // temporary non-dimens height - Real64 DeltaHeight; // temporary height difference - Real64 tempDeltaTai; // temporary Delta Tai - - auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); - auto &pattern = state.dataRoomAirMod->AirPattern(PattrnID); - Tmean = patternZoneInfo.TairMean; - Grad = pattern.GradPatrn.Gradient; - - ZetaTmean = 0.5; // by definition, - - for (i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { - thisZeta = patternZoneInfo.Surf(i).Zeta; - DeltaHeight = -1.0 * (ZetaTmean - thisZeta) * patternZoneInfo.ZoneHeight; - tempDeltaTai = DeltaHeight * Grad; - patternZoneInfo.Surf(i).TadjacentAir = tempDeltaTai + Tmean; + auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); + auto &pattern = state.dataRoomAir->AirPattern(PattrnID); + Real64 Tmean = patternZoneInfo.TairMean; // MAT + Real64 Grad = pattern.GradPatrn.Gradient; // Vertical temperature gradient + + Real64 ZetaTmean = 0.5; // non-dimensional height for MAT + + for (int i = 1; i <= patternZoneInfo.totNumSurfs; ++i) { + Real64 zeta = patternZoneInfo.Surf(i).Zeta; + Real64 DeltaHeight = -1.0 * (ZetaTmean - zeta) * patternZoneInfo.ZoneHeight; + patternZoneInfo.Surf(i).TadjacentAir = DeltaHeight * Grad + Tmean; } patternZoneInfo.Tstat = pattern.DeltaTstat + Tmean; @@ -588,8 +514,6 @@ Real64 FigureNDheightInZone(EnergyPlusData &state, int const thisHBsurf) // inde // FUNCTION INFORMATION: // AUTHOR B.Griffith // DATE WRITTEN aug 2005, Jan2004 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // return a non-dimensional height zeta @@ -599,83 +523,59 @@ Real64 FigureNDheightInZone(EnergyPlusData &state, int const thisHBsurf) // inde // use ceiling height from Zone structure // non dimensionalize surface's centroid's Z value - // Using/Aliasing - using DataVectorTypes::Vector; - - // Return value - Real64 FigureNDheightInZone; - // FUNCTION PARAMETER DEFINITIONS: Real64 constexpr TolValue(0.0001); - // FUNCTION LOCAL VARIABLE DECLARATIONS: - int thisZone; - Real64 ZoneZorig; - Real64 ZoneCeilHeight; - Real64 Zcm; - Real64 SurfMinZ; - Real64 SurfMaxZ; - Real64 Zeta; - Real64 FloorCount; - Real64 ZFlrAvg; - Real64 ZMax; - Real64 ZMin; - int Count; - Real64 Z1; - Real64 Z2; - // Get the centroid height for the surface - Zcm = state.dataSurface->Surface(thisHBsurf).Centroid.z; - thisZone = state.dataSurface->Surface(thisHBsurf).Zone; + Real64 Zcm = state.dataSurface->Surface(thisHBsurf).Centroid.z; + auto &zone = state.dataHeatBal->Zone(state.dataSurface->Surface(thisHBsurf).Zone); // this next Do block is copied from SurfaceGeometry.cc with modification for just floor Z // used find floor z. - FloorCount = 0.0; - ZFlrAvg = 0.0; - ZMax = 0.0; - ZMin = 0.0; - Count = 0; - for (int spaceNum : state.dataHeatBal->Zone(thisZone).spaceIndexes) { + int FloorCount = 0; + Real64 ZFlrAvg = 0.0; + Real64 ZMax = 0.0; + Real64 ZMin = 0.0; + int Count = 0; + for (int spaceNum : zone.spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { - if (state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::Floor) { + auto const &surf = state.dataSurface->Surface(SurfNum); + if (surf.Class == DataSurfaces::SurfaceClass::Floor) { // Use Average Z for surface, more important for roofs than floors... ++FloorCount; - Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); - Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z); + Real64 Z1 = minval(surf.Vertex, &Vector3::z); + Real64 Z2 = maxval(surf.Vertex, &Vector3::z); ZFlrAvg += (Z1 + Z2) / 2.0; - } - if (state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::Wall) { + } else if (surf.Class == DataSurfaces::SurfaceClass::Wall) { // Use Wall calculation in case no floor in zone ++Count; if (Count == 1) { - ZMax = state.dataSurface->Surface(SurfNum).Vertex(1).z; + ZMax = surf.Vertex(1).z; ZMin = ZMax; } - ZMax = max(ZMax, maxval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z)); - ZMin = min(ZMin, minval(state.dataSurface->Surface(SurfNum).Vertex, &Vector::z)); + ZMax = max(ZMax, maxval(surf.Vertex, &Vector3::z)); + ZMin = min(ZMin, minval(surf.Vertex, &Vector3::z)); } } } - if (FloorCount > 0.0) { - ZFlrAvg /= FloorCount; - } else { - ZFlrAvg = ZMin; - } - ZoneZorig = ZFlrAvg; // Z floor [M] - ZoneCeilHeight = state.dataHeatBal->Zone(thisZone).CeilingHeight; + + ZFlrAvg = (FloorCount > 0.0) ? (ZFlrAvg / FloorCount) : ZMin; + + Real64 ZoneZorig = ZFlrAvg; // Z floor [M] + Real64 ZoneCeilHeight = zone.CeilingHeight; // first check if some basic things are reasonable - SurfMinZ = minval(state.dataSurface->Surface(thisHBsurf).Vertex, &Vector::z); - SurfMaxZ = maxval(state.dataSurface->Surface(thisHBsurf).Vertex, &Vector::z); + Real64 SurfMinZ = minval(state.dataSurface->Surface(thisHBsurf).Vertex, &Vector3::z); + Real64 SurfMaxZ = maxval(state.dataSurface->Surface(thisHBsurf).Vertex, &Vector3::z); if (SurfMinZ < (ZoneZorig - TolValue)) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "RoomAirModelUserTempPattern: Problem in non-dimensional height calculation"); ShowContinueError( state, - format("too low surface: {} in zone: {}", state.dataSurface->Surface(thisHBsurf).Name, state.dataHeatBal->Zone(thisZone).Name)); + format("too low surface: {} in zone: {}", state.dataSurface->Surface(thisHBsurf).Name, zone.Name)); ShowContinueError(state, format("**** Average floor height of zone is: {:.3R}", ZoneZorig)); ShowContinueError(state, format("**** Surface minimum height is: {:.3R}", SurfMinZ)); } else { @@ -688,7 +588,7 @@ Real64 FigureNDheightInZone(EnergyPlusData &state, int const thisHBsurf) // inde ShowWarningError(state, "RoomAirModelUserTempPattern: Problem in non-dimensional height calculation"); ShowContinueError( state, - format(" too high surface: {} in zone: {}", state.dataSurface->Surface(thisHBsurf).Name, state.dataHeatBal->Zone(thisZone).Name)); + format(" too high surface: {} in zone: {}", state.dataSurface->Surface(thisHBsurf).Name, zone.Name)); ShowContinueError(state, format("**** Average Ceiling height of zone is: {:.3R}", (ZoneZorig + ZoneCeilHeight))); ShowContinueError(state, format("**** Surface Maximum height is: {:.3R}", SurfMaxZ)); } else { @@ -697,16 +597,11 @@ Real64 FigureNDheightInZone(EnergyPlusData &state, int const thisHBsurf) // inde } // non dimensionalize. - Zeta = (Zcm - ZoneZorig) / ZoneCeilHeight; - // bound so that floors and ceiling are just in from endpoints. - + Real64 Zeta = (Zcm - ZoneZorig) / ZoneCeilHeight; if (Zeta > 0.99) Zeta = 0.99; + else if (Zeta < 0.01) Zeta = 0.01; - if (Zeta < 0.01) Zeta = 0.01; - - FigureNDheightInZone = Zeta; - - return FigureNDheightInZone; + return Zeta; } //*************************************************** @@ -717,8 +612,6 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // // SUBROUTINE INFORMATION: // AUTHOR Brent Griffith // DATE WRITTEN August 2005,Feb. 2004 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // map data from air domain back to surface domain for each zone @@ -736,70 +629,59 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // using Psychrometrics::PsyHgAirFnWTdb; using Psychrometrics::PsyRhoAirFnPbTdbW; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 QRetAir; // Heat to return air from lights - Real64 CpAir; // Air heat capacity [J/kg-K] - Real64 TempRetAir; // Return air temperature [C] - Real64 TempZoneAir; // Zone air temperature [C] - int ZoneNode; // Node number of controlled zone - Real64 MassFlowRA; // Return air mass flow [kg/s] - Real64 FlowThisTS; // Window gap air mass flow [kg/s] - Real64 WinGapFlowToRA; // Mass flow to return air from all airflow windows in zone [kg/s] - Real64 WinGapFlowTtoRA; // Sum of mass flow times outlet temp for all airflow windows in zone [(kg/s)-C] - Real64 WinGapTtoRA; // Temp of outlet flow mixture to return air from all airflow windows in zone [C] - Real64 H2OHtOfVap; // Heat of vaporization of water (W/kg) - Real64 RhoAir; // Density of air (Kg/m3) - Real64 ZoneMult; - Real64 SumRetAirLatentGainRate; - // set air system leaving node conditions // this is not so easy. THis task is normally done in CalcZoneLeavingConditions // but efforts to do this update there were not successful. // Need to revisit how to best implement this. Ended up taking code from CalcZoneLeavingConditions // ZoneNum is already equal to ActualZoneNum , changed block of source - auto &patternZoneInfo = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum); + auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); if (patternZoneInfo.ZoneNodeID != 0) { // the zone system node should get the conditions leaving the zone (but before return air heat gains are added). - state.dataLoopNodes->Node(patternZoneInfo.ZoneNodeID).Temp = - patternZoneInfo.Tleaving; + state.dataLoopNodes->Node(patternZoneInfo.ZoneNodeID).Temp = patternZoneInfo.Tleaving; } - auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - for (int nodeCount = 1; nodeCount <= state.dataZoneEquip->ZoneEquipConfig(ZoneNum).NumReturnNodes; ++nodeCount) { + // What if ZoneNodeID is 0? + + auto &zoneNode = state.dataLoopNodes->Node(patternZoneInfo.ZoneNodeID); + auto &zone = state.dataHeatBal->Zone(ZoneNum); + auto &zoneHeatBal = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); + + int ZoneMult = zone.Multiplier * zone.ListMultiplier; + + for (int returnNodeNum : state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ReturnNode) { // BEGIN BLOCK of code from CalcZoneLeavingConditions********************************* - int ReturnNode = state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ReturnNode(nodeCount); - ZoneNode = patternZoneInfo.ZoneNodeID; - ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; + auto &returnNode = state.dataLoopNodes->Node(returnNodeNum); + // RETURN AIR HEAT GAIN from the Lights statement; this heat gain is stored in // Add sensible heat gain from refrigerated cases with under case returns - QRetAir = InternalHeatGains::zoneSumAllReturnAirConvectionGains(state, ZoneNum, ReturnNode); + Real64 QRetAir = InternalHeatGains::zoneSumAllReturnAirConvectionGains(state, ZoneNum, returnNodeNum); - CpAir = PsyCpAirFnW(state.dataLoopNodes->Node(ZoneNode).HumRat); + Real64 CpAir = PsyCpAirFnW(zoneNode.HumRat); // Need to add the energy to the return air from lights and from airflow windows. Where the heat // is added depends on if there is system flow or not. If there is system flow the heat is added // to the Zone Return Node. If there is no system flow then the heat is added back to the zone in the // Correct step through the SysDepZoneLoads variable. - MassFlowRA = state.dataLoopNodes->Node(ReturnNode).MassFlowRate / ZoneMult; - TempZoneAir = patternZoneInfo.Tleaving; // key difference from - TempRetAir = TempZoneAir; - WinGapFlowToRA = 0.0; - WinGapTtoRA = 0.0; - WinGapFlowTtoRA = 0.0; + Real64 MassFlowRA = returnNode.MassFlowRate / ZoneMult; + Real64 TempZoneAir = patternZoneInfo.Tleaving; // key difference from + Real64 TempRetAir = TempZoneAir; + Real64 WinGapFlowToRA = 0.0; + Real64 WinGapTtoRA = 0.0; + Real64 WinGapFlowTtoRA = 0.0; - if (state.dataHeatBal->Zone(ZoneNum).HasAirFlowWindowReturn) { - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + if (zone.HasAirFlowWindowReturn) { + for (int spaceNum : zone.spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { if (state.dataSurface->SurfWinAirflowThisTS(SurfNum) > 0.0 && state.dataSurface->SurfWinAirflowDestination(SurfNum) == DataSurfaces::WindowAirFlowDestination::Return) { - FlowThisTS = PsyRhoAirFnPbTdbW(state, + Real64 FlowThisTS = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataSurface->SurfWinTAirflowGapOutlet(SurfNum), - state.dataLoopNodes->Node(ZoneNode).HumRat) * + zoneNode.HumRat) * state.dataSurface->SurfWinAirflowThisTS(SurfNum) * state.dataSurface->Surface(SurfNum).Width; WinGapFlowToRA += FlowThisTS; WinGapFlowTtoRA += FlowThisTS * state.dataSurface->SurfWinTAirflowGapOutlet(SurfNum); @@ -809,7 +691,7 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // } if (WinGapFlowToRA > 0.0) WinGapTtoRA = WinGapFlowTtoRA / WinGapFlowToRA; - if (!state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { + if (!zone.NoHeatToReturnAir) { if (MassFlowRA > 0.0) { if (WinGapFlowToRA > 0.0) { // Add heat-to-return from window gap airflow @@ -819,78 +701,72 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // // All of return air comes from flow through airflow windows TempRetAir = WinGapTtoRA; // Put heat from window airflow that exceeds return air flow into zone air - thisZoneHB.SysDepZoneLoads += (WinGapFlowToRA - MassFlowRA) * CpAir * (WinGapTtoRA - TempZoneAir); + zoneHeatBal.SysDepZoneLoads += (WinGapFlowToRA - MassFlowRA) * CpAir * (WinGapTtoRA - TempZoneAir); } } // Add heat-to-return from lights TempRetAir += QRetAir / (MassFlowRA * CpAir); if (TempRetAir > RetTempMax) { - state.dataLoopNodes->Node(ReturnNode).Temp = RetTempMax; + returnNode.Temp = RetTempMax; if (!state.dataGlobal->ZoneSizingCalc) { - thisZoneHB.SysDepZoneLoads += CpAir * MassFlowRA * (TempRetAir - RetTempMax); + zoneHeatBal.SysDepZoneLoads += CpAir * MassFlowRA * (TempRetAir - RetTempMax); } } else if (TempRetAir < RetTempMin) { - state.dataLoopNodes->Node(ReturnNode).Temp = RetTempMin; + returnNode.Temp = RetTempMin; if (!state.dataGlobal->ZoneSizingCalc) { - thisZoneHB.SysDepZoneLoads += CpAir * MassFlowRA * (TempRetAir - RetTempMin); + zoneHeatBal.SysDepZoneLoads += CpAir * MassFlowRA * (TempRetAir - RetTempMin); } } else { - state.dataLoopNodes->Node(ReturnNode).Temp = TempRetAir; + returnNode.Temp = TempRetAir; } } else { // No return air flow // Assign all heat-to-return from window gap airflow to zone air - if (WinGapFlowToRA > 0.0) thisZoneHB.SysDepZoneLoads += WinGapFlowToRA * CpAir * (WinGapTtoRA - TempZoneAir); + if (WinGapFlowToRA > 0.0) zoneHeatBal.SysDepZoneLoads += WinGapFlowToRA * CpAir * (WinGapTtoRA - TempZoneAir); // Assign all heat-to-return from lights to zone air - if (QRetAir > 0.0) thisZoneHB.SysDepZoneLoads += QRetAir; - state.dataLoopNodes->Node(ReturnNode).Temp = state.dataLoopNodes->Node(ZoneNode).Temp; + if (QRetAir > 0.0) zoneHeatBal.SysDepZoneLoads += QRetAir; + returnNode.Temp = zoneNode.Temp; } } else { - state.dataLoopNodes->Node(ReturnNode).Temp = state.dataLoopNodes->Node(ZoneNode).Temp; + returnNode.Temp = zoneNode.Temp; } // Update the rest of the Return Air Node conditions, if the return air system exists! - state.dataLoopNodes->Node(ReturnNode).Press = state.dataLoopNodes->Node(ZoneNode).Press; + returnNode.Press = zoneNode.Press; - H2OHtOfVap = PsyHgAirFnWTdb(state.dataLoopNodes->Node(ZoneNode).HumRat, state.dataLoopNodes->Node(ReturnNode).Temp); - RhoAir = PsyRhoAirFnPbTdbW( - state, state.dataEnvrn->OutBaroPress, state.dataLoopNodes->Node(ReturnNode).Temp, state.dataLoopNodes->Node(ZoneNode).HumRat); + Real64 H2OHtOfVap = PsyHgAirFnWTdb(zoneNode.HumRat, returnNode.Temp); + Real64 RhoAir = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, returnNode.Temp, zoneNode.HumRat); // Include impact of under case returns for refrigerated display cases when updateing return node // humidity ratio - if (!state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { + if (!zone.NoHeatToReturnAir) { if (MassFlowRA > 0) { - SumRetAirLatentGainRate = SumAllReturnAirLatentGains(state, ZoneNum, ReturnNode); - state.dataLoopNodes->Node(ReturnNode).HumRat = - state.dataLoopNodes->Node(ZoneNode).HumRat + (SumRetAirLatentGainRate / (H2OHtOfVap * MassFlowRA)); + Real64 SumRetAirLatentGainRate = SumAllReturnAirLatentGains(state, ZoneNum, returnNodeNum); + returnNode.HumRat = zoneNode.HumRat + (SumRetAirLatentGainRate / (H2OHtOfVap * MassFlowRA)); } else { // If no mass flow rate exists, include the latent HVAC case credit with the latent Zone case credit - state.dataLoopNodes->Node(ReturnNode).HumRat = state.dataLoopNodes->Node(ZoneNode).HumRat; + returnNode.HumRat = zoneNode.HumRat; state.dataHeatBal->RefrigCaseCredit(ZoneNum).LatCaseCreditToZone += state.dataHeatBal->RefrigCaseCredit(ZoneNum).LatCaseCreditToHVAC; // shouldn't the HVAC term be zeroed out then? - SumRetAirLatentGainRate = SumAllReturnAirLatentGains(state, ZoneNum, 0); - thisZoneHB.ZoneLatentGain += SumRetAirLatentGainRate; + Real64 SumRetAirLatentGainRate = SumAllReturnAirLatentGains(state, ZoneNum, 0); + zoneHeatBal.ZoneLatentGain += SumRetAirLatentGainRate; } } else { - state.dataLoopNodes->Node(ReturnNode).HumRat = state.dataLoopNodes->Node(ZoneNode).HumRat; + returnNode.HumRat = zoneNode.HumRat; state.dataHeatBal->RefrigCaseCredit(ZoneNum).LatCaseCreditToZone += state.dataHeatBal->RefrigCaseCredit(ZoneNum).LatCaseCreditToHVAC; // shouldn't the HVAC term be zeroed out then? - SumRetAirLatentGainRate = SumAllReturnAirLatentGains(state, ZoneNum, ReturnNode); - thisZoneHB.ZoneLatentGain += SumRetAirLatentGainRate; + + zoneHeatBal.ZoneLatentGain += SumAllReturnAirLatentGains(state, ZoneNum, returnNodeNum); } - state.dataLoopNodes->Node(ReturnNode).Enthalpy = - PsyHFnTdbW(state.dataLoopNodes->Node(ReturnNode).Temp, state.dataLoopNodes->Node(ReturnNode).HumRat); + returnNode.Enthalpy = PsyHFnTdbW(returnNode.Temp, returnNode.HumRat); // END BLOCK of code from CalcZoneLeavingConditions********************************* } // set exhaust node leaving temp if present if (allocated(patternZoneInfo.ExhaustAirNodeID)) { - auto const &APZoneInfo(patternZoneInfo); - auto const &EANodeID(APZoneInfo.ExhaustAirNodeID); - Real64 const Texhaust(APZoneInfo.Texhaust); - for (int i = 1, ie = EANodeID.u(); i <= ie; ++i) { - state.dataLoopNodes->Node(EANodeID(i)).Temp = Texhaust; + for (int exhaustAirNodeID : patternZoneInfo.ExhaustAirNodeID) { + state.dataLoopNodes->Node(exhaustAirNodeID).Temp = patternZoneInfo.Texhaust; } } @@ -898,17 +774,15 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = patternZoneInfo.Tstat; // set results for all surface - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + for (int spaceNum : zone.spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); - int j = 0; - for (int i = thisSpace.HTSurfaceFirst; i <= thisSpace.HTSurfaceLast; ++i) { - ++j; - state.dataHeatBal->SurfTempEffBulkAir(i) = patternZoneInfo.Surf(j).TadjacentAir; + for (int i = thisSpace.HTSurfaceFirst, j = 0; i <= thisSpace.HTSurfaceLast; ++i) { + state.dataHeatBal->SurfTempEffBulkAir(i) = patternZoneInfo.Surf(++j).TadjacentAir; } } // set flag for reference air temperature mode - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + for (int spaceNum : zone.spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); for (int i = thisSpace.HTSurfaceFirst; i <= thisSpace.HTSurfaceLast; ++i) { state.dataSurface->SurfTAirRef(i) = DataSurfaces::RefAirTemp::AdjacentAirTemp; diff --git a/src/EnergyPlus/SQLiteProcedures.cc b/src/EnergyPlus/SQLiteProcedures.cc index f46cf5d6279..01f9b3872d4 100644 --- a/src/EnergyPlus/SQLiteProcedures.cc +++ b/src/EnergyPlus/SQLiteProcedures.cc @@ -232,7 +232,7 @@ void CreateSQLiteZoneExtendedOutput(EnergyPlusData &state) state.dataSQLiteProcedures->sqlite->addVentilationData(ventNum, state.dataHeatBal->Ventilation(ventNum)); } for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - state.dataSQLiteProcedures->sqlite->addRoomAirModelData(zoneNum, state.dataRoomAirMod->AirModel(zoneNum)); + state.dataSQLiteProcedures->sqlite->addRoomAirModelData(zoneNum, state.dataRoomAir->AirModel(zoneNum)); } state.dataSQLiteProcedures->sqlite->createZoneExtendedOutput(); diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index c1c3452bfc8..0b74c4d44a1 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -536,17 +536,17 @@ namespace ThermalComfort { } else { state.dataThermalComforts->AirTemp = thisZoneHB.ZTAVComf; } - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->anyNonMixingRoomAirModel) { state.dataThermalComforts->ZoneNum = state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).ZonePtr; - if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { - state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 + if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || + state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 // UCSD-CV - } else if (state.dataRoomAirMod->IsZoneCrossVent(state.dataThermalComforts->ZoneNum)) { - if (state.dataRoomAirMod->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { - state.dataThermalComforts->AirTemp = state.dataRoomAirMod->ZTJET(state.dataThermalComforts->ZoneNum); - } else if (state.dataRoomAirMod->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { - state.dataThermalComforts->AirTemp = state.dataRoomAirMod->ZTJET(state.dataThermalComforts->ZoneNum); + } else if (state.dataRoomAir->IsZoneCrossVent(state.dataThermalComforts->ZoneNum)) { + if (state.dataRoomAir->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { + state.dataThermalComforts->AirTemp = state.dataRoomAir->ZTJET(state.dataThermalComforts->ZoneNum); + } else if (state.dataRoomAir->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { + state.dataThermalComforts->AirTemp = state.dataRoomAir->ZTJET(state.dataThermalComforts->ZoneNum); } } } @@ -617,11 +617,11 @@ namespace ThermalComfort { state, format("PEOPLE=\"{}\", Incorrect Clothing Type", state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).Name)); } - if (state.dataRoomAirMod->anyNonMixingRoomAirModel && state.dataRoomAirMod->IsZoneCrossVent(state.dataThermalComforts->ZoneNum)) { - if (state.dataRoomAirMod->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { - state.dataThermalComforts->AirVel = state.dataRoomAirMod->Ujet(state.dataThermalComforts->ZoneNum); - } else if (state.dataRoomAirMod->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { - state.dataThermalComforts->AirVel = state.dataRoomAirMod->Urec(state.dataThermalComforts->ZoneNum); + if (state.dataRoomAir->anyNonMixingRoomAirModel && state.dataRoomAir->IsZoneCrossVent(state.dataThermalComforts->ZoneNum)) { + if (state.dataRoomAir->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Jet) { + state.dataThermalComforts->AirVel = state.dataRoomAir->Ujet(state.dataThermalComforts->ZoneNum); + } else if (state.dataRoomAir->ZoneCrossVent(state.dataThermalComforts->ZoneNum).VforComfort == RoomAir::Comfort::Recirculation) { + state.dataThermalComforts->AirVel = state.dataRoomAir->Urec(state.dataThermalComforts->ZoneNum); } else { state.dataThermalComforts->AirVel = 0.2; } @@ -826,10 +826,10 @@ namespace ThermalComfort { auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataThermalComforts->ZoneNum); // (var TA) state.dataThermalComforts->AirTemp = thisZoneHB.ZTAVComf; - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { - state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 + if (state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || + state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 } } // (var TR) @@ -1474,10 +1474,10 @@ namespace ThermalComfort { auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataThermalComforts->ZoneNum); state.dataThermalComforts->AirTemp = thisZoneHB.ZTAVComf; - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { - state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 + if (state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || + state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 } } state.dataThermalComforts->RadTemp = CalcRadTemp(state, state.dataThermalComforts->PeopleNum); @@ -2317,9 +2317,9 @@ namespace ThermalComfort { // keep track of occupied hours state.dataThermalComforts->ZoneOccHrs(iZone) += state.dataGlobal->TimeStepZone; CurAirTemp = thisZoneHB.ZTAVComf; - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDispVent3Node(iZone) || state.dataRoomAirMod->IsZoneUI(iZone)) { - CurAirTemp = state.dataRoomAirMod->TCMF(iZone); + if (state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->IsZoneDispVent3Node(iZone) || state.dataRoomAir->IsZoneUI(iZone)) { + CurAirTemp = state.dataRoomAir->TCMF(iZone); } } CurMeanRadiantTemp = state.dataHeatBal->ZoneMRT(iZone); @@ -2537,7 +2537,7 @@ namespace ThermalComfort { testCooling = (state.dataHeatBalFanSys->TempControlType(iZone) != DataHVACGlobals::ThermostatType::SingleHeating); if (testHeating && (SensibleLoadPredictedNoAdj > 0)) { // heating - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAir::RoomAirModel::Mixing) { + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAir::RoomAirModel::Mixing) { deltaT = state.dataHeatBalFanSys->TempTstatAir(iZone) - state.dataHeatBalFanSys->ZoneThermostatSetPointLo(iZone); } else { if (state.dataZoneTempPredictorCorrector->NumOnOffCtrZone > 0) { @@ -2563,7 +2563,7 @@ namespace ThermalComfort { } } } else if (testCooling && (SensibleLoadPredictedNoAdj < 0)) { // cooling - if (state.dataRoomAirMod->AirModel(iZone).AirModel != RoomAir::RoomAirModel::Mixing) { + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAir::RoomAirModel::Mixing) { deltaT = state.dataHeatBalFanSys->TempTstatAir(iZone) - state.dataHeatBalFanSys->ZoneThermostatSetPointHi(iZone); } else { if (state.dataZoneTempPredictorCorrector->NumOnOffCtrZone > 0) { @@ -2875,10 +2875,10 @@ namespace ThermalComfort { if (!state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).AdaptiveASH55) continue; state.dataThermalComforts->ZoneNum = state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).ZonePtr; state.dataThermalComforts->AirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataThermalComforts->ZoneNum).ZTAVComf; - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { - state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); + if (state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || + state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); } } state.dataThermalComforts->RadTemp = CalcRadTemp(state, state.dataThermalComforts->PeopleNum); @@ -3086,10 +3086,10 @@ namespace ThermalComfort { if (!state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).AdaptiveCEN15251) continue; state.dataThermalComforts->ZoneNum = state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).ZonePtr; state.dataThermalComforts->AirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataThermalComforts->ZoneNum).ZTAVComf; - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAirMod->IsZoneUI(state.dataThermalComforts->ZoneNum)) { - state.dataThermalComforts->AirTemp = state.dataRoomAirMod->TCMF(state.dataThermalComforts->ZoneNum); + if (state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || + state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); } } state.dataThermalComforts->RadTemp = CalcRadTemp(state, state.dataThermalComforts->PeopleNum); diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 80711acc3db..d2aa2c66d93 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -191,11 +191,11 @@ void InitUFAD(EnergyPlusData &state, // initialize these variables every timestep state.dataUFADManager->HeightIntMass = state.dataUFADManager->HeightIntMassDefault; - state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; NumShadesDown = 0.0; - for (int Ctd = state.dataRoomAirMod->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Window(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Window(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); if (surf.ExtBoundCond == ExternalEnvironment || @@ -208,8 +208,8 @@ void InitUFAD(EnergyPlusData &state, } } if (ZoneModelType == RoomAirModel::UFADExt) { - UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); - auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(UINum); + UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); + auto &zoneUE = state.dataRoomAir->ZoneUFADExt(UINum); if (zoneUE.NumExtWin > 1.0) { if (NumShadesDown / zoneUE.NumExtWin >= 0.5) { zoneUE.ShadeDown = true; @@ -252,7 +252,7 @@ void SizeUFAD(EnergyPlusData &state, Real64 ZoneSteamEqConv(0.0); // zone steam equip design convective gain [W] if (ZoneModelType == RoomAirModel::UFADInt) { - UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); + UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); NumberOfOccupants = 0.0; for (int Ctd = 1; Ctd <= state.dataHeatBal->TotPeople; ++Ctd) { if (state.dataHeatBal->People(Ctd).ZonePtr == ZoneNum) { @@ -260,7 +260,7 @@ void SizeUFAD(EnergyPlusData &state, } } - auto &zoneUI = state.dataRoomAirMod->ZoneUFADInt(UINum); + auto &zoneUI = state.dataRoomAir->ZoneUFADInt(UINum); if (zoneUI.DiffArea == AutoSize) { if (zoneUI.DiffuserType == Diffuser::Swirl) { zoneUI.DiffArea = 0.0075; @@ -444,11 +444,11 @@ void SizeUFAD(EnergyPlusData &state, } if (ZoneModelType == RoomAirModel::UFADExt) { - UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); - auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(UINum); + UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); + auto &zoneUE = state.dataRoomAir->ZoneUFADExt(UINum); // calculate total window width in zone - for (int Ctd = state.dataRoomAirMod->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Window(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAirMod->APos_Window(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); if (surf.ExtBoundCond == ExternalEnvironment || @@ -697,15 +697,15 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataUFADManager->HA_OCWin = 0.0; // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? - if (state.dataRoomAirMod->IsZoneUI(ZoneNum)) { - Real64 zoneCeilingHeight1 = state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); - Real64 zoneCeilingHeight2 = state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum); + if (state.dataRoomAir->IsZoneUI(ZoneNum)) { + Real64 zoneCeilingHeight1 = state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + Real64 zoneCeilingHeight2 = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum); LayFrac = FractionHeight; LayH = FractionHeight * (zoneCeilingHeight2 - zoneCeilingHeight1); // WALL Hc, HA and HAT calculation - for (int Ctd = state.dataRoomAirMod->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Wall(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAirMod->APos_Wall(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { + SurfNum = state.dataRoomAir->APos_Wall(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); @@ -718,20 +718,20 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HWall(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWall(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAirMod->HWall(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); } // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HWall(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWall(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAirMod->HWall(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); } if (std::abs(ZInfSurf - ZSupSurf) < 1.e-10) { @@ -747,15 +747,15 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - HLU = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - HLD = state.dataRoomAirMod->UFADHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + HLU = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + HLD = state.dataRoomAir->UFADHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAirMod->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; @@ -765,13 +765,13 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataRoomAirMod->HWall(Ctd); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWall(Ctd); } // END WALL // WINDOW Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Window(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAirMod->APos_Window(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + SurfNum = state.dataRoomAir->APos_Window(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); @@ -785,35 +785,35 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = Z1 - zoneCeilingHeight1; if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAirMod->HWindow(Ctd); - state.dataUFADManager->HAT_MXWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataUFADManager->HA_MXWin += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + state.dataUFADManager->HAT_MXWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataUFADManager->HA_MXWin += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAirMod->HWindow(Ctd); - state.dataUFADManager->HAT_OCWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataUFADManager->HA_OCWin += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); + state.dataUFADManager->HAT_OCWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataUFADManager->HA_OCWin += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - HLU = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - HLD = state.dataRoomAirMod->UFADHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + HLU = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + HLD = state.dataRoomAir->UFADHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAirMod->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; @@ -831,28 +831,28 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (surf.Tilt <= 10.0) { // Window Ceiling - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (surf.Tilt >= 170.0) { // Window Floor - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HWindow(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HWindow(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAirMod->HWindow(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); } - state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataRoomAirMod->HWindow(Ctd); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); } // END WINDOW // DOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR - SurfNum = state.dataRoomAirMod->APos_Door(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR + SurfNum = state.dataRoomAir->APos_Door(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; @@ -864,31 +864,31 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = Z1 - zoneCeilingHeight1; if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HDoor(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HDoor(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAirMod->HDoor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); } if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HDoor(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HDoor(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAirMod->HDoor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - HLU = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - HLD = state.dataRoomAirMod->UFADHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + HLU = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + HLD = state.dataRoomAir->UFADHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAirMod->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; @@ -898,7 +898,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataRoomAirMod->HDoor(Ctd); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HDoor(Ctd); } // END DOOR @@ -906,8 +906,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataUFADManager->HeightIntMass = min(state.dataUFADManager->HeightIntMassDefault, (zoneCeilingHeight2 - zoneCeilingHeight1)); - for (int Ctd = state.dataRoomAirMod->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Internal(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAirMod->APos_Internal(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { + SurfNum = state.dataRoomAir->APos_Internal(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); @@ -917,23 +917,23 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = 0.0; if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HInternal(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HInternal(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAirMod->HInternal(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - HLU = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - HLD = state.dataRoomAirMod->UFADHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + HLU = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + HLD = state.dataRoomAir->UFADHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAirMod->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; @@ -943,41 +943,41 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataRoomAirMod->HInternal(Ctd); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HInternal(Ctd); } // END INTERNAL // CEILING Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Ceiling(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAirMod->APos_Ceiling(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { + SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HCeiling(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); state.dataUFADManager->HAT_MX += - surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HCeiling(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAirMod->HCeiling(Ctd); - state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataRoomAirMod->HCeiling(Ctd); + surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); + state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); } // END CEILING // FLOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAirMod->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAirMod->PosZ_Floor(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAirMod->APos_Floor(Ctd); + for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { + SurfNum = state.dataRoomAir->APos_Floor(Ctd); if (SurfNum == 0) continue; auto &surf = state.dataSurface->Surface(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAirMod->UFADHcIn); - state.dataRoomAirMod->HFloor(Ctd) = state.dataRoomAirMod->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAirMod->HFloor(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAirMod->HFloor(Ctd); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); - state.dataRoomAirMod->UFADHcIn(SurfNum) = state.dataRoomAirMod->HFloor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); + state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HFloor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); } // END FLOOR } } @@ -1106,30 +1106,30 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZoneM2OC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZoneM2MX(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); } else { - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZoneMXOC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZoneMXMX(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); } } else { - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } } auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); MIXFLAG = false; - state.dataRoomAirMod->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; + state.dataRoomAir->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; SumSysMCp = 0.0; SumSysMCpT = 0.0; TotSysFlow = 0.0; TSupK = 0.0; SumSysM = 0.0; ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; - CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); - UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); - auto &zoneUI = state.dataRoomAirMod->ZoneUFADInt(UINum); + CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); + auto &zoneUI = state.dataRoomAir->ZoneUFADInt(UINum); HeightThermostat = zoneUI.ThermostatHeight; HeightComfort = zoneUI.ComfortHeight; TempDiffCritRep = zoneUI.TempTrigger; @@ -1195,8 +1195,8 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t } // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. HcUCSDUF(state, ZoneNum, 0.5); - PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum) + - state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum); + PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum); if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { NumberOfPlumes = PowerInPlumes / PowerPerPlume; NumDiffusersPerPlume = NumDiffusers / NumberOfPlumes; @@ -1218,8 +1218,8 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t HeightFrac = max(0.0, min(1.0, HeightFrac)); for (Ctd = 1; Ctd <= 4; ++Ctd) { HcUCSDUF(state, ZoneNum, HeightFrac); - PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum) + - state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum); + PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum); if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { NumberOfPlumes = PowerInPlumes / PowerPerPlume; NumDiffusersPerPlume = NumDiffusers / NumberOfPlumes; @@ -1236,126 +1236,126 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t HeightFrac = zoneUI.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); - state.dataRoomAirMod->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; GainsFrac = zoneUI.A_Kc * std::pow(Gamma, zoneUI.B_Kc) + zoneUI.C_Kc + zoneUI.D_Kc * Gamma + zoneUI.E_Kc * pow_2(Gamma); GainsFrac = max(0.6, min(GainsFrac, 1.0)); - state.dataRoomAirMod->AIRRATOC(ZoneNum) = + state.dataRoomAir->AIRRATOC(ZoneNum) = state.dataHeatBal->Zone(ZoneNum).Volume * - (state.dataRoomAirMod->HeightTransition(ZoneNum) - min(state.dataRoomAirMod->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * + (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAirMod->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - state.dataRoomAirMod->AIRRATMX(ZoneNum) = - state.dataHeatBal->Zone(ZoneNum).Volume * (CeilingHeight - state.dataRoomAirMod->HeightTransition(ZoneNum)) / CeilingHeight * + state.dataRoomAir->AIRRATMX(ZoneNum) = + state.dataHeatBal->Zone(ZoneNum).Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAirMod->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->XMATOC(ZoneNum)[2]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->XMATOC(ZoneNum)[1]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->XMATOC(ZoneNum)[0]; + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->XMATMX(ZoneNum)[2]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->XMATMX(ZoneNum)[1]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->XMATMX(ZoneNum)[0]; + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; } else { - state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[2]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[1]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[0]; + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[2]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[1]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[0]; + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; } - Real64 AirCap = state.dataRoomAirMod->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[1] + - (1.0 / 3.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[2]); + Real64 AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A Real64 TempDepCoef = GainsFrac * state.dataUFADManager->HA_OC + MCp_Total; Real64 TempIndCoef = GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum)) + + state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAirMod->ZTOC(ZoneNum) = (TempHistTerm + + state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum)) + + state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult) / ((11.0 / 6.0) * AirCap + GainsFrac * state.dataUFADManager->HA_OC + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAirMod->ZTOC(ZoneNum) = state.dataRoomAirMod->Zone1OC(ZoneNum) + TempIndCoef / AirCap; + state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; } else { - state.dataRoomAirMod->ZTOC(ZoneNum) = - (state.dataRoomAirMod->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + state.dataRoomAir->ZTOC(ZoneNum) = + (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } } break; case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAirMod->ZTOC(ZoneNum) = (AirCap * state.dataRoomAirMod->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); } break; default: break; } - AirCap = state.dataRoomAirMod->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[1] + - (1.0 / 3.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[2]); + AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAir->ZTMMX(ZoneNum)[2]); TempDepCoef = (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total; TempIndCoef = (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum)) + - state.dataRoomAirMod->ZTOC(ZoneNum) * MCp_Total; + state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAirMod->ZTMX(ZoneNum) = + state.dataRoomAir->ZTMX(ZoneNum) = (TempHistTerm + (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum)) + - state.dataRoomAirMod->ZTOC(ZoneNum) * MCp_Total) / + state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAirMod->ZTMX(ZoneNum) = state.dataRoomAirMod->Zone1MX(ZoneNum) + TempIndCoef / AirCap; + state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; } else { - state.dataRoomAirMod->ZTMX(ZoneNum) = - (state.dataRoomAirMod->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + state.dataRoomAir->ZTMX(ZoneNum) = + (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } } break; case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAirMod->ZTMX(ZoneNum) = (AirCap * state.dataRoomAirMod->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); } break; default: break; } - state.dataRoomAirMod->ZTFloor(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); } if (PowerInPlumes <= 0.0) { HeightFrac = 0.0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; - state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; } else { - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = Gamma; - state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = Gamma; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; } } //=============================== M I X E D Calculation ============================================== - if (state.dataRoomAirMod->ZTMX(ZoneNum) < state.dataRoomAirMod->ZTOC(ZoneNum) || MCp_Total <= 0.0 || + if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || HeightFrac * CeilingHeight < state.dataUFADManager->ThickOccupiedSubzoneMin) { MIXFLAG = true; HeightFrac = 0.0; - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; - state.dataRoomAirMod->MaxTempGrad(ZoneNum) = 0.0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; Real64 AirCap = thisZoneHB.AirPowerCap; TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); @@ -1382,9 +1382,9 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t default: break; } - state.dataRoomAirMod->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTFloor(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; HcUCSDUF(state, ZoneNum, HeightFrac); TempDepCoef = state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total; TempIndCoef = ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total; @@ -1406,31 +1406,31 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t default: break; } - state.dataRoomAirMod->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTFloor(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; } } //========================================================================================= // Comfort temperature and temperature at the thermostat/temperature control sensor - state.dataRoomAirMod->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAirMod->HeightTransition(ZoneNum)) / 2.0; - HeightOccupiedSubzoneAve = state.dataRoomAirMod->HeightTransition(ZoneNum) / 2.0; + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; // Comfort temperature if (MIXFLAG) { - state.dataRoomAirMod->TCMF(ZoneNum) = ZTAveraged; + state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; } else { if (HeightComfort < HeightOccupiedSubzoneAve) { - state.dataRoomAirMod->TCMF(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightUpSubzoneAve) { - state.dataRoomAirMod->TCMF(ZoneNum) = (state.dataRoomAirMod->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightComfort) + - state.dataRoomAirMod->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / + state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightComfort) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); } else if (HeightComfort >= HeightUpSubzoneAve && HeightComfort <= CeilingHeight) { - state.dataRoomAirMod->TCMF(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } else { ShowFatalError(state, format("UFAD comfort height is above ceiling or below floor in Zone: {}", state.dataHeatBal->Zone(ZoneNum).Name)); } @@ -1442,13 +1442,13 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = ZTAveraged; } else { if (HeightThermostat < HeightOccupiedSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightUpSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAirMod->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightThermostat) + - state.dataRoomAirMod->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightThermostat) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); } else if (HeightThermostat >= HeightUpSubzoneAve && HeightThermostat <= CeilingHeight) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } else { ShowFatalError(state, format("Underfloor air distribution thermostat height is above ceiling or below floor in Zone: {}", @@ -1458,39 +1458,39 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t // Temperature gradients if ((HeightUpSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = - (state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); + state.dataRoomAir->AvgTempGrad(ZoneNum) = + (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); } else { - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; } if (MIXFLAG) { - state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 1; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 1; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; } else { - state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; } if (ZoneEquipConfigNum > 0) { ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; - state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); } if (MIXFLAG) { - state.dataRoomAirMod->Phi(ZoneNum) = 1.0; + state.dataRoomAir->Phi(ZoneNum) = 1.0; } else { - state.dataRoomAirMod->Phi(ZoneNum) = (state.dataRoomAirMod->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / - (state.dataRoomAirMod->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); + state.dataRoomAir->Phi(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / + (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); } // Mixed for reporting purposes - if ((MIXFLAG) || ((state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; - state.dataRoomAirMod->HeightTransition(ZoneNum) = 0.0; - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; + if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAir->HeightTransition(ZoneNum) = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; } else { - state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; } } @@ -1610,22 +1610,22 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZoneM2OC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZoneM2MX(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); } else { - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZoneMXOC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZoneMXMX(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); } } else { - state.dataRoomAirMod->Zone1OC(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); - state.dataRoomAirMod->Zone1MX(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } } auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); HeightFrac = 0.0; MIXFLAG = false; - state.dataRoomAirMod->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; + state.dataRoomAir->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; SumSysMCp = 0.0; SumSysMCpT = 0.0; TotSysFlow = 0.0; @@ -1635,9 +1635,9 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t ConvGainsWindows = 0.0; Gamma = 0.0; ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; - CeilingHeight = state.dataRoomAirMod->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAirMod->ZoneCeilingHeight1(ZoneNum); - UINum = state.dataRoomAirMod->ZoneUFADPtr(ZoneNum); - auto &zoneUE = state.dataRoomAirMod->ZoneUFADExt(UINum); + CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); + auto &zoneUE = state.dataRoomAir->ZoneUFADExt(UINum); HeightThermostat = zoneUE.ThermostatHeight; HeightComfort = zoneUE.ComfortHeight; TempDiffCritRep = zoneUE.TempTrigger; @@ -1704,10 +1704,10 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. HcUCSDUF(state, ZoneNum, 0.5); ConvGainsWindows = state.dataUFADManager->HAT_MXWin + state.dataUFADManager->HAT_OCWin - - state.dataUFADManager->HA_MXWin * state.dataRoomAirMod->ZTMX(ZoneNum) - - state.dataUFADManager->HA_OCWin * state.dataRoomAirMod->ZTOC(ZoneNum); - PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum) + - state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataUFADManager->HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - + state.dataUFADManager->HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); + PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum); // NumberOfPlumes = PowerInPlumes / PowerPerPlume if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { NumberOfPlumes = PowerInPlumes / PowerPerPlume; @@ -1748,15 +1748,15 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t if (zoneUE.ShadeDown) { GainsFrac -= 0.2; } - state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; for (Ctd = 1; Ctd <= 4; ++Ctd) { HcUCSDUF(state, ZoneNum, HeightFrac); ConvGainsWindows = state.dataUFADManager->HAT_MXWin + state.dataUFADManager->HAT_OCWin - - state.dataUFADManager->HA_MXWin * state.dataRoomAirMod->ZTMX(ZoneNum) - - state.dataUFADManager->HA_OCWin * state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataUFADManager->HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - + state.dataUFADManager->HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); ConvGainsWindows = max(ConvGainsWindows, 0.0); - PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum) + - state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum); + PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum); // NumberOfPlumes = PowerInPlumes / PowerPerPlume NumberOfPlumes = 1.0; if (PowerInPlumes <= 0.0) break; @@ -1777,7 +1777,7 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t HeightFrac = zoneUE.TransHeight / CeilingHeight; } HeightFrac = min(1.0, HeightFrac); - state.dataRoomAirMod->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; GainsFrac = zoneUE.A_Kc * std::pow(Gamma, zoneUE.B_Kc) + zoneUE.C_Kc + zoneUE.D_Kc * Gamma + zoneUE.E_Kc * pow_2(Gamma); @@ -1785,124 +1785,124 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t if (zoneUE.ShadeDown) { GainsFrac -= 0.2; } - state.dataRoomAirMod->AIRRATOC(ZoneNum) = + state.dataRoomAir->AIRRATOC(ZoneNum) = state.dataHeatBal->Zone(ZoneNum).Volume * - (state.dataRoomAirMod->HeightTransition(ZoneNum) - min(state.dataRoomAirMod->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * + (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAirMod->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - state.dataRoomAirMod->AIRRATMX(ZoneNum) = - state.dataHeatBal->Zone(ZoneNum).Volume * (CeilingHeight - state.dataRoomAirMod->HeightTransition(ZoneNum)) / CeilingHeight * + state.dataRoomAir->AIRRATMX(ZoneNum) = + state.dataHeatBal->Zone(ZoneNum).Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAirMod->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->XMATOC(ZoneNum)[2]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->XMATOC(ZoneNum)[1]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->XMATOC(ZoneNum)[0]; + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->XMATMX(ZoneNum)[2]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->XMATMX(ZoneNum)[1]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->XMATMX(ZoneNum)[0]; + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; } else { - state.dataRoomAirMod->ZTMOC(ZoneNum)[2] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[2]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[1] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[1]; - state.dataRoomAirMod->ZTMOC(ZoneNum)[0] = state.dataRoomAirMod->DSXMATOC(ZoneNum)[0]; + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[2] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[2]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[1] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[1]; - state.dataRoomAirMod->ZTMMX(ZoneNum)[0] = state.dataRoomAirMod->DSXMATMX(ZoneNum)[0]; + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; } - AirCap = state.dataRoomAirMod->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[1] + - (1.0 / 3.0) * state.dataRoomAirMod->ZTMOC(ZoneNum)[2]); + AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); TempDepCoef = GainsFrac * state.dataUFADManager->HA_OC + MCp_Total; TempIndCoef = GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum)) + + state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAirMod->ZTOC(ZoneNum) = (TempHistTerm + + state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_MX * state.dataRoomAirMod->ZTMX(ZoneNum)) + + state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult) / ((11.0 / 6.0) * AirCap + GainsFrac * state.dataUFADManager->HA_OC + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAirMod->ZTOC(ZoneNum) = state.dataRoomAirMod->Zone1OC(ZoneNum) + TempIndCoef / AirCap; + state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; } else { - state.dataRoomAirMod->ZTOC(ZoneNum) = - (state.dataRoomAirMod->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + state.dataRoomAir->ZTOC(ZoneNum) = + (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } } break; case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAirMod->ZTOC(ZoneNum) = (AirCap * state.dataRoomAirMod->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); } break; default: break; } - AirCap = state.dataRoomAirMod->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAirMod->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[1] + - (1.0 / 3.0) * state.dataRoomAirMod->ZTMMX(ZoneNum)[2]); + AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAir->ZTMMX(ZoneNum)[2]); TempDepCoef = (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total; TempIndCoef = (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum)) + - state.dataRoomAirMod->ZTOC(ZoneNum) * MCp_Total; + state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAirMod->ZTMX(ZoneNum) = + state.dataRoomAir->ZTMX(ZoneNum) = (TempHistTerm + (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_OC * state.dataRoomAirMod->ZTOC(ZoneNum)) + - state.dataRoomAirMod->ZTOC(ZoneNum) * MCp_Total) / + state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAirMod->ZTMX(ZoneNum) = state.dataRoomAirMod->Zone1MX(ZoneNum) + TempIndCoef / AirCap; + state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; } else { - state.dataRoomAirMod->ZTMX(ZoneNum) = - (state.dataRoomAirMod->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + state.dataRoomAir->ZTMX(ZoneNum) = + (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } } break; case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAirMod->ZTMX(ZoneNum) = (AirCap * state.dataRoomAirMod->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); } break; default: break; } - state.dataRoomAirMod->ZTFloor(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); } if (PowerInPlumes <= 0.0) { HeightFrac = 0.0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; - state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = 0.0; - state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows(ZoneNum) = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumesfromWindows(ZoneNum) = 0.0; } else { - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAirMod->ZoneUFADGamma(ZoneNum) = Gamma; - state.dataRoomAirMod->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; - state.dataRoomAirMod->ZoneUFADPowInPlumesfromWindows(ZoneNum) = ConvGainsWindows; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = Gamma; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; + state.dataRoomAir->ZoneUFADPowInPlumesfromWindows(ZoneNum) = ConvGainsWindows; } } //=============================== M I X E D Calculation ============================================== - if (state.dataRoomAirMod->ZTMX(ZoneNum) < state.dataRoomAirMod->ZTOC(ZoneNum) || MCp_Total <= 0.0 || + if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || HeightFrac * CeilingHeight < state.dataUFADManager->ThickOccupiedSubzoneMin) { MIXFLAG = true; HeightFrac = 0.0; Real64 const thisZoneT1 = thisZoneHB.ZoneT1; - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; - state.dataRoomAirMod->MaxTempGrad(ZoneNum) = 0.0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; Real64 AirCap = thisZoneHB.AirPowerCap; TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); @@ -1927,9 +1927,9 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t default: break; } - state.dataRoomAirMod->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTFloor(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; HcUCSDUF(state, ZoneNum, HeightFrac); TempDepCoef = state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total; TempIndCoef = ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total; @@ -1951,30 +1951,30 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t default: break; } - state.dataRoomAirMod->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAirMod->ZTFloor(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; } } //========================================================================================= // Comfort temperature and temperature at the thermostat/temperature control sensor - HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAirMod->HeightTransition(ZoneNum)) / 2.0; - HeightOccupiedSubzoneAve = state.dataRoomAirMod->HeightTransition(ZoneNum) / 2.0; + HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; // Comfort temperature if (MIXFLAG) { - state.dataRoomAirMod->TCMF(ZoneNum) = ZTAveraged; + state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; } else { if (HeightComfort < HeightOccupiedSubzoneAve) { - state.dataRoomAirMod->TCMF(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightUpSubzoneAve) { - state.dataRoomAirMod->TCMF(ZoneNum) = (state.dataRoomAirMod->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightComfort) + - state.dataRoomAirMod->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / + state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightComfort) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); } else if (HeightComfort >= HeightUpSubzoneAve && HeightComfort <= CeilingHeight) { - state.dataRoomAirMod->TCMF(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } else { ShowFatalError(state, format("UFAD comfort height is above ceiling or below floor in Zone: {}", state.dataHeatBal->Zone(ZoneNum).Name)); } @@ -1986,13 +1986,13 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = ZTAveraged; } else { if (HeightThermostat < HeightOccupiedSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightUpSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAirMod->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightThermostat) + - state.dataRoomAirMod->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightThermostat) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); } else if (HeightThermostat >= HeightUpSubzoneAve && HeightThermostat <= CeilingHeight) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } else { ShowFatalError(state, format("Underfloor air distribution thermostat height is above ceiling or below floor in Zone: {}", @@ -2002,39 +2002,39 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t // Temperature gradients if ((HeightUpSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = - (state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); + state.dataRoomAir->AvgTempGrad(ZoneNum) = + (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); } else { - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; } if (MIXFLAG) { - state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 1; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 1; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; } else { - state.dataRoomAirMod->ZoneUFADMixedFlag(ZoneNum) = 0; - state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; } if (ZoneEquipConfigNum > 0) { ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; - state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); } if (MIXFLAG) { - state.dataRoomAirMod->Phi(ZoneNum) = 1.0; + state.dataRoomAir->Phi(ZoneNum) = 1.0; } else { - state.dataRoomAirMod->Phi(ZoneNum) = (state.dataRoomAirMod->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / - (state.dataRoomAirMod->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); + state.dataRoomAir->Phi(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / + (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); } // Mixed for reporting purposes - if ((MIXFLAG) || ((state.dataRoomAirMod->ZTMX(ZoneNum) - state.dataRoomAirMod->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; - state.dataRoomAirMod->HeightTransition(ZoneNum) = 0.0; - state.dataRoomAirMod->AvgTempGrad(ZoneNum) = 0.0; + if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAir->HeightTransition(ZoneNum) = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; } else { - state.dataRoomAirMod->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; } } diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 1f01ca876df..532d5276aa0 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -4851,9 +4851,9 @@ void CalcZoneLeavingConditions(EnergyPlusData &state, bool const FirstHVACIterat } // user defined room air model may feed temp that differs from zone node - if (allocated(state.dataRoomAirMod->AirPatternZoneInfo)) { - if ((state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).IsUsed) && (!state.dataGlobal->BeginEnvrnFlag)) { - TempZoneAir = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Tleaving; + if (allocated(state.dataRoomAir->AirPatternZoneInfo)) { + if ((state.dataRoomAir->AirPatternZoneInfo(ZoneNum).IsUsed) && (!state.dataGlobal->BeginEnvrnFlag)) { + TempZoneAir = state.dataRoomAir->AirPatternZoneInfo(ZoneNum).Tleaving; TempRetAir = TempZoneAir; } else { TempZoneAir = state.dataLoopNodes->Node(ZoneNode).Temp; diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 2203a1d948e..1f518e18850 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -3585,10 +3585,10 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( this->TempHistoryTerm = this->AirPowerCap * (3.0 * this->ZTM[0] - (3.0 / 2.0) * this->ZTM[1] + (1.0 / 3.0) * this->ZTM[2]); this->TempDepZnLd = (11.0 / 6.0) * this->AirPowerCap + this->TempDepCoef; this->TempIndZnLd = this->TempHistoryTerm + this->TempIndCoef; - if (state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + if (state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { // RoomAirflowNetworkModel - make dynamic term independent of TimeStepSys - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); if (afnZoneInfo.IsUsed) { int RoomAirNode = afnZoneInfo.ControlAirNodeID; RoomAir::LoadPredictionRoomAirModelAirflowNetwork(state, zoneNum, RoomAirNode); @@ -3618,8 +3618,8 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { this->ZoneT1 = this->ZoneTM2; this->ZoneW1 = this->ZoneWM2; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); for (auto &afnNode : afnZoneInfo.Node) { afnNode.AirTempT1 = afnNode.AirTempT2; afnNode.HumRatT1 = afnNode.HumRatT2; @@ -3628,8 +3628,8 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( } else { this->ZoneT1 = this->ZoneTMX; this->ZoneW1 = this->ZoneWMX; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); for (auto &afnNode : afnZoneInfo.Node) { afnNode.AirTempT1 = afnNode.AirTempTX; afnNode.HumRatT1 = afnNode.HumRatTX; @@ -3640,8 +3640,8 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( } else { this->ZoneT1 = this->ZT; this->ZoneW1 = this->ZoneAirHumRat; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - auto &afnZoneInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); for (auto &afnNode : afnZoneInfo.Node) { afnNode.AirTempT1 = afnNode.AirTemp; afnNode.HumRatT1 = afnNode.HumRat; @@ -4119,8 +4119,8 @@ void ZoneSpaceHeatBalanceData::calcPredictedHumidityRatio(EnergyPlusData &state, } C = RhoAir * volume * thisZone.ZoneVolCapMultpMoist / TimeStepSysSec; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - auto &roomAFNInfo = state.dataRoomAirMod->AFNZoneInfo(zoneNum); + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + auto &roomAFNInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); int RoomAirNode = roomAFNInfo.ControlAirNodeID; H2OHtOfVap = Psychrometrics::PsyHgAirFnWTdb(roomAFNInfo.Node(RoomAirNode).HumRat, roomAFNInfo.Node(RoomAirNode).AirTemp); A = roomAFNInfo.Node(RoomAirNode).SumLinkM + roomAFNInfo.Node(RoomAirNode).SumHmARa; @@ -4346,7 +4346,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( } // Update zone node temperature and thermostat temperature unless already updated in Room Air Model, // calculate load correction factor - if (!state.dataRoomAirMod->anyNonMixingRoomAirModel) { + if (!state.dataRoomAir->anyNonMixingRoomAirModel) { // Fully mixed thisSystemNode.Temp = this->ZT; // SpaceHB TODO: What to do here if this is for space @@ -4355,7 +4355,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( } state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; } else { - auto &thisAirModel = state.dataRoomAirMod->AirModel(zoneNum); + auto &thisAirModel = state.dataRoomAir->AirModel(zoneNum); if ((thisAirModel.AirModel == RoomAir::RoomAirModel::Mixing) || (!thisAirModel.SimAirModel)) { // Fully mixed thisSystemNode.Temp = this->ZT; @@ -4364,7 +4364,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( state.dataHeatBalFanSys->TempTstatAir(zoneNum) = this->ZT; } state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; - } else if (state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { + } else if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUI(zoneNum)) { // UCSDDV: Not fully mixed - calculate factor to correct load for fully mixed assumption // Space HB TODO: Space HB doesn't mix with DV etc. if (this->SumSysMCp > DataHVACGlobals::SmallMassFlow) { @@ -4401,8 +4401,8 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( } } else if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { // Zone node used in the RoomAirflowNetwork model - this->ZT = state.dataRoomAirMod->AFNZoneInfo(zoneNum) - .Node(state.dataRoomAirMod->AFNZoneInfo(zoneNum).ControlAirNodeID) + this->ZT = state.dataRoomAir->AFNZoneInfo(zoneNum) + .Node(state.dataRoomAir->AFNZoneInfo(zoneNum).ControlAirNodeID) .AirTemp; thisSystemNode.Temp = this->ZT; // SpaceHB TODO: What to do here if this is for space @@ -4461,9 +4461,9 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( } // SpaceHB TODO: For now, room air model is only for zones - if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - this->ZT = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(state.dataRoomAirMod->AFNZoneInfo(zoneNum).ControlAirNodeID).AirTemp; + if (spaceNum == 0 && state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + this->ZT = state.dataRoomAir->AFNZoneInfo(zoneNum).Node(state.dataRoomAir->AFNZoneInfo(zoneNum).ControlAirNodeID).AirTemp; } } @@ -4511,9 +4511,9 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // tempChange is used by HVACManager to determine if the timestep needs to be shortened. bool isMixed = true; // SpaceHB TODO: For now, room air model is only for zones - if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - isMixed = !((state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) && !state.dataRoomAirMod->ZoneDispVent3NodeMixedFlag(zoneNum)) || - (state.dataRoomAirMod->IsZoneUI(zoneNum) && !state.dataRoomAirMod->ZoneUFADMixedFlag(zoneNum))); + if (spaceNum == 0 && state.dataRoomAir->anyNonMixingRoomAirModel) { + isMixed = !((state.dataRoomAir->IsZoneDispVent3Node(zoneNum) && !state.dataRoomAir->ZoneDispVent3NodeMixedFlag(zoneNum)) || + (state.dataRoomAir->IsZoneUI(zoneNum) && !state.dataRoomAir->ZoneUFADMixedFlag(zoneNum))); } switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { @@ -4521,8 +4521,8 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( tempChange = max(tempChange, std::abs(this->ZT - this->ZTM[0])); } else { tempChange = max(tempChange, - max(std::abs(state.dataRoomAirMod->ZTOC(zoneNum) - state.dataRoomAirMod->ZTMOC(zoneNum)[0]), - std::abs(state.dataRoomAirMod->ZTMX(zoneNum) - state.dataRoomAirMod->ZTMMX(zoneNum)[0]))); + max(std::abs(state.dataRoomAir->ZTOC(zoneNum) - state.dataRoomAir->ZTMOC(zoneNum)[0]), + std::abs(state.dataRoomAir->ZTMX(zoneNum) - state.dataRoomAir->ZTMMX(zoneNum)[0]))); } } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: @@ -4531,8 +4531,8 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( tempChange = max(tempChange, std::abs(this->ZT - this->ZoneT1)); } else { tempChange = max(tempChange, - max(std::abs(state.dataRoomAirMod->ZTOC(zoneNum) - state.dataRoomAirMod->Zone1OC(zoneNum)), - std::abs(state.dataRoomAirMod->ZTMX(zoneNum) - state.dataRoomAirMod->Zone1MX(zoneNum)))); + max(std::abs(state.dataRoomAir->ZTOC(zoneNum) - state.dataRoomAir->Zone1OC(zoneNum)), + std::abs(state.dataRoomAir->ZTMX(zoneNum) - state.dataRoomAir->Zone1MX(zoneNum)))); } } break; default: @@ -4582,7 +4582,7 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in constexpr std::string_view routineName("pushTimestepHistories"); assert(zoneNum > 0); - auto &thisAirModel = state.dataRoomAirMod->AirModel(zoneNum); + auto &thisAirModel = state.dataRoomAir->AirModel(zoneNum); // Push the temperature and humidity ratio histories @@ -4602,28 +4602,28 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADExt) { - state.dataRoomAirMod->XMATFloor(zoneNum)[3] = state.dataRoomAirMod->XMATFloor(zoneNum)[2]; - state.dataRoomAirMod->XMATFloor(zoneNum)[2] = state.dataRoomAirMod->XMATFloor(zoneNum)[1]; - state.dataRoomAirMod->XMATFloor(zoneNum)[1] = state.dataRoomAirMod->XMATFloor(zoneNum)[0]; - state.dataRoomAirMod->XMATFloor(zoneNum)[0] = state.dataRoomAirMod->ZTFloor(zoneNum); - state.dataRoomAirMod->MATFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); + state.dataRoomAir->XMATFloor(zoneNum)[3] = state.dataRoomAir->XMATFloor(zoneNum)[2]; + state.dataRoomAir->XMATFloor(zoneNum)[2] = state.dataRoomAir->XMATFloor(zoneNum)[1]; + state.dataRoomAir->XMATFloor(zoneNum)[1] = state.dataRoomAir->XMATFloor(zoneNum)[0]; + state.dataRoomAir->XMATFloor(zoneNum)[0] = state.dataRoomAir->ZTFloor(zoneNum); + state.dataRoomAir->MATFloor(zoneNum) = state.dataRoomAir->ZTFloor(zoneNum); - state.dataRoomAirMod->XMATOC(zoneNum)[3] = state.dataRoomAirMod->XMATOC(zoneNum)[2]; - state.dataRoomAirMod->XMATOC(zoneNum)[2] = state.dataRoomAirMod->XMATOC(zoneNum)[1]; - state.dataRoomAirMod->XMATOC(zoneNum)[1] = state.dataRoomAirMod->XMATOC(zoneNum)[0]; - state.dataRoomAirMod->XMATOC(zoneNum)[0] = state.dataRoomAirMod->ZTOC(zoneNum); - state.dataRoomAirMod->MATOC(zoneNum) = state.dataRoomAirMod->ZTOC(zoneNum); + state.dataRoomAir->XMATOC(zoneNum)[3] = state.dataRoomAir->XMATOC(zoneNum)[2]; + state.dataRoomAir->XMATOC(zoneNum)[2] = state.dataRoomAir->XMATOC(zoneNum)[1]; + state.dataRoomAir->XMATOC(zoneNum)[1] = state.dataRoomAir->XMATOC(zoneNum)[0]; + state.dataRoomAir->XMATOC(zoneNum)[0] = state.dataRoomAir->ZTOC(zoneNum); + state.dataRoomAir->MATOC(zoneNum) = state.dataRoomAir->ZTOC(zoneNum); - state.dataRoomAirMod->XMATMX(zoneNum)[3] = state.dataRoomAirMod->XMATMX(zoneNum)[2]; - state.dataRoomAirMod->XMATMX(zoneNum)[2] = state.dataRoomAirMod->XMATMX(zoneNum)[1]; - state.dataRoomAirMod->XMATMX(zoneNum)[1] = state.dataRoomAirMod->XMATMX(zoneNum)[0]; - state.dataRoomAirMod->XMATMX(zoneNum)[0] = state.dataRoomAirMod->ZTMX(zoneNum); - state.dataRoomAirMod->MATMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); + state.dataRoomAir->XMATMX(zoneNum)[3] = state.dataRoomAir->XMATMX(zoneNum)[2]; + state.dataRoomAir->XMATMX(zoneNum)[2] = state.dataRoomAir->XMATMX(zoneNum)[1]; + state.dataRoomAir->XMATMX(zoneNum)[1] = state.dataRoomAir->XMATMX(zoneNum)[0]; + state.dataRoomAir->XMATMX(zoneNum)[0] = state.dataRoomAir->ZTMX(zoneNum); + state.dataRoomAir->MATMX(zoneNum) = state.dataRoomAir->ZTMX(zoneNum); } // for RoomAirflowNetwork model if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + for (auto &afnNode : state.dataRoomAir->AFNZoneInfo(zoneNum).Node) { afnNode.AirTempX[3] = afnNode.AirTempX[2]; afnNode.AirTempX[2] = afnNode.AirTempX[1]; afnNode.AirTempX[1] = afnNode.AirTempX[0]; @@ -4647,16 +4647,16 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADExt) { - state.dataRoomAirMod->ZoneM2Floor(zoneNum) = state.dataRoomAirMod->ZoneMXFloor(zoneNum); - state.dataRoomAirMod->ZoneMXFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); // using average for whole zone time step. - state.dataRoomAirMod->ZoneM2OC(zoneNum) = state.dataRoomAirMod->ZoneMXOC(zoneNum); - state.dataRoomAirMod->ZoneMXOC(zoneNum) = state.dataRoomAirMod->ZTOC(zoneNum); // using average for whole zone time step. - state.dataRoomAirMod->ZoneM2MX(zoneNum) = state.dataRoomAirMod->ZoneMXMX(zoneNum); - state.dataRoomAirMod->ZoneMXMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); // using average for whole zone time step. + state.dataRoomAir->ZoneM2Floor(zoneNum) = state.dataRoomAir->ZoneMXFloor(zoneNum); + state.dataRoomAir->ZoneMXFloor(zoneNum) = state.dataRoomAir->ZTFloor(zoneNum); // using average for whole zone time step. + state.dataRoomAir->ZoneM2OC(zoneNum) = state.dataRoomAir->ZoneMXOC(zoneNum); + state.dataRoomAir->ZoneMXOC(zoneNum) = state.dataRoomAir->ZTOC(zoneNum); // using average for whole zone time step. + state.dataRoomAir->ZoneM2MX(zoneNum) = state.dataRoomAir->ZoneMXMX(zoneNum); + state.dataRoomAir->ZoneMXMX(zoneNum) = state.dataRoomAir->ZTMX(zoneNum); // using average for whole zone time step. } if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + for (auto &afnNode : state.dataRoomAir->AFNZoneInfo(zoneNum).Node) { afnNode.AirTempT2 = afnNode.AirTempTX; afnNode.AirTempTX = afnNode.AirTemp; @@ -4699,25 +4699,25 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, this->DSWPrevZoneTS[0] = this->ZoneAirHumRat; // SpaceHB TODO: For now, room air model is only for zones - if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { - state.dataRoomAirMod->DSXMATFloor(zoneNum)[3] = state.dataRoomAirMod->DSXMATFloor(zoneNum)[2]; - state.dataRoomAirMod->DSXMATFloor(zoneNum)[2] = state.dataRoomAirMod->DSXMATFloor(zoneNum)[1]; - state.dataRoomAirMod->DSXMATFloor(zoneNum)[1] = state.dataRoomAirMod->DSXMATFloor(zoneNum)[0]; - state.dataRoomAirMod->DSXMATFloor(zoneNum)[0] = state.dataRoomAirMod->MATFloor(zoneNum); - - state.dataRoomAirMod->DSXMATOC(zoneNum)[3] = state.dataRoomAirMod->DSXMATOC(zoneNum)[2]; - state.dataRoomAirMod->DSXMATOC(zoneNum)[2] = state.dataRoomAirMod->DSXMATOC(zoneNum)[1]; - state.dataRoomAirMod->DSXMATOC(zoneNum)[1] = state.dataRoomAirMod->DSXMATOC(zoneNum)[0]; - state.dataRoomAirMod->DSXMATOC(zoneNum)[0] = state.dataRoomAirMod->MATOC(zoneNum); - - state.dataRoomAirMod->DSXMATMX(zoneNum)[3] = state.dataRoomAirMod->DSXMATMX(zoneNum)[2]; - state.dataRoomAirMod->DSXMATMX(zoneNum)[2] = state.dataRoomAirMod->DSXMATMX(zoneNum)[1]; - state.dataRoomAirMod->DSXMATMX(zoneNum)[1] = state.dataRoomAirMod->DSXMATMX(zoneNum)[0]; - state.dataRoomAirMod->DSXMATMX(zoneNum)[0] = state.dataRoomAirMod->MATMX(zoneNum); - } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + if (spaceNum == 0 && state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUI(zoneNum)) { + state.dataRoomAir->DSXMATFloor(zoneNum)[3] = state.dataRoomAir->DSXMATFloor(zoneNum)[2]; + state.dataRoomAir->DSXMATFloor(zoneNum)[2] = state.dataRoomAir->DSXMATFloor(zoneNum)[1]; + state.dataRoomAir->DSXMATFloor(zoneNum)[1] = state.dataRoomAir->DSXMATFloor(zoneNum)[0]; + state.dataRoomAir->DSXMATFloor(zoneNum)[0] = state.dataRoomAir->MATFloor(zoneNum); + + state.dataRoomAir->DSXMATOC(zoneNum)[3] = state.dataRoomAir->DSXMATOC(zoneNum)[2]; + state.dataRoomAir->DSXMATOC(zoneNum)[2] = state.dataRoomAir->DSXMATOC(zoneNum)[1]; + state.dataRoomAir->DSXMATOC(zoneNum)[1] = state.dataRoomAir->DSXMATOC(zoneNum)[0]; + state.dataRoomAir->DSXMATOC(zoneNum)[0] = state.dataRoomAir->MATOC(zoneNum); + + state.dataRoomAir->DSXMATMX(zoneNum)[3] = state.dataRoomAir->DSXMATMX(zoneNum)[2]; + state.dataRoomAir->DSXMATMX(zoneNum)[2] = state.dataRoomAir->DSXMATMX(zoneNum)[1]; + state.dataRoomAir->DSXMATMX(zoneNum)[1] = state.dataRoomAir->DSXMATMX(zoneNum)[0]; + state.dataRoomAir->DSXMATMX(zoneNum)[0] = state.dataRoomAir->MATMX(zoneNum); + } + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + for (auto &afnNode : state.dataRoomAir->AFNZoneInfo(zoneNum).Node) { afnNode.AirTempDSX[3] = afnNode.AirTempDSX[2]; afnNode.AirTempDSX[2] = afnNode.AirTempDSX[1]; afnNode.AirTempDSX[1] = afnNode.AirTempDSX[0]; @@ -4739,19 +4739,19 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::DispVent3Node || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADInt || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADExt) { - state.dataRoomAirMod->ZoneM2Floor(zoneNum) = state.dataRoomAirMod->ZoneMXFloor(zoneNum); - state.dataRoomAirMod->ZoneMXFloor(zoneNum) = state.dataRoomAirMod->ZTFloor(zoneNum); // using average for whole zone time step. - state.dataRoomAirMod->ZoneM2OC(zoneNum) = state.dataRoomAirMod->ZoneMXOC(zoneNum); - state.dataRoomAirMod->ZoneMXOC(zoneNum) = state.dataRoomAirMod->ZTOC(zoneNum); // using average for whole zone time step. - state.dataRoomAirMod->ZoneM2MX(zoneNum) = state.dataRoomAirMod->ZoneMXMX(zoneNum); - state.dataRoomAirMod->ZoneMXMX(zoneNum) = state.dataRoomAirMod->ZTMX(zoneNum); // using average for whole zone time step. - } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (int LoopNode = 1; LoopNode <= state.dataRoomAirMod->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { - auto &afnNode = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(LoopNode); + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::DispVent3Node || + state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADInt || + state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADExt) { + state.dataRoomAir->ZoneM2Floor(zoneNum) = state.dataRoomAir->ZoneMXFloor(zoneNum); + state.dataRoomAir->ZoneMXFloor(zoneNum) = state.dataRoomAir->ZTFloor(zoneNum); // using average for whole zone time step. + state.dataRoomAir->ZoneM2OC(zoneNum) = state.dataRoomAir->ZoneMXOC(zoneNum); + state.dataRoomAir->ZoneMXOC(zoneNum) = state.dataRoomAir->ZTOC(zoneNum); // using average for whole zone time step. + state.dataRoomAir->ZoneM2MX(zoneNum) = state.dataRoomAir->ZoneMXMX(zoneNum); + state.dataRoomAir->ZoneMXMX(zoneNum) = state.dataRoomAir->ZTMX(zoneNum); // using average for whole zone time step. + } + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + for (int LoopNode = 1; LoopNode <= state.dataRoomAir->AFNZoneInfo(zoneNum).NumOfAirNodes; ++LoopNode) { + auto &afnNode = state.dataRoomAir->AFNZoneInfo(zoneNum).Node(LoopNode); afnNode.AirTempT2 = afnNode.AirTempTX; afnNode.AirTempTX = afnNode.AirTemp; @@ -4793,25 +4793,25 @@ void ZoneSpaceHeatBalanceData::revertZoneTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::DispVent3Node || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADInt || - state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADExt) { + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::DispVent3Node || + state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADInt || + state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::UFADExt) { - state.dataRoomAirMod->XMATFloor(zoneNum)[0] = state.dataRoomAirMod->XMATFloor(zoneNum)[1]; - state.dataRoomAirMod->XMATFloor(zoneNum)[1] = state.dataRoomAirMod->XMATFloor(zoneNum)[2]; - state.dataRoomAirMod->XMATFloor(zoneNum)[2] = state.dataRoomAirMod->XMATFloor(zoneNum)[3]; + state.dataRoomAir->XMATFloor(zoneNum)[0] = state.dataRoomAir->XMATFloor(zoneNum)[1]; + state.dataRoomAir->XMATFloor(zoneNum)[1] = state.dataRoomAir->XMATFloor(zoneNum)[2]; + state.dataRoomAir->XMATFloor(zoneNum)[2] = state.dataRoomAir->XMATFloor(zoneNum)[3]; - state.dataRoomAirMod->XMATOC(zoneNum)[0] = state.dataRoomAirMod->XMATOC(zoneNum)[1]; - state.dataRoomAirMod->XMATOC(zoneNum)[1] = state.dataRoomAirMod->XMATOC(zoneNum)[2]; - state.dataRoomAirMod->XMATOC(zoneNum)[2] = state.dataRoomAirMod->XMATOC(zoneNum)[3]; + state.dataRoomAir->XMATOC(zoneNum)[0] = state.dataRoomAir->XMATOC(zoneNum)[1]; + state.dataRoomAir->XMATOC(zoneNum)[1] = state.dataRoomAir->XMATOC(zoneNum)[2]; + state.dataRoomAir->XMATOC(zoneNum)[2] = state.dataRoomAir->XMATOC(zoneNum)[3]; - state.dataRoomAirMod->XMATMX(zoneNum)[0] = state.dataRoomAirMod->XMATMX(zoneNum)[1]; - state.dataRoomAirMod->XMATMX(zoneNum)[1] = state.dataRoomAirMod->XMATMX(zoneNum)[2]; - state.dataRoomAirMod->XMATMX(zoneNum)[3] = state.dataRoomAirMod->XMATMX(zoneNum)[3]; + state.dataRoomAir->XMATMX(zoneNum)[0] = state.dataRoomAir->XMATMX(zoneNum)[1]; + state.dataRoomAir->XMATMX(zoneNum)[1] = state.dataRoomAir->XMATMX(zoneNum)[2]; + state.dataRoomAir->XMATMX(zoneNum)[3] = state.dataRoomAir->XMATMX(zoneNum)[3]; } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + for (auto &afnNode : state.dataRoomAir->AFNZoneInfo(zoneNum).Node) { afnNode.AirTempX[0] = afnNode.AirTempX[1]; afnNode.AirTempX[1] = afnNode.AirTempX[2]; afnNode.AirTempX[2] = afnNode.AirTempX[3]; @@ -4949,8 +4949,8 @@ void ZoneSpaceHeatBalanceData::correctHumRat(EnergyPlusData &state, int const zo if (this->ZoneAirHumRatTemp > WZSat) this->ZoneAirHumRatTemp = WZSat; - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - this->ZoneAirHumRatTemp = state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node(state.dataRoomAirMod->AFNZoneInfo(zoneNum).ControlAirNodeID).HumRat; + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + this->ZoneAirHumRatTemp = state.dataRoomAir->AFNZoneInfo(zoneNum).Node(state.dataRoomAir->AFNZoneInfo(zoneNum).ControlAirNodeID).HumRat; } // HybridModel with measured humidity ratio begins @@ -7121,28 +7121,28 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, this->MAT = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, this->XMAT, this->DSXMAT); this->ZoneAirHumRat = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, this->WPrevZoneTS, this->DSWPrevZoneTS); - if (spaceNum == 0 && state.dataRoomAirMod->anyNonMixingRoomAirModel) { - if (state.dataRoomAirMod->IsZoneDispVent3Node(zoneNum) || state.dataRoomAirMod->IsZoneUI(zoneNum)) { + if (spaceNum == 0 && state.dataRoomAir->anyNonMixingRoomAirModel) { + if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUI(zoneNum)) { - state.dataRoomAirMod->MATFloor(zoneNum) = + state.dataRoomAir->MATFloor(zoneNum) = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, - state.dataRoomAirMod->XMATFloor(zoneNum), - state.dataRoomAirMod->DSXMATFloor(zoneNum)); - state.dataRoomAirMod->MATOC(zoneNum) = + state.dataRoomAir->XMATFloor(zoneNum), + state.dataRoomAir->DSXMATFloor(zoneNum)); + state.dataRoomAir->MATOC(zoneNum) = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, - state.dataRoomAirMod->XMATOC(zoneNum), - state.dataRoomAirMod->DSXMATOC(zoneNum)); - state.dataRoomAirMod->MATMX(zoneNum) = + state.dataRoomAir->XMATOC(zoneNum), + state.dataRoomAir->DSXMATOC(zoneNum)); + state.dataRoomAir->MATMX(zoneNum) = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, - state.dataRoomAirMod->XMATMX(zoneNum), - state.dataRoomAirMod->DSXMATMX(zoneNum)); + state.dataRoomAir->XMATMX(zoneNum), + state.dataRoomAir->DSXMATMX(zoneNum)); } - if (state.dataRoomAirMod->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { - for (auto &afnNode : state.dataRoomAirMod->AFNZoneInfo(zoneNum).Node) { + if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { + for (auto &afnNode : state.dataRoomAir->AFNZoneInfo(zoneNum).Node) { afnNode.AirTemp = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, afnNode.AirTempX, diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index a9ee278ccca..73f6898296b 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -1172,7 +1172,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) SurfNum = 1; state->dataSurface->Surface.allocate(SurfNum); state->dataSurface->Surface(SurfNum).Zone = 1; - state->dataRoomAirMod->AirModel.allocate(1); + state->dataRoomAir->AirModel.allocate(1); state->dataHeatBal->SurfTempEffBulkAir.allocate(1); state->dataHeatBal->SurfTempEffBulkAir(1) = 1.0; SurfTemp.allocate(1); @@ -1192,7 +1192,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state->dataSurface->surfIntConv(SurfNum).model = Convect::HcInt::SetByZone; state->dataSurface->surfIntConv(SurfNum).userModelNum = 0; - state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::DispVent3Node; + state->dataRoomAir->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::DispVent3Node; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; HcIn(1) = 0.0; @@ -1204,7 +1204,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; state->dataSurface->surfIntConv(SurfNum).model = Convect::HcInt::SetByZone; state->dataSurface->surfIntConv(SurfNum).userModelNum = 0; - state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::CrossVent; + state->dataRoomAir->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModel = RoomAir::RoomAirModel::CrossVent; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; HcIn(1) = 0.0; diff --git a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc index d9b520416c2..6ff4962d1d6 100644 --- a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc @@ -75,13 +75,13 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->dataGlobal->NumOfZones = 2; int MaxSurf = 2; - state->dataRoomAirMod->RecInflowRatio.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->RecInflowRatio.allocate(state->dataGlobal->NumOfZones); state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AFNSurfaceCrossVent.allocate({0, MaxSurf}, state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AFNSurfaceCrossVent(1, 1) = 1; - state->dataRoomAirMod->AFNSurfaceCrossVent(0, 1) = 1; - state->dataRoomAirMod->AFNSurfaceCrossVent(0, 2) = 2; + state->dataRoomAir->AFNSurfaceCrossVent.allocate({0, MaxSurf}, state->dataGlobal->NumOfZones); + state->dataRoomAir->AFNSurfaceCrossVent(1, 1) = 1; + state->dataRoomAir->AFNSurfaceCrossVent(0, 1) = 1; + state->dataRoomAir->AFNSurfaceCrossVent(0, 2) = 2; state->afn->MultizoneSurfaceData.allocate(MaxSurf); state->afn->MultizoneSurfaceData(1).SurfNum = 6; @@ -123,7 +123,7 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->dataEnvrn->WindDir = 271.66666666666669; - state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->AirModel.allocate(state->dataGlobal->NumOfZones); state->afn->AirflowNetworkLinkageData.allocate(2); state->afn->AirflowNetworkLinkageData(1).CompNum = 1; @@ -137,46 +137,46 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->afn->AirflowNetworkCompData(3).TypeNum = 2; state->afn->AirflowNetworkCompData(3).CompTypeNum = AirflowNetwork::iComponentTypeNum::SOP; - state->dataRoomAirMod->SurfParametersCrossDispVent.allocate(2); - state->dataRoomAirMod->SurfParametersCrossDispVent(1).Width = 22.715219999999999; - state->dataRoomAirMod->SurfParametersCrossDispVent(1).Height = 1.3715999999999999; - state->dataRoomAirMod->SurfParametersCrossDispVent(2).Width = 22.869143999999999; - state->dataRoomAirMod->SurfParametersCrossDispVent(2).Height = 1.3715999999999999; - - state->dataRoomAirMod->CrossVentJetRecFlows.allocate({0, MaxSurf}, 1); - - state->dataRoomAirMod->PosZ_Wall.allocate(1); - state->dataRoomAirMod->PosZ_Wall(1).beg = 1; - state->dataRoomAirMod->PosZ_Wall(1).end = 4; - - state->dataRoomAirMod->APos_Wall.allocate(12); - state->dataRoomAirMod->APos_Wall(1) = 5; - state->dataRoomAirMod->APos_Wall(2) = 7; - state->dataRoomAirMod->APos_Wall(3) = 8; - state->dataRoomAirMod->APos_Wall(4) = 10; - - state->dataRoomAirMod->Droom.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->Droom(1) = 13.631070390838719; - state->dataRoomAirMod->Dstar.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->Ain.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZoneCrossVent.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZoneCrossVent(1).ZonePtr = 1; - state->dataRoomAirMod->JetRecAreaRatio.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->Ujet.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->Urec.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->Qrec.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->Qtot.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->Tin.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->SurfParametersCrossDispVent.allocate(2); + state->dataRoomAir->SurfParametersCrossDispVent(1).Width = 22.715219999999999; + state->dataRoomAir->SurfParametersCrossDispVent(1).Height = 1.3715999999999999; + state->dataRoomAir->SurfParametersCrossDispVent(2).Width = 22.869143999999999; + state->dataRoomAir->SurfParametersCrossDispVent(2).Height = 1.3715999999999999; + + state->dataRoomAir->CrossVentJetRecFlows.allocate({0, MaxSurf}, 1); + + state->dataRoomAir->PosZ_Wall.allocate(1); + state->dataRoomAir->PosZ_Wall(1).beg = 1; + state->dataRoomAir->PosZ_Wall(1).end = 4; + + state->dataRoomAir->APos_Wall.allocate(12); + state->dataRoomAir->APos_Wall(1) = 5; + state->dataRoomAir->APos_Wall(2) = 7; + state->dataRoomAir->APos_Wall(3) = 8; + state->dataRoomAir->APos_Wall(4) = 10; + + state->dataRoomAir->Droom.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->Droom(1) = 13.631070390838719; + state->dataRoomAir->Dstar.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->Ain.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->ZoneCrossVent.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->ZoneCrossVent(1).ZonePtr = 1; + state->dataRoomAir->JetRecAreaRatio.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->Ujet.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->Urec.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->Qrec.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->Qtot.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->Tin.allocate(state->dataGlobal->NumOfZones); EvolveParaCrossVent(*state, 1); - EXPECT_NEAR(27.14, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Fin, 0.01); - EXPECT_NEAR(0.871, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Uin, 0.001); - EXPECT_NEAR(0.000, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Vjet, 0.001); - EXPECT_NEAR(0.243, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Yjet, 0.001); - EXPECT_NEAR(0.279, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Ujet, 0.001); - EXPECT_NEAR(0.070, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Yrec, 0.001); - EXPECT_NEAR(0.080, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Urec, 0.001); - EXPECT_NEAR(0.466, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).YQrec, 0.001); - EXPECT_NEAR(0.535, state->dataRoomAirMod->CrossVentJetRecFlows(1, 1).Qrec, 0.001); + EXPECT_NEAR(27.14, state->dataRoomAir->CrossVentJetRecFlows(1, 1).Fin, 0.01); + EXPECT_NEAR(0.871, state->dataRoomAir->CrossVentJetRecFlows(1, 1).Uin, 0.001); + EXPECT_NEAR(0.000, state->dataRoomAir->CrossVentJetRecFlows(1, 1).Vjet, 0.001); + EXPECT_NEAR(0.243, state->dataRoomAir->CrossVentJetRecFlows(1, 1).Yjet, 0.001); + EXPECT_NEAR(0.279, state->dataRoomAir->CrossVentJetRecFlows(1, 1).Ujet, 0.001); + EXPECT_NEAR(0.070, state->dataRoomAir->CrossVentJetRecFlows(1, 1).Yrec, 0.001); + EXPECT_NEAR(0.080, state->dataRoomAir->CrossVentJetRecFlows(1, 1).Urec, 0.001); + EXPECT_NEAR(0.466, state->dataRoomAir->CrossVentJetRecFlows(1, 1).YQrec, 0.001); + EXPECT_NEAR(0.535, state->dataRoomAir->CrossVentJetRecFlows(1, 1).Qrec, 0.001); } diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index a8c1d7068ac..88adf4b53c5 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -73,14 +73,14 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataGlobal->NumOfZones = 1; int TotSurfaces = 3; - state->dataRoomAirMod->IsZoneDispVent3Node.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->IsZoneDispVent3Node(1) = true; + state->dataRoomAir->IsZoneDispVent3Node.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->IsZoneDispVent3Node(1) = true; state->dataSurface->Surface.allocate(TotSurfaces); state->dataHeatBal->SurfTempEffBulkAir.allocate(TotSurfaces); state->dataHeatBalSurf->SurfTempIn.allocate(TotSurfaces); - state->dataRoomAirMod->DispVent3NodeHcIn.allocate(TotSurfaces); - state->dataRoomAirMod->ZTMX.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZTOC.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->DispVent3NodeHcIn.allocate(TotSurfaces); + state->dataRoomAir->ZTMX.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->ZTOC.allocate(state->dataGlobal->NumOfZones); // Surface 1 Vertical wall state->dataSurface->Surface(1).Name = "Class1_Wall_6_0_0_0_0_0_Subsurface"; @@ -162,113 +162,113 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataSurface->SurfTAirRef.dimension(TotSurfaces, 0); state->dataSurface->SurfTAirRefRpt.dimension(TotSurfaces, 0); - state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::DispVent3Node; + state->dataRoomAir->AirModel.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->AirModel(1).AirModel = RoomAir::RoomAirModel::DispVent3Node; - state->dataRoomAirMod->APos_Wall.allocate(TotSurfaces); - state->dataRoomAirMod->APos_Floor.allocate(TotSurfaces); - state->dataRoomAirMod->APos_Ceiling.allocate(TotSurfaces); - state->dataRoomAirMod->PosZ_Wall.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->PosZ_Floor.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->PosZ_Ceiling.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->APos_Window.allocate(TotSurfaces); - state->dataRoomAirMod->APos_Door.allocate(TotSurfaces); - state->dataRoomAirMod->APos_Internal.allocate(TotSurfaces); - state->dataRoomAirMod->PosZ_Window.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->PosZ_Door.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->PosZ_Internal.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->HCeiling.allocate(TotSurfaces); - state->dataRoomAirMod->HWall.allocate(TotSurfaces); - state->dataRoomAirMod->HFloor.allocate(TotSurfaces); - state->dataRoomAirMod->HInternal.allocate(TotSurfaces); - state->dataRoomAirMod->HWindow.allocate(TotSurfaces); - state->dataRoomAirMod->HDoor.allocate(TotSurfaces); + state->dataRoomAir->APos_Wall.allocate(TotSurfaces); + state->dataRoomAir->APos_Floor.allocate(TotSurfaces); + state->dataRoomAir->APos_Ceiling.allocate(TotSurfaces); + state->dataRoomAir->PosZ_Wall.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->PosZ_Floor.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->PosZ_Ceiling.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->APos_Window.allocate(TotSurfaces); + state->dataRoomAir->APos_Door.allocate(TotSurfaces); + state->dataRoomAir->APos_Internal.allocate(TotSurfaces); + state->dataRoomAir->PosZ_Window.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->PosZ_Door.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->PosZ_Internal.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->HCeiling.allocate(TotSurfaces); + state->dataRoomAir->HWall.allocate(TotSurfaces); + state->dataRoomAir->HFloor.allocate(TotSurfaces); + state->dataRoomAir->HInternal.allocate(TotSurfaces); + state->dataRoomAir->HWindow.allocate(TotSurfaces); + state->dataRoomAir->HDoor.allocate(TotSurfaces); - state->dataRoomAirMod->ZoneCeilingHeight1.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZoneCeilingHeight2.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZoneCeilingHeight1(1) = 4.9784; - state->dataRoomAirMod->ZoneCeilingHeight2(1) = 4.9784; + state->dataRoomAir->ZoneCeilingHeight1.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->ZoneCeilingHeight2.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->ZoneCeilingHeight1(1) = 4.9784; + state->dataRoomAir->ZoneCeilingHeight2(1) = 4.9784; // Arrays initializations - state->dataRoomAirMod->APos_Wall = 0; - state->dataRoomAirMod->APos_Floor = 0; - state->dataRoomAirMod->APos_Ceiling = 0; - state->dataRoomAirMod->PosZ_Wall(1).beg = 1; - state->dataRoomAirMod->PosZ_Wall(1).end = 0; - state->dataRoomAirMod->PosZ_Floor(1).beg = 1; - state->dataRoomAirMod->PosZ_Floor(1).end = 0; - state->dataRoomAirMod->PosZ_Ceiling(1).beg = 1; - state->dataRoomAirMod->PosZ_Ceiling(1).end = 0; - state->dataRoomAirMod->APos_Window = 0; - state->dataRoomAirMod->APos_Door = 0; - state->dataRoomAirMod->APos_Internal = 0; - state->dataRoomAirMod->PosZ_Window(1).beg = 1; - state->dataRoomAirMod->PosZ_Window(1).end = 0; - state->dataRoomAirMod->PosZ_Door(1).beg = 1; - state->dataRoomAirMod->PosZ_Door(1).end = 3; - state->dataRoomAirMod->PosZ_Internal(1).beg = 1; - state->dataRoomAirMod->PosZ_Internal(1).end = 0; - state->dataRoomAirMod->HCeiling = 0.0; - state->dataRoomAirMod->HWall = 0.0; - state->dataRoomAirMod->HFloor = 0.0; - state->dataRoomAirMod->HInternal = 0.0; - state->dataRoomAirMod->HWindow = 0.0; - state->dataRoomAirMod->HDoor = 0.0; + state->dataRoomAir->APos_Wall = 0; + state->dataRoomAir->APos_Floor = 0; + state->dataRoomAir->APos_Ceiling = 0; + state->dataRoomAir->PosZ_Wall(1).beg = 1; + state->dataRoomAir->PosZ_Wall(1).end = 0; + state->dataRoomAir->PosZ_Floor(1).beg = 1; + state->dataRoomAir->PosZ_Floor(1).end = 0; + state->dataRoomAir->PosZ_Ceiling(1).beg = 1; + state->dataRoomAir->PosZ_Ceiling(1).end = 0; + state->dataRoomAir->APos_Window = 0; + state->dataRoomAir->APos_Door = 0; + state->dataRoomAir->APos_Internal = 0; + state->dataRoomAir->PosZ_Window(1).beg = 1; + state->dataRoomAir->PosZ_Window(1).end = 0; + state->dataRoomAir->PosZ_Door(1).beg = 1; + state->dataRoomAir->PosZ_Door(1).end = 3; + state->dataRoomAir->PosZ_Internal(1).beg = 1; + state->dataRoomAir->PosZ_Internal(1).end = 0; + state->dataRoomAir->HCeiling = 0.0; + state->dataRoomAir->HWall = 0.0; + state->dataRoomAir->HFloor = 0.0; + state->dataRoomAir->HInternal = 0.0; + state->dataRoomAir->HWindow = 0.0; + state->dataRoomAir->HDoor = 0.0; - state->dataRoomAirMod->ZoneCrossVent.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->ZoneCrossVent(1).ZonePtr = 1; - state->dataRoomAirMod->PosZ_Door(1).beg = 1; - state->dataRoomAirMod->PosZ_Door(1).end = 3; - state->dataRoomAirMod->APos_Door(1) = 1; - state->dataRoomAirMod->APos_Door(2) = 2; - state->dataRoomAirMod->APos_Door(3) = 3; + state->dataRoomAir->ZoneCrossVent.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->ZoneCrossVent(1).ZonePtr = 1; + state->dataRoomAir->PosZ_Door(1).beg = 1; + state->dataRoomAir->PosZ_Door(1).end = 3; + state->dataRoomAir->APos_Door(1) = 1; + state->dataRoomAir->APos_Door(2) = 2; + state->dataRoomAir->APos_Door(3) = 3; - state->dataRoomAirMod->ZTMX(1) = 20.0; - state->dataRoomAirMod->ZTOC(1) = 21.0; + state->dataRoomAir->ZTMX(1) = 20.0; + state->dataRoomAir->ZTOC(1) = 21.0; state->dataHeatBalSurf->SurfTempIn(1) = 23.0; state->dataHeatBalSurf->SurfTempIn(2) = 23.0; state->dataHeatBalSurf->SurfTempIn(3) = 23.0; HcDispVent3Node(*state, 1, 0.5); - EXPECT_NEAR(1.889346, state->dataRoomAirMod->DispVent3NodeHcIn(1), 0.0001); - EXPECT_NEAR(1.650496, state->dataRoomAirMod->DispVent3NodeHcIn(2), 0.0001); - EXPECT_NEAR(1.889346, state->dataRoomAirMod->DispVent3NodeHcIn(3), 0.0001); + EXPECT_NEAR(1.889346, state->dataRoomAir->DispVent3NodeHcIn(1), 0.0001); + EXPECT_NEAR(1.650496, state->dataRoomAir->DispVent3NodeHcIn(2), 0.0001); + EXPECT_NEAR(1.889346, state->dataRoomAir->DispVent3NodeHcIn(3), 0.0001); EXPECT_NEAR(379.614212, state->dataDispVentMgr->HAT_OC, 0.0001); EXPECT_NEAR(16.504965, state->dataDispVentMgr->HA_OC, 0.0001); EXPECT_NEAR(869.099591, state->dataDispVentMgr->HAT_MX, 0.0001); EXPECT_NEAR(37.786938, state->dataDispVentMgr->HA_MX, 0.0001); - state->dataRoomAirMod->IsZoneDispVent3Node.deallocate(); + state->dataRoomAir->IsZoneDispVent3Node.deallocate(); state->dataSurface->Surface.deallocate(); state->dataHeatBal->SurfTempEffBulkAir.deallocate(); state->dataHeatBalSurf->SurfTempIn.deallocate(); - state->dataRoomAirMod->DispVent3NodeHcIn.deallocate(); - state->dataRoomAirMod->ZTMX.deallocate(); - state->dataRoomAirMod->ZTOC.deallocate(); - state->dataRoomAirMod->AirModel.deallocate(); + state->dataRoomAir->DispVent3NodeHcIn.deallocate(); + state->dataRoomAir->ZTMX.deallocate(); + state->dataRoomAir->ZTOC.deallocate(); + state->dataRoomAir->AirModel.deallocate(); - state->dataRoomAirMod->APos_Wall.deallocate(); - state->dataRoomAirMod->APos_Floor.deallocate(); - state->dataRoomAirMod->APos_Ceiling.deallocate(); - state->dataRoomAirMod->PosZ_Wall.deallocate(); - state->dataRoomAirMod->PosZ_Floor.deallocate(); - state->dataRoomAirMod->PosZ_Ceiling.deallocate(); - state->dataRoomAirMod->APos_Window.deallocate(); - state->dataRoomAirMod->APos_Door.deallocate(); - state->dataRoomAirMod->APos_Internal.deallocate(); - state->dataRoomAirMod->PosZ_Window.deallocate(); - state->dataRoomAirMod->PosZ_Door.deallocate(); - state->dataRoomAirMod->PosZ_Internal.deallocate(); - state->dataRoomAirMod->HCeiling.deallocate(); - state->dataRoomAirMod->HWall.deallocate(); - state->dataRoomAirMod->HFloor.deallocate(); - state->dataRoomAirMod->HInternal.deallocate(); - state->dataRoomAirMod->HWindow.deallocate(); - state->dataRoomAirMod->HDoor.deallocate(); - state->dataRoomAirMod->ZoneCeilingHeight1.deallocate(); - state->dataRoomAirMod->ZoneCeilingHeight2.deallocate(); - state->dataRoomAirMod->ZoneCrossVent.deallocate(); + state->dataRoomAir->APos_Wall.deallocate(); + state->dataRoomAir->APos_Floor.deallocate(); + state->dataRoomAir->APos_Ceiling.deallocate(); + state->dataRoomAir->PosZ_Wall.deallocate(); + state->dataRoomAir->PosZ_Floor.deallocate(); + state->dataRoomAir->PosZ_Ceiling.deallocate(); + state->dataRoomAir->APos_Window.deallocate(); + state->dataRoomAir->APos_Door.deallocate(); + state->dataRoomAir->APos_Internal.deallocate(); + state->dataRoomAir->PosZ_Window.deallocate(); + state->dataRoomAir->PosZ_Door.deallocate(); + state->dataRoomAir->PosZ_Internal.deallocate(); + state->dataRoomAir->HCeiling.deallocate(); + state->dataRoomAir->HWall.deallocate(); + state->dataRoomAir->HFloor.deallocate(); + state->dataRoomAir->HInternal.deallocate(); + state->dataRoomAir->HWindow.deallocate(); + state->dataRoomAir->HDoor.deallocate(); + state->dataRoomAir->ZoneCeilingHeight1.deallocate(); + state->dataRoomAir->ZoneCeilingHeight2.deallocate(); + state->dataRoomAir->ZoneCrossVent.deallocate(); } TEST_F(EnergyPlusFixture, DVThirdOrderFloorTempCalculation) diff --git a/tst/EnergyPlus/unit/HybridModel.unit.cc b/tst/EnergyPlus/unit/HybridModel.unit.cc index c6540a0fdb0..f46f8510e54 100644 --- a/tst/EnergyPlus/unit/HybridModel.unit.cc +++ b/tst/EnergyPlus/unit/HybridModel.unit.cc @@ -104,10 +104,10 @@ TEST_F(EnergyPlusFixture, HybridModel_correctZoneAirTempsTest) state->dataHeatBal->Zone.allocate(1); state->dataHybridModel->HybridModelZone.allocate(1); state->dataHybridModel->FlagHybridModel = true; - state->dataRoomAirMod->AirModel.allocate(1); - state->dataRoomAirMod->ZTOC.allocate(1); - state->dataRoomAirMod->ZTMX.allocate(1); - state->dataRoomAirMod->ZTMMX.allocate(1); + state->dataRoomAir->AirModel.allocate(1); + state->dataRoomAir->ZTOC.allocate(1); + state->dataRoomAir->ZTMX.allocate(1); + state->dataRoomAir->ZTMMX.allocate(1); state->afn->exchangeData.allocate(1); state->dataLoopNodes->Node.allocate(1); state->dataHeatBalFanSys->TempTstatAir.allocate(1); @@ -125,10 +125,10 @@ TEST_F(EnergyPlusFixture, HybridModel_correctZoneAirTempsTest) state->dataSurface->Surface.allocate(2); state->dataHeatBalSurf->SurfHConvInt.allocate(1); state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1); - state->dataRoomAirMod->IsZoneDispVent3Node.dimension(1, false); - state->dataRoomAirMod->IsZoneCrossVent.dimension(1, false); - state->dataRoomAirMod->IsZoneUI.dimension(1, false); - state->dataRoomAirMod->ZoneDispVent3NodeMixedFlag.allocate(1); + state->dataRoomAir->IsZoneDispVent3Node.dimension(1, false); + state->dataRoomAir->IsZoneCrossVent.dimension(1, false); + state->dataRoomAir->IsZoneUI.dimension(1, false); + state->dataRoomAir->ZoneDispVent3NodeMixedFlag.allocate(1); state->dataHeatBal->ZnAirRpt.allocate(1); state->dataZoneEquip->ZoneEquipConfig.allocate(1); state->dataHeatBal->ZoneIntGain.allocate(1); @@ -479,8 +479,8 @@ TEST_F(EnergyPlusFixture, HybridModel_CorrectZoneContaminantsTest) state->dataHeatBal->Zone.allocate(1); state->dataHybridModel->HybridModelZone.allocate(1); state->dataHybridModel->FlagHybridModel = true; - state->dataRoomAirMod->AirModel.allocate(1); - state->dataRoomAirMod->ZTOC.allocate(1); + state->dataRoomAir->AirModel.allocate(1); + state->dataRoomAir->ZTOC.allocate(1); state->afn->exchangeData.allocate(1); state->dataLoopNodes->Node.allocate(1); state->dataHeatBalFanSys->TempTstatAir.allocate(1); @@ -500,10 +500,10 @@ TEST_F(EnergyPlusFixture, HybridModel_CorrectZoneContaminantsTest) state->dataSurface->SurfaceWindow.allocate(1); state->dataSurface->Surface.allocate(2); state->dataHeatBalSurf->SurfHConvInt.allocate(1); - state->dataRoomAirMod->IsZoneDispVent3Node.dimension(1, false); - state->dataRoomAirMod->IsZoneCrossVent.dimension(1, false); - state->dataRoomAirMod->IsZoneUI.dimension(1, false); - state->dataRoomAirMod->ZoneDispVent3NodeMixedFlag.allocate(1); + state->dataRoomAir->IsZoneDispVent3Node.dimension(1, false); + state->dataRoomAir->IsZoneCrossVent.dimension(1, false); + state->dataRoomAir->IsZoneUI.dimension(1, false); + state->dataRoomAir->ZoneDispVent3NodeMixedFlag.allocate(1); state->dataHeatBal->ZnAirRpt.allocate(1); state->dataZoneEquip->ZoneEquipConfig.allocate(1); state->dataSize->ZoneEqSizing.allocate(1); diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 1ee74f10e90..1836730d032 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -106,7 +106,7 @@ class RoomAirflowNetworkTest : public EnergyPlusFixture state->dataLoopNodes->NumOfNodes = 5; state->dataGlobal->BeginEnvrnFlag = true; int NumOfSurfaces = 2; - state->dataRoomAirMod->AFNZoneInfo.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->AFNZoneInfo.allocate(state->dataGlobal->NumOfZones); state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); state->dataHeatBal->space.allocate(state->dataGlobal->numSpaces); state->dataZoneEquip->ZoneEquipConfig.allocate(state->dataGlobal->NumOfZones); @@ -151,67 +151,67 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataEnvrn->OutBaroPress = 101325.0; state->dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).IsUsed = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).ActualZoneID = ZoneNum; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).NumOfAirNodes = NumOfAirNodes; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node.allocate(NumOfAirNodes); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).ControlAirNodeID = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).ZoneVolumeFraction = 0.2; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).ZoneVolumeFraction = 0.8; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC.allocate(1); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC.allocate(1); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).NumHVACs = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).NumHVACs = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyFraction = 0.4; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnFraction = 0.4; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "ZoneHVAC"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "ZoneHVAC"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyNodeName = "Supply"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyNodeName = "Supply"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnNodeName = "Return"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnNodeName = "Return"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "ZoneHVAC"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "ZoneHVAC"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).IntGainsDeviceIndices.allocate(1); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).IntGainsDeviceIndices.allocate(1); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).intGainsDeviceSpaces.allocate(1); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).intGainsDeviceSpaces.allocate(1); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).NumIntGains = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).NumIntGains = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).IntGainsDeviceIndices(1) = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).IntGainsDeviceIndices(1) = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).intGainsDeviceSpaces(1) = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).intGainsDeviceSpaces(1) = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).IntGainsFractions.allocate(1); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).IntGainsFractions.allocate(1); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).IntGainsFractions(1) = 0.4; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).IntGainsFractions(1) = 0.6; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HasIntGainsAssigned = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HasIntGainsAssigned = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HasSurfacesAssigned = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HasSurfacesAssigned = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HasHVACAssigned = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HasHVACAssigned = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).SurfMask.allocate(2); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).SurfMask.allocate(2); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).SurfMask(1) = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).SurfMask(2) = false; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).SurfMask(1) = false; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).SurfMask(2) = true; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).NumOfAirflowLinks = 3; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link.allocate(3); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(1).AFNSimuID = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(2).AFNSimuID = 2; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).Link(3).AFNSimuID = 3; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).AFNNodeID = 1; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).NumOfAirflowLinks = 3; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link.allocate(3); - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(1).AFNSimuID = 3; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(2).AFNSimuID = 4; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).Link(3).AFNSimuID = 5; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).AFNNodeID = 2; + state->dataRoomAir->AFNZoneInfo(ZoneNum).IsUsed = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).ActualZoneID = ZoneNum; + state->dataRoomAir->AFNZoneInfo(ZoneNum).NumOfAirNodes = NumOfAirNodes; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node.allocate(NumOfAirNodes); + state->dataRoomAir->AFNZoneInfo(ZoneNum).ControlAirNodeID = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).ZoneVolumeFraction = 0.2; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).ZoneVolumeFraction = 0.8; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC.allocate(1); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC.allocate(1); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).NumHVACs = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).NumHVACs = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyFraction = 0.4; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnFraction = 0.4; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "ZoneHVAC"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "ZoneHVAC"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyNodeName = "Supply"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyNodeName = "Supply"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnNodeName = "Return"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnNodeName = "Return"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "ZoneHVAC"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "ZoneHVAC"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).IntGainsDeviceIndices.allocate(1); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).IntGainsDeviceIndices.allocate(1); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).intGainsDeviceSpaces.allocate(1); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).intGainsDeviceSpaces.allocate(1); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).NumIntGains = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).NumIntGains = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).IntGainsDeviceIndices(1) = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).IntGainsDeviceIndices(1) = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).intGainsDeviceSpaces(1) = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).intGainsDeviceSpaces(1) = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).IntGainsFractions.allocate(1); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).IntGainsFractions.allocate(1); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).IntGainsFractions(1) = 0.4; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).IntGainsFractions(1) = 0.6; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HasIntGainsAssigned = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HasIntGainsAssigned = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HasSurfacesAssigned = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HasSurfacesAssigned = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HasHVACAssigned = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HasHVACAssigned = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).SurfMask.allocate(2); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).SurfMask.allocate(2); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).SurfMask(1) = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).SurfMask(2) = false; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).SurfMask(1) = false; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).SurfMask(2) = true; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).NumOfAirflowLinks = 3; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).Link.allocate(3); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).Link(1).AFNSimuID = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).Link(2).AFNSimuID = 2; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).Link(3).AFNSimuID = 3; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).AFNNodeID = 1; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).NumOfAirflowLinks = 3; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).Link.allocate(3); + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).Link(1).AFNSimuID = 3; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).Link(2).AFNSimuID = 4; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).Link(3).AFNSimuID = 5; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).AFNNodeID = 2; state->afn->AirflowNetworkLinkageData(1).NodeNums[0] = 1; state->afn->AirflowNetworkLinkageData(2).NodeNums[0] = 1; @@ -321,54 +321,54 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); - EXPECT_NEAR(120.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); - EXPECT_NEAR(80.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); - EXPECT_NEAR(1.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHA, 0.00001); - EXPECT_NEAR(25.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATsurf, 0.00001); - EXPECT_NEAR(0.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATref, 0.00001); - EXPECT_NEAR(4.0268, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCp, 0.0001); - EXPECT_NEAR(80.536, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCpT, 0.001); - EXPECT_NEAR(0.004, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysM, 0.00001); - EXPECT_NEAR(4.0e-6, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMW, 0.00001); - EXPECT_NEAR(30.200968, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCp, 0.0001); - EXPECT_NEAR(744.95722, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCpT, 0.001); - EXPECT_NEAR(0.03, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkM, 0.00001); - EXPECT_NEAR(3.0e-5, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW, 0.00001); - EXPECT_NEAR(-8.431365e-8, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmAW, 0.0000001); - EXPECT_NEAR(0.0009756833, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); - EXPECT_NEAR(9.0784549e-7, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); + EXPECT_NEAR(120.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); + EXPECT_NEAR(80.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); + EXPECT_NEAR(1.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHA, 0.00001); + EXPECT_NEAR(25.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATsurf, 0.00001); + EXPECT_NEAR(0.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATref, 0.00001); + EXPECT_NEAR(4.0268, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCp, 0.0001); + EXPECT_NEAR(80.536, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCpT, 0.001); + EXPECT_NEAR(0.004, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysM, 0.00001); + EXPECT_NEAR(4.0e-6, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMW, 0.00001); + EXPECT_NEAR(30.200968, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCp, 0.0001); + EXPECT_NEAR(744.95722, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCpT, 0.001); + EXPECT_NEAR(0.03, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkM, 0.00001); + EXPECT_NEAR(3.0e-5, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW, 0.00001); + EXPECT_NEAR(-8.431365e-8, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmAW, 0.0000001); + EXPECT_NEAR(0.0009756833, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); + EXPECT_NEAR(9.0784549e-7, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); thisRAFN.CalcRoomAirModelAirflowNetwork(*state, RoomAirNode); - EXPECT_NEAR(24.907085, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); - EXPECT_NEAR(0.00189601, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); - EXPECT_NEAR(9.770445, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); + EXPECT_NEAR(24.907085, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); + EXPECT_NEAR(0.00189601, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); + EXPECT_NEAR(9.770445, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); RoomAirNode = 2; thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); - EXPECT_NEAR(180.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); - EXPECT_NEAR(120.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); - EXPECT_NEAR(2.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHA, 0.00001); - EXPECT_NEAR(60.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATsurf, 0.00001); - EXPECT_NEAR(0.0, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATref, 0.00001); - EXPECT_NEAR(6.04019, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCp, 0.0001); - EXPECT_NEAR(120.803874, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCpT, 0.00001); - EXPECT_NEAR(0.006, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysM, 0.00001); - EXPECT_NEAR(6.0e-6, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMW, 0.00001); - EXPECT_NEAR(20.14327, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCp, 0.0001); - EXPECT_NEAR(523.73441, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCpT, 0.001); - EXPECT_NEAR(0.02, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkM, 0.00001); - EXPECT_NEAR(2.5e-5, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW, 0.00001); - EXPECT_NEAR(-3.5644894e-9, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmAW, 0.0000001); - EXPECT_NEAR(0.0019191284, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); - EXPECT_NEAR(1.98975381e-6, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); + EXPECT_NEAR(180.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); + EXPECT_NEAR(120.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); + EXPECT_NEAR(2.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHA, 0.00001); + EXPECT_NEAR(60.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATsurf, 0.00001); + EXPECT_NEAR(0.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHATref, 0.00001); + EXPECT_NEAR(6.04019, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCp, 0.0001); + EXPECT_NEAR(120.803874, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMCpT, 0.00001); + EXPECT_NEAR(0.006, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysM, 0.00001); + EXPECT_NEAR(6.0e-6, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumSysMW, 0.00001); + EXPECT_NEAR(20.14327, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCp, 0.0001); + EXPECT_NEAR(523.73441, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMCpT, 0.001); + EXPECT_NEAR(0.02, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkM, 0.00001); + EXPECT_NEAR(2.5e-5, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumLinkMW, 0.00001); + EXPECT_NEAR(-3.5644894e-9, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmAW, 0.0000001); + EXPECT_NEAR(0.0019191284, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); + EXPECT_NEAR(1.98975381e-6, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); thisRAFN.CalcRoomAirModelAirflowNetwork(*state, RoomAirNode); - EXPECT_NEAR(24.057841, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); - EXPECT_NEAR(0.0028697086, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); - EXPECT_NEAR(15.53486185, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); + EXPECT_NEAR(24.057841, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); + EXPECT_NEAR(0.0028697086, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); + EXPECT_NEAR(15.53486185, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); thisRAFN.UpdateRoomAirModelAirflowNetwork(*state); @@ -401,17 +401,17 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataDefineEquipment->AirDistUnit(1).Name = "ADU"; state->dataDefineEquipment->AirDistUnit(1).EquipName.allocate(1); state->dataDefineEquipment->AirDistUnit(1).EquipName(1) = "AirTerminal"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "AirTerminal"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyFraction = 0.4; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnFraction = 0.4; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "AirTerminal"; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; - state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).Name = "AirTerminal"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).SupplyFraction = 0.4; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(1).HVAC(1).ReturnFraction = 0.4; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).Name = "AirTerminal"; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; + state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); // No errorfound - EXPECT_NEAR(1.1824296, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RhoAir, 0.00001); - EXPECT_NEAR(1010.1746, state->dataRoomAirMod->AFNZoneInfo(ZoneNum).Node(RoomAirNode).CpAir, 0.001); + EXPECT_NEAR(1.1824296, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RhoAir, 0.00001); + EXPECT_NEAR(1010.1746, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).CpAir, 0.001); state->dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf = false; } @@ -565,8 +565,8 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) InternalHeatGains::GetInternalHeatGainsInput(*state); ErrorsFound = false; - state->dataRoomAirMod->AirModel.allocate(1); - state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::AirflowNetwork; + state->dataRoomAir->AirModel.allocate(1); + state->dataRoomAir->AirModel(1).AirModel = RoomAir::RoomAirModel::AirflowNetwork; RoomAir::GetRoomAirflowNetworkData(*state, ErrorsFound); EXPECT_TRUE(ErrorsFound); diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index 327c235e891..46327c6165f 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -90,8 +90,8 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcIfSetPointMetTest1) state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(state->dataGlobal->NumOfZones); state->dataThermalComforts->ThermalComfortSetPoint.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->TempControlType.allocate(1); - state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::Mixing; + state->dataRoomAir->AirModel.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->AirModel(1).AirModel = RoomAir::RoomAirModel::Mixing; state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointLo.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointHi.allocate(state->dataGlobal->NumOfZones); @@ -925,8 +925,8 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcIfSetPointMetWithCutoutTest) state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(state->dataGlobal->NumOfZones); state->dataThermalComforts->ThermalComfortSetPoint.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->TempControlType.allocate(1); - state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->AirModel(1).AirModel = RoomAir::RoomAirModel::Mixing; + state->dataRoomAir->AirModel.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->AirModel(1).AirModel = RoomAir::RoomAirModel::Mixing; state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointLo.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneThermostatSetPointHi.allocate(state->dataGlobal->NumOfZones); @@ -986,8 +986,8 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortASH55) state->dataGlobal->NumOfZones = 1; state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); state->dataHeatBal->ZoneMRT.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->IsZoneDispVent3Node.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAirMod->IsZoneUI.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->IsZoneDispVent3Node.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->IsZoneUI.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneQdotRadHVACToPerson.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneQHTRadSysToPerson.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneQCoolingPanelToPerson.allocate(state->dataGlobal->NumOfZones); @@ -1011,7 +1011,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortASH55) state->dataHeatBal->People(1).WorkEffPtr = 0; state->dataHeatBal->People(1).clothingType = ClothingType::InsulationSchedule; - state->dataRoomAirMod->IsZoneDispVent3Node(1) = state->dataRoomAirMod->IsZoneUI(1) = false; + state->dataRoomAir->IsZoneDispVent3Node(1) = state->dataRoomAir->IsZoneUI(1) = false; state->dataHeatBalFanSys->ZoneQHTRadSysToPerson(1) = 0.0; state->dataHeatBalFanSys->ZoneQCoolingPanelToPerson(1) = 0.0; state->dataHeatBalFanSys->ZoneQHWBaseboardToPerson(1) = 0.0; diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index c99cdb59039..90abe9da4af 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -151,7 +151,7 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_CorrectZoneHumRatTest) state->dataHeatBal->ZoneAirSolutionAlgo = DataHeatBalance::SolutionAlgo::EulerMethod; - state->dataRoomAirMod->AirModel.allocate(1); + state->dataRoomAir->AirModel.allocate(1); state->dataHeatBal->ZoneIntGain.allocate(1); // Case 1 - All flows at the same humrat From d57668fda5c55284d8d725996ac98af05103173d Mon Sep 17 00:00:00 2001 From: amirroth Date: Sun, 25 Jun 2023 11:46:07 -0400 Subject: [PATCH 11/17] Fix assert/memory issue --- src/EnergyPlus/DataRoomAirModel.hh | 2 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 45 ++++++-------------- src/EnergyPlus/RoomAirModelManager.cc | 6 +-- 3 files changed, 18 insertions(+), 35 deletions(-) diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index 7a2fb8e85fe..c70ec6290d5 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -519,7 +519,7 @@ namespace RoomAir { Real64 Texhaust = 0.0; // temperature for exhaust air node int totNumSurfs = 0; // total surfs for this zone int firstSurfID = 0; // Index of first surface - int RAFNNum = 0; // RAFN number + int roomAFNNodeNum = 0; // RAFN number }; struct BegEnd { diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index bfa7a85f96e..fb4931da8f4 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -131,28 +131,26 @@ namespace RoomAir { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - int RAFNNum = afnZoneInfo.RAFNNum; - if (RAFNNum == 0) { + // At this point, this should probably be an assert, not a ShowFatalError. This should have been trapped already. + if (afnZoneInfo.roomAFNNodeNum == 0) { ShowFatalError(state, format("SimRoomAirModelAirflowNetwork: Zone is not defined in the RoomAirModelAirflowNetwork model ={}", state.dataHeatBal->Zone(ZoneNum).Name)); } - auto &thisRAFN(state.dataRoomAirflowNetModel->RAFN(RAFNNum)); - thisRAFN.ZoneNum = ZoneNum; + auto &roomAFNNode = state.dataRoomAirflowNetModel->RAFN(afnZoneInfo.roomAFNNodeNum); + roomAFNNode.ZoneNum = ZoneNum; // model control volume for each roomAir:node in the zone. - for (int ThisRoomAirNode = 1; ThisRoomAirNode <= afnZoneInfo.NumOfAirNodes; ++ThisRoomAirNode) { + for (int roomAirNode = 1; roomAirNode <= afnZoneInfo.NumOfAirNodes; ++roomAirNode) { - thisRAFN.RoomAirNode = ThisRoomAirNode; - - thisRAFN.InitRoomAirModelAirflowNetwork(state, ThisRoomAirNode); - - thisRAFN.CalcRoomAirModelAirflowNetwork(state, ThisRoomAirNode); + roomAFNNode.RoomAirNode = roomAirNode; + roomAFNNode.InitRoomAirModelAirflowNetwork(state, roomAirNode); + roomAFNNode.CalcRoomAirModelAirflowNetwork(state, roomAirNode); } - thisRAFN.UpdateRoomAirModelAirflowNetwork(state); + roomAFNNode.UpdateRoomAirModelAirflowNetwork(state); } // SimRoomAirModelAirflowNetwork @@ -166,22 +164,10 @@ namespace RoomAir { // SUBROUTINE INFORMATION: // AUTHOR Lixing Gu // DATE WRITTEN June, 2015 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Predict zone loads at a controlled node - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: //////////// hoisted into namespace //////////////////////////////////////////////// // static bool OneTimeFlag_FindFirstLastPtr( true ); // one time setup flag // // state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag @@ -192,17 +178,15 @@ namespace RoomAir { } auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - int RAFNNum = afnZoneInfo.RAFNNum; - if (RAFNNum == 0) { + if (afnZoneInfo.roomAFNNodeNum == 0) { // Again? ShowFatalError(state, format("LoadPredictionRoomAirModelAirflowNetwork: Zone is not defined in the RoomAirModelAirflowNetwork model ={}", state.dataHeatBal->Zone(ZoneNum).Name)); } - auto &thisRAFN(state.dataRoomAirflowNetModel->RAFN(RAFNNum)); - thisRAFN.ZoneNum = ZoneNum; - - thisRAFN.InitRoomAirModelAirflowNetwork(state, RoomAirNode); + auto &roomAFNNode = state.dataRoomAirflowNetModel->RAFN(afnZoneInfo.roomAFNNodeNum); + roomAFNNode.ZoneNum = ZoneNum; + roomAFNNode.InitRoomAirModelAirflowNetwork(state, RoomAirNode); } // LoadPredictionRoomAirModelAirflowNetwork @@ -215,7 +199,6 @@ namespace RoomAir { // AUTHOR B. Griffith // DATE WRITTEN November 2009 // MODIFIED Lixing Gu, Aug. 2015 for v8.4 release - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Perform one-time checking and term calculations @@ -259,7 +242,7 @@ namespace RoomAir { if (state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlag) { // then do one - time setup inits // loop over all zones with RoomAirflowNetwork model - for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { + for (int LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { if (!state.dataRoomAir->AFNZoneInfo(LoopZone).IsUsed) continue; int NumSurfs = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 7e6c57d2c26..3451ee0a6e9 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1311,7 +1311,7 @@ namespace RoomAir { auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); roomAFNZoneInfo.ZoneID = ZoneNum; - roomAFNZoneInfo.RAFNNum = Loop; + roomAFNZoneInfo.roomAFNNodeNum = Loop; roomAFNZoneInfo.IsUsed = true; roomAFNZoneInfo.Name = ipsc->cAlphaArgs(1); roomAFNZoneInfo.ZoneName = ipsc->cAlphaArgs(2); // Zone Name @@ -2120,10 +2120,10 @@ namespace RoomAir { state.dataRoomAir->MATFloor = 23.0; state.dataRoomAir->XMATFloor = {23.0, 23.0, 23.0, 23.0}; state.dataRoomAir->DSXMATFloor = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAir->MATOC = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->MATOC = 23.0; state.dataRoomAir->XMATOC = {23.0, 23.0, 23.0, 23.0}; state.dataRoomAir->DSXMATOC = {23.0, 23.0, 23.0, 23.0}; - state.dataRoomAir->MATMX = {23.0, 23.0, 23.0, 23.0}; + state.dataRoomAir->MATMX = 23.0; state.dataRoomAir->XMATMX = {23.0, 23.0, 23.0, 23.0}; state.dataRoomAir->DSXMATMX = {23.0, 23.0, 23.0, 23.0}; state.dataRoomAir->ZTMFloor = {23.0, 23.0, 23.0}; From 5b51b311b96a84eeb0d3af2e4f651e40adf8d1d2 Mon Sep 17 00:00:00 2001 From: amirroth Date: Sun, 25 Jun 2023 23:59:46 -0400 Subject: [PATCH 12/17] Some RoomAFN mods --- src/EnergyPlus/DataRoomAirModel.hh | 1 - src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 867 +++++++----------- src/EnergyPlus/RoomAirModelAirflowNetwork.hh | 64 +- src/EnergyPlus/RoomAirModelManager.cc | 3 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 1 - src/EnergyPlus/ZoneTempPredictorCorrector.cc | 2 +- .../unit/RoomAirflowNetwork.unit.cc | 20 +- 7 files changed, 378 insertions(+), 580 deletions(-) diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index c70ec6290d5..479c3a717b5 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -519,7 +519,6 @@ namespace RoomAir { Real64 Texhaust = 0.0; // temperature for exhaust air node int totNumSurfs = 0; // total surfs for this zone int firstSurfID = 0; // Index of first surface - int roomAFNNodeNum = 0; // RAFN number }; struct BegEnd { diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index fb4931da8f4..4d93f23b000 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -110,11 +110,7 @@ namespace RoomAir { using namespace DataSurfaces; using namespace DataHeatBalance; - // Object Data - - // Functions - - void SimRoomAirModelAirflowNetwork(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone + void SimRoomAirModelAFN(EnergyPlusData &state, int const zoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: @@ -128,37 +124,23 @@ namespace RoomAir { // METHODOLOGY EMPLOYED: // calls subroutines (LOL) - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - - // At this point, this should probably be an assert, not a ShowFatalError. This should have been trapped already. - if (afnZoneInfo.roomAFNNodeNum == 0) { - ShowFatalError(state, - format("SimRoomAirModelAirflowNetwork: Zone is not defined in the RoomAirModelAirflowNetwork model ={}", - state.dataHeatBal->Zone(ZoneNum).Name)); - } - - auto &roomAFNNode = state.dataRoomAirflowNetModel->RAFN(afnZoneInfo.roomAFNNodeNum); - roomAFNNode.ZoneNum = ZoneNum; + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); // model control volume for each roomAir:node in the zone. - for (int roomAirNode = 1; roomAirNode <= afnZoneInfo.NumOfAirNodes; ++roomAirNode) { - - roomAFNNode.RoomAirNode = roomAirNode; - roomAFNNode.InitRoomAirModelAirflowNetwork(state, roomAirNode); - roomAFNNode.CalcRoomAirModelAirflowNetwork(state, roomAirNode); + for (int roomAirNodeNum = 1; roomAirNodeNum <= afnZoneInfo.NumOfAirNodes; ++roomAirNodeNum) { + InitRoomAirModelAFN(state, zoneNum, roomAirNodeNum); + CalcRoomAirModelAFN(state, zoneNum, roomAirNodeNum); } - roomAFNNode.UpdateRoomAirModelAirflowNetwork(state); + UpdateRoomAirModelAFN(state, zoneNum); } // SimRoomAirModelAirflowNetwork //**************************************************** - void LoadPredictionRoomAirModelAirflowNetwork(EnergyPlusData &state, - int const ZoneNum, - int const RoomAirNode) // index number for the specified zone and node + void LoadPredictionRoomAirModelAFN(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum) // index number for the specified zone and node { // SUBROUTINE INFORMATION: @@ -168,31 +150,15 @@ namespace RoomAir { // PURPOSE OF THIS SUBROUTINE: // Predict zone loads at a controlled node - //////////// hoisted into namespace //////////////////////////////////////////////// - // static bool OneTimeFlag_FindFirstLastPtr( true ); // one time setup flag // - // state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag - //////////////////////////////////////////////////////////////////////////////////// - if (state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag) { - state.dataRoomAirflowNetModel->RAFN.allocate(state.dataRoomAir->NumOfRoomAFNControl); - state.dataRoomAirflowNetModel->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag = false; - } - - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - - if (afnZoneInfo.roomAFNNodeNum == 0) { // Again? - ShowFatalError(state, - format("LoadPredictionRoomAirModelAirflowNetwork: Zone is not defined in the RoomAirModelAirflowNetwork model ={}", - state.dataHeatBal->Zone(ZoneNum).Name)); - } - auto &roomAFNNode = state.dataRoomAirflowNetModel->RAFN(afnZoneInfo.roomAFNNodeNum); - roomAFNNode.ZoneNum = ZoneNum; - roomAFNNode.InitRoomAirModelAirflowNetwork(state, RoomAirNode); + InitRoomAirModelAFN(state, zoneNum, roomAirNodeNum); } // LoadPredictionRoomAirModelAirflowNetwork //**************************************************** - void RAFNData::InitRoomAirModelAirflowNetwork(EnergyPlusData &state, int const RoomAirNode) // index number for the specified zone + void InitRoomAirModelAFN(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum) // index number for the specified zone { // SUBROUTINE INFORMATION: @@ -207,98 +173,70 @@ namespace RoomAir { using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - //////////// hoisted into namespace //////////////////////////////////////////////// - // static bool MyOneTimeFlag( true ); // one time setup flag // InitRoomAirModelAirflowNetworkOneTimeFlag - // static bool MyOneTimeFlagConf( true ); // one time setup flag for zone configuration // InitRoomAirModelAirflowNetworkOneTimeFlagConf - // static bool MyEnvrnFlag( true ); // one time setup flag for zone configuration // InitRoomAirModelAirflowNetworkEnvrnFlag - //////////////////////////////////////////////////////////////////////////////////// - Real64 SumLinkMCp; - Real64 SumLinkMCpT; - int linkNum; - Real64 LinkInTemp; - Real64 CpAir; - Real64 LinkInHumRat; - Real64 LinkInMdot; - Real64 SumLinkM; - Real64 SumLinkMW; - int LoopZone; - int LoopAirNode; - int NodeNum; - int NodeIn; - int Link; - int IdNode; - int EquipLoop; - int MaxNodeNum; Array1D_bool NodeFound; // True if a node is found. - int MaxEquipNum; Array1D_bool EquipFound; - int ISum; - bool ErrorsFound; - int I; + bool ErrorsFound = false; Array1D SupplyFrac; Array1D ReturnFrac; - if (state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlag) { // then do one - time setup inits + if (state.dataRoomAirflowNetModel->OneTimeFlag) { // then do one - time setup inits // loop over all zones with RoomAirflowNetwork model - for (int LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - if (!state.dataRoomAir->AFNZoneInfo(LoopZone).IsUsed) continue; + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); + if (!afnZoneInfo.IsUsed) continue; int NumSurfs = 0; - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + for (int spaceNum : state.dataHeatBal->Zone(iZone).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); NumSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; } - for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAir->AFNZoneInfo(LoopZone).NumOfAirNodes; - ++LoopAirNode) { // loop over all the modeled room air nodes + for (auto &afnNode : afnZoneInfo.Node) { // calculate volume of air in node's control volume - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).AirVolume = - state.dataHeatBal->Zone(LoopZone).Volume * - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).ZoneVolumeFraction; + afnNode.AirVolume = state.dataHeatBal->Zone(iZone).Volume * afnNode.ZoneVolumeFraction; SetupOutputVariable(state, "RoomAirflowNetwork Node NonAirSystemResponse", OutputProcessor::Unit::W, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).NonAirSystemResponse, + afnNode.NonAirSystemResponse, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); + afnNode.Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SysDepZoneLoadsLagged", OutputProcessor::Unit::W, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).SysDepZoneLoadsLagged, + afnNode.SysDepZoneLoadsLagged, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); + afnNode.Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SumIntSensibleGain", OutputProcessor::Unit::W, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).SumIntSensibleGain, + afnNode.SumIntSensibleGain, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); + afnNode.Name); SetupOutputVariable(state, "RoomAirflowNetwork Node SumIntLatentGain", OutputProcessor::Unit::W, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).SumIntLatentGain, + afnNode.SumIntLatentGain, OutputProcessor::SOVTimeStepType::HVAC, OutputProcessor::SOVStoreType::Average, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).Name); + afnNode.Name); } } - state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlag = false; + state.dataRoomAirflowNetModel->OneTimeFlag = false; } - if (state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf) { // then do one - time setup inits + if (state.dataRoomAirflowNetModel->OneTimeFlagConf) { // then do one - time setup inits if (allocated(state.dataZoneEquip->ZoneEquipConfig) && allocated(state.dataZoneEquip->ZoneEquipList)) { - MaxNodeNum = 0; - MaxEquipNum = 0; + int MaxNodeNum = 0; + int MaxEquipNum = 0; ErrorsFound = false; - for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - if (!state.dataHeatBal->Zone(LoopZone).IsControlled) continue; - MaxEquipNum = max(MaxEquipNum, state.dataZoneEquip->ZoneEquipList(LoopZone).NumOfEquipTypes); - MaxNodeNum = max(MaxNodeNum, state.dataZoneEquip->ZoneEquipConfig(LoopZone).NumInletNodes); + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + if (!state.dataHeatBal->Zone(iZone).IsControlled) continue; + MaxEquipNum = max(MaxEquipNum, state.dataZoneEquip->ZoneEquipList(iZone).NumOfEquipTypes); + MaxNodeNum = max(MaxNodeNum, state.dataZoneEquip->ZoneEquipConfig(iZone).NumInletNodes); } if (MaxNodeNum > 0) { NodeFound.allocate(MaxNodeNum); @@ -314,160 +252,120 @@ namespace RoomAir { } // loop over all zones with RoomAirflowNetwork model - for (LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - if (!state.dataHeatBal->Zone(LoopZone).IsControlled) continue; - if (!state.dataRoomAir->AFNZoneInfo(LoopZone).IsUsed) continue; - state.dataRoomAir->AFNZoneInfo(LoopZone).ActualZoneID = LoopZone; + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + auto const &zone = state.dataHeatBal->Zone(iZone); + if (!zone.IsControlled) continue; + + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); + if (!afnZoneInfo.IsUsed) continue; + afnZoneInfo.ActualZoneID = iZone; SupplyFrac = 0.0; ReturnFrac = 0.0; NodeFound = false; int numAirDistUnits = 0; + auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(iZone); + auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(iZone); + // find supply air node number - for (LoopAirNode = 1; LoopAirNode <= state.dataRoomAir->AFNZoneInfo(LoopZone).NumOfAirNodes; - ++LoopAirNode) { // loop over all the modeled room air nodes - for (EquipLoop = 1; EquipLoop <= state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).NumHVACs; - ++EquipLoop) { // loop over all the equip for a single room air node - // Check zone equipment name - for (I = 1; I <= state.dataZoneEquip->ZoneEquipList(LoopZone).NumOfEquipTypes; ++I) { // loop over all equip types - if (state.dataZoneEquip->ZoneEquipList(LoopZone).EquipType(I) == DataZoneEquipment::ZoneEquipType::AirDistributionUnit) { + for (auto &afnNode : afnZoneInfo.Node) { + for (auto &afnHVAC : afnNode.HVAC) { + for (int I = 1; I <= zoneEquipList.NumOfEquipTypes; ++I) { // loop over all equip types + if (zoneEquipList.EquipType(I) == DataZoneEquipment::ZoneEquipType::AirDistributionUnit) { if (numAirDistUnits == 0) - numAirDistUnits = - state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "ZoneHVAC:AirDistributionUnit"); + numAirDistUnits = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "ZoneHVAC:AirDistributionUnit"); if (state.dataZoneAirLoopEquipmentManager->GetAirDistUnitsFlag) { ZoneAirLoopEquipmentManager::GetZoneAirLoopEquipment(state); state.dataZoneAirLoopEquipmentManager->GetAirDistUnitsFlag = false; } + for (int AirDistUnitNum = 1; AirDistUnitNum <= numAirDistUnits; ++AirDistUnitNum) { - if (state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I) == - state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).Name) { - if (state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name == - state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).EquipName(1)) { - if (state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .EquipConfigIndex == 0) - state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .EquipConfigIndex = I; - if (!EquipFound(I)) EquipFound(I) = true; - SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .SupplyFraction; - ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .ReturnFraction; + if (zoneEquipList.EquipName(I) == state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).Name) { + if (afnHVAC.Name == state.dataDefineEquipment->AirDistUnit(AirDistUnitNum).EquipName(1)) { + if (afnHVAC.EquipConfigIndex == 0) { + afnHVAC.EquipConfigIndex = I; + } + EquipFound(I) = true; + SupplyFrac(I) += afnHVAC.SupplyFraction; + ReturnFrac(I) += afnHVAC.ReturnFraction; } } } - } else { - if (UtilityRoutines::SameString( - state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I), - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name)) { - if (state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .EquipConfigIndex == 0) - state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .EquipConfigIndex = I; - EquipFound(I) = true; - SupplyFrac(I) = SupplyFrac(I) + state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .SupplyFraction; - ReturnFrac(I) = ReturnFrac(I) + state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .ReturnFraction; + } else if (UtilityRoutines::SameString(zoneEquipList.EquipName(I), afnHVAC.Name)) { + if (afnHVAC.EquipConfigIndex == 0) { + afnHVAC.EquipConfigIndex = I; } + EquipFound(I) = true; + SupplyFrac(I) += afnHVAC.SupplyFraction; + ReturnFrac(I) += afnHVAC.ReturnFraction; } } - for (IdNode = 1; IdNode <= state.dataLoopNodes->NumOfNodes; ++IdNode) { // loop over all nodes to find supply node ID - if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(IdNode), - state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .SupplyNodeName)) { - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum = IdNode; + + for (int iNode = 1; iNode <= state.dataLoopNodes->NumOfNodes; ++iNode) { // loop over all nodes to find supply node ID + if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(iNode), afnHVAC.SupplyNodeName)) { + afnHVAC.SupNodeNum = iNode; break; } } // Verify inlet nodes int inletNodeIndex = 0; - for (NodeNum = 1; NodeNum <= state.dataZoneEquip->ZoneEquipConfig(LoopZone).NumInletNodes; - ++NodeNum) { // loop over all supply inlet nodes in a single zone + for (int iNode = 1; iNode <= zoneEquipConfig.NumInletNodes; ++iNode) { // loop over all supply inlet nodes in a single zone // !Get node conditions - if (state.dataZoneEquip->ZoneEquipConfig(LoopZone).InletNode(NodeNum) == IdNode) { - NodeFound(NodeNum) = true; - inletNodeIndex = NodeNum; + if (zoneEquipConfig.InletNode(iNode) == afnHVAC.SupNodeNum) { + NodeFound(iNode) = true; + inletNodeIndex = iNode; break; } } - if (state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupNodeNum > 0 && - UtilityRoutines::SameString( - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnNodeName, - "")) { + if (afnHVAC.SupNodeNum > 0 && afnHVAC.ReturnNodeName.empty()) { // Find matching return node - for (int retNode = 1; retNode <= state.dataZoneEquip->ZoneEquipConfig(LoopZone).NumReturnNodes; ++retNode) { - if ((state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNodeInletNum(retNode) == inletNodeIndex) && - (state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNode(retNode) > 0)) { - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = - state.dataZoneEquip->ZoneEquipConfig(LoopZone).ReturnNode(retNode); // Zone return node + for (int retNode = 1; retNode <= zoneEquipConfig.NumReturnNodes; ++retNode) { + if ((zoneEquipConfig.ReturnNodeInletNum(retNode) == inletNodeIndex) && + (zoneEquipConfig.ReturnNode(retNode) > 0)) { + afnHVAC.RetNodeNum = zoneEquipConfig.ReturnNode(retNode); // Zone return node break; } } } - if (state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum == 0) { - for (IdNode = 1; IdNode <= state.dataLoopNodes->NumOfNodes; ++IdNode) { // loop over all nodes to find return node ID - if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(IdNode), - state.dataRoomAir->AFNZoneInfo(LoopZone) - .Node(LoopAirNode) - .HVAC(EquipLoop) - .ReturnNodeName)) { - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).RetNodeNum = - IdNode; + if (afnHVAC.RetNodeNum == 0) { + for (int iNode = 1; iNode <= state.dataLoopNodes->NumOfNodes; ++iNode) { // loop over all nodes to find return node ID + if (UtilityRoutines::SameString(state.dataLoopNodes->NodeID(iNode), afnHVAC.ReturnNodeName)) { + afnHVAC.RetNodeNum = iNode; break; } } } - SetupOutputVariable( - state, - "RoomAirflowNetwork Node HVAC Supply Fraction", - OutputProcessor::Unit::None, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).SupplyFraction, - OutputProcessor::SOVTimeStepType::HVAC, - OutputProcessor::SOVStoreType::Average, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); - SetupOutputVariable( - state, - "RoomAirflowNetwork Node HVAC Return Fraction", - OutputProcessor::Unit::None, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).ReturnFraction, - OutputProcessor::SOVTimeStepType::HVAC, - OutputProcessor::SOVStoreType::Average, - state.dataRoomAir->AFNZoneInfo(LoopZone).Node(LoopAirNode).HVAC(EquipLoop).Name); + SetupOutputVariable(state, + "RoomAirflowNetwork Node HVAC Supply Fraction", + OutputProcessor::Unit::None, + afnHVAC.SupplyFraction, + OutputProcessor::SOVTimeStepType::HVAC, + OutputProcessor::SOVStoreType::Average, + afnHVAC.Name); + SetupOutputVariable(state, + "RoomAirflowNetwork Node HVAC Return Fraction", + OutputProcessor::Unit::None, + afnHVAC.ReturnFraction, + OutputProcessor::SOVTimeStepType::HVAC, + OutputProcessor::SOVStoreType::Average, + afnHVAC.Name); } } // Count node with.TRUE. - ISum = 0; - for (NodeNum = 1; NodeNum <= MaxNodeNum; ++NodeNum) { // loop over all supply inlet nodes in a single zone - if (NodeFound(NodeNum)) ISum = ISum + 1; + int ISum = 0; + for (int iNode = 1; iNode <= MaxNodeNum; ++iNode) { // loop over all supply inlet nodes in a single zone + if (NodeFound(iNode)) ++ISum; } // Provide error messages with incorrect supplu node inputs - if (ISum != state.dataZoneEquip->ZoneEquipConfig(LoopZone).NumInletNodes) { - if (ISum > state.dataZoneEquip->ZoneEquipConfig(LoopZone).NumInletNodes) { + if (ISum != zoneEquipConfig.NumInletNodes) { + if (ISum > zoneEquipConfig.NumInletNodes) { ShowSevereError( state, "GetRoomAirflowNetworkData: The number of equipment listed in RoomAirflowNetwork:Node:HVACEquipment objects"); ShowContinueError( state, - format("is greater than the number of zone configuration inlet nodes in {}", state.dataHeatBal->Zone(LoopZone).Name)); + format("is greater than the number of zone configuration inlet nodes in {}", zone.Name)); ShowContinueError(state, "Please check inputs of both objects."); ErrorsFound = true; } else { @@ -475,31 +373,31 @@ namespace RoomAir { state, "GetRoomAirflowNetworkData: The number of equipment listed in RoomAirflowNetwork:Node:HVACEquipment objects"); ShowContinueError( state, - format("is less than the number of zone configuration inlet nodes in {}", state.dataHeatBal->Zone(LoopZone).Name)); + format("is less than the number of zone configuration inlet nodes in {}", zone.Name)); ShowContinueError(state, "Please check inputs of both objects."); ErrorsFound = true; } } // Check equipment names to ensure they are used in RoomAirflowNetwork : Node : HVACEquipment objects - for (I = 1; I <= state.dataZoneEquip->ZoneEquipList(LoopZone).NumOfEquipTypes; ++I) { // loop over all equip types + for (int I = 1; I <= zoneEquipList.NumOfEquipTypes; ++I) { // loop over all equip types if (!EquipFound(I)) { ShowSevereError(state, "GetRoomAirflowNetworkData: The equipment listed in ZoneEquipList is not found in the lsit of " "RoomAir:Node:AirflowNetwork:HVACEquipment objects ="); ShowContinueError( - state, format("{}. Please check inputs of both objects.", state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I))); + state, format("{}. Please check inputs of both objects.", zoneEquipList.EquipName(I))); ErrorsFound = true; } } // Check fraction to ensure sum = 1.0 for every equipment - for (I = 1; I <= state.dataZoneEquip->ZoneEquipList(LoopZone).NumOfEquipTypes; ++I) { // loop over all equip types + for (int I = 1; I <= zoneEquipList.NumOfEquipTypes; ++I) { // loop over all equip types if (std::abs(SupplyFrac(I) - 1.0) > 0.001) { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, zone supply fractions do not sum to 1.0"); ShowContinueError(state, format("Entered in {} defined in RoomAir:Node:AirflowNetwork:HVACEquipment", - state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I))); + zoneEquipList.EquipName(I))); ShowContinueError(state, "The Fraction of supply fraction values across all the roomair nodes in a zone needs to sum to 1.0."); ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SupplyFrac(I))); @@ -509,7 +407,7 @@ namespace RoomAir { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, zone return fractions do not sum to 1.0"); ShowContinueError(state, format("Entered in {} defined in RoomAir:Node:AirflowNetwork:HVACEquipment", - state.dataZoneEquip->ZoneEquipList(LoopZone).EquipName(I))); + zoneEquipList.EquipName(I))); ShowContinueError(state, "The Fraction of return fraction values across all the roomair nodes in a zone needs to sum to 1.0."); ShowContinueError(state, format("The sum of fractions entered = {:.3R}", ReturnFrac(I))); @@ -517,20 +415,19 @@ namespace RoomAir { } } } - state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf = false; + state.dataRoomAirflowNetModel->OneTimeFlagConf = false; if (allocated(NodeFound)) NodeFound.deallocate(); if (ErrorsFound) { ShowFatalError(state, "GetRoomAirflowNetworkData: Errors found getting air model input. Program terminates."); } - } - } // End of InitRoomAirModelAirflowNetworkOneTimeFlagConf + } // if (allocated) + } // if (OneTimeFlagConf) - if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkEnvrnFlag) { - for (int LoopZone = 1; LoopZone <= state.dataGlobal->NumOfZones; ++LoopZone) { - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(LoopZone); + if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirflowNetModel->EnvrnFlag) { + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); if (!afnZoneInfo.IsUsed) continue; - for (int LoopAirNode = 1; LoopAirNode <= afnZoneInfo.NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes - auto &afnNode = afnZoneInfo.Node(LoopAirNode); + for (auto &afnNode : afnZoneInfo.Node) { afnNode.AirTemp = 23.0; afnNode.AirTempX = {23.0, 23.0, 23.0, 23.0}; afnNode.AirTempDSX = {23.0, 23.0, 23.0, 23.0}; @@ -549,58 +446,56 @@ namespace RoomAir { afnNode.SysDepZoneLoadsLaggedOld = 0.0; } } - state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkEnvrnFlag = false; + state.dataRoomAirflowNetModel->EnvrnFlag = false; } if (!state.dataGlobal->BeginEnvrnFlag) { - state.dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkEnvrnFlag = true; + state.dataRoomAirflowNetModel->EnvrnFlag = true; } // reuse code in ZoneTempPredictorCorrector for sensible components. - CalcNodeSums(state, RoomAirNode); + CalcNodeSums(state, zoneNum, roomAirNodeNum); - SumNonAirSystemResponseForNode(state, RoomAirNode); + SumNonAirSystemResponseForNode(state, zoneNum, roomAirNodeNum); // latent gains. - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - auto &afnNode = afnZoneInfo.Node(RoomAirNode); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); + auto &afnNode = afnZoneInfo.Node(roomAirNodeNum); if (allocated(afnNode.SurfMask)) { - CalcSurfaceMoistureSums(state, RoomAirNode, afnNode.SumHmAW, afnNode.SumHmARa, afnNode.SumHmARaW, afnNode.SurfMask); + CalcSurfaceMoistureSums(state, zoneNum, roomAirNodeNum, afnNode.SumHmAW, afnNode.SumHmARa, afnNode.SumHmARaW, afnNode.SurfMask); } // prepare AirflowNetwor flow rates and temperatures - SumLinkMCp = 0.0; - SumLinkMCpT = 0.0; - SumLinkM = 0.0; - SumLinkMW = 0.0; - - NodeNum = afnNode.AFNNodeID; - if (NodeNum > 0) { - for (linkNum = 1; linkNum <= afnNode.NumOfAirflowLinks; ++linkNum) { - Link = afnNode.Link(linkNum).AFNSimuID; - if (state.afn->AirflowNetworkLinkageData(Link).NodeNums[0] == NodeNum) { // incoming flow - NodeIn = state.afn->AirflowNetworkLinkageData(Link).NodeNums[1]; - afnNode.Link(linkNum).TempIn = state.afn->AirflowNetworkNodeSimu(NodeIn).TZ; - afnNode.Link(linkNum).HumRatIn = state.afn->AirflowNetworkNodeSimu(NodeIn).WZ; - afnNode.Link(linkNum).MdotIn = state.afn->AirflowNetworkLinkSimu(Link).FLOW2; + Real64 SumLinkMCp = 0.0; + Real64 SumLinkMCpT = 0.0; + Real64 SumLinkM = 0.0; + Real64 SumLinkMW = 0.0; + + if (afnNode.AFNNodeID > 0) { + for (int iLink = 1; iLink <= afnNode.NumOfAirflowLinks; ++iLink) { + auto &afnLink = afnNode.Link(iLink); + int linkNum = afnLink.AFNSimuID; + if (state.afn->AirflowNetworkLinkageData(linkNum).NodeNums[0] == afnNode.AFNNodeID) { // incoming flow + int nodeInNum = state.afn->AirflowNetworkLinkageData(linkNum).NodeNums[1]; + afnLink.TempIn = state.afn->AirflowNetworkNodeSimu(nodeInNum).TZ; + afnLink.HumRatIn = state.afn->AirflowNetworkNodeSimu(nodeInNum).WZ; + afnLink.MdotIn = state.afn->AirflowNetworkLinkSimu(linkNum).FLOW2; } - if (state.afn->AirflowNetworkLinkageData(Link).NodeNums[1] == NodeNum) { // outgoing flow - NodeIn = state.afn->AirflowNetworkLinkageData(Link).NodeNums[0]; - afnNode.Link(linkNum).TempIn = state.afn->AirflowNetworkNodeSimu(NodeIn).TZ; - afnNode.Link(linkNum).HumRatIn = state.afn->AirflowNetworkNodeSimu(NodeIn).WZ; - afnNode.Link(linkNum).MdotIn = state.afn->AirflowNetworkLinkSimu(Link).FLOW; + if (state.afn->AirflowNetworkLinkageData(linkNum).NodeNums[1] == afnNode.AFNNodeID) { // outgoing flow + int nodeInNum = state.afn->AirflowNetworkLinkageData(linkNum).NodeNums[0]; + afnLink.TempIn = state.afn->AirflowNetworkNodeSimu(nodeInNum).TZ; + afnLink.HumRatIn = state.afn->AirflowNetworkNodeSimu(nodeInNum).WZ; + afnLink.MdotIn = state.afn->AirflowNetworkLinkSimu(linkNum).FLOW; } } - for (linkNum = 1; linkNum <= afnNode.NumOfAirflowLinks; ++linkNum) { - LinkInTemp = afnNode.Link(linkNum).TempIn; - LinkInHumRat = afnNode.Link(linkNum).HumRatIn; - LinkInMdot = afnNode.Link(linkNum).MdotIn; - CpAir = PsyCpAirFnW(LinkInHumRat); - SumLinkMCp = SumLinkMCp + CpAir * LinkInMdot; - SumLinkMCpT = SumLinkMCpT + CpAir * LinkInMdot * LinkInTemp; - SumLinkM = SumLinkM + LinkInMdot; - SumLinkMW = SumLinkMW + LinkInMdot * LinkInHumRat; + for (int iLink = 1; iLink <= afnNode.NumOfAirflowLinks; ++iLink) { + auto &afnLink = afnNode.Link(iLink); + Real64 CpAir = PsyCpAirFnW(afnLink.HumRatIn); + SumLinkMCp += CpAir * afnLink.MdotIn; + SumLinkMCpT += CpAir * afnLink.MdotIn * afnLink.TempIn; + SumLinkM += afnLink.MdotIn; + SumLinkMW += afnLink.MdotIn * afnLink.HumRatIn; } } @@ -610,8 +505,7 @@ namespace RoomAir { afnNode.SumLinkMW = SumLinkMW; afnNode.SysDepZoneLoadsLagged = afnNode.SysDepZoneLoadsLaggedOld; - afnNode.RhoAir = - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, afnNode.AirTemp, afnNode.HumRat, "InitRoomAirModelAirflowNetwork"); + afnNode.RhoAir = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, afnNode.AirTemp, afnNode.HumRat, "InitRoomAirModelAirflowNetwork"); afnNode.CpAir = PsyCpAirFnW(afnNode.HumRat); @@ -619,14 +513,15 @@ namespace RoomAir { //***************************************************************************************** - void RAFNData::CalcRoomAirModelAirflowNetwork(EnergyPlusData &state, int const RoomAirNode) // index number for the specified zone and node + void CalcRoomAirModelAFN(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum) // index number for the specified zone and node { // SUBROUTINE INFORMATION: // AUTHOR Brent Griffith // DATE WRITTEN November 2009 // MODIFIED Lixing Gu, Aug. 2015 for v8.4 replease - // RE-ENGINEERED // PURPOSE OF THIS SUBROUTINE: // calculate new values for temperature and humidity ratio for room air node @@ -635,31 +530,19 @@ namespace RoomAir { // take terms(updated in init routine) and use classic air balance equations // solved for state variables. Store results in structure. - // REFERENCES: - // na - // Using/Aliasing Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; using Psychrometrics::PsyHgAirFnWTdb; using Psychrometrics::PsyRhFnTdbWPb; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 H2OHtOfVap; - Real64 HumRatTmp; std::array NodeTempX; std::array NodeHumRatX; - Real64 TempDepCoef; - Real64 TempIndCoef; - Real64 AirCap; - Real64 TempTmp; - Real64 A; - Real64 B; - Real64 C; Real64 AirTempT1; Real64 HumRatT1; - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - auto &afnNode = afnZoneInfo.Node(RoomAirNode); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); + auto &afnNode = afnZoneInfo.Node(roomAirNodeNum); if (state.dataHVACGlobal->UseZoneTimeStepHistory) { NodeTempX[0] = afnNode.AirTempX[0]; @@ -684,56 +567,52 @@ namespace RoomAir { HumRatT1 = afnNode.HumRatT1; } // solve for node drybulb temperature - TempDepCoef = afnNode.SumHA + afnNode.SumLinkMCp + afnNode.SumSysMCp; - TempIndCoef = afnNode.SumIntSensibleGain + afnNode.SumHATsurf - afnNode.SumHATref + afnNode.SumLinkMCpT + + Real64 TempDepCoef = afnNode.SumHA + afnNode.SumLinkMCp + afnNode.SumSysMCp; + Real64 TempIndCoef = afnNode.SumIntSensibleGain + afnNode.SumHATsurf - afnNode.SumHATref + afnNode.SumLinkMCpT + afnNode.SumSysMCpT + afnNode.NonAirSystemResponse + afnNode.SysDepZoneLoadsLagged; - AirCap = - afnNode.AirVolume * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * afnNode.RhoAir * afnNode.CpAir / TimeStepSysSec; + Real64 AirCap = afnNode.AirVolume * state.dataHeatBal->Zone(zoneNum).ZoneVolCapMultpSens * afnNode.RhoAir * afnNode.CpAir / TimeStepSysSec; if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::AnalyticalSolution) { if (TempDepCoef == 0.0) { // B=0 - TempTmp = AirTempT1 + TempIndCoef / AirCap; + afnNode.AirTemp = AirTempT1 + TempIndCoef / AirCap; } else { - TempTmp = (AirTempT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; + afnNode.AirTemp = (AirTempT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } } else if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::EulerMethod) { - TempTmp = (AirCap * AirTempT1 + TempIndCoef) / (AirCap + TempDepCoef); + afnNode.AirTemp = (AirCap * AirTempT1 + TempIndCoef) / (AirCap + TempDepCoef); } else { - TempTmp = (TempIndCoef + AirCap * (3.0 * NodeTempX[0] - (3.0 / 2.0) * NodeTempX[1] + (1.0 / 3.0) * NodeTempX[2])) / + afnNode.AirTemp = (TempIndCoef + AirCap * (3.0 * NodeTempX[0] - (3.0 / 2.0) * NodeTempX[1] + (1.0 / 3.0) * NodeTempX[2])) / ((11.0 / 6.0) * AirCap + TempDepCoef); } - afnNode.AirTemp = TempTmp; - // solve for node humidity ratio using 3 algorithms - H2OHtOfVap = PsyHgAirFnWTdb(afnNode.HumRat, afnNode.AirTemp); - A = afnNode.SumLinkM + afnNode.SumHmARa + afnNode.SumSysM; - B = (afnNode.SumIntLatentGain / H2OHtOfVap) + afnNode.SumSysMW + afnNode.SumLinkMW + afnNode.SumHmARaW; - C = afnNode.RhoAir * afnNode.AirVolume * state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpMoist / TimeStepSysSec; + Real64 H2OHtOfVap = PsyHgAirFnWTdb(afnNode.HumRat, afnNode.AirTemp); + Real64 A = afnNode.SumLinkM + afnNode.SumHmARa + afnNode.SumSysM; + Real64 B = (afnNode.SumIntLatentGain / H2OHtOfVap) + afnNode.SumSysMW + afnNode.SumLinkMW + afnNode.SumHmARaW; + Real64 C = afnNode.RhoAir * afnNode.AirVolume * state.dataHeatBal->Zone(zoneNum).ZoneVolCapMultpMoist / TimeStepSysSec; // Exact solution if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::AnalyticalSolution) { if (A == 0.0) { // B=0 - HumRatTmp = HumRatT1 + B / C; + afnNode.HumRat = HumRatT1 + B / C; } else { - HumRatTmp = (HumRatT1 - B / A) * std::exp(min(700., -A / C)) + B / A; + afnNode.HumRat = (HumRatT1 - B / A) * std::exp(min(700., -A / C)) + B / A; } } else if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::EulerMethod) { - HumRatTmp = (C * HumRatT1 + B) / (C + A); + afnNode.HumRat = (C * HumRatT1 + B) / (C + A); } else { - HumRatTmp = (B + C * (3.0 * NodeHumRatX[0] - (3.0 / 2.0) * NodeHumRatX[1] + (1.0 / 3.0) * NodeHumRatX[2])) / ((11.0 / 6.0) * C + A); + afnNode.HumRat = (B + C * (3.0 * NodeHumRatX[0] - (3.0 / 2.0) * NodeHumRatX[1] + (1.0 / 3.0) * NodeHumRatX[2])) / ((11.0 / 6.0) * C + A); } - afnNode.HumRat = HumRatTmp; - afnNode.AirCap = AirCap; afnNode.AirHumRat = C; - afnNode.RelHumidity = PsyRhFnTdbWPb(state, TempTmp, HumRatTmp, state.dataEnvrn->OutBaroPress, "CalcRoomAirModelAirflowNetwork") * 100.0; + afnNode.RelHumidity = PsyRhFnTdbWPb(state, afnNode.AirTemp, afnNode.HumRat, state.dataEnvrn->OutBaroPress, "CalcRoomAirModelAirflowNetwork") * 100.0; } // CalcRoomAirModelAirflowNetwork - void RAFNData::UpdateRoomAirModelAirflowNetwork(EnergyPlusData &state) + void UpdateRoomAirModelAFN(EnergyPlusData &state, + int const zoneNum) { // SUBROUTINE INFORMATION: @@ -743,41 +622,26 @@ namespace RoomAir { // PURPOSE OF THIS SUBROUTINE: // update variables - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int AirNodeNum; // nested node structure index - int I; - Real64 NodeMass; - Real64 SumMass; - Real64 SumMassT; - Real64 SumMassW; - int RetNodeNum; - - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); if (!afnZoneInfo.IsUsed) return; - if (!state.dataGlobal->ZoneSizingCalc) SumSystemDepResponseForNode(state); - - AirNodeNum = afnZoneInfo.ControlAirNodeID; + if (!state.dataGlobal->ZoneSizingCalc) SumSystemDepResponseForNode(state, zoneNum); // Update return node conditions - for (I = 1; I <= state.dataZoneEquip->ZoneEquipList(ZoneNum).NumOfEquipTypes; ++I) { // loop over all equip types - SumMass = 0.0; - SumMassT = 0.0; - SumMassW = 0.0; - for (int LoopAirNode = 1; LoopAirNode <= afnZoneInfo.NumOfAirNodes; ++LoopAirNode) { // loop over all the modeled room air nodes - auto &afnNode = afnZoneInfo.Node(LoopAirNode); - for (int EquipLoop = 1; EquipLoop <= afnNode.NumHVACs; ++EquipLoop) { // loop over all the equip for a single room air node - auto &afnHVAC = afnNode.HVAC(EquipLoop); - if (afnHVAC.EquipConfigIndex == I) { - if (afnHVAC.SupNodeNum > 0 && afnHVAC.RetNodeNum > 0) { - NodeMass = state.dataLoopNodes->Node(afnHVAC.SupNodeNum).MassFlowRate * afnHVAC.ReturnFraction; - SumMass += NodeMass; - SumMassT += NodeMass * afnNode.AirTemp; - SumMassW += NodeMass * afnNode.HumRat; - RetNodeNum = afnHVAC.RetNodeNum; - } + for (int I = 1; I <= state.dataZoneEquip->ZoneEquipList(zoneNum).NumOfEquipTypes; ++I) { // loop over all equip types + Real64 SumMass = 0.0; + Real64 SumMassT = 0.0; + Real64 SumMassW = 0.0; + int RetNodeNum = 0; + for (auto const &afnNode : afnZoneInfo.Node) { + for (auto const &afnHVAC : afnNode.HVAC) { + if (afnHVAC.EquipConfigIndex == I && afnHVAC.SupNodeNum > 0 && afnHVAC.RetNodeNum > 0) { + Real64 NodeMass = state.dataLoopNodes->Node(afnHVAC.SupNodeNum).MassFlowRate * afnHVAC.ReturnFraction; + SumMass += NodeMass; + SumMassT += NodeMass * afnNode.AirTemp; + SumMassW += NodeMass * afnNode.HumRat; + RetNodeNum = afnHVAC.RetNodeNum; } } } @@ -788,7 +652,9 @@ namespace RoomAir { } } // UpdateRoomAirModelAirflowNetwork - void RAFNData::CalcNodeSums(EnergyPlusData &state, int const RoomAirNodeNum) + void CalcNodeSums(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum) { // SUBROUTINE INFORMATION: @@ -820,54 +686,23 @@ namespace RoomAir { using Psychrometrics::PsyRhoAirFnPbTdbW; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int NodeNum; // System node number - Real64 NodeTemp; // System node temperature - Real64 NodeW; // System node humidity ratio - Real64 MassFlowRate; // System node mass flow rate - int ZoneRetPlenumNum; - int ZoneSupPlenumNum; - bool ZoneRetPlenumAirFlag; - bool ZoneSupPlenumAirFlag; - Real64 CpAir; // Specific heat of air Real64 HA; // !Hc*Area Real64 Area; // !Effective surface area Real64 RefAirTemp; // !Reference air temperature for surface convection calculations - Real64 ZoneMult; - int ADUListIndex; - int ADUNum; - int ADUInNode; - int ADUOutNode; - Real64 SumIntGain; // !node sum of convective internal gains - Real64 SumHA; // Zone sum of Hc*Area - Real64 SumHATsurf; // !Zone sum of Hc*Area*Tsurf - Real64 SumHATref; // !Zone sum of Hc*Area*Tref, for ceiling diffuser convection correlation - Real64 SumMCp; // !Zone sum of MassFlowRate*Cp - Real64 SumMCpT; // !Zone sum of MassFlowRate*Cp*T - Real64 SumSysMCp; // !Zone sum of air system MassFlowRate*Cp - Real64 SumSysMCpT; // !Zone sum of air system MassFlowRate*Cp*T - Real64 SumSysM; // !Zone sum of air system MassFlowRate - Real64 SumSysMW; // !Zone sum of air system MassFlowRate*W - int EquipLoop; // !Index of equipment loop - int Loop; // !Index of RAFN node bool Found; // - Real64 SumLinkM; // !Zone sum of MassFlowRate from the AirflowNetwork model - Real64 SumLinkMW; // !Zone sum of MassFlowRate*W from the AirflowNetwork model - - SumIntGain = 0.0; - SumHA = 0.0; - SumHATsurf = 0.0; - SumHATref = 0.0; - SumMCp = 0.0; - SumMCpT = 0.0; - SumSysMCp = 0.0; - SumSysMCpT = 0.0; - SumSysM = 0.0; - SumSysMW = 0.0; - SumLinkM = 0.0; - SumLinkMW = 0.0; - - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - auto &afnNode = afnZoneInfo.Node(RoomAirNodeNum); + + Real64 SumIntGain = 0.0; // node sum of convective internal gains + Real64 SumHA = 0.0; // Zone sum of Hc*Area + Real64 SumHATsurf = 0.0; // Zone sum of Hc*Area*Tsurf + Real64 SumHATref = 0.0; // Zone sum of Hc*Area*Tref, for ceiling diffuser convection correlation + Real64 SumSysMCp = 0.0; // Zone sum of air system MassFlowRate*Cp + Real64 SumSysMCpT = 0.0; // Zone sum of air system MassFlowRate*Cp*T + Real64 SumSysM = 0.0; // Zone sum of air system MassFlowRate + Real64 SumSysMW = 0.0; // Zone sum of air system MassFlowRate*W + + auto const &zone = state.dataHeatBal->Zone(zoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); + auto &afnNode = afnZoneInfo.Node(roomAirNodeNum); // Sum all convective internal gains: SumIntGain afnNode.SumIntSensibleGain = SumInternalConvectionGainsByIndices(state, @@ -877,7 +712,7 @@ namespace RoomAir { SumInternalLatentGainsByIndices(state, afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); // Add heat to return air if zonal system(no return air) or cycling system(return air frequently very low or zero) - if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { + if (state.dataHeatBal->Zone(zoneNum).NoHeatToReturnAir) { // ******************************************* SumIntGain = SumReturnAirConvectionGainsByIndices(state, @@ -886,105 +721,93 @@ namespace RoomAir { } // Check to see if this is a controlled zone - - bool ControlledZoneAirFlag = state.dataHeatBal->Zone(ZoneNum).IsControlled; - // Check to see if this is a plenum zone - ZoneRetPlenumAirFlag = false; - for (ZoneRetPlenumNum = 1; ZoneRetPlenumNum <= state.dataZonePlenum->NumZoneReturnPlenums; ++ZoneRetPlenumNum) { - if (state.dataZonePlenum->ZoneRetPlenCond(ZoneRetPlenumNum).ActualZoneNum != ZoneNum) continue; - ZoneRetPlenumAirFlag = true; + int zoneRetPlenumNum = 0; + for (int iPlenum = 1; iPlenum <= state.dataZonePlenum->NumZoneReturnPlenums; ++iPlenum) { + if (state.dataZonePlenum->ZoneRetPlenCond(iPlenum).ActualZoneNum != zoneNum) continue; + zoneRetPlenumNum = iPlenum; break; - } // ZoneRetPlenumNum - ZoneSupPlenumAirFlag = false; - for (ZoneSupPlenumNum = 1; ZoneSupPlenumNum <= state.dataZonePlenum->NumZoneSupplyPlenums; ++ZoneSupPlenumNum) { - if (state.dataZonePlenum->ZoneSupPlenCond(ZoneSupPlenumNum).ActualZoneNum != ZoneNum) continue; - ZoneSupPlenumAirFlag = true; + } + bool zoneSupPlenumNum = false; + for (int iPlenum = 1; iPlenum <= state.dataZonePlenum->NumZoneSupplyPlenums; ++iPlenum) { + if (state.dataZonePlenum->ZoneSupPlenCond(iPlenum).ActualZoneNum != zoneNum) continue; + zoneSupPlenumNum = iPlenum; break; - } // ZoneSupPlenumNum + } // Plenum and controlled zones have a different set of inlet nodes which must be calculated. - auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - if (ControlledZoneAirFlag) { - auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneNum); - for (NodeNum = 1; NodeNum <= thisZoneEquipConfig.NumInletNodes; ++NodeNum) { + auto &zoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum); + if (zone.IsControlled) { + auto &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum); + for (int iNode = 1; iNode <= zoneEquipConfig.NumInletNodes; ++iNode) { // Get node conditions // this next block is of interest to irratic system loads... maybe nodes are not accurate at time of call ? // how can we tell ? predict step must be lagged ? correct step, systems have run. - for (EquipLoop = 1; EquipLoop <= afnNode.NumHVACs; - ++EquipLoop) { - if (afnNode.HVAC(EquipLoop).SupNodeNum == - thisZoneEquipConfig.InletNode(NodeNum)) { - NodeTemp = state.dataLoopNodes->Node(thisZoneEquipConfig.InletNode(NodeNum)).Temp; - NodeW = state.dataLoopNodes->Node(thisZoneEquipConfig.InletNode(NodeNum)).HumRat; - MassFlowRate = state.dataLoopNodes->Node(thisZoneEquipConfig.InletNode(NodeNum)).MassFlowRate * - afnNode.HVAC(EquipLoop).SupplyFraction; - CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); + auto const &inletNode = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(iNode)); + for (auto const &afnHVAC : afnNode.HVAC) { + if (afnHVAC.SupNodeNum == zoneEquipConfig.InletNode(iNode)) { + Real64 MassFlowRate = inletNode.MassFlowRate * afnHVAC.SupplyFraction; + Real64 CpAir = PsyCpAirFnW(zoneHB.ZoneAirHumRat); SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + SumSysMCpT += MassFlowRate * CpAir * inletNode.Temp; SumSysM += MassFlowRate; - SumSysMW += MassFlowRate * NodeW; + SumSysMW += MassFlowRate * inletNode.HumRat; } } // EquipLoop } // NodeNum - } else if (ZoneRetPlenumAirFlag) { - for (NodeNum = 1; NodeNum <= state.dataZonePlenum->ZoneRetPlenCond(ZoneRetPlenumNum).NumInletNodes; ++NodeNum) { + } else if (zoneRetPlenumNum != 0) { + auto const &zoneRetPlenum = state.dataZonePlenum->ZoneRetPlenCond(zoneRetPlenumNum); + for (int iNode = 1; iNode <= zoneRetPlenum.NumInletNodes; ++iNode) { // Get node conditions - NodeTemp = state.dataLoopNodes->Node(state.dataZonePlenum->ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).Temp; - MassFlowRate = state.dataLoopNodes->Node(state.dataZonePlenum->ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); - SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + auto const &zoneRetPlenumNode = state.dataLoopNodes->Node(zoneRetPlenum.InletNode(iNode)); + Real64 CpAir = PsyCpAirFnW(zoneHB.ZoneAirHumRat); + SumSysMCp += zoneRetPlenumNode.MassFlowRate * CpAir; + SumSysMCpT += zoneRetPlenumNode.MassFlowRate * CpAir * zoneRetPlenumNode.Temp; } // NodeNum // add in the leaks - for (ADUListIndex = 1; ADUListIndex <= state.dataZonePlenum->ZoneRetPlenCond(ZoneRetPlenumNum).NumADUs; ++ADUListIndex) { - ADUNum = state.dataZonePlenum->ZoneRetPlenCond(ZoneRetPlenumNum).ADUIndex(ADUListIndex); - if (state.dataDefineEquipment->AirDistUnit(ADUNum).UpStreamLeak) { - ADUInNode = state.dataDefineEquipment->AirDistUnit(ADUNum).InletNodeNum; - NodeTemp = state.dataLoopNodes->Node(ADUInNode).Temp; - MassFlowRate = state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateUpStrLk; - CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); - SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + for (int iADU = 1; iADU <= zoneRetPlenum.NumADUs; ++iADU) { + int ADUNum = zoneRetPlenum.ADUIndex(iADU); + auto const &adu = state.dataDefineEquipment->AirDistUnit(ADUNum); + if (adu.UpStreamLeak) { + Real64 CpAir = PsyCpAirFnW(zoneHB.ZoneAirHumRat); + SumSysMCp += adu.MassFlowRateUpStrLk * CpAir; + SumSysMCpT += adu.MassFlowRateUpStrLk * CpAir * state.dataLoopNodes->Node(adu.InletNodeNum).Temp; } - if (state.dataDefineEquipment->AirDistUnit(ADUNum).DownStreamLeak) { - ADUOutNode = state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum; - NodeTemp = state.dataLoopNodes->Node(ADUOutNode).Temp; - MassFlowRate = state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateDnStrLk; - CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); - SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + if (adu.DownStreamLeak) { + Real64 CpAir = PsyCpAirFnW(zoneHB.ZoneAirHumRat); + SumSysMCp += adu.MassFlowRateDnStrLk * CpAir; + SumSysMCpT += adu.MassFlowRateDnStrLk * CpAir * state.dataLoopNodes->Node(adu.OutletNodeNum).Temp; } } // ADUListIndex - } else if (ZoneSupPlenumAirFlag) { + } else if (zoneSupPlenumNum != 0) { // Get node conditions - NodeTemp = state.dataLoopNodes->Node(state.dataZonePlenum->ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; - MassFlowRate = state.dataLoopNodes->Node(state.dataZonePlenum->ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; - CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); - SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + auto const &zoneSupPlenum = state.dataZonePlenum->ZoneSupPlenCond(zoneSupPlenumNum); + auto const &inletNode = state.dataLoopNodes->Node(zoneSupPlenum.InletNode); + Real64 CpAir = PsyCpAirFnW(zoneHB.ZoneAirHumRat); + SumSysMCp += inletNode.MassFlowRate * CpAir; + SumSysMCpT += inletNode.MassFlowRate * CpAir * inletNode.Temp; } - ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; + int ZoneMult = zone.Multiplier * zone.ListMultiplier; - SumSysMCp = SumSysMCp / ZoneMult; - SumSysMCpT = SumSysMCpT / ZoneMult; - SumSysM = SumSysM / ZoneMult; - SumSysMW = SumSysMW / ZoneMult; + SumSysMCp /= ZoneMult; + SumSysMCpT /= ZoneMult; + SumSysM /= ZoneMult; + SumSysMW /= ZoneMult; // Sum all surface convection : SumHA, SumHATsurf, SumHATref(and additional contributions to SumIntGain) // Modified by Gu to include assigned surfaces only shown in the surface lsit if (!afnNode.HasSurfacesAssigned) return; int surfCount = 0; - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { ++surfCount; - if (afnZoneInfo.ControlAirNodeID == RoomAirNodeNum) { + if (afnZoneInfo.ControlAirNodeID == roomAirNodeNum) { Found = false; - for (Loop = 1; Loop <= afnZoneInfo.NumOfAirNodes; ++Loop) { - if (Loop != RoomAirNodeNum) { + for (int Loop = 1; Loop <= afnZoneInfo.NumOfAirNodes; ++Loop) { + if (Loop != roomAirNodeNum) { if (afnZoneInfo.Node(Loop).SurfMask(surfCount)) { Found = true; break; @@ -1015,7 +838,7 @@ namespace RoomAir { // Convective heat gain from airflow window if (state.dataSurface->SurfWinAirflowThisTS(SurfNum) > 0.0) { SumIntGain += state.dataSurface->SurfWinConvHeatGainToZoneAir(SurfNum); - if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { + if (zone.NoHeatToReturnAir) { SumIntGain += state.dataSurface->SurfWinRetHeatGainToZoneAir(SurfNum); state.dataSurface->SurfWinHeatGain(SurfNum) += state.dataSurface->SurfWinRetHeatGainToZoneAir(SurfNum); if (state.dataSurface->SurfWinHeatGain(SurfNum) >= 0.0) { @@ -1053,30 +876,30 @@ namespace RoomAir { } // End of check if window - HA = HA + state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area; + HA += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area; SumHATsurf += state.dataHeatBalSurf->SurfHConvInt(SurfNum) * Area * state.dataHeatBalSurf->SurfTempInTmp(SurfNum); if (state.dataSurface->SurfTAirRef(SurfNum) == DataSurfaces::RefAirTemp::ZoneMeanAirTemp) { // The zone air is the reference temperature(which is to be solved for in CorrectZoneAirTemp). - RefAirTemp = thisZoneHB.MAT; + RefAirTemp = zoneHB.MAT; SumHA += HA; } else if (state.dataSurface->SurfTAirRef(SurfNum) == DataSurfaces::RefAirTemp::AdjacentAirTemp) { RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); SumHATref += HA * RefAirTemp; } else if (state.dataSurface->SurfTAirRef(SurfNum) == DataSurfaces::RefAirTemp::ZoneSupplyAirTemp) { // check whether this zone is a controlled zone or not - if (!ControlledZoneAirFlag) { + if (!zone.IsControlled) { ShowFatalError(state, format("Zones must be controlled for Ceiling-Diffuser Convection model. No system serves zone {}", - state.dataHeatBal->Zone(ZoneNum).Name)); + zone.Name)); return; } // determine supply air temperature as a weighted average of the inlet temperatures. RefAirTemp = SumSysMCpT / SumSysMCp; SumHATref += HA * RefAirTemp; } else { - RefAirTemp = thisZoneHB.MAT; - SumHA = SumHA + HA; + RefAirTemp = zoneHB.MAT; + SumHA += HA; } } // SurfNum @@ -1092,12 +915,13 @@ namespace RoomAir { } // CalcNodeSums - void RAFNData::CalcSurfaceMoistureSums(EnergyPlusData &state, - int const RoomAirNode, - Real64 &SumHmAW, - Real64 &SumHmARa, - Real64 &SumHmARaW, - [[maybe_unused]] Array1D const &SurfMask) + void CalcSurfaceMoistureSums(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum, + Real64 &SumHmAW, + Real64 &SumHmARa, + Real64 &SumHmARaW, + [[maybe_unused]] Array1D const &SurfMask) { // SUBROUTINE INFORMATION: @@ -1105,7 +929,6 @@ namespace RoomAir { // derived from P. Biddulph-- HAMT, L. Gu -- EPMD, // DATE WRITTEN November 2009 // MODIFIED Lixing Gu, Aug. 2015 for v8.4 replease - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Breakout summation of surface moisture interaction terms @@ -1119,78 +942,63 @@ namespace RoomAir { using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyWFnTdbRhPb; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int Loop; - Real64 RhoAirZone; - Real64 Wsurf; - bool Found; - SumHmAW = 0.0; SumHmARa = 0.0; SumHmARaW = 0.0; - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); - int surfCount = 0; - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + int surfCount = 1; + for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); - for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { - ++surfCount; - if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Window) continue; + for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum, ++surfCount) { + auto const &surf = state.dataSurface->Surface(SurfNum); + if (surf.Class == SurfaceClass::Window) continue; - if (afnZoneInfo.ControlAirNodeID == RoomAirNode) { - Found = false; - for (Loop = 1; Loop <= afnZoneInfo.NumOfAirNodes; ++Loop) { + if (afnZoneInfo.ControlAirNodeID == roomAirNodeNum) { + bool Found = false; + for (int Loop = 1; Loop <= afnZoneInfo.NumOfAirNodes && !Found; ++Loop) { // None - assigned surfaces belong to the zone node - if (Loop != RoomAirNode) { - if (afnZoneInfo.Node(Loop).SurfMask(surfCount)) { - Found = true; - break; - } - } + Found = (Loop != roomAirNodeNum) && afnZoneInfo.Node(Loop).SurfMask(surfCount); } if (Found) continue; } else { - if (!afnZoneInfo.Node(RoomAirNode).SurfMask(surfCount)) continue; + if (!afnZoneInfo.Node(roomAirNodeNum).SurfMask(surfCount)) continue; } auto &HMassConvInFD = state.dataMstBal->HMassConvInFD; auto &RhoVaporSurfIn = state.dataMstBal->RhoVaporSurfIn; auto &RhoVaporAirIn = state.dataMstBal->RhoVaporAirIn; - if (state.dataSurface->Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::HeatTransferModel::HAMT) { + if (surf.HeatTransferAlgorithm == DataSurfaces::HeatTransferModel::HAMT) { UpdateHeatBalHAMT(state, SurfNum); - SumHmAW += HMassConvInFD(SurfNum) * state.dataSurface->Surface(SurfNum).Area * (RhoVaporSurfIn(SurfNum) - RhoVaporAirIn(SurfNum)); + SumHmAW += HMassConvInFD(SurfNum) * surf.Area * (RhoVaporSurfIn(SurfNum) - RhoVaporAirIn(SurfNum)); - RhoAirZone = PsyRhoAirFnPbTdbW( + Real64 RhoAirZone = PsyRhoAirFnPbTdbW( state, state.dataEnvrn->OutBaroPress, - state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(SurfNum).Zone).MAT, + state.dataZoneTempPredictorCorrector->zoneHeatBalance(surf.Zone).MAT, PsyRhFnTdbRhov(state, state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(SurfNum).Zone).MAT, RhoVaporAirIn(SurfNum), "RhoAirZone")); - Wsurf = PsyWFnTdbRhPb(state, + Real64 Wsurf = PsyWFnTdbRhPb(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), PsyRhFnTdbRhov(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), RhoVaporSurfIn(SurfNum), "Wsurf"), state.dataEnvrn->OutBaroPress); - SumHmARa = SumHmARa + HMassConvInFD(SurfNum) * state.dataSurface->Surface(SurfNum).Area * RhoAirZone; - - SumHmARaW = SumHmARaW + HMassConvInFD(SurfNum) * state.dataSurface->Surface(SurfNum).Area * RhoAirZone * Wsurf; + SumHmARa += HMassConvInFD(SurfNum) * surf.Area * RhoAirZone; + SumHmARaW += HMassConvInFD(SurfNum) * surf.Area * RhoAirZone * Wsurf; } - if (state.dataSurface->Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::HeatTransferModel::EMPD) { + else if (surf.HeatTransferAlgorithm == DataSurfaces::HeatTransferModel::EMPD) { UpdateMoistureBalanceEMPD(state, SurfNum); RhoVaporSurfIn(SurfNum) = state.dataMstBalEMPD->RVSurface(SurfNum); - SumHmAW = SumHmAW + - HMassConvInFD(SurfNum) * state.dataSurface->Surface(SurfNum).Area * (RhoVaporSurfIn(SurfNum) - RhoVaporAirIn(SurfNum)); - SumHmARa = - SumHmARa + - HMassConvInFD(SurfNum) * state.dataSurface->Surface(SurfNum).Area * + SumHmAW += HMassConvInFD(SurfNum) * surf.Area * (RhoVaporSurfIn(SurfNum) - RhoVaporAirIn(SurfNum)); + SumHmARa += HMassConvInFD(SurfNum) * surf.Area * PsyRhoAirFnPbTdbW( state, state.dataEnvrn->OutBaroPress, @@ -1199,21 +1007,22 @@ namespace RoomAir { state.dataHeatBalSurf->SurfTempInTmp(SurfNum), PsyRhFnTdbRhovLBnd0C(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), RhoVaporAirIn(SurfNum)), state.dataEnvrn->OutBaroPress)); - SumHmARaW = SumHmARaW + HMassConvInFD(SurfNum) * state.dataSurface->Surface(SurfNum).Area * RhoVaporSurfIn(SurfNum); + SumHmARaW += HMassConvInFD(SurfNum) * surf.Area * RhoVaporSurfIn(SurfNum); } - } - } + } // for (SurfNum) + } // for (spaceNum) } // CalcSurfaceMoistureSums - void RAFNData::SumNonAirSystemResponseForNode(EnergyPlusData &state, int const RAFNNodeNum) + void SumNonAirSystemResponseForNode(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum) { // SUBROUTINE INFORMATION: // AUTHOR B. Griffith // DATE WRITTEN June 2012 // MODIFIED Lixing Gu, Aug. 2015 for v8.4 replease - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Sum system response from none air systems @@ -1232,64 +1041,62 @@ namespace RoomAir { Real64 LatOutputProvided; // TODO - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); - auto &roomAFNNode = afnZoneInfo.Node(RAFNNodeNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); + auto &afnNode = afnZoneInfo.Node(roomAirNodeNum); - roomAFNNode.NonAirSystemResponse = 0.0; + afnNode.NonAirSystemResponse = 0.0; if (!allocated(state.dataZoneEquip->ZoneEquipConfig)) return; - for (int I = 1; I <= roomAFNNode.NumHVACs; ++I) { - auto &roomAFNNodeHVAC = roomAFNNode.HVAC(I); - switch (roomAFNNodeHVAC.zoneEquipType) { + for (auto &afnHVAC : afnNode.HVAC) { + switch (afnHVAC.zoneEquipType) { case DataZoneEquipment::ZoneEquipType::BaseboardWater: { //'ZoneHVAC:Baseboard:RadiantConvective:Water' 13 - SimHWBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); - roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; + SimHWBaseboard(state, afnHVAC.Name, zoneNum, false, SysOutputProvided, afnHVAC.CompIndex); + afnNode.NonAirSystemResponse += afnHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; case DataZoneEquipment::ZoneEquipType::BaseboardSteam: { // CASE(BBSteam_Num) !'ZoneHVAC:Baseboard:RadiantConvective:Steam' 14 - SimSteamBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); + SimSteamBaseboard(state, afnHVAC.Name, zoneNum, false, SysOutputProvided, afnHVAC.CompIndex); - roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; + afnNode.NonAirSystemResponse += afnHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater: { // CASE(BBWaterConvective_Num) !'ZoneHVAC:Baseboard:Convective:Water' 16 - SimBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); - roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; + SimBaseboard(state, afnHVAC.Name, zoneNum, false, SysOutputProvided, afnHVAC.CompIndex); + afnNode.NonAirSystemResponse += afnHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; case DataZoneEquipment::ZoneEquipType::BaseboardConvectiveElectric: { // CASE(BBElectricConvective_Num) !'ZoneHVAC:Baseboard:Convective:Electric' 15 - SimElectricBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, SysOutputProvided, roomAFNNodeHVAC.CompIndex); - roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; + SimElectricBaseboard(state, afnHVAC.Name, zoneNum, SysOutputProvided, afnHVAC.CompIndex); + afnNode.NonAirSystemResponse += afnHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; case DataZoneEquipment::ZoneEquipType::RefrigerationChillerSet: { // CASE(RefrigerationAirChillerSet_Num) !'ZoneHVAC:RefrigerationChillerSet' 20 - SimAirChillerSet( - state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, LatOutputProvided, roomAFNNodeHVAC.CompIndex); - roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; + SimAirChillerSet(state, afnHVAC.Name, zoneNum, false, SysOutputProvided, LatOutputProvided, afnHVAC.CompIndex); + afnNode.NonAirSystemResponse += afnHVAC.SupplyFraction * SysOutputProvided; } break; case DataZoneEquipment::ZoneEquipType::BaseboardElectric: { // CASE(BBElectric_Num) !'ZoneHVAC:Baseboard:RadiantConvective:Electric' 12 - SimElecBaseboard(state, roomAFNNodeHVAC.Name, ZoneNum, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); - roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; + SimElecBaseboard(state, afnHVAC.Name, zoneNum, false, SysOutputProvided, afnHVAC.CompIndex); + afnNode.NonAirSystemResponse += afnHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; case DataZoneEquipment::ZoneEquipType::HighTemperatureRadiant: { // CASE(BBElectric_Num) !'ZoneHVAC:HighTemperatureRadiant' 17 - SimHighTempRadiantSystem(state, roomAFNNodeHVAC.Name, false, SysOutputProvided, roomAFNNodeHVAC.CompIndex); - roomAFNNode.NonAirSystemResponse += roomAFNNodeHVAC.SupplyFraction * SysOutputProvided; + SimHighTempRadiantSystem(state, afnHVAC.Name, false, SysOutputProvided, afnHVAC.CompIndex); + afnNode.NonAirSystemResponse += afnHVAC.SupplyFraction * SysOutputProvided; // LatOutputProvided = 0.0d0 !This baseboard does not add / remove any latent heat } break; @@ -1304,13 +1111,13 @@ namespace RoomAir { //***************************************************************************************** - void RAFNData::SumSystemDepResponseForNode(EnergyPlusData &state) + void SumSystemDepResponseForNode(EnergyPlusData &state, + int const zoneNum) { // SUBROUTINE INFORMATION: // AUTHOR B.Griffith // DATE WRITTEN aug 2005, Jan2004 // MODIFIED Lixing Gu, Aug. 2015 for v8.4 replease - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Sum system sensible loads used at the next time step @@ -1319,40 +1126,36 @@ namespace RoomAir { using ZoneDehumidifier::SimZoneDehumidifier; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int I; - Real64 SysOutputProvided; Real64 LatOutputProvided; - int RoomAirNode; // TODO - auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); + auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); // SysDepZoneLoads saved to be added to zone heat balance next - SysOutputProvided = 0.0; - for (RoomAirNode = 1; RoomAirNode <= afnZoneInfo.NumOfAirNodes; ++RoomAirNode) { - afnZoneInfo.Node(RoomAirNode).SysDepZoneLoadsLaggedOld = 0.0; - for (int I = 1; I <= afnZoneInfo.Node(RoomAirNode).NumHVACs; ++I) { - if (afnZoneInfo.Node(RoomAirNode).HVAC(I).zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { + Real64 SysOutputProvided = 0.0; + for (auto &afnNode : afnZoneInfo.Node) { + afnNode.SysDepZoneLoadsLaggedOld = 0.0; + for (auto &afnHVAC : afnNode.HVAC) { + if (afnHVAC.zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { if (SysOutputProvided == 0.0) SimZoneDehumidifier(state, - afnZoneInfo.Node(RoomAirNode).HVAC(I).Name, - ZoneNum, + afnHVAC.Name, + zoneNum, false, SysOutputProvided, LatOutputProvided, - afnZoneInfo.Node(RoomAirNode).HVAC(I).CompIndex); + afnHVAC.CompIndex); if (SysOutputProvided > 0.0) break; } } } if (SysOutputProvided > 0.0) { - for (RoomAirNode = 1; RoomAirNode <= afnZoneInfo.NumOfAirNodes; ++RoomAirNode) { - for (I = 1; I <= afnZoneInfo.Node(RoomAirNode).NumHVACs; ++I) { - if (afnZoneInfo.Node(RoomAirNode).HVAC(I).zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { - afnZoneInfo.Node(RoomAirNode).SysDepZoneLoadsLaggedOld += - afnZoneInfo.Node(RoomAirNode).HVAC(I).SupplyFraction * SysOutputProvided; + for (auto &afnNode : afnZoneInfo.Node) { + for (auto const &afnHVAC : afnNode.HVAC) { + if (afnHVAC.zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { + afnNode.SysDepZoneLoadsLaggedOld += afnHVAC.SupplyFraction * SysOutputProvided; } } } diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.hh b/src/EnergyPlus/RoomAirModelAirflowNetwork.hh index add3d454989..023f301dbc2 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.hh +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.hh @@ -60,35 +60,41 @@ struct EnergyPlusData; namespace RoomAir { // Data - class RAFNData { - public: - int ZoneNum = 0; - int RoomAirNode = 0; + void InitRoomAirModelAFN(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum); // index number for the specified zone and room air node - void InitRoomAirModelAirflowNetwork(EnergyPlusData &state, int const RoomAirNode); // index number for the specified zone and room air node + void CalcRoomAirModelAFN(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum); // index number for the specified zone and room air node - void CalcRoomAirModelAirflowNetwork(EnergyPlusData &state, - int const ThisRoomAirNode); // index number for the specified zone and room air node + void UpdateRoomAirModelAFN(EnergyPlusData &state, + int const zoneNum); // index number for the specified zone - void UpdateRoomAirModelAirflowNetwork(EnergyPlusData &state); // index number for the specified zone + void CalcNodeSums(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum); // index number for the specified zone and room air node - void CalcNodeSums(EnergyPlusData &state, int const RoomAirNode); // index number for the specified zone and room air node + void SumNonAirSystemResponseForNode(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum); // index number for the specified zone and room air node - void SumNonAirSystemResponseForNode(EnergyPlusData &state, int const RoomAirNode); // index number for the specified zone and room air node + void SumSystemDepResponseForNode(EnergyPlusData &state, + int const zoneNum); // index number for the specified zone and room air node - void SumSystemDepResponseForNode(EnergyPlusData &state); // index number for the specified zone and room air node + void CalcSurfaceMoistureSums(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum, + Real64 &SumHmAW, + Real64 &SumHmARa, + Real64 &SumHmARaW, + Array1D const &SurfMask); - void CalcSurfaceMoistureSums( - EnergyPlusData &state, int const RoomAirNode, Real64 &SumHmAW, Real64 &SumHmARa, Real64 &SumHmARaW, Array1D const &SurfMask); - }; + void SimRoomAirModelAFN(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone - // Object data - - void SimRoomAirModelAirflowNetwork(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone - - void LoadPredictionRoomAirModelAirflowNetwork(EnergyPlusData &state, - int const ZoneNum, - int const RoomAirNode); // index number for the specified zone and node + void LoadPredictionRoomAirModelAFN(EnergyPlusData &state, + int const zoneNum, + int const roomAirNodeNum); // index number for the specified zone and node //***************************************************************************************** @@ -96,19 +102,15 @@ namespace RoomAir { struct RoomAirModelAirflowNetworkData : BaseGlobalStruct { - bool InitRoomAirModelAirflowNetworkOneTimeFlag = true; - bool InitRoomAirModelAirflowNetworkOneTimeFlagConf = true; - bool InitRoomAirModelAirflowNetworkEnvrnFlag = true; - bool LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag = true; - Array1D RAFN; + bool OneTimeFlag = true; + bool OneTimeFlagConf = true; + bool EnvrnFlag = true; void clear_state() override { - this->InitRoomAirModelAirflowNetworkOneTimeFlag = true; - this->InitRoomAirModelAirflowNetworkOneTimeFlagConf = true; - this->InitRoomAirModelAirflowNetworkEnvrnFlag = true; - this->LoadPredictionRoomAirModelAirflowNetworkOneTimeFlag = true; - this->RAFN.clear(); + this->OneTimeFlag = true; + this->OneTimeFlagConf = true; + this->EnvrnFlag = true; } }; diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 3451ee0a6e9..355882bf9c1 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -172,7 +172,7 @@ namespace RoomAir { case RoomAirModel::AirflowNetwork: // RoomAirflowNetwork zone model // simulate room airflow using the AirflowNetwork - based model - SimRoomAirModelAirflowNetwork(state, ZoneNum); + SimRoomAirModelAFN(state, ZoneNum); break; default: // mixing air model @@ -1311,7 +1311,6 @@ namespace RoomAir { auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(ZoneNum); roomAFNZoneInfo.ZoneID = ZoneNum; - roomAFNZoneInfo.roomAFNNodeNum = Loop; roomAFNZoneInfo.IsUsed = true; roomAFNZoneInfo.Name = ipsc->cAlphaArgs(1); roomAFNZoneInfo.ZoneName = ipsc->cAlphaArgs(2); // Zone Name diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index ec8fb812f8e..9ea43a42dec 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -734,7 +734,6 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // returnNode.Press = zoneNode.Press; Real64 H2OHtOfVap = PsyHgAirFnWTdb(zoneNode.HumRat, returnNode.Temp); - Real64 RhoAir = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, returnNode.Temp, zoneNode.HumRat); // Include impact of under case returns for refrigerated display cases when updateing return node // humidity ratio diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 1f518e18850..60bb16781cb 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -3591,7 +3591,7 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); if (afnZoneInfo.IsUsed) { int RoomAirNode = afnZoneInfo.ControlAirNodeID; - RoomAir::LoadPredictionRoomAirModelAirflowNetwork(state, zoneNum, RoomAirNode); + RoomAir::LoadPredictionRoomAirModelAFN(state, zoneNum, RoomAirNode); this->TempDepCoef = afnZoneInfo.Node(RoomAirNode).SumHA + afnZoneInfo.Node(RoomAirNode).SumLinkMCp; this->TempIndCoef = afnZoneInfo.Node(RoomAirNode).SumIntSensibleGain + diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 1836730d032..69768beea1c 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -132,7 +132,6 @@ class RoomAirflowNetworkTest : public EnergyPlusFixture state->afn->AirflowNetworkLinkageData.allocate(5); state->afn->AirflowNetworkNodeSimu.allocate(6); state->afn->AirflowNetworkLinkSimu.allocate(5); - state->dataRoomAirflowNetModel->RAFN.allocate(state->dataGlobal->NumOfZones); } virtual void TearDown() @@ -316,10 +315,7 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) PsyCpAirFnW(thisZoneHB.ZoneAirHumRat)); RoomAirNode = 1; - auto &thisRAFN(state->dataRoomAirflowNetModel->RAFN(ZoneNum)); - thisRAFN.ZoneNum = ZoneNum; - - thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); + InitRoomAirModelAFN(*state, ZoneNum, RoomAirNode); EXPECT_NEAR(120.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); EXPECT_NEAR(80.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); @@ -338,14 +334,14 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) EXPECT_NEAR(0.0009756833, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); EXPECT_NEAR(9.0784549e-7, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); - thisRAFN.CalcRoomAirModelAirflowNetwork(*state, RoomAirNode); + CalcRoomAirModelAFN(*state, ZoneNum, RoomAirNode); EXPECT_NEAR(24.907085, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); EXPECT_NEAR(0.00189601, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); EXPECT_NEAR(9.770445, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); RoomAirNode = 2; - thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); + InitRoomAirModelAFN(*state, ZoneNum, RoomAirNode); EXPECT_NEAR(180.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntSensibleGain, 0.00001); EXPECT_NEAR(120.0, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumIntLatentGain, 0.00001); @@ -364,13 +360,13 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) EXPECT_NEAR(0.0019191284, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARa, 0.0000001); EXPECT_NEAR(1.98975381e-6, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).SumHmARaW, 0.0000001); - thisRAFN.CalcRoomAirModelAirflowNetwork(*state, RoomAirNode); + CalcRoomAirModelAFN(*state, ZoneNum, RoomAirNode); EXPECT_NEAR(24.057841, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).AirTemp, 0.00001); EXPECT_NEAR(0.0028697086, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).HumRat, 0.00001); EXPECT_NEAR(15.53486185, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RelHumidity, 0.00001); - thisRAFN.UpdateRoomAirModelAirflowNetwork(*state); + UpdateRoomAirModelAFN(*state, ZoneNum); EXPECT_NEAR(24.397538, state->dataLoopNodes->Node(2).Temp, 0.00001); EXPECT_NEAR(0.0024802305, state->dataLoopNodes->Node(2).HumRat, 0.000001); @@ -394,7 +390,7 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->afn->get_input(); state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipType(1) = DataZoneEquipment::ZoneEquipType::AirDistributionUnit; - state->dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf = true; + state->dataRoomAirflowNetModel->OneTimeFlagConf = true; state->dataZoneAirLoopEquipmentManager->GetAirDistUnitsFlag = false; state->dataDefineEquipment->AirDistUnit.allocate(1); state->dataZoneEquip->ZoneEquipList(ZoneNum).EquipName(1) = "ADU"; @@ -408,12 +404,12 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).SupplyFraction = 0.6; state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(2).HVAC(1).ReturnFraction = 0.6; - thisRAFN.InitRoomAirModelAirflowNetwork(*state, RoomAirNode); + InitRoomAirModelAFN(*state, ZoneNum, RoomAirNode); // No errorfound EXPECT_NEAR(1.1824296, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).RhoAir, 0.00001); EXPECT_NEAR(1010.1746, state->dataRoomAir->AFNZoneInfo(ZoneNum).Node(RoomAirNode).CpAir, 0.001); - state->dataRoomAirflowNetModel->InitRoomAirModelAirflowNetworkOneTimeFlagConf = false; + state->dataRoomAirflowNetModel->OneTimeFlagConf = false; } TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check) { From 59b14bbbbb32bcdd5fe030b8066f49520b40d814 Mon Sep 17 00:00:00 2001 From: amirroth Date: Tue, 27 Jun 2023 11:34:00 -0400 Subject: [PATCH 13/17] Some UFAD cleanup --- src/EnergyPlus/DataRoomAirModel.hh | 80 +- src/EnergyPlus/HeatBalanceAirManager.cc | 2 +- src/EnergyPlus/InternalHeatGains.cc | 2 +- src/EnergyPlus/RoomAirModelManager.cc | 24 +- src/EnergyPlus/ThermalComfort.cc | 12 +- src/EnergyPlus/UFADManager.cc | 807 +++++++------------ src/EnergyPlus/UFADManager.hh | 26 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 8 +- tst/EnergyPlus/unit/HybridModel.unit.cc | 4 +- tst/EnergyPlus/unit/ThermalComfort.unit.cc | 4 +- 10 files changed, 327 insertions(+), 642 deletions(-) diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index 479c3a717b5..f525373c01d 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -241,33 +241,7 @@ namespace RoomAir { Real64 Zmax = 0.0; }; - struct UFADIntData - { - // Members - std::string ZoneName = ""; // Name of zone - int ZonePtr = 0; // Pointer to the zone number for this statement - int ZoneEquipPtr = 0; // Pointer to zone equip for this UFAD zone - Real64 DiffusersPerZone = 0.0; // Number of diffusers in this zone - Real64 PowerPerPlume = 0.0; // Power in each plume [W] - Real64 DiffArea = 0.0; // Effective area of a diffuser [m2] - Real64 DiffAngle = 0.0; // angle between diffuser slots and vertical (degrees) - Real64 HeatSrcHeight = 0.0; // height of heat source above floor [m] - Real64 ThermostatHeight = 0.0; // Height of thermostat/ temperature control sensor [m] - Real64 ComfortHeight = 0.0; // Height at which air temperature is measured for - // comfort purposes [m] - Real64 TempTrigger = 0.0; // Minimum temperature difference between TOC TMX - // for stratification [deltaC] - Diffuser DiffuserType = Diffuser::Invalid; // 1=Swirl, 2=variable area, 3=displacement, 4=linear bar grille, 5=custom - Real64 TransHeight = 0.0; // user specified transition height [m] - bool CalcTransHeight; // flag to calc trans height or use user specified input - Real64 A_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 B_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 C_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 D_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 E_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - }; - - struct UFADExtData + struct UFADData { // Members std::string ZoneName = ""; // Name of zone @@ -639,7 +613,7 @@ struct RoomAirModelData : BaseGlobalStruct // UCSD-UF int TotUFADInt = 0; // total number of UCSDUI zones int TotUFADExt = 0; // total number of UCSDUE zones - Array1D_bool IsZoneUI; // controls program flow, for interior or exterior UFAD model + Array1D_bool IsZoneUFAD; // controls program flow, for interior or exterior UFAD model Array1D_int ZoneUFADPtr; Array1D UFADHcIn; Array1D_int ZoneUFADMixedFlag; @@ -667,8 +641,7 @@ struct RoomAirModelData : BaseGlobalStruct Array1D AirNode; Array1D ZoneDispVent3Node; // UCSD Array1D ZoneCrossVent; - Array1D ZoneUFADInt; - Array1D ZoneUFADExt; + Array1D ZoneUFAD; Array2D CrossVentJetRecFlows; // Jet and recirculation zone flows and properties Array1D SurfParametersCrossDispVent; // Surface parameters Array1D AirPattern; // user defined patterns ,various types @@ -724,58 +697,16 @@ struct RoomAirModelData : BaseGlobalStruct ZoneCeilingHeight2.clear(); MATFloor.clear(); // [C] floor level mean air temp XMATFloor.clear(); // [C] floor level mean air temp at t minus 1 zone time step -#ifdef GET_OUT - XM2TFloor.clear(); // [C] floor level mean air temp at t minus 2 zone time step - XM3TFloor.clear(); // [C] floor level mean air temp at t minus 3 zone time step - XM4TFloor.clear(); // [C] floor level mean air temp at t minus 4 zone time step -#endif // DSXMATFloor.clear(); // [C] floor level mean air temp at t minus 1 system time step -#ifdef GET_OUT - DSXM2TFloor.clear(); // [C] floor level mean air temp at t minus 2 system time step - DSXM3TFloor.clear(); // [C] floor level mean air temp at t minus 3 system time step - DSXM4TFloor.clear(); // [C] floor level mean air temp at t minus 4 system time step -#endif // MATOC.clear(); // [C] occupied mean air temp XMATOC.clear(); // [C] occupied mean air temp at t minus 1 zone time step -#ifdef GET_OUT - XM2TOC.clear(); // [C] occupied mean air temp at t minus 2 zone time step - XM3TOC.clear(); // [C] occupied mean air temp at t minus 3 zone time step - XM4TOC.clear(); // [C] occupied mean air temp at t minus 4 zone time step -#endif // DSXMATOC.clear(); // [C] occupied mean air temp at t minus 1 system time step -#ifdef GET_OUT - DSXM2TOC.clear(); // [C] occupied mean air temp at t minus 2 system time step - DSXM3TOC.clear(); // [C] occupied mean air temp at t minus 3 system time step - DSXM4TOC.clear(); // [C] occupied mean air temp at t minus 4 system time step -#endif // MATMX.clear(); // [C] mixed (upper) mean air temp XMATMX.clear(); // [C] mixed (upper) mean air temp at t minus 1 zone time step -#ifdef GET_OUT - XM2TMX.clear(); // [C] mixed (upper) mean air temp at t minus 2 zone time step - XM3TMX.clear(); // [C] mixed (upper) mean air temp at t minus 3 zone time step - XM4TMX.clear(); // [C] mixed (upper) mean air temp at t minus 4 zone time step -#endif // DSXMATMX.clear(); // [C] mixed mean air temp at t minus 1 system time step -#ifdef GET_OUT - DSXM2TMX.clear(); // [C] mixed mean air temp at t minus 2 system time step - DSXM3TMX.clear(); // [C] mixed mean air temp at t minus 3 system time step - DSXM4TMX.clear(); // [C] mixed mean air temp at t minus 4 system time step -#endif // ZTMFloor.clear(); // [C] difference equation's Floor air temp at t minus 1 -#ifdef GET_OUT - ZTM2Floor.clear(); // [C] difference equation's Floor air temp at t minus 2 - ZTM3Floor.clear(); // [C] difference equation's Floor air temp at t minus 3 -#endif // ZTMOC.clear(); // [C] difference equation's Occupied air temp at t minus 1 -#ifdef GET_OUT - ZTM2OC.clear(); // [C] difference equation's Occupied air temp at t minus 2 - ZTM3OC.clear(); // [C] difference equation's Occupied air temp at t minus 3 -#endif // ZTMMX.clear(); // [C] difference equation's Mixed air temp at t minus 1 -#ifdef GET_OUT - ZTM2MX.clear(); // [C] difference equation's Mixed air temp at t minus 1 - ZTM3MX.clear(); // [C] difference equation's Mixed air temp at t minus 1 -#endif // AIRRATFloor.clear(); AIRRATOC.clear(); AIRRATMX.clear(); @@ -819,7 +750,7 @@ struct RoomAirModelData : BaseGlobalStruct // UCSD-UF TotUFADInt = 0; // total number of UCSDUI zones TotUFADExt = 0; // total number of UCSDUE zones - IsZoneUI.clear(); // controls program flow, for interior or exterior UFAD model + IsZoneUFAD.clear(); // controls program flow, for interior or exterior UFAD model ZoneUFADPtr.clear(); UFADHcIn.clear(); ZoneUFADMixedFlag.clear(); @@ -847,8 +778,7 @@ struct RoomAirModelData : BaseGlobalStruct AirNode.clear(); ZoneDispVent3Node.clear(); // UCSD ZoneCrossVent.clear(); - ZoneUFADInt.clear(); - ZoneUFADExt.clear(); + ZoneUFAD.clear(); CrossVentJetRecFlows.clear(); // Jet and recirculation zone flows and properties SurfParametersCrossDispVent.clear(); // Surface parameters AirPattern.clear(); // user defined patterns ,various types diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index cd0d678d98d..b93dedb0fc4 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -4577,7 +4577,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if if (NumOfAirModels > 0) { state.dataRoomAir->IsZoneDispVent3Node.dimension(state.dataGlobal->NumOfZones, false); state.dataRoomAir->IsZoneCrossVent.dimension(state.dataGlobal->NumOfZones, false); - state.dataRoomAir->IsZoneUI.dimension(state.dataGlobal->NumOfZones, false); + state.dataRoomAir->IsZoneUFAD.dimension(state.dataGlobal->NumOfZones, false); } for (AirModelNum = 1; AirModelNum <= NumOfAirModels; ++AirModelNum) { diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 91f953ed6c6..adada631d31 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -7342,7 +7342,7 @@ namespace InternalHeatGains { if (state.dataHeatBal->People(Loop).UserSpecSensFrac == Constant::AutoCalculate) { Real64 airTemp = thisZoneHB.MAT; if (state.dataRoomAir->anyNonMixingRoomAirModel) { - if (state.dataRoomAir->IsZoneDispVent3Node(NZ) || state.dataRoomAir->IsZoneUI(NZ)) { + if (state.dataRoomAir->IsZoneDispVent3Node(NZ) || state.dataRoomAir->IsZoneUFAD(NZ)) { airTemp = state.dataRoomAir->TCMF(NZ); } } diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 355882bf9c1..812eff2c3a4 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1109,8 +1109,7 @@ namespace RoomAir { if (state.dataRoomAir->TotUFADInt <= 0 && state.dataRoomAir->TotUFADExt <= 0) return; - state.dataRoomAir->ZoneUFADInt.allocate(state.dataRoomAir->TotUFADInt); - state.dataRoomAir->ZoneUFADExt.allocate(state.dataRoomAir->TotUFADExt); + state.dataRoomAir->ZoneUFAD.allocate(state.dataRoomAir->TotUFADInt + state.dataRoomAir->TotUFADExt); state.dataRoomAir->ZoneUFADPtr.dimension(state.dataGlobal->NumOfZones, 0); ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; @@ -1128,7 +1127,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); // First is Zone Name - auto &zoneUI = state.dataRoomAir->ZoneUFADInt(Loop); + auto &zoneUI = state.dataRoomAir->ZoneUFAD(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; zoneUI.ZoneName = ipsc->cAlphaArgs(1); @@ -1138,7 +1137,8 @@ namespace RoomAir { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAir->IsZoneUI(zoneUI.ZonePtr) = true; + state.dataRoomAir->IsZoneUFAD(zoneUI.ZonePtr) = true; + state.dataRoomAir->ZoneUFADPtr(zoneUI.ZonePtr) = Loop; } // 2nd alpha is diffuser type @@ -1190,7 +1190,7 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); // First is Zone Name - auto &zoneUE = state.dataRoomAir->ZoneUFADExt(Loop); + auto &zoneUE = state.dataRoomAir->ZoneUFAD(Loop + state.dataRoomAir->TotUFADInt); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; zoneUE.ZoneName = ipsc->cAlphaArgs(1); zoneUE.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); @@ -1198,7 +1198,7 @@ namespace RoomAir { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1)); ErrorsFound = true; } else { - state.dataRoomAir->IsZoneUI(zoneUE.ZonePtr) = true; + state.dataRoomAir->IsZoneUFAD(zoneUE.ZonePtr) = true; state.dataRoomAir->ZoneUFADPtr(zoneUE.ZonePtr) = Loop; } @@ -2072,7 +2072,7 @@ namespace RoomAir { AuxSurf.deallocate(); - if (any(state.dataRoomAir->IsZoneDispVent3Node) || any(state.dataRoomAir->IsZoneUI)) { + if (any(state.dataRoomAir->IsZoneDispVent3Node) || any(state.dataRoomAir->IsZoneUFAD)) { state.dataRoomAir->MaxTempGrad.allocate(state.dataGlobal->NumOfZones); state.dataRoomAir->AvgTempGrad.allocate(state.dataGlobal->NumOfZones); state.dataRoomAir->TCMF.allocate(state.dataGlobal->NumOfZones); @@ -2239,7 +2239,7 @@ namespace RoomAir { } // for (iZone) } // if (any(IsZoneDV)) - if (any(state.dataRoomAir->IsZoneUI)) { + if (any(state.dataRoomAir->IsZoneUFAD)) { state.dataRoomAir->ZoneUFADMixedFlag.allocate(state.dataGlobal->NumOfZones); state.dataRoomAir->ZoneUFADMixedFlagRep.allocate(state.dataGlobal->NumOfZones); state.dataRoomAir->UFADHcIn.allocate(state.dataSurface->TotSurfaces); @@ -2332,7 +2332,7 @@ namespace RoomAir { zone.Name); // set zone equip pointer in the UCSDUI data structure - state.dataRoomAir->ZoneUFADInt(state.dataRoomAir->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; + state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; } // for (iZone) @@ -2419,7 +2419,7 @@ namespace RoomAir { OutputProcessor::SOVStoreType::State, zone.Name); // set zone equip pointer in the UCSDUE data structure - state.dataRoomAir->ZoneUFADExt(state.dataRoomAir->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; + state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; } } @@ -2572,7 +2572,7 @@ namespace RoomAir { // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAir->MyEnvrnFlag(ZoneNum)) { - if (state.dataRoomAir->IsZoneDispVent3Node(ZoneNum) || state.dataRoomAir->IsZoneUI(ZoneNum)) { + if (state.dataRoomAir->IsZoneDispVent3Node(ZoneNum) || state.dataRoomAir->IsZoneUFAD(ZoneNum)) { state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; @@ -2623,7 +2623,7 @@ namespace RoomAir { state.dataRoomAir->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; } - if (state.dataRoomAir->IsZoneUI(ZoneNum)) { + if (state.dataRoomAir->IsZoneUFAD(ZoneNum)) { state.dataRoomAir->UFADHcIn = 0.0; state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 0; diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index 0b74c4d44a1..94c42adaf59 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -539,7 +539,7 @@ namespace ThermalComfort { if (state.dataRoomAir->anyNonMixingRoomAirModel) { state.dataThermalComforts->ZoneNum = state.dataHeatBal->People(state.dataThermalComforts->PeopleNum).ZonePtr; if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataRoomAir->IsZoneUFAD(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 // UCSD-CV } else if (state.dataRoomAir->IsZoneCrossVent(state.dataThermalComforts->ZoneNum)) { @@ -828,7 +828,7 @@ namespace ThermalComfort { state.dataThermalComforts->AirTemp = thisZoneHB.ZTAVComf; if (state.dataRoomAir->anyNonMixingRoomAirModel) { if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataRoomAir->IsZoneUFAD(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 } } @@ -1476,7 +1476,7 @@ namespace ThermalComfort { state.dataThermalComforts->AirTemp = thisZoneHB.ZTAVComf; if (state.dataRoomAir->anyNonMixingRoomAirModel) { if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataRoomAir->IsZoneUFAD(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); // PH 3/7/04 } } @@ -2318,7 +2318,7 @@ namespace ThermalComfort { state.dataThermalComforts->ZoneOccHrs(iZone) += state.dataGlobal->TimeStepZone; CurAirTemp = thisZoneHB.ZTAVComf; if (state.dataRoomAir->anyNonMixingRoomAirModel) { - if (state.dataRoomAir->IsZoneDispVent3Node(iZone) || state.dataRoomAir->IsZoneUI(iZone)) { + if (state.dataRoomAir->IsZoneDispVent3Node(iZone) || state.dataRoomAir->IsZoneUFAD(iZone)) { CurAirTemp = state.dataRoomAir->TCMF(iZone); } } @@ -2877,7 +2877,7 @@ namespace ThermalComfort { state.dataThermalComforts->AirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataThermalComforts->ZoneNum).ZTAVComf; if (state.dataRoomAir->anyNonMixingRoomAirModel) { if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataRoomAir->IsZoneUFAD(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); } } @@ -3088,7 +3088,7 @@ namespace ThermalComfort { state.dataThermalComforts->AirTemp = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataThermalComforts->ZoneNum).ZTAVComf; if (state.dataRoomAir->anyNonMixingRoomAirModel) { if (state.dataRoomAir->IsZoneDispVent3Node(state.dataThermalComforts->ZoneNum) || - state.dataRoomAir->IsZoneUI(state.dataThermalComforts->ZoneNum)) { + state.dataRoomAir->IsZoneUFAD(state.dataThermalComforts->ZoneNum)) { state.dataThermalComforts->AirTemp = state.dataRoomAir->TCMF(state.dataThermalComforts->ZoneNum); } } diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index d2aa2c66d93..e78f19c3709 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -162,8 +162,6 @@ void InitUFAD(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR Fred Buhl // DATE WRITTEN August 2005 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // initialize arrays & variables used by the UCSD UFAD zone models @@ -172,7 +170,6 @@ void InitUFAD(EnergyPlusData &state, // Note that much of the initialization is done in RoomAirManager, SharedDVCVUFDataInit Real64 NumShadesDown(0.0); - int UINum; // index to underfloor interior zone model data // Do the one time initializations if (state.dataUFADManager->MyOneTimeFlag) { @@ -208,31 +205,20 @@ void InitUFAD(EnergyPlusData &state, } } if (ZoneModelType == RoomAirModel::UFADExt) { - UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); - auto &zoneUE = state.dataRoomAir->ZoneUFADExt(UINum); - if (zoneUE.NumExtWin > 1.0) { - if (NumShadesDown / zoneUE.NumExtWin >= 0.5) { - zoneUE.ShadeDown = true; - } else { - zoneUE.ShadeDown = false; - } - } else { - zoneUE.ShadeDown = false; - } + auto &zoneUE = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); + zoneUE.ShadeDown = (zoneUE.NumExtWin > 1.0) && (NumShadesDown / zoneUE.NumExtWin >= 0.5); } } void SizeUFAD(EnergyPlusData &state, int const ZoneNum, - RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + RoomAirModel const model // type of zone model; UCSDUFI = 6 ) { // SUBROUTINE INFORMATION: // AUTHOR Fred Buhl // DATE WRITTEN August 2005 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // set some smart defaults for UFAD systems @@ -242,7 +228,6 @@ void SizeUFAD(EnergyPlusData &state, using DataSizing::AutoSize; - int UINum; // index to underfloor interior zone model data Real64 NumberOfOccupants(0.0); // design number of occupants in the zone Real64 NumberOfPlumes(0.0); // design number of plumes in the zone Real64 ZoneElecConv(0.0); // zone elec equip design convective gain [W] @@ -251,201 +236,15 @@ void SizeUFAD(EnergyPlusData &state, Real64 ZoneHWEqConv(0.0); // zone hot water equip design convective gain [W] Real64 ZoneSteamEqConv(0.0); // zone steam equip design convective gain [W] - if (ZoneModelType == RoomAirModel::UFADInt) { - UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); - NumberOfOccupants = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotPeople; ++Ctd) { - if (state.dataHeatBal->People(Ctd).ZonePtr == ZoneNum) { - NumberOfOccupants += state.dataHeatBal->People(Ctd).NumberOfPeople; - } - } + // This is for both UFADInt and UFADExt + auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); - auto &zoneUI = state.dataRoomAir->ZoneUFADInt(UINum); - if (zoneUI.DiffArea == AutoSize) { - if (zoneUI.DiffuserType == Diffuser::Swirl) { - zoneUI.DiffArea = 0.0075; - } else if (zoneUI.DiffuserType == Diffuser::VarArea) { - zoneUI.DiffArea = 0.035; - } else if (zoneUI.DiffuserType == Diffuser::DisplVent) { - zoneUI.DiffArea = 0.0060; - } else if (zoneUI.DiffuserType == Diffuser::LinBarGrille) { - // 4 ft x 4 inches; 75 cfm per linear foot; area is .025 m2/m - zoneUI.DiffArea = 0.03; - } else { - zoneUI.DiffArea = 0.0075; - } - BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionInterior", - zoneUI.ZoneName, - "Design effective area of diffuser", - zoneUI.DiffArea); - } - if (zoneUI.DiffAngle == AutoSize) { - if (zoneUI.DiffuserType == Diffuser::Swirl) { - zoneUI.DiffAngle = 28.0; - } else if (zoneUI.DiffuserType == Diffuser::VarArea) { - zoneUI.DiffAngle = 45.0; - } else if (zoneUI.DiffuserType == Diffuser::DisplVent) { - zoneUI.DiffAngle = 73.0; - } else if (zoneUI.DiffuserType == Diffuser::LinBarGrille) { - zoneUI.DiffAngle = 15.0; - } else { - zoneUI.DiffAngle = 28.0; - } - BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionInterior", - zoneUI.ZoneName, - "Angle between diffuser slots and the vertical", - zoneUI.DiffAngle); - } - if (zoneUI.TransHeight == AutoSize) { - zoneUI.CalcTransHeight = true; - zoneUI.TransHeight = 0.0; - } else { - zoneUI.CalcTransHeight = false; - } - if (zoneUI.DiffuserType == Diffuser::Swirl) { - if (zoneUI.A_Kc != Constant::AutoCalculate || - zoneUI.B_Kc != Constant::AutoCalculate || - zoneUI.C_Kc != Constant::AutoCalculate || - zoneUI.D_Kc != Constant::AutoCalculate || - zoneUI.E_Kc != Constant::AutoCalculate) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = Swirl.", - zoneUI.ZoneName)); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - zoneUI.A_Kc = 0.0; - zoneUI.B_Kc = 0.0; - zoneUI.C_Kc = 0.6531; - zoneUI.D_Kc = 0.0069; - zoneUI.E_Kc = -0.00004; - } else if (zoneUI.DiffuserType == Diffuser::VarArea) { - if (zoneUI.A_Kc != Constant::AutoCalculate || - zoneUI.B_Kc != Constant::AutoCalculate || - zoneUI.C_Kc != Constant::AutoCalculate || - zoneUI.D_Kc != Constant::AutoCalculate || - zoneUI.E_Kc != Constant::AutoCalculate) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = VariableArea.", - zoneUI.ZoneName)); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - zoneUI.A_Kc = 0.0; - zoneUI.B_Kc = 0.0; - zoneUI.C_Kc = 0.88; - zoneUI.D_Kc = 0.0; - zoneUI.E_Kc = 0.0; - } else if (zoneUI.DiffuserType == Diffuser::DisplVent) { - if (zoneUI.A_Kc != Constant::AutoCalculate || - zoneUI.B_Kc != Constant::AutoCalculate || - zoneUI.C_Kc != Constant::AutoCalculate || - zoneUI.D_Kc != Constant::AutoCalculate || - zoneUI.E_Kc != Constant::AutoCalculate) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = HorizontalDisplacement.", - zoneUI.ZoneName)); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - zoneUI.A_Kc = 0.0; - zoneUI.B_Kc = 0.0; - zoneUI.C_Kc = 0.67; - zoneUI.D_Kc = 0.0; - zoneUI.E_Kc = 0.0; - } else if (zoneUI.DiffuserType == Diffuser::LinBarGrille) { - if (zoneUI.A_Kc != Constant::AutoCalculate || - zoneUI.B_Kc != Constant::AutoCalculate || - zoneUI.C_Kc != Constant::AutoCalculate || - zoneUI.D_Kc != Constant::AutoCalculate || - zoneUI.E_Kc != Constant::AutoCalculate) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = LinearBarGrille.", - zoneUI.ZoneName)); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - zoneUI.A_Kc = 0.0; - zoneUI.B_Kc = 0.0; - zoneUI.C_Kc = 0.8; - zoneUI.D_Kc = 0.0; - zoneUI.E_Kc = 0.0; - } else { - if (zoneUI.A_Kc == Constant::AutoCalculate || - zoneUI.B_Kc == Constant::AutoCalculate || - zoneUI.C_Kc == Constant::AutoCalculate || - zoneUI.D_Kc == Constant::AutoCalculate || - zoneUI.E_Kc == Constant::AutoCalculate) { - ShowFatalError(state, - format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E must be " - "specified when Floor Diffuser Type = Custom.", - zoneUI.ZoneName)); - } - } - if (zoneUI.PowerPerPlume == Constant::AutoCalculate) { - NumberOfPlumes = 0.0; - if (NumberOfOccupants > 0.0) { - NumberOfPlumes = NumberOfOccupants; - } else { - NumberOfPlumes = 1.0; - } - ZoneElecConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotElecEquip; ++Ctd) { - if (state.dataHeatBal->ZoneElectric(Ctd).ZonePtr == ZoneNum) { - ZoneElecConv += state.dataHeatBal->ZoneElectric(Ctd).DesignLevel * state.dataHeatBal->ZoneElectric(Ctd).FractionConvected; - } - } - ZoneGasConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotGasEquip; ++Ctd) { - if (state.dataHeatBal->ZoneGas(Ctd).ZonePtr == ZoneNum) { - ZoneGasConv += state.dataHeatBal->ZoneGas(Ctd).DesignLevel * state.dataHeatBal->ZoneGas(Ctd).FractionConvected; - } - } - ZoneOthEqConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotOthEquip; ++Ctd) { - if (state.dataHeatBal->ZoneOtherEq(Ctd).ZonePtr == ZoneNum) { - ZoneOthEqConv += state.dataHeatBal->ZoneOtherEq(Ctd).DesignLevel * state.dataHeatBal->ZoneOtherEq(Ctd).FractionConvected; - } - } - ZoneHWEqConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotHWEquip; ++Ctd) { - if (state.dataHeatBal->ZoneHWEq(Ctd).ZonePtr == ZoneNum) { - ZoneHWEqConv += state.dataHeatBal->ZoneHWEq(Ctd).DesignLevel * state.dataHeatBal->ZoneHWEq(Ctd).FractionConvected; - } - } - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotStmEquip; ++Ctd) { - ZoneSteamEqConv = 0.0; - if (state.dataHeatBal->ZoneSteamEq(Ctd).ZonePtr == ZoneNum) { - ZoneSteamEqConv += state.dataHeatBal->ZoneSteamEq(Ctd).DesignLevel * state.dataHeatBal->ZoneSteamEq(Ctd).FractionConvected; - } - } - zoneUI.PowerPerPlume = - (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; - BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionInterior", - zoneUI.ZoneName, - "Power per plume [W]", - zoneUI.PowerPerPlume); - } - if (zoneUI.DiffusersPerZone == AutoSize) { - if (NumberOfOccupants > 0.0) { - zoneUI.DiffusersPerZone = NumberOfOccupants; - } else { - zoneUI.DiffusersPerZone = 1.0; - } - BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionInterior", - zoneUI.ZoneName, - "Number of diffusers per zone", - zoneUI.DiffusersPerZone); - } + NumberOfOccupants = 0.0; + for (auto const &people : state.dataHeatBal->People) { + if (people.ZonePtr == ZoneNum) NumberOfOccupants += people.NumberOfPeople; } - if (ZoneModelType == RoomAirModel::UFADExt) { - UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); - auto &zoneUE = state.dataRoomAir->ZoneUFADExt(UINum); + if (model == RoomAirModel::UFADExt) { // calculate total window width in zone for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { int SurfNum = state.dataRoomAir->APos_Window(Ctd); @@ -455,212 +254,164 @@ void SizeUFAD(EnergyPlusData &state, surf.ExtBoundCond == OtherSideCoefNoCalcExt || surf.ExtBoundCond == OtherSideCoefCalcExt || surf.ExtBoundCond == OtherSideCondModeledExt) { - zoneUE.WinWidth += surf.Width; - ++zoneUE.NumExtWin; + zoneU.WinWidth += surf.Width; + ++zoneU.NumExtWin; } } - if (zoneUE.WinWidth <= 0.0) { + if (zoneU.WinWidth <= 0.0) { ShowWarningError(state, format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {} there are no exterior windows.", - zoneUE.ZoneName)); + zoneU.ZoneName)); ShowContinueError(state, " The zone will be treated as a UFAD interior zone"); } - NumberOfOccupants = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotPeople; ++Ctd) { - if (state.dataHeatBal->People(Ctd).ZonePtr == ZoneNum) { - NumberOfOccupants += state.dataHeatBal->People(Ctd).NumberOfPeople; - } - } - if (zoneUE.DiffArea == AutoSize) { - if (zoneUE.DiffuserType == Diffuser::Swirl) { - zoneUE.DiffArea = 0.0075; - } else if (zoneUE.DiffuserType == Diffuser::VarArea) { - zoneUE.DiffArea = 0.035; - } else if (zoneUE.DiffuserType == Diffuser::DisplVent) { - zoneUE.DiffArea = 0.0060; - } else if (zoneUE.DiffuserType == Diffuser::LinBarGrille) { - // 4 ft x 4 inches; eff area is 50% of total area; 75 cfm per linear foot. - zoneUE.DiffArea = 0.03; - } else { - zoneUE.DiffArea = 0.0075; - } - BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionExterior", - zoneUE.ZoneName, - "Design effective area of diffuser", - zoneUE.DiffArea); + } // if (model == RoomAirModel::UFADExt) + + if (zoneU.DiffArea == AutoSize) { + constexpr std::array diffArea = {0.0075, 0.035, 0.0060, 0.03, 0.0075}; + zoneU.DiffArea = diffArea[(int)zoneU.DiffuserType]; + // 4 ft x 4 inches; 75 cfm per linear foot; area is .025 m2/m + + BaseSizer::reportSizerOutput(state, + "RoomAirSettings:UnderFloorAirDistributionInterior", + zoneU.ZoneName, + "Design effective area of diffuser", + zoneU.DiffArea); } - if (zoneUE.DiffAngle == AutoSize) { - if (zoneUE.DiffuserType == Diffuser::Swirl) { - zoneUE.DiffAngle = 28.0; - } else if (zoneUE.DiffuserType == Diffuser::VarArea) { - zoneUE.DiffAngle = 45.0; - } else if (zoneUE.DiffuserType == Diffuser::DisplVent) { - zoneUE.DiffAngle = 73.0; - } else if (zoneUE.DiffuserType == Diffuser::LinBarGrille) { - zoneUE.DiffAngle = 15.0; - } else { - zoneUE.DiffAngle = 28.0; - } - BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionExterior", - zoneUE.ZoneName, - "Angle between diffuser slots and the vertical", - zoneUE.DiffAngle); - } - if (zoneUE.TransHeight == AutoSize) { - zoneUE.CalcTransHeight = true; - zoneUE.TransHeight = 0.0; + if (zoneU.DiffAngle == AutoSize) { + constexpr std::array diffAngle = {28.0, 45.0, 73.0, 15.0, 28.0}; + zoneU.DiffAngle = diffAngle[(int)zoneU.DiffuserType]; + + BaseSizer::reportSizerOutput(state, + "RoomAirSettings:UnderFloorAirDistributionInterior", + zoneU.ZoneName, + "Angle between diffuser slots and the vertical", + zoneU.DiffAngle); + } + if (zoneU.TransHeight == AutoSize) { + zoneU.CalcTransHeight = true; + zoneU.TransHeight = 0.0; + } else { + zoneU.CalcTransHeight = false; + } + + if (zoneU.DiffuserType != Diffuser::Custom && + (zoneU.A_Kc != Constant::AutoCalculate || + zoneU.B_Kc != Constant::AutoCalculate || + zoneU.C_Kc != Constant::AutoCalculate || + zoneU.D_Kc != Constant::AutoCalculate || + zoneU.E_Kc != Constant::AutoCalculate)) { + ShowWarningError(state, + format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " + "ignored when Floor Diffuser Type = {}.", zoneU.ZoneName, diffuserNamesUC[(int)zoneU.DiffuserType])); + ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); + } + + if (zoneU.DiffuserType == Diffuser::Swirl) { + zoneU.A_Kc = 0.0; + zoneU.B_Kc = 0.0; + zoneU.C_Kc = 0.6531; + zoneU.D_Kc = 0.0069; + zoneU.E_Kc = -0.00004; + } else if (zoneU.DiffuserType == Diffuser::VarArea) { + zoneU.A_Kc = 0.0; + zoneU.B_Kc = 0.0; + zoneU.C_Kc = (model == RoomAirModel::UFADExt) ? 0.83 : 0.88; + zoneU.D_Kc = 0.0; + zoneU.E_Kc = 0.0; + } else if (zoneU.DiffuserType == Diffuser::DisplVent) { + zoneU.A_Kc = 0.0; + zoneU.B_Kc = 0.0; + zoneU.C_Kc = 0.67; + zoneU.D_Kc = 0.0; + zoneU.E_Kc = 0.0; + } else if (zoneU.DiffuserType == Diffuser::LinBarGrille) { + zoneU.A_Kc = 0.0; + zoneU.B_Kc = 0.0; + zoneU.C_Kc = (model == RoomAirModel::UFADExt) ? 0.8214 : 0.8; + zoneU.D_Kc = (model == RoomAirModel::UFADExt) ? -0.0263 : 0.0; + zoneU.E_Kc = (model == RoomAirModel::UFADExt) ? 0.0014 : 0.0; + } else if (zoneU.A_Kc == Constant::AutoCalculate || + zoneU.B_Kc == Constant::AutoCalculate || + zoneU.C_Kc == Constant::AutoCalculate || + zoneU.D_Kc == Constant::AutoCalculate || + zoneU.E_Kc == Constant::AutoCalculate) { + ShowFatalError(state, + format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E must be " + "specified when Floor Diffuser Type = Custom.", zoneU.ZoneName)); + } + + if (zoneU.PowerPerPlume == Constant::AutoCalculate) { + NumberOfPlumes = 0.0; + if (NumberOfOccupants > 0.0) { + NumberOfPlumes = NumberOfOccupants; } else { - zoneUE.CalcTransHeight = false; + NumberOfPlumes = 1.0; } - if (zoneUE.DiffuserType == Diffuser::Swirl) { - if (zoneUE.A_Kc != Constant::AutoCalculate || - zoneUE.B_Kc != Constant::AutoCalculate || - zoneUE.C_Kc != Constant::AutoCalculate || - zoneUE.D_Kc != Constant::AutoCalculate || - zoneUE.E_Kc != Constant::AutoCalculate) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = Swirl.", - zoneUE.ZoneName)); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - zoneUE.A_Kc = 0.0; - zoneUE.B_Kc = 0.0; - zoneUE.C_Kc = 0.6531; - zoneUE.D_Kc = 0.0069; - zoneUE.E_Kc = -0.00004; - } else if (zoneUE.DiffuserType == Diffuser::VarArea) { - if (zoneUE.A_Kc != Constant::AutoCalculate || - zoneUE.B_Kc != Constant::AutoCalculate || - zoneUE.C_Kc != Constant::AutoCalculate || - zoneUE.D_Kc != Constant::AutoCalculate || - zoneUE.E_Kc != Constant::AutoCalculate) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = VariableArea.", - zoneUE.ZoneName)); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - zoneUE.A_Kc = 0.0; - zoneUE.B_Kc = 0.0; - zoneUE.C_Kc = 0.83; - zoneUE.D_Kc = 0.0; - zoneUE.E_Kc = 0.0; - } else if (zoneUE.DiffuserType == Diffuser::DisplVent) { - if (zoneUE.A_Kc != Constant::AutoCalculate || - zoneUE.B_Kc != Constant::AutoCalculate || - zoneUE.C_Kc != Constant::AutoCalculate || - zoneUE.D_Kc != Constant::AutoCalculate || - zoneUE.E_Kc != Constant::AutoCalculate) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = HorizontalDisplacement.", - zoneUE.ZoneName)); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - zoneUE.A_Kc = 0.0; - zoneUE.B_Kc = 0.0; - zoneUE.C_Kc = 0.67; - zoneUE.D_Kc = 0.0; - zoneUE.E_Kc = 0.0; - } else if (zoneUE.DiffuserType == Diffuser::LinBarGrille) { - if (zoneUE.A_Kc != Constant::AutoCalculate || - zoneUE.B_Kc != Constant::AutoCalculate || - zoneUE.C_Kc != Constant::AutoCalculate || - zoneUE.D_Kc != Constant::AutoCalculate || - zoneUE.E_Kc != Constant::AutoCalculate) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = LinearBarGrille.", - zoneUE.ZoneName)); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - zoneUE.A_Kc = 0.0; - zoneUE.B_Kc = 0.0; - zoneUE.C_Kc = 0.8214; - zoneUE.D_Kc = -0.0263; - zoneUE.E_Kc = 0.0014; - } else { - if (zoneUE.A_Kc == Constant::AutoCalculate || - zoneUE.B_Kc == Constant::AutoCalculate || - zoneUE.C_Kc == Constant::AutoCalculate || - zoneUE.D_Kc == Constant::AutoCalculate || - zoneUE.E_Kc == Constant::AutoCalculate) { - ShowFatalError(state, - format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {}, input for Coefficients A - E must be " - "specified when Floor Diffuser Type = Custom.", - zoneUE.ZoneName)); + ZoneElecConv = 0.0; + for (int Ctd = 1; Ctd <= state.dataHeatBal->TotElecEquip; ++Ctd) { + if (state.dataHeatBal->ZoneElectric(Ctd).ZonePtr == ZoneNum) { + ZoneElecConv += state.dataHeatBal->ZoneElectric(Ctd).DesignLevel * state.dataHeatBal->ZoneElectric(Ctd).FractionConvected; } } - if (zoneUE.PowerPerPlume == Constant::AutoCalculate) { - if (NumberOfOccupants > 0) { - NumberOfPlumes = NumberOfOccupants; - } else { - NumberOfPlumes = 1.0; - } - ZoneElecConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotElecEquip; ++Ctd) { - if (state.dataHeatBal->ZoneElectric(Ctd).ZonePtr == ZoneNum) { - ZoneElecConv += state.dataHeatBal->ZoneElectric(Ctd).DesignLevel; - } - } - ZoneGasConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotGasEquip; ++Ctd) { - if (state.dataHeatBal->ZoneGas(Ctd).ZonePtr == ZoneNum) { - ZoneGasConv += state.dataHeatBal->ZoneGas(Ctd).DesignLevel; - } - } - ZoneOthEqConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotOthEquip; ++Ctd) { - if (state.dataHeatBal->ZoneOtherEq(Ctd).ZonePtr == ZoneNum) { - ZoneOthEqConv += state.dataHeatBal->ZoneOtherEq(Ctd).DesignLevel; - } + ZoneGasConv = 0.0; + for (int Ctd = 1; Ctd <= state.dataHeatBal->TotGasEquip; ++Ctd) { + if (state.dataHeatBal->ZoneGas(Ctd).ZonePtr == ZoneNum) { + ZoneGasConv += state.dataHeatBal->ZoneGas(Ctd).DesignLevel * state.dataHeatBal->ZoneGas(Ctd).FractionConvected; } - ZoneHWEqConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotHWEquip; ++Ctd) { - if (state.dataHeatBal->ZoneHWEq(Ctd).ZonePtr == ZoneNum) { - ZoneHWEqConv += state.dataHeatBal->ZoneHWEq(Ctd).DesignLevel; - } + } + ZoneOthEqConv = 0.0; + for (int Ctd = 1; Ctd <= state.dataHeatBal->TotOthEquip; ++Ctd) { + if (state.dataHeatBal->ZoneOtherEq(Ctd).ZonePtr == ZoneNum) { + ZoneOthEqConv += state.dataHeatBal->ZoneOtherEq(Ctd).DesignLevel * state.dataHeatBal->ZoneOtherEq(Ctd).FractionConvected; } - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotStmEquip; ++Ctd) { - ZoneSteamEqConv = 0.0; - if (state.dataHeatBal->ZoneSteamEq(Ctd).ZonePtr == ZoneNum) { - ZoneSteamEqConv += state.dataHeatBal->ZoneSteamEq(Ctd).DesignLevel; - } + } + ZoneHWEqConv = 0.0; + for (int Ctd = 1; Ctd <= state.dataHeatBal->TotHWEquip; ++Ctd) { + if (state.dataHeatBal->ZoneHWEq(Ctd).ZonePtr == ZoneNum) { + ZoneHWEqConv += state.dataHeatBal->ZoneHWEq(Ctd).DesignLevel * state.dataHeatBal->ZoneHWEq(Ctd).FractionConvected; } - zoneUE.PowerPerPlume = - (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; - BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionExterior", - zoneUE.ZoneName, - "Power per plume [W]", - zoneUE.PowerPerPlume); } - if (zoneUE.DiffusersPerZone == AutoSize) { - if (NumberOfOccupants > 0.0) { - zoneUE.DiffusersPerZone = NumberOfOccupants; - } else { - zoneUE.DiffusersPerZone = 1.0; + for (int Ctd = 1; Ctd <= state.dataHeatBal->TotStmEquip; ++Ctd) { + ZoneSteamEqConv = 0.0; // This should be outside the outer loop, no? + if (state.dataHeatBal->ZoneSteamEq(Ctd).ZonePtr == ZoneNum) { + ZoneSteamEqConv += state.dataHeatBal->ZoneSteamEq(Ctd).DesignLevel * state.dataHeatBal->ZoneSteamEq(Ctd).FractionConvected; } + } + zoneU.PowerPerPlume = + (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; + BaseSizer::reportSizerOutput(state, + "RoomAirSettings:UnderFloorAirDistributionInterior", + zoneU.ZoneName, + "Power per plume [W]", + zoneU.PowerPerPlume); + + if (zoneU.DiffusersPerZone == AutoSize) { + zoneU.DiffusersPerZone = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionExterior", - zoneUE.ZoneName, + "RoomAirSettings:UnderFloorAirDistributionInterior", + zoneU.ZoneName, "Number of diffusers per zone", - zoneUE.DiffusersPerZone); + zoneU.DiffusersPerZone); } } + + if (zoneU.DiffusersPerZone == AutoSize) { + zoneU.DiffusersPerZone = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; + + BaseSizer::reportSizerOutput(state, + "RoomAirSettings:UnderFloorAirDistributionExterior", + zoneU.ZoneName, + "Number of diffusers per zone", + zoneU.DiffusersPerZone); + } } -void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight) +void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight, UFADConvCoef &ufadCC) { // SUBROUTINE INFORMATION: // AUTHOR G. Carrilho da Graca // DATE WRITTEN February 2004 - // MODIFIED - - // RE-ENGINEERED - // PURPOSE OF THIS SUBROUTINE: // Main subroutine for convection calculation in the UCSD Displacement Ventilation model. @@ -685,19 +436,19 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei int SurfNum; // Surface number // Initialize HAT and HA - state.dataUFADManager->HAT_MX = 0.0; - state.dataUFADManager->HAT_OC = 0.0; - state.dataUFADManager->HA_MX = 0.0; - state.dataUFADManager->HA_OC = 0.0; - state.dataUFADManager->HAT_FLOOR = 0.0; - state.dataUFADManager->HA_FLOOR = 0.0; - state.dataUFADManager->HAT_MXWin = 0.0; - state.dataUFADManager->HAT_OCWin = 0.0; - state.dataUFADManager->HA_MXWin = 0.0; - state.dataUFADManager->HA_OCWin = 0.0; + ufadCC.HAT_MX = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone + ufadCC.HAT_MXWin = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone (windows only) + ufadCC.HA_MX = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone + ufadCC.HA_MXWin = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone (windows only) + ufadCC.HAT_OC = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone + ufadCC.HAT_OCWin = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone (windows only) + ufadCC.HA_OC = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone + ufadCC.HA_OCWin = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone (windows only) + ufadCC.HAT_FLOOR = 0.0; // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone + ufadCC.HA_FLOOR = 0.0; // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? - if (state.dataRoomAir->IsZoneUI(ZoneNum)) { + if (state.dataRoomAir->IsZoneUFAD(ZoneNum)) { Real64 zoneCeilingHeight1 = state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); Real64 zoneCeilingHeight2 = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum); @@ -721,8 +472,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); } // The Wall surface is in the lower subzone @@ -730,8 +481,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); } if (std::abs(ZInfSurf - ZSupSurf) < 1.e-10) { @@ -756,12 +507,12 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -788,20 +539,20 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); - state.dataUFADManager->HAT_MXWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataUFADManager->HA_MXWin += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_MXWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_MXWin += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); - state.dataUFADManager->HAT_OCWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataUFADManager->HA_OCWin += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_OCWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_OCWin += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { @@ -814,18 +565,18 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + ufadCC.HA_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataUFADManager->HAT_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + ufadCC.HAT_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + ufadCC.HA_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } } @@ -834,16 +585,16 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (surf.Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); } state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); @@ -867,16 +618,16 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); } if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { @@ -889,12 +640,12 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -920,8 +671,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { @@ -934,12 +685,12 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataUFADManager->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - state.dataUFADManager->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataUFADManager->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - state.dataUFADManager->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } @@ -957,9 +708,9 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_MX += + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); - state.dataUFADManager->HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); } // END CEILING @@ -974,8 +725,8 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataUFADManager->HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); - state.dataUFADManager->HA_OC += surf.Area * state.dataRoomAir->HFloor(Ctd); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HFloor(Ctd); state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); } // END FLOOR @@ -1129,15 +880,16 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); - auto &zoneUI = state.dataRoomAir->ZoneUFADInt(UINum); - HeightThermostat = zoneUI.ThermostatHeight; - HeightComfort = zoneUI.ComfortHeight; - TempDiffCritRep = zoneUI.TempTrigger; - DiffArea = zoneUI.DiffArea; - ThrowAngle = Constant::DegToRadians * zoneUI.DiffAngle; + + auto &zoneU = state.dataRoomAir->ZoneUFAD(UINum); + HeightThermostat = zoneU.ThermostatHeight; + HeightComfort = zoneU.ComfortHeight; + TempDiffCritRep = zoneU.TempTrigger; + DiffArea = zoneU.DiffArea; + ThrowAngle = Constant::DegToRadians * zoneU.DiffAngle; SourceHeight = 0.0; - NumDiffusers = zoneUI.DiffusersPerZone; - PowerPerPlume = zoneUI.PowerPerPlume; + NumDiffusers = zoneU.DiffusersPerZone; + PowerPerPlume = zoneU.PowerPerPlume; // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, // baseboards (nonthermostatic), water heater skin loss ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); @@ -1161,7 +913,7 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t ConvGainsUpSubzone += RetAirGains; } ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; - ZoneEquipConfigNum = zoneUI.ZoneEquipPtr; + ZoneEquipConfigNum = zoneU.ZoneEquipPtr; if (ZoneEquipConfigNum > 0) { for (InNodeIndex = 1; InNodeIndex <= state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { NodeTemp = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; @@ -1189,14 +941,15 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t // For the York MIT diffusers (variable area) the area varies with the flow rate. Assume 400 ft/min velocity // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by - // (TotSysFlow/(NumDiffusers*.0708))*.035 - if (zoneUI.DiffuserType == Diffuser::VarArea) { + // (TotSysFlow/(NumDiffusers*.0708))*.035 + if (zoneU.DiffuserType == Diffuser::VarArea) { DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); } // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. - HcUCSDUF(state, ZoneNum, 0.5); - PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + UFADConvCoef ufadCC; + HcUFAD(state, ZoneNum, 0.5, ufadCC); + PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { NumberOfPlumes = PowerInPlumes / PowerPerPlume; NumDiffusersPerPlume = NumDiffusers / NumberOfPlumes; @@ -1210,16 +963,16 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t } else { Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); - if (zoneUI.CalcTransHeight) { + if (zoneU.CalcTransHeight) { HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } else { - HeightFrac = zoneUI.TransHeight / CeilingHeight; + HeightFrac = zoneU.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); for (Ctd = 1; Ctd <= 4; ++Ctd) { - HcUCSDUF(state, ZoneNum, HeightFrac); - PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { NumberOfPlumes = PowerInPlumes / PowerPerPlume; NumDiffusersPerPlume = NumDiffusers / NumberOfPlumes; @@ -1230,16 +983,16 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t if (PowerInPlumes <= 0.0) break; Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); - if (zoneUI.CalcTransHeight) { + if (zoneU.CalcTransHeight) { HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } else { - HeightFrac = zoneUI.TransHeight / CeilingHeight; + HeightFrac = zoneU.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - GainsFrac = zoneUI.A_Kc * std::pow(Gamma, zoneUI.B_Kc) + - zoneUI.C_Kc + zoneUI.D_Kc * Gamma + - zoneUI.E_Kc * pow_2(Gamma); + GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + + zoneU.C_Kc + zoneU.D_Kc * Gamma + + zoneU.E_Kc * pow_2(Gamma); GainsFrac = max(0.6, min(GainsFrac, 1.0)); state.dataRoomAir->AIRRATOC(ZoneNum) = state.dataHeatBal->Zone(ZoneNum).Volume * @@ -1276,17 +1029,17 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A - Real64 TempDepCoef = GainsFrac * state.dataUFADManager->HA_OC + MCp_Total; - Real64 TempIndCoef = GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + + Real64 TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; + Real64 TempIndCoef = GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - + ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + - GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + + GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - + ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult) / - ((11.0 / 6.0) * AirCap + GainsFrac * state.dataUFADManager->HA_OC + MCp_Total); + ((11.0 / 6.0) * AirCap + GainsFrac * ufadCC.HA_OC + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 @@ -1306,18 +1059,18 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + (1.0 / 3.0) * state.dataRoomAir->ZTMMX(ZoneNum)[2]); - TempDepCoef = (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total; - TempIndCoef = (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + TempDepCoef = (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total; + TempIndCoef = (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - + ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { state.dataRoomAir->ZTMX(ZoneNum) = (TempHistTerm + - (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - + ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / - ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total); + ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 @@ -1360,14 +1113,14 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); for (Ctd = 1; Ctd <= 3; ++Ctd) { - Real64 TempDepCoef = state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total; + Real64 TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; Real64 const thisZoneT1 = thisZoneHB.ZoneT1; // Formerly CoefSumhat, coef in zone temp equation with dimensions of h*A(T1 - Real64 TempIndCoef = ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total; + Real64 TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total) / - ((11.0 / 6.0) * AirCap + state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total); + ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / + ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 @@ -1385,13 +1138,13 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; - HcUCSDUF(state, ZoneNum, HeightFrac); - TempDepCoef = state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total; - TempIndCoef = ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total; + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; + TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total) / - ((11.0 / 6.0) * AirCap + state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total); + ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / + ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 @@ -1637,7 +1390,8 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); - auto &zoneUE = state.dataRoomAir->ZoneUFADExt(UINum); + + auto &zoneUE = state.dataRoomAir->ZoneUFAD(UINum); HeightThermostat = zoneUE.ThermostatHeight; HeightComfort = zoneUE.ComfortHeight; TempDiffCritRep = zoneUE.TempTrigger; @@ -1702,12 +1456,13 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); } // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. - HcUCSDUF(state, ZoneNum, 0.5); - ConvGainsWindows = state.dataUFADManager->HAT_MXWin + state.dataUFADManager->HAT_OCWin - - state.dataUFADManager->HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - - state.dataUFADManager->HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); - PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + UFADConvCoef ufadCC; + HcUFAD(state, ZoneNum, 0.5, ufadCC); + ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - + ufadCC.HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - + ufadCC.HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); + PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); // NumberOfPlumes = PowerInPlumes / PowerPerPlume if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { NumberOfPlumes = PowerInPlumes / PowerPerPlume; @@ -1750,13 +1505,12 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t } state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; for (Ctd = 1; Ctd <= 4; ++Ctd) { - HcUCSDUF(state, ZoneNum, HeightFrac); - ConvGainsWindows = state.dataUFADManager->HAT_MXWin + state.dataUFADManager->HAT_OCWin - - state.dataUFADManager->HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - - state.dataUFADManager->HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - ufadCC.HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - + ufadCC.HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); ConvGainsWindows = max(ConvGainsWindows, 0.0); - PowerInPlumes = ConvGains + state.dataUFADManager->HAT_OC - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - state.dataUFADManager->HAT_MX - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); // NumberOfPlumes = PowerInPlumes / PowerPerPlume NumberOfPlumes = 1.0; if (PowerInPlumes <= 0.0) break; @@ -1819,17 +1573,17 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); - TempDepCoef = GainsFrac * state.dataUFADManager->HA_OC + MCp_Total; - TempIndCoef = GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + + TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; + TempIndCoef = GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - + ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + - GainsFrac * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + + GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - + ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult) / - ((11.0 / 6.0) * AirCap + GainsFrac * state.dataUFADManager->HA_OC + MCp_Total); + ((11.0 / 6.0) * AirCap + GainsFrac * ufadCC.HA_OC + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 @@ -1849,18 +1603,15 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + (1.0 / 3.0) * state.dataRoomAir->ZTMMX(ZoneNum)[2]); - TempDepCoef = (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total; - TempIndCoef = (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + - state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; + TempDepCoef = (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total; + TempIndCoef = (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { state.dataRoomAir->ZTMX(ZoneNum) = - (TempHistTerm + - (1.0 - GainsFrac) * (ConvGains + state.dataUFADManager->HAT_OC + state.dataUFADManager->HAT_MX - - state.dataUFADManager->HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + - state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / - ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * state.dataUFADManager->HA_MX + MCp_Total); + (TempHistTerm + + (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 @@ -1907,12 +1658,12 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); for (Ctd = 1; Ctd <= 3; ++Ctd) { - TempDepCoef = state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total; - TempIndCoef = ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total; + TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; + TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total) / - ((11.0 / 6.0) * AirCap + state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total); + ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / + ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 @@ -1930,13 +1681,13 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; - HcUCSDUF(state, ZoneNum, HeightFrac); - TempDepCoef = state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total; - TempIndCoef = ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total; + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; + TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + state.dataUFADManager->HAT_MX + state.dataUFADManager->HAT_OC + MCpT_Total) / - ((11.0 / 6.0) * AirCap + state.dataUFADManager->HA_MX + state.dataUFADManager->HA_OC + MCp_Total); + ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / + ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); } break; case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { if (TempDepCoef == 0.0) { // B=0 diff --git a/src/EnergyPlus/UFADManager.hh b/src/EnergyPlus/UFADManager.hh index b7eb3133755..e639db6c6dc 100644 --- a/src/EnergyPlus/UFADManager.hh +++ b/src/EnergyPlus/UFADManager.hh @@ -59,6 +59,20 @@ struct EnergyPlusData; namespace RoomAir { + struct UFADConvCoef + { + Real64 HAT_MX = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone + Real64 HAT_MXWin = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone (windows only) + Real64 HA_MX = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone + Real64 HA_MXWin = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone (windows only) + Real64 HAT_OC = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone + Real64 HAT_OCWin = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone (windows only) + Real64 HA_OC = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone + Real64 HA_OCWin = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone (windows only) + Real64 HAT_FLOOR = 0.0; // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone + Real64 HA_FLOOR = 0.0; // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone + }; + void ManageUFAD(EnergyPlusData &state, int const ZoneNum, // index number for the specified zone RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 @@ -74,7 +88,7 @@ namespace RoomAir { RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ); - void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight); + void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight, UFADConvCoef &ufadCC); void CalcUFADInt(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone @@ -85,16 +99,6 @@ namespace RoomAir { struct UFADManagerData : BaseGlobalStruct { - Real64 HAT_MX = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone - Real64 HAT_MXWin = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone (windows only) - Real64 HA_MX = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone - Real64 HA_MXWin = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone (windows only) - Real64 HAT_OC = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone - Real64 HAT_OCWin = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone (windows only) - Real64 HA_OC = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone - Real64 HA_OCWin = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone (windows only) - Real64 HAT_FLOOR = 0.0; // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone - Real64 HA_FLOOR = 0.0; // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone Real64 HeightFloorSubzoneTop = 0.2; // Assumed thickness of floor subzone Real64 ThickOccupiedSubzoneMin = 0.2; // Minimum thickness of occupied subzone Real64 HeightIntMass = 0.0; // Height of internal mass surfaces, assumed vertical, cannot exceed ceiling height diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 60bb16781cb..80efa38801f 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -4364,7 +4364,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( state.dataHeatBalFanSys->TempTstatAir(zoneNum) = this->ZT; } state.dataHeatBalFanSys->LoadCorrectionFactor(zoneNum) = 1.0; - } else if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUI(zoneNum)) { + } else if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUFAD(zoneNum)) { // UCSDDV: Not fully mixed - calculate factor to correct load for fully mixed assumption // Space HB TODO: Space HB doesn't mix with DV etc. if (this->SumSysMCp > DataHVACGlobals::SmallMassFlow) { @@ -4513,7 +4513,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0 && state.dataRoomAir->anyNonMixingRoomAirModel) { isMixed = !((state.dataRoomAir->IsZoneDispVent3Node(zoneNum) && !state.dataRoomAir->ZoneDispVent3NodeMixedFlag(zoneNum)) || - (state.dataRoomAir->IsZoneUI(zoneNum) && !state.dataRoomAir->ZoneUFADMixedFlag(zoneNum))); + (state.dataRoomAir->IsZoneUFAD(zoneNum) && !state.dataRoomAir->ZoneUFADMixedFlag(zoneNum))); } switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { @@ -4700,7 +4700,7 @@ void ZoneSpaceHeatBalanceData::pushSystemTimestepHistory(EnergyPlusData &state, // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0 && state.dataRoomAir->anyNonMixingRoomAirModel) { - if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUI(zoneNum)) { + if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUFAD(zoneNum)) { state.dataRoomAir->DSXMATFloor(zoneNum)[3] = state.dataRoomAir->DSXMATFloor(zoneNum)[2]; state.dataRoomAir->DSXMATFloor(zoneNum)[2] = state.dataRoomAir->DSXMATFloor(zoneNum)[1]; state.dataRoomAir->DSXMATFloor(zoneNum)[1] = state.dataRoomAir->DSXMATFloor(zoneNum)[0]; @@ -7122,7 +7122,7 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, this->ZoneAirHumRat = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, this->WPrevZoneTS, this->DSWPrevZoneTS); if (spaceNum == 0 && state.dataRoomAir->anyNonMixingRoomAirModel) { - if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUI(zoneNum)) { + if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUFAD(zoneNum)) { state.dataRoomAir->MATFloor(zoneNum) = DownInterpolate4HistoryValues(PriorTimeStep, diff --git a/tst/EnergyPlus/unit/HybridModel.unit.cc b/tst/EnergyPlus/unit/HybridModel.unit.cc index f46f8510e54..6cbf38e1c5e 100644 --- a/tst/EnergyPlus/unit/HybridModel.unit.cc +++ b/tst/EnergyPlus/unit/HybridModel.unit.cc @@ -127,7 +127,7 @@ TEST_F(EnergyPlusFixture, HybridModel_correctZoneAirTempsTest) state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1); state->dataRoomAir->IsZoneDispVent3Node.dimension(1, false); state->dataRoomAir->IsZoneCrossVent.dimension(1, false); - state->dataRoomAir->IsZoneUI.dimension(1, false); + state->dataRoomAir->IsZoneUFAD.dimension(1, false); state->dataRoomAir->ZoneDispVent3NodeMixedFlag.allocate(1); state->dataHeatBal->ZnAirRpt.allocate(1); state->dataZoneEquip->ZoneEquipConfig.allocate(1); @@ -502,7 +502,7 @@ TEST_F(EnergyPlusFixture, HybridModel_CorrectZoneContaminantsTest) state->dataHeatBalSurf->SurfHConvInt.allocate(1); state->dataRoomAir->IsZoneDispVent3Node.dimension(1, false); state->dataRoomAir->IsZoneCrossVent.dimension(1, false); - state->dataRoomAir->IsZoneUI.dimension(1, false); + state->dataRoomAir->IsZoneUFAD.dimension(1, false); state->dataRoomAir->ZoneDispVent3NodeMixedFlag.allocate(1); state->dataHeatBal->ZnAirRpt.allocate(1); state->dataZoneEquip->ZoneEquipConfig.allocate(1); diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index 46327c6165f..164841c7dc3 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -987,7 +987,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortASH55) state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); state->dataHeatBal->ZoneMRT.allocate(state->dataGlobal->NumOfZones); state->dataRoomAir->IsZoneDispVent3Node.allocate(state->dataGlobal->NumOfZones); - state->dataRoomAir->IsZoneUI.allocate(state->dataGlobal->NumOfZones); + state->dataRoomAir->IsZoneUFAD.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneQdotRadHVACToPerson.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneQHTRadSysToPerson.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneQCoolingPanelToPerson.allocate(state->dataGlobal->NumOfZones); @@ -1011,7 +1011,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortASH55) state->dataHeatBal->People(1).WorkEffPtr = 0; state->dataHeatBal->People(1).clothingType = ClothingType::InsulationSchedule; - state->dataRoomAir->IsZoneDispVent3Node(1) = state->dataRoomAir->IsZoneUI(1) = false; + state->dataRoomAir->IsZoneDispVent3Node(1) = state->dataRoomAir->IsZoneUFAD(1) = false; state->dataHeatBalFanSys->ZoneQHTRadSysToPerson(1) = 0.0; state->dataHeatBalFanSys->ZoneQCoolingPanelToPerson(1) = 0.0; state->dataHeatBalFanSys->ZoneQHWBaseboardToPerson(1) = 0.0; From 1ede5d12198aa96821ecce532061d34461891c99 Mon Sep 17 00:00:00 2001 From: amirroth Date: Tue, 27 Jun 2023 16:20:25 -0400 Subject: [PATCH 14/17] I am dum --- src/EnergyPlus/RoomAirModelManager.cc | 2 +- src/EnergyPlus/UFADManager.cc | 565 ++++++++++++-------------- 2 files changed, 261 insertions(+), 306 deletions(-) diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 812eff2c3a4..731c13329df 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -1199,7 +1199,7 @@ namespace RoomAir { ErrorsFound = true; } else { state.dataRoomAir->IsZoneUFAD(zoneUE.ZonePtr) = true; - state.dataRoomAir->ZoneUFADPtr(zoneUE.ZonePtr) = Loop; + state.dataRoomAir->ZoneUFADPtr(zoneUE.ZonePtr) = Loop + state.dataRoomAir->TotUFADInt; } zoneUE.DiffuserType = static_cast(getEnumValue(diffuserNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index e78f19c3709..4a11d41dfba 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -228,8 +228,6 @@ void SizeUFAD(EnergyPlusData &state, using DataSizing::AutoSize; - Real64 NumberOfOccupants(0.0); // design number of occupants in the zone - Real64 NumberOfPlumes(0.0); // design number of plumes in the zone Real64 ZoneElecConv(0.0); // zone elec equip design convective gain [W] Real64 ZoneGasConv(0.0); // zone gas equip design convective gain [W] Real64 ZoneOthEqConv(0.0); // zone other equip design convective gain [W] @@ -239,7 +237,10 @@ void SizeUFAD(EnergyPlusData &state, // This is for both UFADInt and UFADExt auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); - NumberOfOccupants = 0.0; + std::string_view cCMO = (model == RoomAirModel::UFADExt) ? + "RoomAirSettings:UnderFloorAirDistributionExterior" : "RoomAirSettings:UnderFloorAirDistributionInterior"; + + Real64 NumberOfOccupants = 0.0; for (auto const &people : state.dataHeatBal->People) { if (people.ZonePtr == ZoneNum) NumberOfOccupants += people.NumberOfPeople; } @@ -272,7 +273,7 @@ void SizeUFAD(EnergyPlusData &state, // 4 ft x 4 inches; 75 cfm per linear foot; area is .025 m2/m BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionInterior", + cCMO, zoneU.ZoneName, "Design effective area of diffuser", zoneU.DiffArea); @@ -282,7 +283,7 @@ void SizeUFAD(EnergyPlusData &state, zoneU.DiffAngle = diffAngle[(int)zoneU.DiffuserType]; BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionInterior", + cCMO, zoneU.ZoneName, "Angle between diffuser slots and the vertical", zoneU.DiffAngle); @@ -301,8 +302,8 @@ void SizeUFAD(EnergyPlusData &state, zoneU.D_Kc != Constant::AutoCalculate || zoneU.E_Kc != Constant::AutoCalculate)) { ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = {}.", zoneU.ZoneName, diffuserNamesUC[(int)zoneU.DiffuserType])); + format("For {} for Zone {}, input for Coefficients A - E will be " + "ignored when Floor Diffuser Type = {}.", cCMO, zoneU.ZoneName, diffuserNamesUC[(int)zoneU.DiffuserType])); ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); } @@ -336,51 +337,49 @@ void SizeUFAD(EnergyPlusData &state, zoneU.D_Kc == Constant::AutoCalculate || zoneU.E_Kc == Constant::AutoCalculate) { ShowFatalError(state, - format("For RoomAirSettings:UnderFloorAirDistributionInterior for Zone {}, input for Coefficients A - E must be " - "specified when Floor Diffuser Type = Custom.", zoneU.ZoneName)); + format("For {} for Zone {}, input for Coefficients A - E must be " + "specified when Floor Diffuser Type = Custom.", cCMO, zoneU.ZoneName)); } if (zoneU.PowerPerPlume == Constant::AutoCalculate) { - NumberOfPlumes = 0.0; - if (NumberOfOccupants > 0.0) { - NumberOfPlumes = NumberOfOccupants; - } else { - NumberOfPlumes = 1.0; - } + Real64 NumberOfPlumes = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; + ZoneElecConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotElecEquip; ++Ctd) { - if (state.dataHeatBal->ZoneElectric(Ctd).ZonePtr == ZoneNum) { - ZoneElecConv += state.dataHeatBal->ZoneElectric(Ctd).DesignLevel * state.dataHeatBal->ZoneElectric(Ctd).FractionConvected; + for (auto const &zoneElectric : state.dataHeatBal->ZoneElectric) { + if (zoneElectric.ZonePtr == ZoneNum) { + // Is the behavior for Exterior UFAD supposed to be different than for Interior UFAD? + ZoneElecConv += (model == RoomAirModel::UFADExt) ? zoneElectric.DesignLevel : (zoneElectric.DesignLevel * zoneElectric.FractionConvected); } } ZoneGasConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotGasEquip; ++Ctd) { - if (state.dataHeatBal->ZoneGas(Ctd).ZonePtr == ZoneNum) { - ZoneGasConv += state.dataHeatBal->ZoneGas(Ctd).DesignLevel * state.dataHeatBal->ZoneGas(Ctd).FractionConvected; + for (auto const &zoneGas : state.dataHeatBal->ZoneGas) { + if (zoneGas.ZonePtr == ZoneNum) { + ZoneGasConv += (model == RoomAirModel::UFADExt) ? zoneGas.DesignLevel : (zoneGas.DesignLevel * zoneGas.FractionConvected); } } ZoneOthEqConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotOthEquip; ++Ctd) { - if (state.dataHeatBal->ZoneOtherEq(Ctd).ZonePtr == ZoneNum) { - ZoneOthEqConv += state.dataHeatBal->ZoneOtherEq(Ctd).DesignLevel * state.dataHeatBal->ZoneOtherEq(Ctd).FractionConvected; + for (auto const &zoneOtherEq : state.dataHeatBal->ZoneOtherEq) { + if (zoneOtherEq.ZonePtr == ZoneNum) { + ZoneOthEqConv += (model == RoomAirModel::UFADExt) ? zoneOtherEq.DesignLevel : (zoneOtherEq.DesignLevel * zoneOtherEq.FractionConvected); } } ZoneHWEqConv = 0.0; - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotHWEquip; ++Ctd) { - if (state.dataHeatBal->ZoneHWEq(Ctd).ZonePtr == ZoneNum) { - ZoneHWEqConv += state.dataHeatBal->ZoneHWEq(Ctd).DesignLevel * state.dataHeatBal->ZoneHWEq(Ctd).FractionConvected; + for (auto const &zoneHWEq : state.dataHeatBal->ZoneHWEq) { + if (zoneHWEq.ZonePtr == ZoneNum) { + ZoneHWEqConv += (model == RoomAirModel::UFADExt) ? zoneHWEq.DesignLevel : (zoneHWEq.DesignLevel * zoneHWEq.FractionConvected); } } - for (int Ctd = 1; Ctd <= state.dataHeatBal->TotStmEquip; ++Ctd) { - ZoneSteamEqConv = 0.0; // This should be outside the outer loop, no? - if (state.dataHeatBal->ZoneSteamEq(Ctd).ZonePtr == ZoneNum) { - ZoneSteamEqConv += state.dataHeatBal->ZoneSteamEq(Ctd).DesignLevel * state.dataHeatBal->ZoneSteamEq(Ctd).FractionConvected; + + for (auto const &zoneSteamEq : state.dataHeatBal->ZoneSteamEq) { + ZoneSteamEqConv = 0.0; // I'm 99.72% sure this is a bug. + if (zoneSteamEq.ZonePtr == ZoneNum) { + ZoneSteamEqConv += (model == RoomAirModel::UFADExt) ? zoneSteamEq.DesignLevel : (zoneSteamEq.DesignLevel * zoneSteamEq.FractionConvected); } } - zoneU.PowerPerPlume = - (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; + zoneU.PowerPerPlume = (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; + BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionInterior", + cCMO, zoneU.ZoneName, "Power per plume [W]", zoneU.PowerPerPlume); @@ -388,7 +387,7 @@ void SizeUFAD(EnergyPlusData &state, if (zoneU.DiffusersPerZone == AutoSize) { zoneU.DiffusersPerZone = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionInterior", + cCMO, zoneU.ZoneName, "Number of diffusers per zone", zoneU.DiffusersPerZone); @@ -399,7 +398,7 @@ void SizeUFAD(EnergyPlusData &state, zoneU.DiffusersPerZone = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; BaseSizer::reportSizerOutput(state, - "RoomAirSettings:UnderFloorAirDistributionExterior", + cCMO, zoneU.ZoneName, "Number of diffusers per zone", zoneU.DiffusersPerZone); @@ -423,18 +422,9 @@ void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeigh using namespace DataEnvironment; using namespace DataHeatBalance; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 HLD; // Convection coefficient for the lower area of surface - Real64 TmedDV; // Average temperature for DV - Real64 Z1; // auxiliary var for lowest height - Real64 Z2; // auxiliary var for highest height - Real64 ZSupSurf; // highest height for this surface - Real64 ZInfSurf; // lowest height for this surface - Real64 HLU; // Convection coefficient for the upper area of surface - Real64 LayH; // Height of the Occupied/Mixed subzone interface - Real64 LayFrac; // Fraction height of the Occupied/Mixed subzone interface - int SurfNum; // Surface number - // Initialize HAT and HA + // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? + if (!state.dataRoomAir->IsZoneUFAD(ZoneNum)) + return; ufadCC.HAT_MX = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone ufadCC.HAT_MXWin = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone (windows only) @@ -446,291 +436,268 @@ void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeigh ufadCC.HA_OCWin = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone (windows only) ufadCC.HAT_FLOOR = 0.0; // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone ufadCC.HA_FLOOR = 0.0; // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone - - // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? - if (state.dataRoomAir->IsZoneUFAD(ZoneNum)) { - Real64 zoneCeilingHeight1 = state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - Real64 zoneCeilingHeight2 = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum); + + Real64 zoneCeilingHeight1 = state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + Real64 zoneCeilingHeight2 = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum); - LayFrac = FractionHeight; - LayH = FractionHeight * (zoneCeilingHeight2 - zoneCeilingHeight1); - // WALL Hc, HA and HAT calculation - for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAir->APos_Wall(Ctd); - if (SurfNum == 0) continue; - - auto &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - Z1 = minval(surf.Vertex, &Vector::z); - Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - zoneCeilingHeight1; - ZInfSurf = Z1 - zoneCeilingHeight1; - - // The Wall surface is in the upper subzone - if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); - ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); - } + Real64 LayH = FractionHeight * (zoneCeilingHeight2 - zoneCeilingHeight1); // Height of the Occupied/Mixed subzone interface - // The Wall surface is in the lower subzone - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); - } + // WALL Hc, HA and HAT calculation + for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Wall(Ctd); + if (SurfNum == 0) continue; - if (std::abs(ZInfSurf - ZSupSurf) < 1.e-10) { - ShowSevereError(state, "RoomAirModelUFAD:HcUCSDUF: Surface values will cause divide by zero."); - ShowContinueError(state, - format("Zone=\"{}\", Surface=\"{}\".", - state.dataHeatBal->Zone(surf.Zone).Name, - surf.Name)); - ShowContinueError(state, format("ZInfSurf=[{:.4R}], LayH=[{:.4R}].", ZInfSurf, LayH)); - ShowContinueError(state, format("ZSupSurf=[{:.4R}], LayH=[{:.4R}].", ZSupSurf, LayH)); - ShowFatalError(state, "...Previous condition causes termination."); - } + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z)- zoneCeilingHeight1; // highest height for this surface + Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; // lowest height for this surface + + // The Wall surface is in the upper subzone + if (ZInfSurf > LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); + } - // The Wall surface is partially in upper and partially in lower subzone - if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - HLU = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - HLD = state.dataRoomAir->UFADHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); - state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; - } + // The Wall surface is in the lower subzone + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); + } - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWall(Ctd); + if (std::abs(ZInfSurf - ZSupSurf) < 1.e-10) { + ShowSevereError(state, "RoomAirModelUFAD:HcUCSDUF: Surface values will cause divide by zero."); + ShowContinueError(state, + format("Zone=\"{}\", Surface=\"{}\".", + state.dataHeatBal->Zone(surf.Zone).Name, + surf.Name)); + ShowContinueError(state, format("ZInfSurf=[{:.4R}], LayH=[{:.4R}].", ZInfSurf, LayH)); + ShowContinueError(state, format("ZSupSurf=[{:.4R}], LayH=[{:.4R}].", ZSupSurf, LayH)); + ShowFatalError(state, "...Previous condition causes termination."); + } - } // END WALL + // The Wall surface is partially in upper and partially in lower subzone + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface + Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); // Average temperature for DV + state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; + } + + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWall(Ctd); - // WINDOW Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAir->APos_Window(Ctd); - if (SurfNum == 0) continue; + } // END WALL - auto &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + // WINDOW Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); + if (SurfNum == 0) continue; + + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + + if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall + Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; + Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; - if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall - Z1 = minval(surf.Vertex, &Vector::z); - Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - zoneCeilingHeight1; - ZInfSurf = Z1 - zoneCeilingHeight1; - - if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); - ufadCC.HAT_MXWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - ufadCC.HA_MXWin += surf.Area * state.dataRoomAir->HWindow(Ctd); - } - - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); - ufadCC.HAT_OCWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - ufadCC.HA_OCWin += surf.Area * state.dataRoomAir->HWindow(Ctd); - } - - if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - HLU = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - HLD = state.dataRoomAir->UFADHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); - state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - ufadCC.HA_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - ufadCC.HAT_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - ufadCC.HA_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; - } - } - - if (surf.Tilt <= 10.0) { // Window Ceiling + if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_MXWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_MXWin += surf.Area * state.dataRoomAir->HWindow(Ctd); } - - if (surf.Tilt >= 170.0) { // Window Floor + + if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); - } - - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); - - } // END WINDOW - - // DOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR - SurfNum = state.dataRoomAir->APos_Door(Ctd); - if (SurfNum == 0) continue; - auto &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - - Z1 = minval(surf.Vertex, &Vector::z); - Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - zoneCeilingHeight1; - ZInfSurf = Z1 - zoneCeilingHeight1; - - if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); - ufadCC.HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); - } - - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); + ufadCC.HAT_OCWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_OCWin += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - HLU = state.dataRoomAir->UFADHcIn(SurfNum); + Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - HLD = state.dataRoomAir->UFADHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); - state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface + Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); // Average temperature + + state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HAT_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + ufadCC.HA_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + ufadCC.HAT_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HA_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } + } + + if (surf.Tilt <= 10.0) { // Window Ceiling + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + } else if (surf.Tilt >= 170.0) { // Window Floor + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); + } + + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); + + } // END WINDOW - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HDoor(Ctd); - - } // END DOOR - - // INTERNAL Hc, HA and HAT CALCULATION - state.dataUFADManager->HeightIntMass = - min(state.dataUFADManager->HeightIntMassDefault, - (zoneCeilingHeight2 - zoneCeilingHeight1)); - for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAir->APos_Internal(Ctd); - if (SurfNum == 0) continue; + // DOOR Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR + int SurfNum = state.dataRoomAir->APos_Door(Ctd); + if (SurfNum == 0) continue; + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - auto &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - ZSupSurf = state.dataUFADManager->HeightIntMass; - ZInfSurf = 0.0; + Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; + Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; + + if (ZInfSurf > LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); + } + + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); + } - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); - } + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface + Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); // Average temperature + state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; + } + + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HDoor(Ctd); - if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - HLU = state.dataRoomAir->UFADHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - HLD = state.dataRoomAir->UFADHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); - state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * - state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; - } + } // END DOOR - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HInternal(Ctd); - } // END INTERNAL + // INTERNAL Hc, HA and HAT CALCULATION + state.dataUFADManager->HeightIntMass = min(state.dataUFADManager->HeightIntMassDefault, (zoneCeilingHeight2 - zoneCeilingHeight1)); + for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Internal(Ctd); + if (SurfNum == 0) continue; + + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + Real64 ZSupSurf = state.dataUFADManager->HeightIntMass; + Real64 ZInfSurf = 0.0; + + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); + } - // CEILING Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); - if (SurfNum == 0) continue; - auto &surf = state.dataSurface->Surface(SurfNum); - - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_MX += - surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); - ufadCC.HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); - } // END CEILING - - // FLOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { - SurfNum = state.dataRoomAir->APos_Floor(Ctd); - if (SurfNum == 0) continue; - auto &surf = state.dataSurface->Surface(SurfNum); - - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HFloor(Ctd); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); - } // END FLOOR - } + Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface + Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); // Average temperature + state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; + } + + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HInternal(Ctd); + } // END INTERNAL + + // CEILING Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); + if (SurfNum == 0) continue; + auto &surf = state.dataSurface->Surface(SurfNum); + + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); + } // END CEILING + + // FLOOR Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Floor(Ctd); + if (SurfNum == 0) continue; + auto &surf = state.dataSurface->Surface(SurfNum); + + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HFloor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); + } // END FLOOR } void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone @@ -760,18 +727,6 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t using InternalHeatGains::SumInternalConvectionGainsByTypes; using InternalHeatGains::SumReturnAirConvectionGainsByTypes; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool MIXFLAG(false); // if true treat as a mixed zone Real64 CeilingHeight; // zone ceiling height above floor [m] From 6da7eb97171a4316caa49e205040bc047b2a53c7 Mon Sep 17 00:00:00 2001 From: amirroth Date: Wed, 28 Jun 2023 14:10:15 -0400 Subject: [PATCH 15/17] Array1D to EPVector for Windows/VS initialization --- src/EnergyPlus/DataRoomAirModel.hh | 48 +-- src/EnergyPlus/UFADManager.cc | 453 ++++++++++------------------- 2 files changed, 184 insertions(+), 317 deletions(-) diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index f525373c01d..25e930f6f4b 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -533,17 +533,17 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ZoneCeilingHeight1; Array1D ZoneCeilingHeight2; Array1D MATFloor; // [C] floor level mean air temp - Array1D> XMATFloor; // [C] floor level mean air temp at t minus X zone time step - Array1D> DSXMATFloor; // [C] floor level mean air temp at t minus X system time step + EPVector> XMATFloor; // [C] floor level mean air temp at t minus X zone time step + EPVector> DSXMATFloor; // [C] floor level mean air temp at t minus X system time step Array1D MATOC; // [C] occupied mean air temp - Array1D> XMATOC; // [C] occupied mean air temp at t minus X zone time step - Array1D> DSXMATOC; // [C] occupied mean air temp at t minus X system time step + EPVector> XMATOC; // [C] occupied mean air temp at t minus X zone time step + EPVector> DSXMATOC; // [C] occupied mean air temp at t minus X system time step Array1D MATMX; // [C] mixed (upper) mean air temp - Array1D> XMATMX; // [C] mixed (upper) mean air temp at t minus X zone time step - Array1D> DSXMATMX; // [C] mixed mean air temp at t minus X system time step - Array1D> ZTMFloor; // [C] difference equation's Floor air temp at t minus X - Array1D> ZTMOC; // [C] difference equation's Occupied air temp at t minus X - Array1D> ZTMMX; // [C] difference equation's Mixed air temp at t minus X + EPVector> XMATMX; // [C] mixed (upper) mean air temp at t minus X zone time step + EPVector> DSXMATMX; // [C] mixed mean air temp at t minus X system time step + EPVector> ZTMFloor; // [C] difference equation's Floor air temp at t minus X + EPVector> ZTMOC; // [C] difference equation's Occupied air temp at t minus X + EPVector> ZTMMX; // [C] difference equation's Mixed air temp at t minus X Array1D AIRRATFloor; Array1D AIRRATOC; Array1D AIRRATMX; @@ -566,15 +566,15 @@ struct RoomAirModelData : BaseGlobalStruct Array1D_int APos_Wall; Array1D_int APos_Floor; Array1D_int APos_Ceiling; - Array1D PosZ_Wall; - Array1D PosZ_Floor; - Array1D PosZ_Ceiling; + EPVector PosZ_Wall; + EPVector PosZ_Floor; + EPVector PosZ_Ceiling; Array1D_int APos_Window; Array1D_int APos_Door; Array1D_int APos_Internal; - Array1D PosZ_Window; - Array1D PosZ_Door; - Array1D PosZ_Internal; + EPVector PosZ_Window; + EPVector PosZ_Door; + EPVector PosZ_Internal; // Convection coefficients for the various surfaces Array1D HCeiling; Array1D HWall; @@ -637,16 +637,16 @@ struct RoomAirModelData : BaseGlobalStruct int NumOfRoomAFNControl = 0; // count of RoomAirSettings:AirflowNetwork // Object Data - Array1D AirModel; - Array1D AirNode; - Array1D ZoneDispVent3Node; // UCSD - Array1D ZoneCrossVent; - Array1D ZoneUFAD; + EPVector AirModel; + EPVector AirNode; + EPVector ZoneDispVent3Node; // UCSD + EPVector ZoneCrossVent; + EPVector ZoneUFAD; Array2D CrossVentJetRecFlows; // Jet and recirculation zone flows and properties - Array1D SurfParametersCrossDispVent; // Surface parameters - Array1D AirPattern; // user defined patterns ,various types - Array1D AirPatternZoneInfo; // added zone information for user defined patterns - Array1D AFNZoneInfo; // added zone info + EPVector SurfParametersCrossDispVent; // Surface parameters + EPVector AirPattern; // user defined patterns ,various types + EPVector AirPatternZoneInfo; // added zone information for user defined patterns + EPVector AFNZoneInfo; // added zone info void clear_state() override { diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 4a11d41dfba..1352de7be4a 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -700,6 +700,42 @@ void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeigh } // END FLOOR } +static constexpr std::array IntGainTypesOccupied = { + DataHeatBalance::IntGainType::People, + DataHeatBalance::IntGainType::WaterHeaterMixed, + DataHeatBalance::IntGainType::WaterHeaterStratified, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + DataHeatBalance::IntGainType::ElectricEquipment, + DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, + DataHeatBalance::IntGainType::GasEquipment, + DataHeatBalance::IntGainType::HotWaterEquipment, + DataHeatBalance::IntGainType::SteamEquipment, + DataHeatBalance::IntGainType::OtherEquipment, + DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, + DataHeatBalance::IntGainType::GeneratorFuelCell, + DataHeatBalance::IntGainType::WaterUseEquipment, + DataHeatBalance::IntGainType::GeneratorMicroCHP, + DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, + DataHeatBalance::IntGainType::PipeIndoor, + DataHeatBalance::IntGainType::RefrigerationCase, + DataHeatBalance::IntGainType::RefrigerationCompressorRack, + DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, + DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, + DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, + DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, + DataHeatBalance::IntGainType::RefrigerationWalkIn}; + +static constexpr std::array IntGainTypesUpSubzone = { + DataHeatBalance::IntGainType::DaylightingDeviceTubular, + DataHeatBalance::IntGainType::Lights}; + void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone { @@ -728,85 +764,11 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t using InternalHeatGains::SumReturnAirConvectionGainsByTypes; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - bool MIXFLAG(false); // if true treat as a mixed zone - Real64 CeilingHeight; // zone ceiling height above floor [m] - int UINum; // index to underfloor interior zone model data - Real64 GainsFrac; // fraction of occupied subzone heat gains that remain in the subzone; - // that is, don't go into the plumes - // REAL(r64) :: NumPLPP ! number of plumes per person - Real64 HeightThermostat; // height of the thermostat above the floor [m] - Real64 HeightComfort; // height at which comfort temperature is calculated - Real64 TempDiffCritRep; // Minimum temperature difference between upper and occupied subzones for reporting - Real64 ConvGainsOccSubzone; // convective heat gains into the lower (occupied) subzone [W] - Real64 ConvGainsUpSubzone; // convective heat gains into the upper subzone [W] - Real64 ConvGains; // total zone convective gains (excluding surfaces) [W] - int ZoneEquipConfigNum; // ZoneEquipConfig index for this UFAD zone - Real64 SumSysMCp; // Sum of system mass flow rate * specific heat for this zone [W/K] - Real64 SumSysMCpT; // Sum of system mass flow rate * specific heat * temperature for this zone [W] - Real64 SumSysM; // Sum of systems mass flow rate [kg/s] - Real64 NodeTemp; // inlet node temperature [K] - Real64 MassFlowRate; // system mass flow rate [kg/s] - Real64 CpAir; // specific heat of air [J/kgK] - int InNodeIndex; // inlet node index in ZoneEquipConfig - Real64 SumMCp; // mass flow rate * specific heat for this zone for infiltration, ventilation, mixing [W/K] - Real64 SumMCpT; // mass flow rate * specific heat* temp for this zone for infiltration, ventilation, mixing [W] - Real64 MCp_Total; // total mass flow rate * specific heat for this zone [W/K] - Real64 MCpT_Total; // total mass flow rate * specific heat* temp for this zone [W] - Real64 NumberOfPlumes; - Real64 PowerInPlumes; // [W] - Real64 PowerPerPlume(0.0); // power generating each plume [W] + Real64 HeightFrac; // Fractional height of transition between occupied and upper subzones - Real64 TotSysFlow; // [m3/s] - Real64 NumDiffusersPerPlume; - Real64 NumDiffusers; - Real64 TSupK; // supply yemperature [K] Real64 Gamma; // dimensionless height parameter; higher gamma means interface height will be // higher, smaller gamma means interface height will be lower. - Real64 DiffArea; // diffuser effective area [m2] - Real64 ThrowAngle; // diffuser slot angle relative to vertical [radians] - Real64 SourceHeight; // height of plume sources above the floor [m] - int Ctd; - Real64 TempHistTerm; Real64 ZTAveraged; - Real64 HeightUpSubzoneAve; // Height of center of upper air subzone - Real64 HeightOccupiedSubzoneAve; // Height of center of occupied air subzone - Real64 ZoneMult; // total zone multiplier - int ZoneNodeNum; // node number of the HVAC zone node - static constexpr std::array IntGainTypesOccupied = { - DataHeatBalance::IntGainType::People, - DataHeatBalance::IntGainType::WaterHeaterMixed, - DataHeatBalance::IntGainType::WaterHeaterStratified, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::ElectricEquipment, - DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, - DataHeatBalance::IntGainType::GasEquipment, - DataHeatBalance::IntGainType::HotWaterEquipment, - DataHeatBalance::IntGainType::SteamEquipment, - DataHeatBalance::IntGainType::OtherEquipment, - DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::WaterUseEquipment, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::RefrigerationCase, - DataHeatBalance::IntGainType::RefrigerationCompressorRack, - DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, - DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, - DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, - DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, - DataHeatBalance::IntGainType::RefrigerationWalkIn}; - - static constexpr std::array IntGainTypesUpSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, - DataHeatBalance::IntGainType::Lights}; - Real64 RetAirGains; // Exact solution or Euler method if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { @@ -825,35 +787,33 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t } auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - MIXFLAG = false; + bool MIXFLAG = false; state.dataRoomAir->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; - SumSysMCp = 0.0; - SumSysMCpT = 0.0; - TotSysFlow = 0.0; - TSupK = 0.0; - SumSysM = 0.0; - ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; - CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); - - auto &zoneU = state.dataRoomAir->ZoneUFAD(UINum); - HeightThermostat = zoneU.ThermostatHeight; - HeightComfort = zoneU.ComfortHeight; - TempDiffCritRep = zoneU.TempTrigger; - DiffArea = zoneU.DiffArea; - ThrowAngle = Constant::DegToRadians * zoneU.DiffAngle; - SourceHeight = 0.0; - NumDiffusers = zoneU.DiffusersPerZone; - PowerPerPlume = zoneU.PowerPerPlume; + Real64 SumSysMCp = 0.0; // Sum of system mass flow rate * specific heat for this zone [W/K] + Real64 SumSysMCpT = 0.0; // Sum of system mass flow rate * specific heat * temperature for this zone [W] + Real64 TSupK = 0.0; // supply temperature [K] + Real64 SumSysM = 0.0; // Sum of systems mass flow rate [kg/s] + Real64 TotSysFlow = 0.0; // [m3/s] + int ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; + Real64 CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + + auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); + Real64 HeightThermostat = zoneU.ThermostatHeight; // height of the thermostat above the floor [m] + Real64 HeightComfort = zoneU.ComfortHeight; // height at which comfort temperature is calculated + Real64 TempDiffCritRep = zoneU.TempTrigger; // Minimum temperature difference between upper and occupied subzones for reporting + Real64 DiffArea = zoneU.DiffArea; // diffuser effective area [m2] + Real64 ThrowAngle = Constant::DegToRadians * zoneU.DiffAngle; // diffuser slot angle relative to vertical [radians] + Real64 SourceHeight = 0.0; // height of plume sources above the floor [m] + Real64 NumDiffusers = zoneU.DiffusersPerZone; + Real64 PowerPerPlume = zoneU.PowerPerPlume; // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, // baseboards (nonthermostatic), water heater skin loss - ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); + Real64 ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very // low or zero) if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { - RetAirGains = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); - ConvGainsOccSubzone += RetAirGains; + ConvGainsOccSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); } // Add convection from pool cover to occupied region @@ -861,19 +821,20 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t // gains from lights (ceiling), tubular daylighting devices, high temp radiant heaters - ConvGainsUpSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); + Real64 ConvGainsUpSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); ConvGainsUpSubzone += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum); if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { - RetAirGains = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); - ConvGainsUpSubzone += RetAirGains; + ConvGainsUpSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); } - ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; - ZoneEquipConfigNum = zoneU.ZoneEquipPtr; + + Real64 ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; + Real64 ZoneEquipConfigNum = zoneU.ZoneEquipPtr; if (ZoneEquipConfigNum > 0) { - for (InNodeIndex = 1; InNodeIndex <= state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { - NodeTemp = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; - MassFlowRate = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).MassFlowRate; - CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); + auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum); + for (int InNodeIndex = 1; InNodeIndex <= zoneEquipConfig.NumInletNodes; ++InNodeIndex) { + Real64 NodeTemp = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).Temp; + Real64 MassFlowRate = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).MassFlowRate; + Real64 CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, NodeTemp, thisZoneHB.ZoneAirHumRat); @@ -886,13 +847,13 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t TSupK = 0.0; } } - // mass flow times specific heat for infiltration, ventilation, mixing, earth tube - SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MCPE + thisZoneHB.MCPC + thisZoneHB.MDotCPOA; - // mass flow times specific heat times temperature for infiltration, ventilation, mixing, earth tube - SumMCpT = thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MCPTE + thisZoneHB.MCPTC + + // mass flow rate * specific heat for this zone for infiltration, ventilation, mixing [W/K] + Real64 SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MCPE + thisZoneHB.MCPC + thisZoneHB.MDotCPOA; + // mass flow rate * specific heat* temp for this zone for infiltration, ventilation, mixing [W] + Real64 SumMCpT = thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MCPTE + thisZoneHB.MCPTC + thisZoneHB.MDotCPOA * state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp; - MCp_Total = SumMCp + SumSysMCp; - MCpT_Total = SumMCpT + SumSysMCpT; + Real64 MCp_Total = SumMCp + SumSysMCp; // total mass flow rate * specific heat for this zone [W/K] + Real64 MCpT_Total = SumMCpT + SumSysMCpT; // total mass flow rate * specific heat* temp for this zone [W] // For the York MIT diffusers (variable area) the area varies with the flow rate. Assume 400 ft/min velocity // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by @@ -903,15 +864,12 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. UFADConvCoef ufadCC; HcUFAD(state, ZoneNum, 0.5, ufadCC); - PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); - if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { - NumberOfPlumes = PowerInPlumes / PowerPerPlume; - NumDiffusersPerPlume = NumDiffusers / NumberOfPlumes; - } else { - NumberOfPlumes = 1.0; - NumDiffusersPerPlume = 1.0; - } + Real64 PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + + Real64 NumberOfPlumes = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (PowerInPlumes / PowerPerPlume) : 1.0; + Real64 NumDiffusersPerPlume = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (NumDiffusers / NumberOfPlumes) : 1.0; + if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::KelvinConv) > thisZoneHB.MAT) { // The system will mix HeightFrac = 0.0; @@ -924,7 +882,7 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t HeightFrac = zoneU.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); - for (Ctd = 1; Ctd <= 4; ++Ctd) { + for (int Ctd = 1; Ctd <= 4; ++Ctd) { HcUFAD(state, ZoneNum, HeightFrac, ufadCC); PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); @@ -945,9 +903,7 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t } HeightFrac = max(0.0, min(1.0, HeightFrac)); state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + - zoneU.C_Kc + zoneU.D_Kc * Gamma + - zoneU.E_Kc * pow_2(Gamma); + Real64 GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + zoneU.C_Kc + zoneU.D_Kc * Gamma + zoneU.E_Kc * pow_2(Gamma); GainsFrac = max(0.6, min(GainsFrac, 1.0)); state.dataRoomAir->AIRRATOC(ZoneNum) = state.dataHeatBal->Zone(ZoneNum).Volume * @@ -981,7 +937,7 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t } Real64 AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + + Real64 TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A Real64 TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; @@ -1065,9 +1021,9 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; Real64 AirCap = thisZoneHB.AirPowerCap; - TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); + Real64 TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); - for (Ctd = 1; Ctd <= 3; ++Ctd) { + for (int Ctd = 1; Ctd <= 3; ++Ctd) { Real64 TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; Real64 const thisZoneT1 = thisZoneHB.ZoneT1; // Formerly CoefSumhat, coef in zone temp equation with dimensions of h*A(T1 @@ -1124,8 +1080,8 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t // Comfort temperature and temperature at the thermostat/temperature control sensor state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; - HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; + Real64 HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + Real64 HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; // Comfort temperature if (MIXFLAG) { @@ -1181,7 +1137,7 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t } if (ZoneEquipConfigNum > 0) { - ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; + int ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); } @@ -1230,89 +1186,9 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t using InternalHeatGains::SumReturnAirConvectionGainsByTypes; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - bool MIXFLAG(false); // if true treat as a mixed zone - Real64 CeilingHeight; // zone ceiling height above floor [m] - int UINum; // index to underfloor interior zone model data - Real64 GainsFrac; // fraction of occupied subzone heat gains that remain in the subzone; - // that is, don't go into the plumes - Real64 HeightThermostat; // height of the thermostat above the floor [m] - Real64 HeightComfort; // height at which comfort temperature is calculated - Real64 TempDiffCritRep; // Minimum temperature difference between upper and occupied subzones for reporting - Real64 ConvGainsOccSubzone; // convective heat gains into the lower (occupied) subzone [W] - Real64 ConvGainsUpSubzone; // convective heat gains into the upper subzone [W] - Real64 ConvGains; // total zone convective gains (excluding surfaces) [W] - Real64 ConvGainsWindows; // convective gain from windows [W] - int ZoneEquipConfigNum; // ZoneEquipConfig index for this UFAD zone - Real64 SumSysMCp; // Sum of system mass flow rate * specific heat for this zone [W/K] - Real64 SumSysMCpT; // Sum of system mass flow rate * specific heat * temperature for this zone [W] - Real64 SumSysM; // Sum of systems mass flow rate [kg/s] - Real64 NodeTemp; // inlet node temperature [K] - Real64 MassFlowRate; // system mass flow rate [kg/s] - Real64 CpAir; // specific heat of air [J/kgK] - int InNodeIndex; // inlet node index in ZoneEquipConfig - Real64 SumMCp; // mass flow rate * specific heat for this zone for infiltration, ventilation, mixing [W/K] - Real64 SumMCpT; // mass flow rate * specific heat* temp for this zone for infiltration, ventilation, mixing [W] - Real64 MCp_Total; // total mass flow rate * specific heat for this zone [W/K] - Real64 MCpT_Total; // total mass flow rate * specific heat* temp for this zone [W] - Real64 NumberOfPlumes; - Real64 PowerInPlumes; // [W] - Real64 PowerPerPlume(0.0); // power carried by each plume [W] + Real64 PowerInPlumesPerMeter; // Power in Plumes per meter of window length [W/m] - Real64 NumDiffusersPerPlume(0.0); - Real64 HeightFrac; // Fractional height of transition between occupied and upper subzones - Real64 TotSysFlow; // [m3/s] - Real64 NumDiffusers; - Real64 TSupK; // supply yemperature [K] - Real64 Gamma; // dimensionless height parameter; higher gamma means interface height will be - // higher, smaller gamma means interface height will be lower. - Real64 DiffArea; // diffuser effective area [m2] - Real64 ThrowAngle; // diffuser slot angle relative to vertical [radians] - Real64 SourceHeight; // height of plume sources above the floor [m] - int Ctd; - Real64 AirCap; - Real64 TempHistTerm; Real64 ZTAveraged; - Real64 HeightUpSubzoneAve; // Height of center of upper air subzone - Real64 HeightOccupiedSubzoneAve; // Height of center of occupied air subzone - Real64 ZoneMult; // total zone multiplier - int ZoneNodeNum; // node number of the HVAC zone node - Real64 TempDepCoef(0.0); // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A - Real64 TempIndCoef(0.0); // Formerly CoefSumhat, coef in zone temp equation with dimensions of h*A(T1 - static constexpr std::array IntGainTypesOccupied = { - DataHeatBalance::IntGainType::People, - DataHeatBalance::IntGainType::WaterHeaterMixed, - DataHeatBalance::IntGainType::WaterHeaterStratified, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::ElectricEquipment, - DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, - DataHeatBalance::IntGainType::GasEquipment, - DataHeatBalance::IntGainType::HotWaterEquipment, - DataHeatBalance::IntGainType::SteamEquipment, - DataHeatBalance::IntGainType::OtherEquipment, - DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::WaterUseEquipment, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::RefrigerationCase, - DataHeatBalance::IntGainType::RefrigerationCompressorRack, - DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, - DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, - DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, - DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, - DataHeatBalance::IntGainType::RefrigerationWalkIn}; - - static constexpr std::array IntGainTypesUpSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, - DataHeatBalance::IntGainType::Lights}; - Real64 RetAirGains; // Exact solution or Euler method if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { @@ -1331,58 +1207,56 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t } auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - HeightFrac = 0.0; - MIXFLAG = false; + Real64 HeightFrac = 0.0; // Fractional height of transition between occupied and upper subzones + bool MIXFLAG = false; state.dataRoomAir->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; - SumSysMCp = 0.0; - SumSysMCpT = 0.0; - TotSysFlow = 0.0; - TSupK = 0.0; - SumSysM = 0.0; - PowerInPlumes = 0.0; - ConvGainsWindows = 0.0; - Gamma = 0.0; - ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; - CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - UINum = state.dataRoomAir->ZoneUFADPtr(ZoneNum); - - auto &zoneUE = state.dataRoomAir->ZoneUFAD(UINum); - HeightThermostat = zoneUE.ThermostatHeight; - HeightComfort = zoneUE.ComfortHeight; - TempDiffCritRep = zoneUE.TempTrigger; - DiffArea = zoneUE.DiffArea; - ThrowAngle = Constant::DegToRadians * zoneUE.DiffAngle; - SourceHeight = zoneUE.HeatSrcHeight; - NumDiffusers = zoneUE.DiffusersPerZone; - PowerPerPlume = zoneUE.PowerPerPlume; + Real64 SumSysMCp = 0.0; // Sum of system mass flow rate * specific heat for this zone [W/K] + Real64 SumSysMCpT = 0.0; // Sum of system mass flow rate * specific heat * temperature for this zone [W] + Real64 TotSysFlow = 0.0; // [m3/s] + Real64 TSupK = 0.0; // supply temperature [K] + Real64 SumSysM = 0.0; // Sum of systems mass flow rate [kg/s] + Real64 PowerInPlumes = 0.0; // [W] + Real64 Gamma = 0.0; // dimensionless height parameter; higher gamma means interface height will be + // higher, smaller gamma means interface height will be lower. + int ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; + Real64 CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + + auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); + Real64 HeightThermostat = zoneU.ThermostatHeight; // height of the thermostat above the floor [m] + Real64 HeightComfort = zoneU.ComfortHeight; // height at which comfort temperature is calculated + Real64 TempDiffCritRep = zoneU.TempTrigger; // Minimum temperature difference between upper and occupied subzones for reporting + Real64 DiffArea = zoneU.DiffArea; // diffuser effective area [m2] + Real64 ThrowAngle = Constant::DegToRadians * zoneU.DiffAngle; // diffuser slot angle relative to vertical [radians] + Real64 SourceHeight = zoneU.HeatSrcHeight; // height of plume sources above the floor [m] + Real64 NumDiffusers = zoneU.DiffusersPerZone; + Real64 PowerPerPlume = zoneU.PowerPerPlume; // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, // baseboards (nonthermostatic), water heater skin loss - ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); + Real64 ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very // low or zero) if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { - RetAirGains = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); - ConvGainsOccSubzone += RetAirGains; + ConvGainsOccSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); } // Add convection from pool cover to occupied region ConvGainsOccSubzone += state.dataHeatBalFanSys->SumConvPool(ZoneNum); // gains from lights (ceiling), tubular daylighting devices, high temp radiant heaters - ConvGainsUpSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); + Real64 ConvGainsUpSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); // convective heat gains into the upper subzone [W] ConvGainsUpSubzone += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum); if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { - RetAirGains = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); - ConvGainsUpSubzone += RetAirGains; + ConvGainsUpSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); } - ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; - ZoneEquipConfigNum = zoneUE.ZoneEquipPtr; + Real64 ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; // total zone convective gains (excluding surfaces) [W] + int ZoneEquipConfigNum = zoneU.ZoneEquipPtr; if (ZoneEquipConfigNum > 0) { - for (InNodeIndex = 1; InNodeIndex <= state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { - NodeTemp = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; - MassFlowRate = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).MassFlowRate; - CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); + auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum); + for (int InNodeIndex = 1; InNodeIndex <= zoneEquipConfig.NumInletNodes; ++InNodeIndex) { + Real64 NodeTemp = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).Temp; + Real64 MassFlowRate = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).MassFlowRate; + Real64 CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, NodeTemp, thisZoneHB.ZoneAirHumRat); @@ -1395,44 +1269,41 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t TSupK = 0.0; } } - // mass flow times specific heat for infiltration, ventilation, mixing - SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MDotCPOA; - // mass flow times specific heat times temperature for infiltration, ventilation, mixing - SumMCpT = thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MDotCPOA * state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp; - MCp_Total = SumMCp + SumSysMCp; - MCpT_Total = SumMCpT + SumSysMCpT; + // mass flow rate * specific heat for this zone for infiltration, ventilation, mixing [W/K] + Real64 SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MDotCPOA; + // mass flow rate * specific heat* temp for this zone for infiltration, ventilation, mixing [W] + Real64 SumMCpT = thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MDotCPOA * state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp; + + Real64 MCp_Total = SumMCp + SumSysMCp; // total mass flow rate * specific heat for this zone [W/K] + Real64 MCpT_Total = SumMCpT + SumSysMCpT; // total mass flow rate * specific heat* temp for this zone [W] // For the York MIT diffusers (variable area) the area varies with the flow rate. Assume 400 ft/min velocity // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by // (TotSysFlow/(NumDiffusers*.0708))*.035 - if (zoneUE.DiffuserType == Diffuser::VarArea) { + if (zoneU.DiffuserType == Diffuser::VarArea) { DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); } // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. UFADConvCoef ufadCC; HcUFAD(state, ZoneNum, 0.5, ufadCC); - ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - + Real64 ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - // ZoneEquipConfig index for this UFAD zone ufadCC.HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - ufadCC.HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); // NumberOfPlumes = PowerInPlumes / PowerPerPlume - if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { - NumberOfPlumes = PowerInPlumes / PowerPerPlume; - NumDiffusersPerPlume = NumDiffusers / NumberOfPlumes; - } else { - NumberOfPlumes = 1.0; - NumDiffusersPerPlume = 1.0; - } + Real64 NumberOfPlumes = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (PowerInPlumes / PowerPerPlume) : 1.0; + Real64 NumDiffusersPerPlume = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (NumDiffusers / NumberOfPlumes) : 1.0; + if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::KelvinConv) > thisZoneHB.MAT) { // The system will mix HeightFrac = 0.0; } else { if (PowerInPlumes > 0.0) { - if (zoneUE.WinWidth > 0.0) { // exterior zone formula - PowerInPlumesPerMeter = PowerInPlumes / zoneUE.WinWidth; + if (zoneU.WinWidth > 0.0) { // exterior zone formula + PowerInPlumesPerMeter = PowerInPlumes / zoneU.WinWidth; Gamma = (TotSysFlow * std::cos(ThrowAngle)) / (NumDiffusers * DiffArea * std::pow(0.0281 * 0.001 * PowerInPlumesPerMeter, 0.333333)); } else { // interior zone formula Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / @@ -1441,26 +1312,24 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t } else { Gamma = 1000.0; } - if (zoneUE.CalcTransHeight) { - if (zoneUE.WinWidth > 0.0) { // use exterior zone formula + if (zoneU.CalcTransHeight) { + if (zoneU.WinWidth > 0.0) { // use exterior zone formula HeightFrac = (std::sqrt(DiffArea) * (11.03 * std::log(Gamma) - 10.73) + 0.5 * SourceHeight) / CeilingHeight; } else { // use interior zone formula HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } } else { - HeightFrac = zoneUE.TransHeight / CeilingHeight; + HeightFrac = zoneU.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); - GainsFrac = zoneUE.A_Kc * std::pow(Gamma, zoneUE.B_Kc) + - zoneUE.C_Kc + zoneUE.D_Kc * Gamma + - zoneUE.E_Kc * pow_2(Gamma); + Real64 GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + zoneU.C_Kc + zoneU.D_Kc * Gamma + zoneU.E_Kc * pow_2(Gamma); GainsFrac = max(0.7, min(GainsFrac, 1.0)); - if (zoneUE.ShadeDown) { + if (zoneU.ShadeDown) { GainsFrac -= 0.2; } state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; - for (Ctd = 1; Ctd <= 4; ++Ctd) { - HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + for (int Ctd = 1; Ctd <= 4; ++Ctd) { + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - ufadCC.HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - ufadCC.HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); ConvGainsWindows = max(ConvGainsWindows, 0.0); @@ -1469,29 +1338,27 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t // NumberOfPlumes = PowerInPlumes / PowerPerPlume NumberOfPlumes = 1.0; if (PowerInPlumes <= 0.0) break; - if (zoneUE.WinWidth > 0.0) { // use exterior zone formula - PowerInPlumesPerMeter = PowerInPlumes / zoneUE.WinWidth; + if (zoneU.WinWidth > 0.0) { // use exterior zone formula + PowerInPlumesPerMeter = PowerInPlumes / zoneU.WinWidth; Gamma = (TotSysFlow * std::cos(ThrowAngle)) / (NumDiffusers * DiffArea * std::pow(0.0281 * 0.001 * PowerInPlumesPerMeter, 0.333333)); } else { // use interior zone formula Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); } - if (zoneUE.CalcTransHeight) { - if (zoneUE.WinWidth > 0.0) { // exterior zone formula + if (zoneU.CalcTransHeight) { + if (zoneU.WinWidth > 0.0) { // exterior zone formula HeightFrac = (std::sqrt(DiffArea) * (11.03 * std::log(Gamma) - 10.73) + 0.5 * SourceHeight) / CeilingHeight; } else { // interior zone formula HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } } else { - HeightFrac = zoneUE.TransHeight / CeilingHeight; + HeightFrac = zoneU.TransHeight / CeilingHeight; } HeightFrac = min(1.0, HeightFrac); state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - GainsFrac = zoneUE.A_Kc * std::pow(Gamma, zoneUE.B_Kc) + - zoneUE.C_Kc + zoneUE.D_Kc * Gamma + - zoneUE.E_Kc * pow_2(Gamma); + Real64 GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + zoneU.C_Kc + zoneU.D_Kc * Gamma + zoneU.E_Kc * pow_2(Gamma); GainsFrac = max(0.7, min(GainsFrac, 1.0)); - if (zoneUE.ShadeDown) { + if (zoneU.ShadeDown) { GainsFrac -= 0.2; } state.dataRoomAir->AIRRATOC(ZoneNum) = @@ -1525,11 +1392,11 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; } - AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + + Real64 AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); + Real64 TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); - TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; - TempIndCoef = GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - + Real64 TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; + Real64 TempIndCoef = GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { @@ -1610,11 +1477,11 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; Real64 AirCap = thisZoneHB.AirPowerCap; - TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); + Real64 TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); - for (Ctd = 1; Ctd <= 3; ++Ctd) { - TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; - TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; + for (int Ctd = 1; Ctd <= 3; ++Ctd) { + Real64 TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; + Real64 TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; switch (state.dataHeatBal->ZoneAirSolutionAlgo) { case DataHeatBalance::SolutionAlgo::ThirdOrder: { ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / @@ -1666,8 +1533,8 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t // Comfort temperature and temperature at the thermostat/temperature control sensor - HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; - HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; + Real64 HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + Real64 HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; // Comfort temperature if (MIXFLAG) { @@ -1723,7 +1590,7 @@ void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for t } if (ZoneEquipConfigNum > 0) { - ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; + int ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); } From 7c1abac70ff5bc501f049e35c719ff8bdd4d2ab0 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 5 Jul 2023 14:03:24 -0500 Subject: [PATCH 16/17] Remove empty header file --- src/EnergyPlus/CMakeLists.txt | 1 - src/EnergyPlus/DataUCSDSharedData.hh | 0 2 files changed, 1 deletion(-) delete mode 100644 src/EnergyPlus/DataUCSDSharedData.hh diff --git a/src/EnergyPlus/CMakeLists.txt b/src/EnergyPlus/CMakeLists.txt index 922f2c1f915..ce2d6fadb56 100644 --- a/src/EnergyPlus/CMakeLists.txt +++ b/src/EnergyPlus/CMakeLists.txt @@ -215,7 +215,6 @@ set(SRC DataSystemVariables.cc DataSystemVariables.hh DataTimings.hh - DataUCSDSharedData.hh DataVectorTypes.hh DataViewFactorInformation.hh DataWater.hh diff --git a/src/EnergyPlus/DataUCSDSharedData.hh b/src/EnergyPlus/DataUCSDSharedData.hh deleted file mode 100644 index e69de29bb2d..00000000000 From c46b8847792ea8894e473f83301e8bcb2dea0c8a Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 5 Jul 2023 14:05:27 -0500 Subject: [PATCH 17/17] Clang format --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 35 +- src/EnergyPlus/BaseboardElectric.cc | 2 +- src/EnergyPlus/BaseboardRadiator.cc | 4 +- src/EnergyPlus/ChillerElectricEIR.cc | 3 +- src/EnergyPlus/ChillerIndirectAbsorption.cc | 3 +- src/EnergyPlus/ChillerReformulatedEIR.cc | 3 +- src/EnergyPlus/CondenserLoopTowers.cc | 3 +- src/EnergyPlus/ConvectionCoefficients.cc | 3 +- src/EnergyPlus/CrossVentMgr.cc | 46 +- src/EnergyPlus/DXCoils.cc | 22 +- src/EnergyPlus/DataHVACGlobals.cc | 160 +- src/EnergyPlus/DataRoomAirModel.hh | 438 +-- src/EnergyPlus/DataZoneEquipment.cc | 108 +- src/EnergyPlus/DataZoneEquipment.hh | 20 +- src/EnergyPlus/DemandManager.cc | 19 +- src/EnergyPlus/DisplacementVentMgr.cc | 1668 +++++------ src/EnergyPlus/EconomicLifeCycleCost.cc | 3 +- src/EnergyPlus/EconomicTariff.cc | 6 +- src/EnergyPlus/ElectricPowerServiceManager.cc | 6 +- src/EnergyPlus/EvaporativeFluidCoolers.cc | 3 +- src/EnergyPlus/FaultsManager.cc | 6 +- src/EnergyPlus/General.cc | 6 +- src/EnergyPlus/GroundHeatExchangers.cc | 10 +- src/EnergyPlus/HVACStandAloneERV.cc | 3 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 6 +- src/EnergyPlus/HeatBalanceAirManager.cc | 52 +- src/EnergyPlus/HeatBalanceManager.cc | 3 +- src/EnergyPlus/HeatRecovery.cc | 3 +- .../HybridUnitaryAirConditioners.cc | 2 +- src/EnergyPlus/InternalHeatGains.cc | 7 +- src/EnergyPlus/Material.cc | 15 +- src/EnergyPlus/MixedAir.cc | 3 +- src/EnergyPlus/MundtSimMgr.cc | 10 +- src/EnergyPlus/MundtSimMgr.hh | 12 +- src/EnergyPlus/OutdoorAirUnit.cc | 5 +- .../PhotovoltaicThermalCollectors.cc | 4 +- src/EnergyPlus/Plant/PlantManager.cc | 7 +- src/EnergyPlus/PlantChillers.cc | 12 +- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 3 +- src/EnergyPlus/PlantPipingSystemsManager.cc | 3 +- src/EnergyPlus/PluginManager.cc | 6 +- src/EnergyPlus/PoweredInductionUnits.cc | 3 +- src/EnergyPlus/Pumps.cc | 20 +- src/EnergyPlus/ReportCoilSelection.cc | 14 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 135 +- src/EnergyPlus/RoomAirModelAirflowNetwork.hh | 5 +- src/EnergyPlus/RoomAirModelManager.cc | 397 ++- src/EnergyPlus/RoomAirModelManager.hh | 10 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 58 +- src/EnergyPlus/RuntimeLanguageProcessor.cc | 3 +- src/EnergyPlus/SQLiteProcedures.hh | 5 +- src/EnergyPlus/SetPointManager.cc | 4 +- src/EnergyPlus/SizingManager.cc | 11 +- src/EnergyPlus/SteamBaseboardRadiator.cc | 3 +- src/EnergyPlus/SteamCoils.cc | 3 +- src/EnergyPlus/SurfaceGeometry.cc | 13 +- src/EnergyPlus/SystemAvailabilityManager.cc | 12 +- src/EnergyPlus/SystemReports.cc | 27 +- src/EnergyPlus/UFADManager.cc | 2650 ++++++++--------- src/EnergyPlus/UFADManager.hh | 24 +- src/EnergyPlus/UnitVentilator.cc | 3 +- src/EnergyPlus/UnitarySystem.cc | 34 +- src/EnergyPlus/UserDefinedComponents.cc | 4 +- src/EnergyPlus/UtilityRoutines.cc | 9 +- src/EnergyPlus/UtilityRoutines.hh | 7 +- src/EnergyPlus/VentilatedSlab.cc | 4 +- src/EnergyPlus/WaterThermalTanks.cc | 56 +- src/EnergyPlus/WaterToAirHeatPump.cc | 6 +- src/EnergyPlus/WaterUse.cc | 4 +- src/EnergyPlus/WindTurbine.cc | 8 +- src/EnergyPlus/ZoneEquipmentManager.cc | 50 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 67 +- 72 files changed, 3106 insertions(+), 3276 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index fdf2c13aa01..c383d81e934 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -1486,9 +1486,9 @@ namespace AirflowNetwork { Real64 D{fields.at("air_path_hydraulic_diameter")}; DisSysCompCoilData(i).name = UtilityRoutines::makeUPPER(coil_name); // Name of associated EPlus coil component - DisSysCompCoilData(i).EPlusType = coil_type; // coil type - DisSysCompCoilData(i).L = L; // Air path length - DisSysCompCoilData(i).hydraulicDiameter = D; // Air path hydraulic diameter + DisSysCompCoilData(i).EPlusType = coil_type; // coil type + DisSysCompCoilData(i).L = L; // Air path length + DisSysCompCoilData(i).hydraulicDiameter = D; // Air path hydraulic diameter // Add the element to the lookup table, check for name overlaps if (elements.find(DisSysCompCoilData(i).name) == elements.end()) { @@ -1526,9 +1526,9 @@ namespace AirflowNetwork { Real64 D{fields.at("air_path_hydraulic_diameter")}; DisSysCompHXData(i).name = UtilityRoutines::makeUPPER(hx_name); // Name of associated EPlus heat exchange component - DisSysCompHXData(i).EPlusType = hx_type; // coil type - DisSysCompHXData(i).L = L; // Air path length - DisSysCompHXData(i).hydraulicDiameter = D; // Air path hydraulic diameter + DisSysCompHXData(i).EPlusType = hx_type; // coil type + DisSysCompHXData(i).L = L; // Air path length + DisSysCompHXData(i).hydraulicDiameter = D; // Air path hydraulic diameter DisSysCompHXData(i).CoilParentExists = HVACHXAssistedCoolingCoil::VerifyHeatExchangerParent(m_state, hx_type, hx_name); // Add the element to the lookup table, check for name overlaps @@ -1566,9 +1566,9 @@ namespace AirflowNetwork { Real64 D{fields.at("air_path_hydraulic_diameter")}; DisSysCompTermUnitData(i).name = UtilityRoutines::makeUPPER(tu_name); // Name of associated EPlus coil component - DisSysCompTermUnitData(i).EPlusType = tu_type; // Terminal unit type - DisSysCompTermUnitData(i).L = L; // Air path length - DisSysCompTermUnitData(i).hydraulicDiameter = D; // Air path hydraulic diameter + DisSysCompTermUnitData(i).EPlusType = tu_type; // Terminal unit type + DisSysCompTermUnitData(i).L = L; // Air path length + DisSysCompTermUnitData(i).hydraulicDiameter = D; // Air path hydraulic diameter // Add the element to the lookup table, check for name overlaps if (elements.find(DisSysCompTermUnitData(i).name) == elements.end()) { @@ -5469,9 +5469,7 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0) { ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum) - .Node(AirflowNetworkNodeData(i).RAFNNodeNum) - .AFNNodeID == i) { + if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) { AirflowNetworkNodeSimu(i).TZ = m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp; AirflowNetworkNodeSimu(i).WZ = @@ -7736,8 +7734,7 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) { MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10; ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == - i) { + if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) { MV(i) = m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AirTemp * 1.0e10; } } @@ -8030,8 +8027,7 @@ namespace AirflowNetwork { if (AirflowNetworkNodeData(i).RAFNNodeNum > 0 && MA((i - 1) * AirflowNetworkNumOfNodes + i) < 0.9e10) { MA((i - 1) * AirflowNetworkNumOfNodes + i) = 1.0e10; ZoneNum = AirflowNetworkNodeData(i).EPlusZoneNum; - if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == - i) { + if (m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).AFNNodeID == i) { MV(i) = m_state.dataRoomAir->AFNZoneInfo(ZoneNum).Node(AirflowNetworkNodeData(i).RAFNNodeNum).HumRat * 1.0e10; } } @@ -11789,10 +11785,9 @@ namespace AirflowNetwork { return AirLoopNum; } if (m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).NumSubComps == 0) { - DataLoopNode::ConnectionObjectType TypeOfComp = - static_cast(EnergyPlus::getEnumValue( - BranchNodeConnections::ConnectionObjectTypeNamesUC, - m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).TypeOf)); + DataLoopNode::ConnectionObjectType TypeOfComp = static_cast(EnergyPlus::getEnumValue( + BranchNodeConnections::ConnectionObjectTypeNamesUC, + m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).TypeOf)); std::string const &NameOfComp = m_state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(NumOfComp).Name; if (IsParentObject(m_state, TypeOfComp, NameOfComp)) { diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index 39f287cece9..af04ae276e2 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -215,7 +215,7 @@ namespace BaseboardElectric { ++BaseboardNum; auto &thisBaseboard = baseboard->baseboards(BaseboardNum); - thisBaseboard.EquipName = state.dataIPShortCut->cAlphaArgs(1); // name of this baseboard + thisBaseboard.EquipName = state.dataIPShortCut->cAlphaArgs(1); // name of this baseboard thisBaseboard.EquipType = UtilityRoutines::makeUPPER(cCurrentModuleObject); // the type of baseboard-rename change thisBaseboard.Schedule = state.dataIPShortCut->cAlphaArgs(2); if (state.dataIPShortCut->lAlphaFieldBlanks(2)) { diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index 0f766206ff8..1590070af5f 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -416,8 +416,8 @@ namespace BaseboardRadiator { thisBaseboard.Offset = 0.001; } - thisBaseboard.ZonePtr = - DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater, thisBaseboard.EquipID); + thisBaseboard.ZonePtr = DataZoneEquipment::GetZoneEquipControlledZoneNum( + state, DataZoneEquipment::ZoneEquipType::BaseboardConvectiveWater, thisBaseboard.EquipID); } if (ErrorsFound) { diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index f5a27acea9f..8184169039f 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -444,8 +444,7 @@ void GetElectricEIRChillerInput(EnergyPlusData &state) "Condenser (unknown?) Nodes"); } - thisChiller.FlowMode = - static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index 2d4897cf871..88c6d514a97 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -441,8 +441,7 @@ void GetIndirectAbsorberInput(EnergyPlusData &state) } { - thisChiller.FlowMode = - static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(6))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(6))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 809c1d8edeb..f609f5540a6 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -399,8 +399,7 @@ void GetElecReformEIRChillerInput(EnergyPlusData &state) "Condenser Water Nodes"); { - thisChiller.FlowMode = - static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 2b7d48898b2..dd0901368bc 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -457,8 +457,7 @@ namespace CondenserLoopTowers { if (state.dataIPShortCut->lAlphaFieldBlanks(11) || AlphArray(11).empty()) { tower.CapacityControl = CapacityCtrl::FanCycling; // FanCycling } else { - tower.CapacityControl = - static_cast(getEnumValue(CapacityCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(11)))); + tower.CapacityControl = static_cast(getEnumValue(CapacityCtrlNamesUC, UtilityRoutines::makeUPPER(AlphArray(11)))); if (tower.CapacityControl == CapacityCtrl::Invalid) { tower.CapacityControl = CapacityCtrl::FanCycling; ShowWarningError(state, diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 5539808b791..21d74f047aa 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -855,8 +855,7 @@ void GetUserConvCoeffs(EnergyPlusData &state) extConvUserCurve.Name = ipsc->cAlphaArgs(1); ErrorObjectHeader eoh{RoutineName, CurrentModuleObject, extConvUserCurve.Name}; - extConvUserCurve.windSpeedType = - static_cast(getEnumValue(RefWindNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); + extConvUserCurve.windSpeedType = static_cast(getEnumValue(RefWindNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(2)))); if (extConvUserCurve.windSpeedType == RefWind::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 86654982494..7843cc084d2 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -97,7 +97,7 @@ namespace RoomAir { Real64 constexpr CrecFlow2(0.466); // Second correlation constant for the recirculation flow rate void ManageCrossVent(EnergyPlusData &state, - int const ZoneNum) // index number for the specified zone + int const ZoneNum) // index number for the specified zone { // SUBROUTINE INFORMATION: @@ -167,7 +167,7 @@ namespace RoomAir { if (state.dataRoomAir->IsZoneCrossVent(ZoneNum)) { Real64 zoneJetRecAreaRatio = state.dataRoomAir->JetRecAreaRatio(ZoneNum); - + // WALL Hc, HA and HAT calculation for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { int SurfNum = state.dataRoomAir->APos_Wall(Ctd); @@ -180,8 +180,7 @@ namespace RoomAir { CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum); - state.dataCrossVentMgr->HAT_R += - surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HWall(Ctd); } // END WALL // WINDOW Hc, HA and HAT CALCULATION @@ -197,8 +196,7 @@ namespace RoomAir { CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum); - state.dataCrossVentMgr->HAT_R += - surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HWindow(Ctd); } if (surf.Tilt <= 10.0) { // Window Ceiling @@ -215,8 +213,8 @@ namespace RoomAir { state.dataCrossVentMgr->HA_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + - (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = + zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); } if (surf.Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum); @@ -233,8 +231,7 @@ namespace RoomAir { state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = - zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + - (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); + zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); } state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); } // END WINDOW @@ -286,14 +283,14 @@ namespace RoomAir { CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec); Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum); - + state.dataRoomAir->HCeiling(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_R += surf.Area * (1 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec; state.dataCrossVentMgr->HA_R += surf.Area * (1 - zoneJetRecAreaRatio) * Hrec; state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + - (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = + zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); } // END CEILING // FLOOR Hc, HA and HAT CALCULATION @@ -318,8 +315,7 @@ namespace RoomAir { state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = - zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + - (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); + zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum); state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); } // END FLOOR } @@ -361,7 +357,7 @@ namespace RoomAir { auto const &thisSurface = state.dataSurface->Surface(surfNum); int afnSurfNum1 = state.dataRoomAir->AFNSurfaceCrossVent(1, ZoneNum); - + if (thisSurface.Zone == ZoneNum) { // this is a direct airflow network aperture SumToZone = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW2; @@ -451,7 +447,7 @@ namespace RoomAir { // Dstar is Droom corrected for wind angle Vector3 baseCentroid; - + Wroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataHeatBal->Zone(ZoneNum).FloorArea; auto const &baseSurface = state.dataSurface->Surface(thisSurface.BaseSurf); if ((baseSurface.Sides == 3) || (baseSurface.Sides == 4)) { @@ -462,7 +458,7 @@ namespace RoomAir { assert(NSides > 0); baseCentroid = {0.0, 0.0, 0.0}; for (int i = 1; i <= NSides; ++i) { - baseCentroid += baseSurface.Vertex(i); + baseCentroid += baseSurface.Vertex(i); } baseCentroid /= double(NSides); } @@ -482,9 +478,8 @@ namespace RoomAir { } wallCentroid /= double(NSides); } - double DroomTemp = std::sqrt(pow_2(baseCentroid.x - wallCentroid.x) + - pow_2(baseCentroid.y - wallCentroid.y) + - pow_2(baseCentroid.z - wallCentroid.z)); + double DroomTemp = + std::sqrt(pow_2(baseCentroid.x - wallCentroid.x) + pow_2(baseCentroid.y - wallCentroid.y) + pow_2(baseCentroid.z - wallCentroid.z)); if (DroomTemp > state.dataRoomAir->Droom(ZoneNum)) { state.dataRoomAir->Droom(ZoneNum) = DroomTemp; } @@ -623,8 +618,7 @@ namespace RoomAir { } for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) { auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum); - if (jetRecFlows.Uin == 0) - continue; + if (jetRecFlows.Uin == 0) continue; Real64 dstarexp = max(state.dataRoomAir->Dstar(ZoneNum) / (6.0 * std::sqrt(jetRecFlows.Area)), 1.0); jetRecFlows.Vjet = jetRecFlows.Uin * std::sqrt(jetRecFlows.Area) * 6.3 * std::log(dstarexp) / state.dataRoomAir->Dstar(ZoneNum); @@ -780,9 +774,9 @@ namespace RoomAir { (CrecTemp * state.dataCrossVentMgr->HA_R + MCp_Total); } state.dataRoomAir->ZTJET(ZoneNum) = (ConvGainsJet * CjetTemp + ConvGainsRec * CjetTemp + CjetTemp * state.dataCrossVentMgr->HAT_J + - CjetTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total - - CjetTemp * state.dataCrossVentMgr->HA_R * state.dataRoomAir->ZTREC(ZoneNum)) / - (CjetTemp * state.dataCrossVentMgr->HA_J + MCp_Total); + CjetTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total - + CjetTemp * state.dataCrossVentMgr->HA_R * state.dataRoomAir->ZTREC(ZoneNum)) / + (CjetTemp * state.dataCrossVentMgr->HA_J + MCp_Total); state.dataRoomAir->RoomOutflowTemp(ZoneNum) = (ConvGainsJet + ConvGainsRec + state.dataCrossVentMgr->HAT_J + state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total - state.dataCrossVentMgr->HA_J * state.dataRoomAir->ZTJET(ZoneNum) - diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 8c61328bad1..130eb4964ec 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -1727,17 +1727,17 @@ void GetDXCoils(EnergyPlusData &state) if (lAlphaBlanks2(7)) { thisDXCoil.CondenserInletNodeNum(PerfModeNum) = 0; } else { - thisDXCoil.CondenserInletNodeNum(PerfModeNum) = GetOnlySingleNode( - state, - Alphas2(7), - ErrorsFound, - (DataLoopNode::ConnectionObjectType)getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, - UtilityRoutines::makeUPPER(PerfObjectType)), - PerfObjectName, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::OutsideAirReference, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + thisDXCoil.CondenserInletNodeNum(PerfModeNum) = + GetOnlySingleNode(state, + Alphas2(7), + ErrorsFound, + (DataLoopNode::ConnectionObjectType)getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, + UtilityRoutines::makeUPPER(PerfObjectType)), + PerfObjectName, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::OutsideAirReference, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); if (!CheckOutAirNodeNumber(state, thisDXCoil.CondenserInletNodeNum(PerfModeNum))) { ShowWarningError(state, format("{}{}=\"{}\":", RoutineName, PerfObjectType, PerfObjectName)); ShowContinueError(state, format("may not be valid {}=\"{}\".", cAlphaFields2(7), Alphas2(7))); diff --git a/src/EnergyPlus/DataHVACGlobals.cc b/src/EnergyPlus/DataHVACGlobals.cc index caf614d0f96..08fd51ad6e2 100644 --- a/src/EnergyPlus/DataHVACGlobals.cc +++ b/src/EnergyPlus/DataHVACGlobals.cc @@ -200,88 +200,86 @@ namespace DataHVACGlobals { Array1D_string const cVRFHeatingPerformanceOATTypes(NumVRFHeatingPerformanceOATTypes, {"WetBulbTemperature", "DryBulbTemperature"}); #ifdef GET_OUT - constexpr std::array zoneEquipTypeNamesUC = { - "DUMMY", - "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", - "ZONEHVAC:ENERGYRECOVERYVENTILATOR", - "ZONEHVAC:FOURPIPEFANCOIL", - "ZONEHVAC:OUTDOORAIRUNIT", - "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER", - "ZONEHVAC:PACKAGEDTERMINALHEATPUMP", - "ZONEHVAC:UNITHEATER", - "ZONEHVAC:UNITVENTILATOR", - "ZONEHVAC:VENTILATEDSLAB", - "ZONEHVAC:WATERTOAIRHEATPUMP", - "ZONEHVAC:WINDOWAIRCONDITIONER", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:ELECTRIC", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", - "ZONEHVAC:BASEBOARD:CONVECTIVE:ELECTRIC", - "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", - "ZONEHVAC:HIGHTEMPERATURERADIANT", - "ZONEHVAC:DEHUMIDIFIER:DX", - "ZONEHVAC:IDEALLOADSAIRSYSTEM", - "ZONEHVAC:REFRIGERATIONCHILLERSET", - "ZONEHVAC:HYBRIDUNITARYHVAC", - "FAN:ZONEEXHAUST", - "WATERHEATER:HEATPUMP", - "AIRTERMINAL:DUALDUCT:CONSTANTVOLUME", - "AIRTERMINAL:DUALDUCT:VAV", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:REHEAT", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:NOREHEAT", - "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT", - "AIRTERMINAL:SINGLEDUCT:VAV:NOREHEAT", - "AIRTERMINAL:SINGLEDUCT:SERIESPIU:REHEAT", - "AIRTERMINAL:SINGLEDUCT:PARALLELPIU:REHEAT", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEINDUCTION", - "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT:VARIABLESPEEDFAN", - "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT", - "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:NOREHEAT", - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", - "AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR", - "AIRLOOPHVACRETURNAIR"}; + constexpr std::array zoneEquipTypeNamesUC = {"DUMMY", + "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", + "ZONEHVAC:ENERGYRECOVERYVENTILATOR", + "ZONEHVAC:FOURPIPEFANCOIL", + "ZONEHVAC:OUTDOORAIRUNIT", + "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER", + "ZONEHVAC:PACKAGEDTERMINALHEATPUMP", + "ZONEHVAC:UNITHEATER", + "ZONEHVAC:UNITVENTILATOR", + "ZONEHVAC:VENTILATEDSLAB", + "ZONEHVAC:WATERTOAIRHEATPUMP", + "ZONEHVAC:WINDOWAIRCONDITIONER", + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:ELECTRIC", + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", + "ZONEHVAC:BASEBOARD:CONVECTIVE:ELECTRIC", + "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", + "ZONEHVAC:HIGHTEMPERATURERADIANT", + "ZONEHVAC:DEHUMIDIFIER:DX", + "ZONEHVAC:IDEALLOADSAIRSYSTEM", + "ZONEHVAC:REFRIGERATIONCHILLERSET", + "ZONEHVAC:HYBRIDUNITARYHVAC", + "FAN:ZONEEXHAUST", + "WATERHEATER:HEATPUMP", + "AIRTERMINAL:DUALDUCT:CONSTANTVOLUME", + "AIRTERMINAL:DUALDUCT:VAV", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:REHEAT", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:NOREHEAT", + "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT", + "AIRTERMINAL:SINGLEDUCT:VAV:NOREHEAT", + "AIRTERMINAL:SINGLEDUCT:SERIESPIU:REHEAT", + "AIRTERMINAL:SINGLEDUCT:PARALLELPIU:REHEAT", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEINDUCTION", + "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT:VARIABLESPEEDFAN", + "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT", + "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:NOREHEAT", + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", + "AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR", + "AIRLOOPHVACRETURNAIR"}; - constexpr std::array zoneEquipTypeNames = { - "DUMMY", - "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow", - "ZoneHVAC:EnergyRecoveryVentilator", - "ZoneHVAC:FourPipeFanCoil", - "ZoneHVAC:OutdoorAirUnit", - "ZoneHVAC:PackagedTerminalAirConditioner", - "ZoneHVAC:PackagedTerminalHeatPump", - "ZoneHVAC:UnitHeater", - "ZoneHVAC:UnitVentilator", - "ZoneHVAC:VentilatedSlab", - "ZoneHVAC:WaterToAirHeatPump", - "ZoneHVAC:WindowAirConditioner", - "ZoneHVAC:Baseboard:RadiantConvective:Electric", - "ZoneHVAC:Baseboard:RadiantConvective:Water", - "ZoneHVAC:Baseboard:RadiantConvective:Steam", - "ZoneHVAC:Baseboard:Convective:Electric", - "ZoneHVAC:Baseboard:Convective:Water", - "ZoneHVAC:HighTemperatureRadiant", - "ZoneHVAC:Dehumidifier:DX", - "ZoneHVAC:IdealLoadsAirSystem", - "ZoneHVAC:RefrigerationChillerSet", - "ZoneHVAC:HybridUnitaryHVAC", - "Fan:ZoneExhaust", - "WaterHeater:HeatPump", - "AirTerminal:DualDuct:ConstantVolume", - "AirTerminal:DualDuct:VAV", - "AirTerminal:SingleDuct:ConstantVolume:Reheat", - "AirTerminal:SingleDuct:ConstantVolume:NoReheat", - "AirTerminal:SingleDuct:VAV:Reheat", - "AirTerminal:SingleDuct:VAV:NoReheat", - "AirTerminal:SingleDuct:SeriesPIU:Reheat", - "AirTerminal:SingleDuct:ParallelPIU:Reheat", - "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction", - "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", - "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", - "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat", - "AirTerminal:SingleDuct:ConstantVolume:CooledBeam", - "AirTerminal:DualDuct:VAV:OutdoorAir", - "AirLoopHVACReturnAir"}; -#endif // + constexpr std::array zoneEquipTypeNames = {"DUMMY", + "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow", + "ZoneHVAC:EnergyRecoveryVentilator", + "ZoneHVAC:FourPipeFanCoil", + "ZoneHVAC:OutdoorAirUnit", + "ZoneHVAC:PackagedTerminalAirConditioner", + "ZoneHVAC:PackagedTerminalHeatPump", + "ZoneHVAC:UnitHeater", + "ZoneHVAC:UnitVentilator", + "ZoneHVAC:VentilatedSlab", + "ZoneHVAC:WaterToAirHeatPump", + "ZoneHVAC:WindowAirConditioner", + "ZoneHVAC:Baseboard:RadiantConvective:Electric", + "ZoneHVAC:Baseboard:RadiantConvective:Water", + "ZoneHVAC:Baseboard:RadiantConvective:Steam", + "ZoneHVAC:Baseboard:Convective:Electric", + "ZoneHVAC:Baseboard:Convective:Water", + "ZoneHVAC:HighTemperatureRadiant", + "ZoneHVAC:Dehumidifier:DX", + "ZoneHVAC:IdealLoadsAirSystem", + "ZoneHVAC:RefrigerationChillerSet", + "ZoneHVAC:HybridUnitaryHVAC", + "Fan:ZoneExhaust", + "WaterHeater:HeatPump", + "AirTerminal:DualDuct:ConstantVolume", + "AirTerminal:DualDuct:VAV", + "AirTerminal:SingleDuct:ConstantVolume:Reheat", + "AirTerminal:SingleDuct:ConstantVolume:NoReheat", + "AirTerminal:SingleDuct:VAV:Reheat", + "AirTerminal:SingleDuct:VAV:NoReheat", + "AirTerminal:SingleDuct:SeriesPIU:Reheat", + "AirTerminal:SingleDuct:ParallelPIU:Reheat", + "AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction", + "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", + "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", + "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat", + "AirTerminal:SingleDuct:ConstantVolume:CooledBeam", + "AirTerminal:DualDuct:VAV:OutdoorAir", + "AirLoopHVACReturnAir"}; +#endif // } // namespace DataHVACGlobals } // namespace EnergyPlus diff --git a/src/EnergyPlus/DataRoomAirModel.hh b/src/EnergyPlus/DataRoomAirModel.hh index 25e930f6f4b..11a9291bc77 100644 --- a/src/EnergyPlus/DataRoomAirModel.hh +++ b/src/EnergyPlus/DataRoomAirModel.hh @@ -75,9 +75,9 @@ namespace RoomAir { Invalid = -1, UserDefined, // user defined patterns Mixing, // mixing air model - DispVent1Node, // Mundt nodal model - DispVent3Node, // UCSD Displacement Ventilation model - CrossVent, // UCSD-CV + DispVent1Node, // Mundt nodal model + DispVent3Node, // UCSD Displacement Ventilation model + CrossVent, // UCSD-CV UFADInt, // UCSD UFAD interior zone model UFADExt, // UCSD UFAD exterior zone model AirflowNetwork, // RoomAirModel_AirflowNetwork interior zone model @@ -85,7 +85,7 @@ namespace RoomAir { }; extern const std::array roomAirModelNames; - extern const std::array roomAirModelNamesUC; + extern const std::array roomAirModelNamesUC; // Parameters to indicate air temperature coupling scheme enum class CouplingScheme @@ -100,20 +100,20 @@ namespace RoomAir { enum class AirNodeType { Invalid = -1, - Inlet, // air node at inlet (for Mundt and Rees&Haves Models) - Floor, // air node at floor (for Mundt and Rees&Haves Models) - Control, // air node at control point (for Mundt Model) - Ceiling, // air node at ceiling (for Mundt Model) - Mundt, // air node for vertical walls (for Mundt Model) - Return, // air node for return (for Mundt and Rees&Haves Models) - AFN, // air node for airflow network based room air model - Plume, // air node for plume load (for Rees&Haves Model) - Rees, // air node for vertical walls (for Rees&Haves Model) + Inlet, // air node at inlet (for Mundt and Rees&Haves Models) + Floor, // air node at floor (for Mundt and Rees&Haves Models) + Control, // air node at control point (for Mundt Model) + Ceiling, // air node at ceiling (for Mundt Model) + Mundt, // air node for vertical walls (for Mundt Model) + Return, // air node for return (for Mundt and Rees&Haves Models) + AFN, // air node for airflow network based room air model + Plume, // air node for plume load (for Rees&Haves Model) + Rees, // air node for vertical walls (for Rees&Haves Model) Num }; extern const std::array airNodeTypeNamesUC; - + // user-defined pattern two gradient interpolation modes enum class UserDefinedPatternMode { @@ -164,15 +164,15 @@ namespace RoomAir { }; extern const std::array comfortNamesUC; - + struct AirModelData { // Members std::string Name = ""; std::string ZoneName = ""; - int ZonePtr = 0; // Pointer to the zone number for this statement - RoomAirModel AirModel = RoomAirModel::Mixing; - CouplingScheme TempCoupleScheme = CouplingScheme::Direct; + int ZonePtr = 0; // Pointer to the zone number for this statement + RoomAirModel AirModel = RoomAirModel::Mixing; + CouplingScheme TempCoupleScheme = CouplingScheme::Direct; bool SimAirModel = false; // FALSE if Mixing air model is currently used and // TRUE if other air models are currently used }; @@ -182,42 +182,42 @@ namespace RoomAir { // Members std::string Name = ""; // name std::string ZoneName = ""; - int ZonePtr = 0; // Pointer to the zone number for this statement - AirNodeType ClassType = AirNodeType::Invalid; // depending on type of model - Real64 Height = 0.0; // height - Real64 ZoneVolumeFraction = 0.0; // portion of zone air volume associated with this node - Array1D_bool SurfMask; // limit of 60 surfaces at current sizing - bool IsZone = false; // TRUE if this node is zone node + int ZonePtr = 0; // Pointer to the zone number for this statement + AirNodeType ClassType = AirNodeType::Invalid; // depending on type of model + Real64 Height = 0.0; // height + Real64 ZoneVolumeFraction = 0.0; // portion of zone air volume associated with this node + Array1D_bool SurfMask; // limit of 60 surfaces at current sizing + bool IsZone = false; // TRUE if this node is zone node }; struct DispVentData { // Members std::string ZoneName = ""; // Name of zone - int ZonePtr = 0; // Pointer to the zone number for this statement + int ZonePtr = 0; // Pointer to the zone number for this statement int SchedGainsPtr = -1; // Schedule for internal gain fraction to occupied zone std::string SchedGainsName = ""; // Gains Schedule name - Real64 NumPlumesPerOcc = 0.0; // Effective number of plumes per occupant - Real64 ThermostatHeight = 0.0; // Height of thermostat/ temperature control sensor - Real64 ComfortHeight = 0.0; // Height at which air temperature is measured for comfort purposes - Real64 TempTrigger = 0.0; // Minimum temperature difference between TOC TMX for stratification + Real64 NumPlumesPerOcc = 0.0; // Effective number of plumes per occupant + Real64 ThermostatHeight = 0.0; // Height of thermostat/ temperature control sensor + Real64 ComfortHeight = 0.0; // Height at which air temperature is measured for comfort purposes + Real64 TempTrigger = 0.0; // Minimum temperature difference between TOC TMX for stratification }; struct CrossVentData { // Members - std::string ZoneName = ""; // Name of zone - int ZonePtr = 0; // Pointer to the zone number for this statement - int SchedGainsPtr = 0; // Schedule for internal gain fraction to occupied zone - std::string SchedGainsName = ""; // Gains Schedule name - Comfort VforComfort = Comfort::Invalid; // Use Recirculation or Jet velocity and temperatures + std::string ZoneName = ""; // Name of zone + int ZonePtr = 0; // Pointer to the zone number for this statement + int SchedGainsPtr = 0; // Schedule for internal gain fraction to occupied zone + std::string SchedGainsName = ""; // Gains Schedule name + Comfort VforComfort = Comfort::Invalid; // Use Recirculation or Jet velocity and temperatures // for comfort models }; struct CrossVentFlow { // Members - int FlowFlag = 0; // Equal to 1 if the opening has inflow, else equal to 0. + int FlowFlag = 0; // Equal to 1 if the opening has inflow, else equal to 0. Real64 Width = 0.0; // Width of the opening [m] Real64 Area = 0.0; // Area of the opening [m2] Real64 Fin = 0.0; // Inflow volume flux through the opening [m3/s] @@ -244,9 +244,9 @@ namespace RoomAir { struct UFADData { // Members - std::string ZoneName = ""; // Name of zone - int ZonePtr = 0; // Pointer to the zone number for this statement - int ZoneEquipPtr = 0; // Pointer to zone equip for this UFAD zone + std::string ZoneName = ""; // Name of zone + int ZonePtr = 0; // Pointer to the zone number for this statement + int ZoneEquipPtr = 0; // Pointer to zone equip for this UFAD zone Real64 DiffusersPerZone = 0.0; // Number of diffusers in this zone Real64 PowerPerPlume = 0.0; // Power in each plume [W] Real64 DiffArea = 0.0; // Effective area of a diffuser [m2] @@ -258,16 +258,16 @@ namespace RoomAir { Real64 TempTrigger = 0.0; // Minimum temperature difference between TOC TMX // for stratification [deltaC] Diffuser DiffuserType = Diffuser::Invalid; // 1=Swirl, 2=variable area, 3=displacement, 4=linear bar grille, 5=custom - Real64 TransHeight = 0.0; // user specified transition height [m] - bool CalcTransHeight = false; // flag to calc trans height or use user specified input - Real64 A_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 B_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 C_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 D_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 E_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 - Real64 WinWidth = 0.0; // sum of widths of exterior windows in zone - Real64 NumExtWin = 0.0; // number of exterior windows in the zone - bool ShadeDown = false; // signals shade up or down + Real64 TransHeight = 0.0; // user specified transition height [m] + bool CalcTransHeight = false; // flag to calc trans height or use user specified input + Real64 A_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 B_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 C_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 D_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 E_Kc = 0.0; // Coefficient A in Formula Kc = A*Gamma**B + C + D*Gamma + E*Gamma**2 + Real64 WinWidth = 0.0; // sum of widths of exterior windows in zone + Real64 NumExtWin = 0.0; // number of exterior windows in the zone + bool ShadeDown = false; // signals shade up or down }; struct SurfMapPattern // nested structure in RoomAirPattern @@ -276,7 +276,7 @@ namespace RoomAir { // user variables Array1D_string SurfName; // user defined name Array1D DeltaTai; // (Tai - MAT ) offset from mean air temp - int NumSurfs = 0; // number of surfaces in this pattern + int NumSurfs = 0; // number of surfaces in this pattern // calculated and from elsewhere Array1D_int SurfID; // index in HB surface structure array }; @@ -286,24 +286,24 @@ namespace RoomAir { // Members // user variables std::string Name = ""; // name - Real64 Gradient = 0.0; // value of vertical gradient [C/m] + Real64 Gradient = 0.0; // value of vertical gradient [C/m] }; struct TwoVertGradInterpolPattern // nested structure in RoomAirPattern { // Members // user variables - std::string Name = ""; // name - Real64 TstatHeight = 0.0; // Height of thermostat/ temperature control sensor - Real64 TleavingHeight = 0.0; // height of return air node where leaving zone - Real64 TexhaustHeight = 0.0; // height of exhaust air node where leaving zone - Real64 LowGradient = 0.0; // lower value of vertical gradient [C/m] - Real64 HiGradient = 0.0; // upper value of vertical gradient [C/m] + std::string Name = ""; // name + Real64 TstatHeight = 0.0; // Height of thermostat/ temperature control sensor + Real64 TleavingHeight = 0.0; // height of return air node where leaving zone + Real64 TexhaustHeight = 0.0; // height of exhaust air node where leaving zone + Real64 LowGradient = 0.0; // lower value of vertical gradient [C/m] + Real64 HiGradient = 0.0; // upper value of vertical gradient [C/m] UserDefinedPatternMode InterpolationMode = UserDefinedPatternMode::Invalid; // control for interpolation mode - Real64 UpperBoundTempScale = 0.0; // temperature value for HiGradient - Real64 LowerBoundTempScale = 0.0; // temperature value for LowGradient - Real64 UpperBoundHeatRateScale = 0.0; // load value for HiGradient - Real64 LowerBoundHeatRateScale = 0.0; // load value for lowGradient + Real64 UpperBoundTempScale = 0.0; // temperature value for HiGradient + Real64 LowerBoundTempScale = 0.0; // temperature value for LowGradient + Real64 UpperBoundHeatRateScale = 0.0; // load value for HiGradient + Real64 LowerBoundHeatRateScale = 0.0; // load value for lowGradient }; struct TempVsHeightPattern // to be used as nested structure in RoomAirPattern @@ -316,51 +316,51 @@ namespace RoomAir { struct TemperaturePattern // RoomAirPattern { // Members - std::string Name = ""; // unique identifier - int PatrnID = 0; // control ID for referencing in Schedules - UserDefinedPatternType PatternMode = UserDefinedPatternType::Invalid; // Control for what type of calcs in this pattern - ConstGradPattern GradPatrn; // Constant gradient pattern - TwoVertGradInterpolPattern TwoGradPatrn; // Two gradient interpolation pattern - TempVsHeightPattern VertPatrn; // Vertical gradient profile pattern - SurfMapPattern MapPatrn; // Generic Surface map pattern - Real64 DeltaTstat = 0.0; // (Tstat - MAT) offset deg C - Real64 DeltaTleaving = 0.0; // (Tleaving - MAT) deg C - Real64 DeltaTexhaust = 0.0; // (Texhaust - MAT) deg C + std::string Name = ""; // unique identifier + int PatrnID = 0; // control ID for referencing in Schedules + UserDefinedPatternType PatternMode = UserDefinedPatternType::Invalid; // Control for what type of calcs in this pattern + ConstGradPattern GradPatrn; // Constant gradient pattern + TwoVertGradInterpolPattern TwoGradPatrn; // Two gradient interpolation pattern + TempVsHeightPattern VertPatrn; // Vertical gradient profile pattern + SurfMapPattern MapPatrn; // Generic Surface map pattern + Real64 DeltaTstat = 0.0; // (Tstat - MAT) offset deg C + Real64 DeltaTleaving = 0.0; // (Tleaving - MAT) deg C + Real64 DeltaTexhaust = 0.0; // (Texhaust - MAT) deg C }; struct SurfaceAssocNested { // Members - std::string Name = ""; // unique identifier - int SurfID = 0; // id in HB surface structs + std::string Name = ""; // unique identifier + int SurfID = 0; // id in HB surface structs Real64 TadjacentAir = 23.0; // place to put resulting temperature value - Real64 Zeta = 0.0; // non-dimensional height in zone ot + Real64 Zeta = 0.0; // non-dimensional height in zone ot }; struct AirPatternInfobyZone // becomes AirPatternZoneInfo { // Members // user variables - bool IsUsed = false; // .TRUE. if user-defined patterns used in zone + bool IsUsed = false; // .TRUE. if user-defined patterns used in zone std::string Name = ""; // Name std::string ZoneName = ""; // Zone name in building - int ZoneID = 0; // Index of Zone in Heat Balance + int ZoneID = 0; // Index of Zone in Heat Balance std::string AvailSched = ""; // Name of availability schedule - int AvailSchedID = 0; // index of availability schedule + int AvailSchedID = 0; // index of availability schedule std::string PatternCntrlSched = ""; // name of schedule that selects pattern - int PatternSchedID = 0; // index of pattern selecting schedule + int PatternSchedID = 0; // index of pattern selecting schedule // calculated and from elsewhere - Real64 ZoneHeight = 0.0; // in meters, from Zone%CeilingHeight - int ZoneNodeID = 0; // index in Node array for this zone - Array1D_int ExhaustAirNodeID; // indexes in Node array + Real64 ZoneHeight = 0.0; // in meters, from Zone%CeilingHeight + int ZoneNodeID = 0; // index in Node array for this zone + Array1D_int ExhaustAirNodeID; // indexes in Node array // Is 23.0 a constexpr somewhere - Real64 TairMean = 23.0; // comes from MAT - Real64 Tstat = 23.0; // temperature for thermostat - Real64 Tleaving = 23.0; // temperature for return air node - Real64 Texhaust = 23.0; // temperature for exhaust air node + Real64 TairMean = 23.0; // comes from MAT + Real64 Tstat = 23.0; // temperature for thermostat + Real64 Tleaving = 23.0; // temperature for return air node + Real64 Texhaust = 23.0; // temperature for exhaust air node Array1D Surf; // nested struct w/ surface info - int totNumSurfs = 0; // total surfs for this zone - int firstSurfID = 0; // Index of first surface + int totNumSurfs = 0; // total surfs for this zone + int firstSurfID = 0; // Index of first surface // report Real64 Gradient = 0.0; // result for modeled gradient if using two-gradient interpolation }; @@ -369,12 +369,12 @@ namespace RoomAir { { // Members // user variables - int AFNSimuID = 0; // point to this linkage in AirflowNetworkLinkSimu structure - int AFNDataID = 0; // point to this linkage in AirflowNetworkLinkageData structure - int AFNReportID = 0; // point to this linkage in AirflowNetworkLinkReport structure - Real64 MdotIn = 0.0; // mass flow rate of air into control volume(neg means leaving control volume) (kg / s) - Real64 TempIn = 0.0; // drybulb temperature of air into control volume - Real64 HumRatIn = 0.0; // humidity ratio of air into control volume + int AFNSimuID = 0; // point to this linkage in AirflowNetworkLinkSimu structure + int AFNDataID = 0; // point to this linkage in AirflowNetworkLinkageData structure + int AFNReportID = 0; // point to this linkage in AirflowNetworkLinkReport structure + Real64 MdotIn = 0.0; // mass flow rate of air into control volume(neg means leaving control volume) (kg / s) + Real64 TempIn = 0.0; // drybulb temperature of air into control volume + Real64 HumRatIn = 0.0; // humidity ratio of air into control volume }; struct AFNNodeInternalGains // becomes IntGain @@ -382,68 +382,68 @@ namespace RoomAir { // Members // user variables DataHeatBalance::IntGainType type = DataHeatBalance::IntGainType::Invalid; // Internal type - std::string Name = ""; // Intenral gain name - bool UseRoomAirModelTempForGains = false; // TRUE if user inputs temp for gains - bool FractionCheck = false; // TRUE if a fraction of internal gain for each object is checked + std::string Name = ""; // Intenral gain name + bool UseRoomAirModelTempForGains = false; // TRUE if user inputs temp for gains + bool FractionCheck = false; // TRUE if a fraction of internal gain for each object is checked }; struct AFNHVAC // becomes HVAC { // Members // user variables - std::string Name = ""; // HVAC system name - std::string ObjectTypeName = ""; // HVAC object type name - std::string SupplyNodeName = ""; // HVAC system supply node name - std::string ReturnNodeName = ""; // HVAC system return node name - DataZoneEquipment::ZoneEquipType zoneEquipType = DataZoneEquipment::ZoneEquipType::Invalid; // HVAC type num - Real64 SupplyFraction = 0.0; // Supply flow fraction - Real64 ReturnFraction = 0.0; // Return flow fraction - int EquipConfigIndex = 0; // HVAC equipment configuration index - int SupNodeNum = 0; // HVAC supply node number - int RetNodeNum = 0; // HVAC return node number - int CompIndex = 0; // Component index + std::string Name = ""; // HVAC system name + std::string ObjectTypeName = ""; // HVAC object type name + std::string SupplyNodeName = ""; // HVAC system supply node name + std::string ReturnNodeName = ""; // HVAC system return node name + DataZoneEquipment::ZoneEquipType zoneEquipType = DataZoneEquipment::ZoneEquipType::Invalid; // HVAC type num + Real64 SupplyFraction = 0.0; // Supply flow fraction + Real64 ReturnFraction = 0.0; // Return flow fraction + int EquipConfigIndex = 0; // HVAC equipment configuration index + int SupNodeNum = 0; // HVAC supply node number + int RetNodeNum = 0; // HVAC return node number + int CompIndex = 0; // Component index }; - + struct AFNAirNodeNested // becomes Node { // Members // user variables - std::string Name = ""; // name of the node itself - Real64 ZoneVolumeFraction = 0.0; // Zone volume fraction applied to this specific node - std::string NodeSurfListName = ""; // name of nodes' adjacent surface list - bool HasSurfacesAssigned = false; // True if this node has surfaces assigned - Array1D SurfMask; // Sized to num of surfs in Zone, true if surface is associated with this node - std::string NodeIntGainsListName = ""; // name of node's internal gains list - bool HasIntGainsAssigned = false; // True if this node has internal gain assigned - int NumIntGains = 0; // Number of matching internal gain objects for all spaces in the zone - Array1D intGainsDeviceSpaces; // index pointers to space struct - Array1D IntGainsDeviceIndices; // index pointers to internal gains struct - Array1D IntGainsFractions; // gain fractions to this node + std::string Name = ""; // name of the node itself + Real64 ZoneVolumeFraction = 0.0; // Zone volume fraction applied to this specific node + std::string NodeSurfListName = ""; // name of nodes' adjacent surface list + bool HasSurfacesAssigned = false; // True if this node has surfaces assigned + Array1D SurfMask; // Sized to num of surfs in Zone, true if surface is associated with this node + std::string NodeIntGainsListName = ""; // name of node's internal gains list + bool HasIntGainsAssigned = false; // True if this node has internal gain assigned + int NumIntGains = 0; // Number of matching internal gain objects for all spaces in the zone + Array1D intGainsDeviceSpaces; // index pointers to space struct + Array1D IntGainsDeviceIndices; // index pointers to internal gains struct + Array1D IntGainsFractions; // gain fractions to this node Array1D IntGain; // Internal gain struct - std::string NodeHVACListName = ""; // name of node's HVAC list - bool HasHVACAssigned = false; // True if HVAC systems are assigned to this node - int NumHVACs = 0; // Number of HVAC systems + std::string NodeHVACListName = ""; // name of node's HVAC list + bool HasHVACAssigned = false; // True if HVAC systems are assigned to this node + int NumHVACs = 0; // Number of HVAC systems Array1D HVAC; // HVAC struct - int AFNNodeID = 0; // pointer to AirflowNetworkNodeData structure - int NumOfAirflowLinks = 0; // Number of intra zone links - Array1D Link; // Linkage struct - Real64 AirVolume = 0.0; // air volume in control volume associated with this node(m3 / s) - Real64 RhoAir = 0.0; // current density of air for nodal control volume - Real64 CpAir = 0.0; // current heat capacity of air for nodal control volume - - Real64 AirTemp = 0.0; // node air temperature + int AFNNodeID = 0; // pointer to AirflowNetworkNodeData structure + int NumOfAirflowLinks = 0; // Number of intra zone links + Array1D Link; // Linkage struct + Real64 AirVolume = 0.0; // air volume in control volume associated with this node(m3 / s) + Real64 RhoAir = 0.0; // current density of air for nodal control volume + Real64 CpAir = 0.0; // current heat capacity of air for nodal control volume + + Real64 AirTemp = 0.0; // node air temperature std::array AirTempX = {0.0, 0.0, 0.0, 0.0}; // node air temperature at t minus X zone timestep std::array AirTempDSX = {0.0, 0.0, 0.0, 0.0}; // node air temperature at t minus X system timestep - Real64 AirTempT1 = 0.0; // node air temperature at the previous time step used in Exact and Euler method - Real64 AirTempTX = 0.0; // temporary node air temperature to test convergence used in Exact and Euler method - Real64 AirTempT2 = 0.0; // node air temperature at time step t-2 used in Exact and Euler method + Real64 AirTempT1 = 0.0; // node air temperature at the previous time step used in Exact and Euler method + Real64 AirTempTX = 0.0; // temporary node air temperature to test convergence used in Exact and Euler method + Real64 AirTempT2 = 0.0; // node air temperature at time step t-2 used in Exact and Euler method - Real64 HumRat = 0.0; // node air humidity ratio + Real64 HumRat = 0.0; // node air humidity ratio std::array HumRatX = {0.0, 0.0, 0.0, 0.0}; // node air humidity ratio at t minus X zone timestep std::array HumRatDSX = {0.0, 0.0, 0.0, 0.0}; // node air humidity ratio at t minus 1 system timestep - Real64 HumRatT1 = 0.0; // node air humidity ratio at the previous time step used in Exact and Euler method - Real64 HumRatTX = 0.0; // temporary node air humidity ratio to test convergence used in Exact and Euler method - Real64 HumRatT2 = 0.0; // node air humidity ratio at time step t-2 used in Exact and Euler method + Real64 HumRatT1 = 0.0; // node air humidity ratio at the previous time step used in Exact and Euler method + Real64 HumRatTX = 0.0; // temporary node air humidity ratio to test convergence used in Exact and Euler method + Real64 HumRatT2 = 0.0; // node air humidity ratio at time step t-2 used in Exact and Euler method Real64 RelHumidity = 0.0; // node air relative humidity @@ -469,41 +469,43 @@ namespace RoomAir { Real64 SumHmARa = 0.0; // SUM OF ZONE AREA*Moist CONVECTION COEFF*Rho Air Real64 SumHmARaW = 0.0; // SUM OF ZONE AREA*Moist CONVECTION COEFF*Rho Air* Inside Humidity Ratio Real64 SumLinkM = 0.0; // sum of mdor for incoming airflows for this node derived from the AirflowNetwork model - Real64 SumLinkMW = 0.0; // sum of mdor*Cp*T for incoming airflows and source humidity ratio for this node derived from the AirflowNetwork model + Real64 SumLinkMW = + 0.0; // sum of mdor*Cp*T for incoming airflows and source humidity ratio for this node derived from the AirflowNetwork model }; struct AFNInfoByZone // becomes RoomAirflowNetworkZoneInfo { // Members // user variables - bool IsUsed = false; // true. if RoomAirflowNetwork model used in zone - std::string Name = ""; // Name - std::string ZoneName = ""; // Zone name in building - int ZoneID = 0; // Index of Zone in Heat Balance - int ActualZoneID = 0; // Index of controlled zones in ZoneCOnfigure - std::string AvailSched = ""; // Name of availability schedule - int AvailSchedID = 0; // index of availability schedule - int ControlAirNodeID = 0; // index of roomair node that is HVAC control sensor location - int NumOfAirNodes = 0; // Number of air nodes + bool IsUsed = false; // true. if RoomAirflowNetwork model used in zone + std::string Name = ""; // Name + std::string ZoneName = ""; // Zone name in building + int ZoneID = 0; // Index of Zone in Heat Balance + int ActualZoneID = 0; // Index of controlled zones in ZoneCOnfigure + std::string AvailSched = ""; // Name of availability schedule + int AvailSchedID = 0; // index of availability schedule + int ControlAirNodeID = 0; // index of roomair node that is HVAC control sensor location + int NumOfAirNodes = 0; // Number of air nodes Array1D Node; // Node struct - int ZoneNodeID = 0; // index in system Node array for this zone - Real64 TairMean = 0.0; // comes from MAT - Real64 Tstat = 0.0; // temperature for thermostat - Real64 Tleaving = 0.0; // temperature for return air node - Real64 Texhaust = 0.0; // temperature for exhaust air node - int totNumSurfs = 0; // total surfs for this zone - int firstSurfID = 0; // Index of first surface + int ZoneNodeID = 0; // index in system Node array for this zone + Real64 TairMean = 0.0; // comes from MAT + Real64 Tstat = 0.0; // temperature for thermostat + Real64 Tleaving = 0.0; // temperature for return air node + Real64 Texhaust = 0.0; // temperature for exhaust air node + int totNumSurfs = 0; // total surfs for this zone + int firstSurfID = 0; // Index of first surface }; - struct BegEnd { + struct BegEnd + { int beg = 0; int end = 0; }; } // namespace RoomAir - + struct RoomAirModelData : BaseGlobalStruct { - bool GetAirModelData = true; // Used to "get" all air model data + bool GetAirModelData = true; // Used to "get" all air model data bool MyOneTimeFlag = true; Array1D_bool MyEnvrnFlag; @@ -516,13 +518,13 @@ struct RoomAirModelData : BaseGlobalStruct // UCSD int TotDispVent3Node = 0; // Total number of UCSDDV zones Array1D DispVent3NodeHcIn; - Array1D_bool IsZoneDispVent3Node; // Is the air model for the zone UCSDDV? - Array1D ZTOC; // Temperature of occupied (lower) zone - Array1D AvgTempGrad; // vertical Average Temperature Gradient in the room - Array1D ZTMX; // Temperature of the mixing(upper) layer - Array1D MaxTempGrad; // maximum Average Temperature Gradient in the room - Array1D HVACAirTemp; // HVAC system temperature (DEG C) - Array1D HVACMassFlow; // HVAC system mass flow rate (KG/S) + Array1D_bool IsZoneDispVent3Node; // Is the air model for the zone UCSDDV? + Array1D ZTOC; // Temperature of occupied (lower) zone + Array1D AvgTempGrad; // vertical Average Temperature Gradient in the room + Array1D ZTMX; // Temperature of the mixing(upper) layer + Array1D MaxTempGrad; // maximum Average Temperature Gradient in the room + Array1D HVACAirTemp; // HVAC system temperature (DEG C) + Array1D HVACMassFlow; // HVAC system mass flow rate (KG/S) Array1D ZTFloor; Array1D HeightTransition; Array1D FracMinFlow; @@ -532,18 +534,18 @@ struct RoomAirModelData : BaseGlobalStruct Array1D TCMF; // comfort temperature Array1D ZoneCeilingHeight1; Array1D ZoneCeilingHeight2; - Array1D MATFloor; // [C] floor level mean air temp + Array1D MATFloor; // [C] floor level mean air temp EPVector> XMATFloor; // [C] floor level mean air temp at t minus X zone time step EPVector> DSXMATFloor; // [C] floor level mean air temp at t minus X system time step - Array1D MATOC; // [C] occupied mean air temp + Array1D MATOC; // [C] occupied mean air temp EPVector> XMATOC; // [C] occupied mean air temp at t minus X zone time step EPVector> DSXMATOC; // [C] occupied mean air temp at t minus X system time step - Array1D MATMX; // [C] mixed (upper) mean air temp + Array1D MATMX; // [C] mixed (upper) mean air temp EPVector> XMATMX; // [C] mixed (upper) mean air temp at t minus X zone time step EPVector> DSXMATMX; // [C] mixed mean air temp at t minus X system time step - EPVector> ZTMFloor; // [C] difference equation's Floor air temp at t minus X - EPVector> ZTMOC; // [C] difference equation's Occupied air temp at t minus X - EPVector> ZTMMX; // [C] difference equation's Mixed air temp at t minus X + EPVector> ZTMFloor; // [C] difference equation's Floor air temp at t minus X + EPVector> ZTMOC; // [C] difference equation's Occupied air temp at t minus X + EPVector> ZTMMX; // [C] difference equation's Mixed air temp at t minus X Array1D AIRRATFloor; Array1D AIRRATOC; Array1D AIRRATMX; @@ -584,14 +586,14 @@ struct RoomAirModelData : BaseGlobalStruct Array1D HDoor; // UCSD-CV - int TotCrossVent = 0; // Total number of UCSDDV zones + int TotCrossVent = 0; // Total number of UCSDDV zones int CrossVentNumAFNSurfaces = 0; // total number of AirFlowNetwork surfaces. Array1D CrossVentHcIn; - Array1D_bool IsZoneCrossVent; // Is the air model for the zone UCSDDV? - Array1D ZoneCrossVentIsMixing; // Zone set to CV is actually using a mixing model - Array1D ZTJET; // Jet Temperatures - Array1D ZTREC; // Recirculation Temperatures - Array1D RoomOutflowTemp; // Temperature of air flowing out of the room + Array1D_bool IsZoneCrossVent; // Is the air model for the zone UCSDDV? + Array1D ZoneCrossVentIsMixing; // Zone set to CV is actually using a mixing model + Array1D ZTJET; // Jet Temperatures + Array1D ZTREC; // Recirculation Temperatures + Array1D RoomOutflowTemp; // Temperature of air flowing out of the room Array1D JetRecAreaRatio; Array1D Urec; // Recirculation region average velocity Array1D Ujet; // Jet region average velocity @@ -599,20 +601,20 @@ struct RoomAirModelData : BaseGlobalStruct Array1D Qtot; // Total volumetric inflow rate through all active aperatures [m3/s] Array1D RecInflowRatio; // Ratio of the recirculation volumetric flow rate to the total inflow flow rate [] Array1D Uhc; - Array1D Ain; // Inflow aperture area - Array1D Droom; // CV Zone average length - Array1D Dstar; // CV Zone average length, wind direction corrected - Array1D Tin; // Inflow air temperature - Array1D TotArea; // Sum of the areas of all apertures in the zone + Array1D Ain; // Inflow aperture area + Array1D Droom; // CV Zone average length + Array1D Dstar; // CV Zone average length, wind direction corrected + Array1D Tin; // Inflow air temperature + Array1D TotArea; // Sum of the areas of all apertures in the zone Array2D_int AFNSurfaceCrossVent; // table for AirflowNetwork surfaces organization // Interzone surfaces counts twice. - Array1D Rfr; // Ration between inflow and recirculation air flows + Array1D Rfr; // Ration between inflow and recirculation air flows Array1D ZoneCrossVentHasREC; // Airflow pattern is C = 0, CR(1) bool UCSDModelUsed = false; bool DispVent1NodeModelUsed = false; // UCSD-UF - int TotUFADInt = 0; // total number of UCSDUI zones - int TotUFADExt = 0; // total number of UCSDUE zones + int TotUFADInt = 0; // total number of UCSDUI zones + int TotUFADExt = 0; // total number of UCSDUE zones Array1D_bool IsZoneUFAD; // controls program flow, for interior or exterior UFAD model Array1D_int ZoneUFADPtr; Array1D UFADHcIn; @@ -621,7 +623,7 @@ struct RoomAirModelData : BaseGlobalStruct Array1D ZoneUFADGamma; Array1D ZoneUFADPowInPlumes; // [W] Array1D ZoneUFADPowInPlumesfromWindows; // [W] - Array1D Phi; // dimensionless measure of occupied subzone temperature + Array1D Phi; // dimensionless measure of occupied subzone temperature // END UCSD // Begin NREL User-defined patterns int numTempDistContrldZones = 0; // count of zones with user-defined patterns @@ -642,11 +644,11 @@ struct RoomAirModelData : BaseGlobalStruct EPVector ZoneDispVent3Node; // UCSD EPVector ZoneCrossVent; EPVector ZoneUFAD; - Array2D CrossVentJetRecFlows; // Jet and recirculation zone flows and properties - EPVector SurfParametersCrossDispVent; // Surface parameters + Array2D CrossVentJetRecFlows; // Jet and recirculation zone flows and properties + EPVector SurfParametersCrossDispVent; // Surface parameters EPVector AirPattern; // user defined patterns ,various types - EPVector AirPatternZoneInfo; // added zone information for user defined patterns - EPVector AFNZoneInfo; // added zone info + EPVector AirPatternZoneInfo; // added zone information for user defined patterns + EPVector AFNZoneInfo; // added zone info void clear_state() override { @@ -679,13 +681,13 @@ struct RoomAirModelData : BaseGlobalStruct TotDispVent3Node = 0; // Total number of UCSDDV zones DispVent3NodeHcIn.clear(); - IsZoneDispVent3Node.clear(); // Is the air model for the zone UCSDDV? - ZTOC.clear(); // Temperature of occupied (lower) zone - AvgTempGrad.clear(); // vertical Average Temperature Gradient in the room - ZTMX.clear(); // Temperature of the mixing(upper) layer - MaxTempGrad.clear(); // maximum Average Temperature Gradient in the room - HVACAirTemp.clear(); // HVAC system temperature (DEG C) - HVACMassFlow.clear(); // HVAC system mass flow rate (KG/S) + IsZoneDispVent3Node.clear(); // Is the air model for the zone UCSDDV? + ZTOC.clear(); // Temperature of occupied (lower) zone + AvgTempGrad.clear(); // vertical Average Temperature Gradient in the room + ZTMX.clear(); // Temperature of the mixing(upper) layer + MaxTempGrad.clear(); // maximum Average Temperature Gradient in the room + HVACAirTemp.clear(); // HVAC system temperature (DEG C) + HVACMassFlow.clear(); // HVAC system mass flow rate (KG/S) ZTFloor.clear(); HeightTransition.clear(); FracMinFlow.clear(); @@ -704,9 +706,9 @@ struct RoomAirModelData : BaseGlobalStruct MATMX.clear(); // [C] mixed (upper) mean air temp XMATMX.clear(); // [C] mixed (upper) mean air temp at t minus 1 zone time step DSXMATMX.clear(); // [C] mixed mean air temp at t minus 1 system time step - ZTMFloor.clear(); // [C] difference equation's Floor air temp at t minus 1 - ZTMOC.clear(); // [C] difference equation's Occupied air temp at t minus 1 - ZTMMX.clear(); // [C] difference equation's Mixed air temp at t minus 1 + ZTMFloor.clear(); // [C] difference equation's Floor air temp at t minus 1 + ZTMOC.clear(); // [C] difference equation's Occupied air temp at t minus 1 + ZTMMX.clear(); // [C] difference equation's Mixed air temp at t minus 1 AIRRATFloor.clear(); AIRRATOC.clear(); AIRRATMX.clear(); @@ -721,14 +723,14 @@ struct RoomAirModelData : BaseGlobalStruct ZoneMXMX.clear(); // [C] difference equation's Mixed air temp at t minus 1 ZoneM2MX.clear(); // [C] difference equation's Mixed air temp at t minus 2 // UCSD-CV - TotCrossVent = 0; // Total number of UCSDDV zones + TotCrossVent = 0; // Total number of UCSDDV zones CrossVentNumAFNSurfaces = 0; // total number of AirFlowNetwork surfaces. CrossVentHcIn.clear(); - IsZoneCrossVent.clear(); // Is the air model for the zone UCSDDV? - ZoneCrossVentIsMixing.clear(); // Zone set to CV is actually using a mixing model - ZTJET.clear(); // Jet Temperatures - ZTREC.clear(); // Recirculation Temperatures - RoomOutflowTemp.clear(); // Temperature of air flowing out of the room + IsZoneCrossVent.clear(); // Is the air model for the zone UCSDDV? + ZoneCrossVentIsMixing.clear(); // Zone set to CV is actually using a mixing model + ZTJET.clear(); // Jet Temperatures + ZTREC.clear(); // Recirculation Temperatures + RoomOutflowTemp.clear(); // Temperature of air flowing out of the room JetRecAreaRatio.clear(); Urec.clear(); // Recirculation region average velocity Ujet.clear(); // Jet region average velocity @@ -736,20 +738,20 @@ struct RoomAirModelData : BaseGlobalStruct Qtot.clear(); // Total volumetric inflow rate through all active aperatures [m3/s] RecInflowRatio.clear(); // Ratio of the recirculation volumetric flow rate to the total inflow flow rate [] Uhc.clear(); - Ain.clear(); // Inflow aperture area - Droom.clear(); // CV Zone average length - Dstar.clear(); // CV Zone average length, wind direction corrected - Tin.clear(); // Inflow air temperature - TotArea.clear(); // Sum of the areas of all apertures in the zone + Ain.clear(); // Inflow aperture area + Droom.clear(); // CV Zone average length + Dstar.clear(); // CV Zone average length, wind direction corrected + Tin.clear(); // Inflow air temperature + TotArea.clear(); // Sum of the areas of all apertures in the zone AFNSurfaceCrossVent.clear(); // table for AirflowNetwork surfaces organization // Interzone surfaces counts twice. - Rfr.clear(); // Ration between inflow and recirculation air flows + Rfr.clear(); // Ration between inflow and recirculation air flows ZoneCrossVentHasREC.clear(); // Airflow pattern is C = 0, CR(1) UCSDModelUsed = false; DispVent1NodeModelUsed = false; // UCSD-UF - TotUFADInt = 0; // total number of UCSDUI zones - TotUFADExt = 0; // total number of UCSDUE zones + TotUFADInt = 0; // total number of UCSDUI zones + TotUFADExt = 0; // total number of UCSDUE zones IsZoneUFAD.clear(); // controls program flow, for interior or exterior UFAD model ZoneUFADPtr.clear(); UFADHcIn.clear(); @@ -758,7 +760,7 @@ struct RoomAirModelData : BaseGlobalStruct ZoneUFADGamma.clear(); ZoneUFADPowInPlumes.clear(); // [W] ZoneUFADPowInPlumesfromWindows.clear(); // [W] - Phi.clear(); // dimensionless measure of occupied subzone temperature + Phi.clear(); // dimensionless measure of occupied subzone temperature // END UCSD // Begin NREL User-defined patterns numTempDistContrldZones = 0; // count of zones with user-defined patterns @@ -779,11 +781,11 @@ struct RoomAirModelData : BaseGlobalStruct ZoneDispVent3Node.clear(); // UCSD ZoneCrossVent.clear(); ZoneUFAD.clear(); - CrossVentJetRecFlows.clear(); // Jet and recirculation zone flows and properties - SurfParametersCrossDispVent.clear(); // Surface parameters - AirPattern.clear(); // user defined patterns ,various types - AirPatternZoneInfo.clear(); // added zone information for user defined patterns - AFNZoneInfo.clear(); // added zone info + CrossVentJetRecFlows.clear(); // Jet and recirculation zone flows and properties + SurfParametersCrossDispVent.clear(); // Surface parameters + AirPattern.clear(); // user defined patterns ,various types + AirPatternZoneInfo.clear(); // added zone information for user defined patterns + AFNZoneInfo.clear(); // added zone info } }; diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index 40c43dcd53f..427e3cc4a8c 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -94,58 +94,58 @@ Array1D_string const cValidSysAvailManagerCompTypes(NumValidSysAvailZoneComponen "ZoneHVAC:EvaporativeCoolerUnit", "ZoneHVAC:HybridUnitaryHVAC"}); -constexpr std::array(ZoneEquipType::Num)> zoneEquipTypeNamesUC = - {"DUMMY", // DUMMY, - - "ZONEHVAC:FOURPIPEFANCOIL", // FanCoilFourPipe - "ZONEHVAC:PACKAGEDTERMINALHEATPUMP", // PackagedTerminalHeatPump - "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER", // PackagedTerminalAirConditioner - "ZONEHVAC:WATERTOAIRHEATPUMP", // PackagedTerminalHeatPumpWaterToAir - "ZONEHVAC:WINDOWAIRCONDITIONER", // WindowAirConditioner - "ZONEHVAC:UNITHEATER", // UnitHeater - "ZONEHVAC:UNITVENTILATOR", // UnitVentilator - "ZONEHVAC:ENERGYRECOVERYVENTILATOR", // EnergyRecoveryVentilator - "ZONEHVAC:VENTILATEDSLAB", // VentilatedSlab - "ZONEHVAC:OUTDOORAIRUNIT", // OutdoorAirUnit - "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", // VariableRefrigerantFlowTerminal - "ZONEHVAC:IDEALLOADSAIRSYSTEM", // IdealLoadsAirSystem - "ZONEHVAC:EVAPORATIVECOOLERUNIT", // EvaporativeCooler - "ZONEHVAC:HYBRIDUNITARYHVAC", // HybridEvaporativeCooler, - - // last zone equipment type to use zone availability manager. The above list must not change or - // NumValidSysAvailZoneComponents must also change. - - "ZONEHVAC:AIRDISTRIBUTIONUNIT", // AirDistributionUnit - "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", // BaseboardWaterConvective - "ZONEHVAC:BASEBOARD:CONVECTIVE:ELECTRIC", // BaseboardElectricConvective - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", // BaseboardSteam - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", // BaseboardWater - "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:ELECTRIC", // BaseboardElectric - "ZONEHVAC:HIGHTEMPERATURERADIANT", // HighTempRadiant - "ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW", // LowTempRadiant - "FAN:ZONEEXHAUST", // ExhaustFan - "HEATEXCHANGER:AIRTOAIR:FLATPLATE", // HeatExchanger - "WATERHEATER:HEATPUMP:PUMPEDCONDENSER", // HeatPumpWaterHeater - "ZONEHVAC:DEHUMIDIFIER:DX", // DXDehumidifier - "ZONEHVAC:REFRIGERATIONCHILLERSET", // RefrigerationAirChillerSet - "ZONEHVAC:FORCEDAIR:USERDEFINED", // UserDefinedVACForcedAir - "ZONEHVAC:COOLINGPANEL:RADIANTCONVECTIVE:WATER", // CoolingPanel - "AIRLOOPHVAC:UNITARYSYSTEM", // UnitarySystem - "AIRTERMINAL:DUALDUCT:CONSTANTVOLUME", // AirTerminalDualDuctConstantVolume - "AIRTERMINAL:DUALDUCT:VAV", // AirTerminalDualDuctVAV - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:REHEAT", // AirTerminalSingleDuctConstantVolumeReheat - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:NOREHEAT", // AirTerminalSingleDuctConstantVolumeNoReheat - "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT", // AirTerminalSingleDuctVAVReheat - "AIRTERMINAL:SINGLEDUCT:VAV:NOREHEAT", // AirTerminalSingleDuctVAVNoReheat - "AIRTERMINAL:SINGLEDUCT:SERIESPIU:REHEAT", // AirTerminalSingleDuctSeriesPIUReheat - "AIRTERMINAL:SINGLEDUCT:PARALLELPIU:REHEAT", // AirTerminalSingleDuctParallelPIUReheat - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEINDUCTION", // AirTerminalSingleDuctCAVFourPipeInduction - "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT:VARIABLESPEEDFAN", // AirTerminalSingleDuctVAVReheatVariableSpeedFan - "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT", // AirTerminalSingleDuctVAVHeatAndCoolReheat - "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:NOREHEAT", // AirTerminalSingleDuctVAVHeatAndCoolNoReheat - "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", // AirTerminalSingleDuctConstantVolumeCooledBeam - "AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR", // AirTerminalDualDuctVAVOutdoorAir - "AIRLOOPHVACRETURNAIR" // AirLoopHVACReturnAir +constexpr std::array(ZoneEquipType::Num)> zoneEquipTypeNamesUC = { + "DUMMY", // DUMMY, + + "ZONEHVAC:FOURPIPEFANCOIL", // FanCoilFourPipe + "ZONEHVAC:PACKAGEDTERMINALHEATPUMP", // PackagedTerminalHeatPump + "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER", // PackagedTerminalAirConditioner + "ZONEHVAC:WATERTOAIRHEATPUMP", // PackagedTerminalHeatPumpWaterToAir + "ZONEHVAC:WINDOWAIRCONDITIONER", // WindowAirConditioner + "ZONEHVAC:UNITHEATER", // UnitHeater + "ZONEHVAC:UNITVENTILATOR", // UnitVentilator + "ZONEHVAC:ENERGYRECOVERYVENTILATOR", // EnergyRecoveryVentilator + "ZONEHVAC:VENTILATEDSLAB", // VentilatedSlab + "ZONEHVAC:OUTDOORAIRUNIT", // OutdoorAirUnit + "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW", // VariableRefrigerantFlowTerminal + "ZONEHVAC:IDEALLOADSAIRSYSTEM", // IdealLoadsAirSystem + "ZONEHVAC:EVAPORATIVECOOLERUNIT", // EvaporativeCooler + "ZONEHVAC:HYBRIDUNITARYHVAC", // HybridEvaporativeCooler, + + // last zone equipment type to use zone availability manager. The above list must not change or + // NumValidSysAvailZoneComponents must also change. + + "ZONEHVAC:AIRDISTRIBUTIONUNIT", // AirDistributionUnit + "ZONEHVAC:BASEBOARD:CONVECTIVE:WATER", // BaseboardWaterConvective + "ZONEHVAC:BASEBOARD:CONVECTIVE:ELECTRIC", // BaseboardElectricConvective + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:STEAM", // BaseboardSteam + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:WATER", // BaseboardWater + "ZONEHVAC:BASEBOARD:RADIANTCONVECTIVE:ELECTRIC", // BaseboardElectric + "ZONEHVAC:HIGHTEMPERATURERADIANT", // HighTempRadiant + "ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW", // LowTempRadiant + "FAN:ZONEEXHAUST", // ExhaustFan + "HEATEXCHANGER:AIRTOAIR:FLATPLATE", // HeatExchanger + "WATERHEATER:HEATPUMP:PUMPEDCONDENSER", // HeatPumpWaterHeater + "ZONEHVAC:DEHUMIDIFIER:DX", // DXDehumidifier + "ZONEHVAC:REFRIGERATIONCHILLERSET", // RefrigerationAirChillerSet + "ZONEHVAC:FORCEDAIR:USERDEFINED", // UserDefinedVACForcedAir + "ZONEHVAC:COOLINGPANEL:RADIANTCONVECTIVE:WATER", // CoolingPanel + "AIRLOOPHVAC:UNITARYSYSTEM", // UnitarySystem + "AIRTERMINAL:DUALDUCT:CONSTANTVOLUME", // AirTerminalDualDuctConstantVolume + "AIRTERMINAL:DUALDUCT:VAV", // AirTerminalDualDuctVAV + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:REHEAT", // AirTerminalSingleDuctConstantVolumeReheat + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:NOREHEAT", // AirTerminalSingleDuctConstantVolumeNoReheat + "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT", // AirTerminalSingleDuctVAVReheat + "AIRTERMINAL:SINGLEDUCT:VAV:NOREHEAT", // AirTerminalSingleDuctVAVNoReheat + "AIRTERMINAL:SINGLEDUCT:SERIESPIU:REHEAT", // AirTerminalSingleDuctSeriesPIUReheat + "AIRTERMINAL:SINGLEDUCT:PARALLELPIU:REHEAT", // AirTerminalSingleDuctParallelPIUReheat + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEINDUCTION", // AirTerminalSingleDuctCAVFourPipeInduction + "AIRTERMINAL:SINGLEDUCT:VAV:REHEAT:VARIABLESPEEDFAN", // AirTerminalSingleDuctVAVReheatVariableSpeedFan + "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT", // AirTerminalSingleDuctVAVHeatAndCoolReheat + "AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:NOREHEAT", // AirTerminalSingleDuctVAVHeatAndCoolNoReheat + "AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM", // AirTerminalSingleDuctConstantVolumeCooledBeam + "AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR", // AirTerminalDualDuctVAVOutdoorAir + "AIRLOOPHVACRETURNAIR" // AirLoopHVACReturnAir }; static constexpr std::array(LoadDist::Num)> LoadDistNamesUC = { @@ -414,8 +414,8 @@ void GetZoneEquipmentData(EnergyPlusData &state) thisZoneEquipList.Name = thisZoneEquipConfig.EquipListName; std::string loadDistName = ip->getAlphaFieldValue(epListFields, objectSchemaProps, "load_distribution_scheme"); - thisZoneEquipList.LoadDistScheme = static_cast( - getEnumValue(DataZoneEquipment::LoadDistNamesUC, UtilityRoutines::makeUPPER(loadDistName))); + thisZoneEquipList.LoadDistScheme = + static_cast(getEnumValue(DataZoneEquipment::LoadDistNamesUC, UtilityRoutines::makeUPPER(loadDistName))); if (thisZoneEquipList.LoadDistScheme == DataZoneEquipment::LoadDist::Invalid) { ShowSevereError(state, format("{}{} = \"{}, Invalid choice\".", RoutineName, CurrentModuleObject, thisZoneEquipList.Name)); ShowContinueError(state, format("...load_distribution_scheme=\"{}\".", loadDistName)); diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index 72d90b06dd6..3ea1322aa7b 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -123,7 +123,7 @@ namespace DataZoneEquipment { PurchasedAir, EvaporativeCooler, HybridEvaporativeCooler, // last zone equipment type to use zone availability manager. The above list must not change or - // NumValidSysAvailZoneComponents must also change. + // NumValidSysAvailZoneComponents must also change. AirDistributionUnit, BaseboardConvectiveWater, BaseboardConvectiveElectric, @@ -141,20 +141,20 @@ namespace DataZoneEquipment { CoolingPanel, UnitarySystem, AirTerminalDualDuctConstantVolume, - AirTerminalDualDuctVAV, + AirTerminalDualDuctVAV, AirTerminalSingleDuctConstantVolumeReheat, - AirTerminalSingleDuctConstantVolumeNoReheat, - AirTerminalSingleDuctVAVReheat, - AirTerminalSingleDuctVAVNoReheat, + AirTerminalSingleDuctConstantVolumeNoReheat, + AirTerminalSingleDuctVAVReheat, + AirTerminalSingleDuctVAVNoReheat, AirTerminalSingleDuctSeriesPIUReheat, - AirTerminalSingleDuctParallelPIUReheat, + AirTerminalSingleDuctParallelPIUReheat, AirTerminalSingleDuctCAVFourPipeInduction, AirTerminalSingleDuctVAVReheatVariableSpeedFan, AirTerminalSingleDuctVAVHeatAndCoolReheat, - AirTerminalSingleDuctVAVHeatAndCoolNoReheat, - AirTerminalSingleDuctConstantVolumeCooledBeam, - AirTerminalDualDuctVAVOutdoorAir, - AirLoopHVACReturnAir, + AirTerminalSingleDuctVAVHeatAndCoolNoReheat, + AirTerminalSingleDuctConstantVolumeCooledBeam, + AirTerminalDualDuctVAVOutdoorAir, + AirLoopHVACReturnAir, Num }; diff --git a/src/EnergyPlus/DemandManager.cc b/src/EnergyPlus/DemandManager.cc index c156da52d5b..1014a5bf22e 100644 --- a/src/EnergyPlus/DemandManager.cc +++ b/src/EnergyPlus/DemandManager.cc @@ -426,8 +426,8 @@ void GetDemandManagerListInput(EnergyPlusData &state) thisDemandMgrList.History = 0.0; // Validate Demand Manager Priority - thisDemandMgrList.ManagerPriority = static_cast( - getEnumValue(ManagePriorityNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); + thisDemandMgrList.ManagerPriority = + static_cast(getEnumValue(ManagePriorityNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(6)))); ErrorsFound = ErrorsFound || (thisDemandMgrList.ManagerPriority == ManagePriorityType::Invalid); // Get DEMAND MANAGER Type and Name pairs @@ -676,8 +676,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = - static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -775,8 +774,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = - static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -895,8 +893,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = - static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -1016,8 +1013,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = - static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) @@ -1149,8 +1145,7 @@ void GetDemandManagerInput(EnergyPlusData &state) } // Validate Limiting Control - demandMgr.LimitControl = - static_cast(getEnumValue(ManagerLimitVentNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); + demandMgr.LimitControl = static_cast(getEnumValue(ManagerLimitVentNamesUC, UtilityRoutines::makeUPPER(AlphArray(3)))); ErrorsFound = ErrorsFound || (demandMgr.LimitControl == ManagerLimit::Invalid); if (NumArray(1) == 0.0) diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index 50476f4c848..f2309eadd55 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -77,213 +77,162 @@ namespace EnergyPlus { namespace RoomAir { -// MODULE INFORMATION: -// AUTHOR G. Carrilho da Graca -// DATE WRITTEN February 2004 -// MODIFIED na -// RE-ENGINEERED na - -// PURPOSE OF THIS MODULE: -// Routines that implement the UCSD Displacement Ventilation - -// Using/Aliasing -using namespace DataLoopNode; -using namespace DataEnvironment; -using namespace DataHeatBalance; -using namespace DataHeatBalSurface; -using namespace DataSurfaces; -using Convect::CalcDetailedHcInForDVModel; - -void ManageDispVent3Node(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone -{ - - // SUBROUTINE INFORMATION: + // MODULE INFORMATION: // AUTHOR G. Carrilho da Graca // DATE WRITTEN February 2004 + // MODIFIED na + // RE-ENGINEERED na - // PURPOSE OF THIS SUBROUTINE: - // manage the UCSD Displacement Ventilation model + // PURPOSE OF THIS MODULE: + // Routines that implement the UCSD Displacement Ventilation - // initialize Displacement Ventilation model - InitDispVent3Node(state, ZoneNum); - - // perform Displacement Ventilation model calculations - CalcDispVent3Node(state, ZoneNum); -} + // Using/Aliasing + using namespace DataLoopNode; + using namespace DataEnvironment; + using namespace DataHeatBalance; + using namespace DataHeatBalSurface; + using namespace DataSurfaces; + using Convect::CalcDetailedHcInForDVModel; -//************************************************************************************************** + void ManageDispVent3Node(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone + { -void InitDispVent3Node(EnergyPlusData &state, int const ZoneNum) -{ + // SUBROUTINE INFORMATION: + // AUTHOR G. Carrilho da Graca + // DATE WRITTEN February 2004 - // SUBROUTINE INFORMATION: - // AUTHOR G. Carrilho da Graca - // DATE WRITTEN February 2004 - // MODIFIED - - // RE-ENGINEERED - - - // PURPOSE OF THIS SUBROUTINE: - // Low Energy Cooling by Ventilation initialization subroutine. - // All the data preparation needed to run the LECV models. - // The subroutines sets up arrays with the locations in the main EnergyPlus surface array of - // ceiling, windows, doors and walls. The zone maximum and minimum height is calculated. - - // Do the one time initializations - if (state.dataDispVentMgr->InitUCSDDVMyOneTimeFlag) { - state.dataDispVentMgr->MyEnvrnFlag.dimension(state.dataGlobal->NumOfZones, true); - state.dataDispVentMgr->HeightFloorSubzoneTop = 0.2; - state.dataDispVentMgr->ThickOccupiedSubzoneMin = 0.2; - state.dataDispVentMgr->HeightIntMassDefault = 2.0; - state.dataDispVentMgr->InitUCSDDVMyOneTimeFlag = false; - } + // PURPOSE OF THIS SUBROUTINE: + // manage the UCSD Displacement Ventilation model - // Do the begin environment initializations - if (state.dataGlobal->BeginEnvrnFlag && state.dataDispVentMgr->MyEnvrnFlag(ZoneNum)) { - state.dataDispVentMgr->HAT_MX = 0.0; - state.dataDispVentMgr->HAT_OC = 0.0; - state.dataDispVentMgr->HA_MX = 0.0; - state.dataDispVentMgr->HA_OC = 0.0; - state.dataDispVentMgr->HAT_FLOOR = 0.0; - state.dataDispVentMgr->HA_FLOOR = 0.0; - state.dataDispVentMgr->MyEnvrnFlag(ZoneNum) = false; - } + // initialize Displacement Ventilation model + InitDispVent3Node(state, ZoneNum); - if (!state.dataGlobal->BeginEnvrnFlag) { - state.dataDispVentMgr->MyEnvrnFlag(ZoneNum) = true; + // perform Displacement Ventilation model calculations + CalcDispVent3Node(state, ZoneNum); } - // initialize these module variables every timestep - state.dataDispVentMgr->HeightIntMass = state.dataDispVentMgr->HeightIntMassDefault; -} - -//************************************************************************************************** - -void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight) -{ - - // SUBROUTINE INFORMATION: - // AUTHOR G. Carrilho da Graca - // DATE WRITTEN February 2004 - // MODIFIED - - // RE-ENGINEERED - - - // PURPOSE OF THIS SUBROUTINE: - // Main subroutine for convection calculation in the UCSD Displacement Ventilation model. - // It calls CalcDetailedHcInForDVModel for convection coefficient - // initial calculations and averages the final result comparing the position of the surface with - // the interface subzone height. - - // Using/Aliasing - using namespace DataEnvironment; - using namespace DataHeatBalance; - using ScheduleManager::GetScheduleIndex; - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 HLD; // Convection coefficient for the lower area of surface - Real64 TmedDV; // Average temperature for DV - Real64 Z1; // auxiliary var for lowest height - Real64 Z2; // auxiliary var for highest height - Real64 ZSupSurf; // highest height for this surface - Real64 ZInfSurf; // lowest height for this surface - Real64 HLU; // Convection coefficient for the upper area of surface - Real64 LayH; // Height of the Occupied/Mixed subzone interface - Real64 LayFrac; // Fraction height of the Occupied/Mixed subzone interface - - state.dataDispVentMgr->HAT_MX = 0.0; - state.dataDispVentMgr->HAT_OC = 0.0; - state.dataDispVentMgr->HA_MX = 0.0; - state.dataDispVentMgr->HA_OC = 0.0; - state.dataDispVentMgr->HAT_FLOOR = 0.0; - state.dataDispVentMgr->HA_FLOOR = 0.0; - auto &SurfTempIn(state.dataHeatBalSurf->SurfTempIn); - - // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? - if (state.dataRoomAir->IsZoneDispVent3Node(ZoneNum)) { - LayFrac = FractionHeight; - LayH = FractionHeight * (state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum)); - // WALL Hc, HA and HAT calculation - for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Wall(Ctd); - if (SurfNum == 0) continue; - - auto const &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - Z1 = minval(surf.Vertex, &Vector::z); - Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - ZInfSurf = Z1 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - - // The Wall surface is in the upper subzone - if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); - } - - // The Wall surface is in the lower subzone - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); - } + //************************************************************************************************** + + void InitDispVent3Node(EnergyPlusData &state, int const ZoneNum) + { + + // SUBROUTINE INFORMATION: + // AUTHOR G. Carrilho da Graca + // DATE WRITTEN February 2004 + // MODIFIED - + // RE-ENGINEERED - + + // PURPOSE OF THIS SUBROUTINE: + // Low Energy Cooling by Ventilation initialization subroutine. + // All the data preparation needed to run the LECV models. + // The subroutines sets up arrays with the locations in the main EnergyPlus surface array of + // ceiling, windows, doors and walls. The zone maximum and minimum height is calculated. + + // Do the one time initializations + if (state.dataDispVentMgr->InitUCSDDVMyOneTimeFlag) { + state.dataDispVentMgr->MyEnvrnFlag.dimension(state.dataGlobal->NumOfZones, true); + state.dataDispVentMgr->HeightFloorSubzoneTop = 0.2; + state.dataDispVentMgr->ThickOccupiedSubzoneMin = 0.2; + state.dataDispVentMgr->HeightIntMassDefault = 2.0; + state.dataDispVentMgr->InitUCSDDVMyOneTimeFlag = false; + } - // The Wall surface is partially in upper and partially in lower subzone - if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - HLU = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); - state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; - state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; - state.dataDispVentMgr->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; - } + // Do the begin environment initializations + if (state.dataGlobal->BeginEnvrnFlag && state.dataDispVentMgr->MyEnvrnFlag(ZoneNum)) { + state.dataDispVentMgr->HAT_MX = 0.0; + state.dataDispVentMgr->HAT_OC = 0.0; + state.dataDispVentMgr->HA_MX = 0.0; + state.dataDispVentMgr->HA_OC = 0.0; + state.dataDispVentMgr->HAT_FLOOR = 0.0; + state.dataDispVentMgr->HA_FLOOR = 0.0; + state.dataDispVentMgr->MyEnvrnFlag(ZoneNum) = false; + } - state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HWall(Ctd); + if (!state.dataGlobal->BeginEnvrnFlag) { + state.dataDispVentMgr->MyEnvrnFlag(ZoneNum) = true; + } - } // END WALL + // initialize these module variables every timestep + state.dataDispVentMgr->HeightIntMass = state.dataDispVentMgr->HeightIntMassDefault; + } - // WINDOW Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Window(Ctd); - if (SurfNum == 0) continue; + //************************************************************************************************** + + void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight) + { + + // SUBROUTINE INFORMATION: + // AUTHOR G. Carrilho da Graca + // DATE WRITTEN February 2004 + // MODIFIED - + // RE-ENGINEERED - + + // PURPOSE OF THIS SUBROUTINE: + // Main subroutine for convection calculation in the UCSD Displacement Ventilation model. + // It calls CalcDetailedHcInForDVModel for convection coefficient + // initial calculations and averages the final result comparing the position of the surface with + // the interface subzone height. + + // Using/Aliasing + using namespace DataEnvironment; + using namespace DataHeatBalance; + using ScheduleManager::GetScheduleIndex; + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 HLD; // Convection coefficient for the lower area of surface + Real64 TmedDV; // Average temperature for DV + Real64 Z1; // auxiliary var for lowest height + Real64 Z2; // auxiliary var for highest height + Real64 ZSupSurf; // highest height for this surface + Real64 ZInfSurf; // lowest height for this surface + Real64 HLU; // Convection coefficient for the upper area of surface + Real64 LayH; // Height of the Occupied/Mixed subzone interface + Real64 LayFrac; // Fraction height of the Occupied/Mixed subzone interface - auto const &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall + state.dataDispVentMgr->HAT_MX = 0.0; + state.dataDispVentMgr->HAT_OC = 0.0; + state.dataDispVentMgr->HA_MX = 0.0; + state.dataDispVentMgr->HA_OC = 0.0; + state.dataDispVentMgr->HAT_FLOOR = 0.0; + state.dataDispVentMgr->HA_FLOOR = 0.0; + auto &SurfTempIn(state.dataHeatBalSurf->SurfTempIn); + + // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? + if (state.dataRoomAir->IsZoneDispVent3Node(ZoneNum)) { + LayFrac = FractionHeight; + LayH = FractionHeight * (state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum)); + // WALL Hc, HA and HAT calculation + for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Wall(Ctd); + if (SurfNum == 0) continue; + + auto const &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; Z1 = minval(surf.Vertex, &Vector::z); Z2 = maxval(surf.Vertex, &Vector::z); ZSupSurf = Z2 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); ZInfSurf = Z1 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); } + // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); } + // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); @@ -293,50 +242,135 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - } - if (surf.Tilt <= 10.0) { // Window Ceiling - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); - } + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HWall(Ctd); + + } // END WALL + + // WINDOW Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); + if (SurfNum == 0) continue; + + auto const &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall + Z1 = minval(surf.Vertex, &Vector::z); + Z2 = maxval(surf.Vertex, &Vector::z); + ZSupSurf = Z2 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + + if (ZInfSurf > LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + } - if (surf.Tilt >= 170.0) { // Window Floor - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); - } + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); + } - state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLU = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); + state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; + state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; + state.dataDispVentMgr->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; + } + } - } // END WINDOW + if (surf.Tilt <= 10.0) { // Window Ceiling + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + } - // DOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR - int SurfNum = state.dataRoomAir->APos_Door(Ctd); - if (SurfNum == 0) continue; + if (surf.Tilt >= 170.0) { // Window Floor + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); + } - auto const &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Door Wall - Z1 = minval(surf.Vertex, &Vector::z); - Z2 = maxval(surf.Vertex, &Vector::z); - ZSupSurf = Z2 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - ZInfSurf = Z1 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); + + } // END WINDOW + + // DOOR Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR + int SurfNum = state.dataRoomAir->APos_Door(Ctd); + if (SurfNum == 0) continue; + + auto const &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Door Wall + Z1 = minval(surf.Vertex, &Vector::z); + Z2 = maxval(surf.Vertex, &Vector::z); + ZSupSurf = Z2 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + ZInfSurf = Z1 - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + + if (ZInfSurf > LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); + } - if (ZInfSurf > LayH) { + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); + } + + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLU = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); + state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; + state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; + state.dataDispVentMgr->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; + } + } + + if (surf.Tilt <= 10.0) { // Door Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); @@ -344,7 +378,7 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); } - if (ZSupSurf < LayH) { + if (surf.Tilt >= 170.0) { // Door Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); @@ -352,6 +386,32 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); } + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HDoor(Ctd); + + } // END DOOR + + // INTERNAL Hc, HA and HAT CALCULATION + state.dataDispVentMgr->HeightIntMass = + min(state.dataDispVentMgr->HeightIntMassDefault, + (state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum))); + for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Internal(Ctd); + if (SurfNum == 0) continue; + + auto const &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + ZSupSurf = state.dataDispVentMgr->HeightIntMass; + ZInfSurf = 0.0; + + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); + state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); + state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); + } + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); @@ -361,698 +421,644 @@ void HcDispVent3Node(EnergyPlusData &state, int const ZoneNum, Real64 const Frac HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / (ZSupSurf - ZInfSurf); - state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - } - if (surf.Tilt <= 10.0) { // Door Ceiling - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); - } - - if (surf.Tilt >= 170.0) { // Door Floor - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); - } - - state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HDoor(Ctd); - - } // END DOOR - - // INTERNAL Hc, HA and HAT CALCULATION - state.dataDispVentMgr->HeightIntMass = - min(state.dataDispVentMgr->HeightIntMassDefault, - (state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum))); - for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Internal(Ctd); - if (SurfNum == 0) continue; + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HInternal(Ctd); + } // END INTERNAL - auto const &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - ZSupSurf = state.dataDispVentMgr->HeightIntMass; - ZInfSurf = 0.0; + // CEILING Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); + if (SurfNum == 0) continue; - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_OC += - surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); - state.dataDispVentMgr->HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); - } - - if (ZInfSurf <= LayH && ZSupSurf >= LayH) { + auto const &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - HLU = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); + state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); + } // END CEILING + + // FLOOR Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Floor(Ctd); + if (SurfNum == 0) continue; + + auto const &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - HLD = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); - state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - state.dataDispVentMgr->HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLU; - state.dataDispVentMgr->HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - state.dataDispVentMgr->HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * SurfTempIn(SurfNum) * HLD; - state.dataDispVentMgr->HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; - } - - state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HInternal(Ctd); - } // END INTERNAL - - // CEILING Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); - if (SurfNum == 0) continue; - - auto const &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_MX += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); - state.dataDispVentMgr->HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); - state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); - } // END CEILING - - // FLOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Floor(Ctd); - if (SurfNum == 0) continue; - - auto const &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, SurfTempIn, state.dataRoomAir->DispVent3NodeHcIn); - state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); - state.dataDispVentMgr->HAT_FLOOR += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); - state.dataDispVentMgr->HA_FLOOR += surf.Area * state.dataRoomAir->HFloor(Ctd); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); - state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); - } // END FLOOR + state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->DispVent3NodeHcIn(SurfNum); + state.dataDispVentMgr->HAT_FLOOR += surf.Area * SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); + state.dataDispVentMgr->HA_FLOOR += surf.Area * state.dataRoomAir->HFloor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + state.dataRoomAir->DispVent3NodeHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); + } // END FLOOR + } } -} - -//************************************************************************************************** - -Real64 calculateThirdOrderFloorTemperature(Real64 temperatureHistoryTerm, - Real64 HAT_floor, - Real64 HA_floor, - Real64 MCpT_Total, - Real64 MCp_Total, - Real64 occupiedTemp, - Real64 nonAirSystemResponse, - Real64 zoneMultiplier, - Real64 airCap) -{ - const Real64 elevenOverSix = 11.0 / 6.0; - return (temperatureHistoryTerm + HAT_floor + MCpT_Total + 0.6 * occupiedTemp * MCp_Total + nonAirSystemResponse / zoneMultiplier) / - (elevenOverSix * airCap + HA_floor + 1.6 * MCp_Total); -} - -void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenum -{ - - // SUBROUTINE INFORMATION: - // AUTHOR G. Carrilho da Graca - // DATE WRITTEN February 2004 - // MODIFIED Brent Griffith June 2008 for new interpolation and time history - // RE-ENGINEERED - - - // PURPOSE OF THIS SUBROUTINE: - // Subroutine for displacement ventilation modelling. - // This subroutine calculates the mixed subzone height, surface heat transfer coefficients and - // room air equivalent temperatures and three space temperatures (floor subzone, occupied zone and upper, - // mixed subzone temperature) - - // REFERENCES: - // Model developed by Paul Linden (UCSD), G. Carrilho da Graca (UCSD) and P. Haves (LBL). - // Work funded by the California Energy Comission. More information on the model can found in: - // "Simplified Models for Heat Transfer in Rooms" G. Carrilho da Graca, Ph.D. thesis UCSD. December 2003. - // Using/Aliasing - using namespace DataEnvironment; - using namespace DataHeatBalance; + //************************************************************************************************** + + Real64 calculateThirdOrderFloorTemperature(Real64 temperatureHistoryTerm, + Real64 HAT_floor, + Real64 HA_floor, + Real64 MCpT_Total, + Real64 MCp_Total, + Real64 occupiedTemp, + Real64 nonAirSystemResponse, + Real64 zoneMultiplier, + Real64 airCap) + { + const Real64 elevenOverSix = 11.0 / 6.0; + return (temperatureHistoryTerm + HAT_floor + MCpT_Total + 0.6 * occupiedTemp * MCp_Total + nonAirSystemResponse / zoneMultiplier) / + (elevenOverSix * airCap + HA_floor + 1.6 * MCp_Total); + } - Real64 TimeStepSys = state.dataHVACGlobal->TimeStepSys; - Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; - - using InternalHeatGains::SumInternalConvectionGainsByTypes; - using InternalHeatGains::SumReturnAirConvectionGainsByTypes; - using Psychrometrics::PsyCpAirFnW; - using Psychrometrics::PsyRhoAirFnPbTdbW; - using ScheduleManager::GetCurrentScheduleValue; - using ScheduleManager::GetScheduleIndex; - - // SUBROUTINE PARAMETER DEFINITIONS: - Real64 const OneThird(1.0 / 3.0); - Real64 const MinFlow_pow_fac(std::pow(1.0 / 24.55 * 1.0, 1.0 / 0.6)); - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 HeightFrac; // Fractional height of transition between occupied and mixed subzones - Real64 GainsFrac; // Fraction of lower subzone internal gains that mix as opposed to forming plumes - Real64 ConvGains; // Total convective gains in the room - Real64 ConvGainsOccupiedSubzone; // Total convective gains released in occupied subzone - Real64 ConvGainsMixedSubzone; // Total convective gains released in mixed subzone - Real64 MCp_Total; // Total capacity rate into the zone - assumed to enter at low level - Real64 ZTAveraged; - Real64 TempDiffCritRep; // Minimum temperature difference between mixed and occupied subzones for reporting - bool MIXFLAG; - int Ctd; - Real64 MinFlow; - Real64 NumPLPP; // Number of plumes per person - Real64 MTGAUX; - int ZoneEquipConfigNum; - Real64 PowerInPlumes; - Real64 SumSysMCp; - Real64 SumSysMCpT; - Real64 NodeTemp; - Real64 MassFlowRate; - Real64 CpAir; - Real64 MCpT_Total; - Real64 NumberOfPlumes; - Real64 SumMCp; - Real64 SumMCpT; - Real64 TempHistTerm; - Real64 PowerPerPlume; - Real64 HeightMixedSubzoneAve; // Height of center of mixed air subzone - Real64 HeightOccupiedSubzoneAve; // Height of center of occupied air subzone - Real64 HeightFloorSubzoneAve; // Height of center of floor air subzone - Real64 HeightThermostat; // Height of center of thermostat/temperature control sensor - Real64 HeightComfort; // Height at which air temperature value is used to calculate comfort - Real64 CeilingHeight; - Real64 ZoneMult; // total zone multiplier - int FlagApertures; - - auto &TempDepCoef = state.dataDispVentMgr->TempDepCoef; - auto &TempIndCoef = state.dataDispVentMgr->TempIndCoef; - - Real64 RetAirGain; - assert(state.dataRoomAir->AirModel.allocated()); - - // Exact solution or Euler method - if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { - if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { - if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { - state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZoneM2Floor(ZoneNum); - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); + void CalcDispVent3Node(EnergyPlusData &state, int const ZoneNum) // Which Zonenum + { + + // SUBROUTINE INFORMATION: + // AUTHOR G. Carrilho da Graca + // DATE WRITTEN February 2004 + // MODIFIED Brent Griffith June 2008 for new interpolation and time history + // RE-ENGINEERED - + + // PURPOSE OF THIS SUBROUTINE: + // Subroutine for displacement ventilation modelling. + // This subroutine calculates the mixed subzone height, surface heat transfer coefficients and + // room air equivalent temperatures and three space temperatures (floor subzone, occupied zone and upper, + // mixed subzone temperature) + + // REFERENCES: + // Model developed by Paul Linden (UCSD), G. Carrilho da Graca (UCSD) and P. Haves (LBL). + // Work funded by the California Energy Comission. More information on the model can found in: + // "Simplified Models for Heat Transfer in Rooms" G. Carrilho da Graca, Ph.D. thesis UCSD. December 2003. + + // Using/Aliasing + using namespace DataEnvironment; + using namespace DataHeatBalance; + + Real64 TimeStepSys = state.dataHVACGlobal->TimeStepSys; + Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; + + using InternalHeatGains::SumInternalConvectionGainsByTypes; + using InternalHeatGains::SumReturnAirConvectionGainsByTypes; + using Psychrometrics::PsyCpAirFnW; + using Psychrometrics::PsyRhoAirFnPbTdbW; + using ScheduleManager::GetCurrentScheduleValue; + using ScheduleManager::GetScheduleIndex; + + // SUBROUTINE PARAMETER DEFINITIONS: + Real64 const OneThird(1.0 / 3.0); + Real64 const MinFlow_pow_fac(std::pow(1.0 / 24.55 * 1.0, 1.0 / 0.6)); + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 HeightFrac; // Fractional height of transition between occupied and mixed subzones + Real64 GainsFrac; // Fraction of lower subzone internal gains that mix as opposed to forming plumes + Real64 ConvGains; // Total convective gains in the room + Real64 ConvGainsOccupiedSubzone; // Total convective gains released in occupied subzone + Real64 ConvGainsMixedSubzone; // Total convective gains released in mixed subzone + Real64 MCp_Total; // Total capacity rate into the zone - assumed to enter at low level + Real64 ZTAveraged; + Real64 TempDiffCritRep; // Minimum temperature difference between mixed and occupied subzones for reporting + bool MIXFLAG; + int Ctd; + Real64 MinFlow; + Real64 NumPLPP; // Number of plumes per person + Real64 MTGAUX; + int ZoneEquipConfigNum; + Real64 PowerInPlumes; + Real64 SumSysMCp; + Real64 SumSysMCpT; + Real64 NodeTemp; + Real64 MassFlowRate; + Real64 CpAir; + Real64 MCpT_Total; + Real64 NumberOfPlumes; + Real64 SumMCp; + Real64 SumMCpT; + Real64 TempHistTerm; + Real64 PowerPerPlume; + Real64 HeightMixedSubzoneAve; // Height of center of mixed air subzone + Real64 HeightOccupiedSubzoneAve; // Height of center of occupied air subzone + Real64 HeightFloorSubzoneAve; // Height of center of floor air subzone + Real64 HeightThermostat; // Height of center of thermostat/temperature control sensor + Real64 HeightComfort; // Height at which air temperature value is used to calculate comfort + Real64 CeilingHeight; + Real64 ZoneMult; // total zone multiplier + int FlagApertures; + + auto &TempDepCoef = state.dataDispVentMgr->TempDepCoef; + auto &TempIndCoef = state.dataDispVentMgr->TempIndCoef; + + Real64 RetAirGain; + assert(state.dataRoomAir->AirModel.allocated()); + + // Exact solution or Euler method + if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { + if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { + if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { + state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZoneM2Floor(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); + } else { + state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZoneMXFloor(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); + } } else { - state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZoneMXFloor(ZoneNum); - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); + state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } - } else { - state.dataRoomAir->Zone1Floor(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } - } - auto &zone = state.dataHeatBal->Zone(ZoneNum); - - MIXFLAG = false; - FlagApertures = 1; - state.dataRoomAir->DispVent3NodeHcIn = state.dataHeatBalSurf->SurfHConvInt; - CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - ZoneMult = zone.Multiplier * zone.ListMultiplier; - auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - - for (int Ctd = 1; Ctd <= state.dataRoomAir->TotDispVent3Node; ++Ctd) { - auto &zoneDV3N = state.dataRoomAir->ZoneDispVent3Node(Ctd); - if (ZoneNum == zoneDV3N.ZonePtr) { - GainsFrac = GetCurrentScheduleValue(state, zoneDV3N.SchedGainsPtr); - NumPLPP = zoneDV3N.NumPlumesPerOcc; - HeightThermostat = zoneDV3N.ThermostatHeight; - HeightComfort = zoneDV3N.ComfortHeight; - TempDiffCritRep = zoneDV3N.TempTrigger; + auto &zone = state.dataHeatBal->Zone(ZoneNum); + + MIXFLAG = false; + FlagApertures = 1; + state.dataRoomAir->DispVent3NodeHcIn = state.dataHeatBalSurf->SurfHConvInt; + CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + ZoneMult = zone.Multiplier * zone.ListMultiplier; + auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); + + for (int Ctd = 1; Ctd <= state.dataRoomAir->TotDispVent3Node; ++Ctd) { + auto &zoneDV3N = state.dataRoomAir->ZoneDispVent3Node(Ctd); + if (ZoneNum == zoneDV3N.ZonePtr) { + GainsFrac = GetCurrentScheduleValue(state, zoneDV3N.SchedGainsPtr); + NumPLPP = zoneDV3N.NumPlumesPerOcc; + HeightThermostat = zoneDV3N.ThermostatHeight; + HeightComfort = zoneDV3N.ComfortHeight; + TempDiffCritRep = zoneDV3N.TempTrigger; + } } - } - ConvGainsOccupiedSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); + ConvGainsOccupiedSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); - ConvGainsOccupiedSubzone += 0.5 * thisZoneHB.SysDepZoneLoadsLagged; + ConvGainsOccupiedSubzone += 0.5 * thisZoneHB.SysDepZoneLoadsLagged; - // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very - // low or zero) - if (zone.NoHeatToReturnAir) { - RetAirGain = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); - ConvGainsOccupiedSubzone += RetAirGain; - } - - ConvGainsMixedSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesMixedSubzone); - ConvGainsMixedSubzone += - state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum) + state.dataHeatBalFanSys->SumConvPool(ZoneNum) + 0.5 * thisZoneHB.SysDepZoneLoadsLagged; - if (zone.NoHeatToReturnAir) { - RetAirGain = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesMixedSubzone); - ConvGainsMixedSubzone += RetAirGain; - } + // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very + // low or zero) + if (zone.NoHeatToReturnAir) { + RetAirGain = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); + ConvGainsOccupiedSubzone += RetAirGain; + } - ConvGains = ConvGainsOccupiedSubzone + ConvGainsMixedSubzone; - - //=================== Entering air system temperature and flow==================== - SumSysMCp = 0.0; - SumSysMCpT = 0.0; - // Check to make sure if this is a controlled zone and determine ZoneEquipConfigNum - ZoneEquipConfigNum = ZoneNum; - if (state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).IsControlled) { - for (int NodeNum = 1; NodeNum <= state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { - NodeTemp = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; - MassFlowRate = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); - SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + ConvGainsMixedSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesMixedSubzone); + ConvGainsMixedSubzone += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum) + state.dataHeatBalFanSys->SumConvPool(ZoneNum) + + 0.5 * thisZoneHB.SysDepZoneLoadsLagged; + if (zone.NoHeatToReturnAir) { + RetAirGain = SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesMixedSubzone); + ConvGainsMixedSubzone += RetAirGain; } - } - SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MCPE + thisZoneHB.MCPC + thisZoneHB.MDotCPOA; - SumMCpT = - thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MCPTE + thisZoneHB.MCPTC + thisZoneHB.MDotCPOA * zone.OutDryBulbTemp; - if (state.afn->simulation_control.type == AirflowNetwork::ControlType::MultizoneWithoutDistribution) { - SumMCp = state.afn->exchangeData(ZoneNum).SumMCp + state.afn->exchangeData(ZoneNum).SumMVCp + state.afn->exchangeData(ZoneNum).SumMMCp; - SumMCpT = state.afn->exchangeData(ZoneNum).SumMCpT + state.afn->exchangeData(ZoneNum).SumMVCpT + state.afn->exchangeData(ZoneNum).SumMMCpT; - } + ConvGains = ConvGainsOccupiedSubzone + ConvGainsMixedSubzone; + + //=================== Entering air system temperature and flow==================== + SumSysMCp = 0.0; + SumSysMCpT = 0.0; + // Check to make sure if this is a controlled zone and determine ZoneEquipConfigNum + ZoneEquipConfigNum = ZoneNum; + if (state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).IsControlled) { + for (int NodeNum = 1; NodeNum <= state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { + NodeTemp = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; + MassFlowRate = state.dataLoopNodes->Node(state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; + CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); + SumSysMCp += MassFlowRate * CpAir; + SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + } + } - MCp_Total = SumMCp + SumSysMCp; - MCpT_Total = SumMCpT + SumSysMCpT; + SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MCPE + thisZoneHB.MCPC + thisZoneHB.MDotCPOA; + SumMCpT = + thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MCPTE + thisZoneHB.MCPTC + thisZoneHB.MDotCPOA * zone.OutDryBulbTemp; + if (state.afn->simulation_control.type == AirflowNetwork::ControlType::MultizoneWithoutDistribution) { + SumMCp = state.afn->exchangeData(ZoneNum).SumMCp + state.afn->exchangeData(ZoneNum).SumMVCp + state.afn->exchangeData(ZoneNum).SumMMCp; + SumMCpT = + state.afn->exchangeData(ZoneNum).SumMCpT + state.afn->exchangeData(ZoneNum).SumMVCpT + state.afn->exchangeData(ZoneNum).SumMMCpT; + } - if (state.dataHeatBal->TotPeople > 0) { - int NumberOfOccupants = 0; - NumberOfPlumes = 0.0; - for (Ctd = 1; Ctd <= state.dataHeatBal->TotPeople; ++Ctd) { - if (state.dataHeatBal->People(Ctd).ZonePtr == ZoneNum) { - NumberOfOccupants += state.dataHeatBal->People(Ctd).NumberOfPeople; // *GetCurrentScheduleValue(state, People(Ctd)%NumberOfPeoplePtr) - NumberOfPlumes = NumberOfOccupants * NumPLPP; + MCp_Total = SumMCp + SumSysMCp; + MCpT_Total = SumMCpT + SumSysMCpT; + + if (state.dataHeatBal->TotPeople > 0) { + int NumberOfOccupants = 0; + NumberOfPlumes = 0.0; + for (Ctd = 1; Ctd <= state.dataHeatBal->TotPeople; ++Ctd) { + if (state.dataHeatBal->People(Ctd).ZonePtr == ZoneNum) { + NumberOfOccupants += + state.dataHeatBal->People(Ctd).NumberOfPeople; // *GetCurrentScheduleValue(state, People(Ctd)%NumberOfPeoplePtr) + NumberOfPlumes = NumberOfOccupants * NumPLPP; + } } - } - if (NumberOfPlumes == 0.0) { + if (NumberOfPlumes == 0.0) { + NumberOfPlumes = 1.0; + } + PowerInPlumes = (1.0 - GainsFrac) * ConvGainsOccupiedSubzone; + PowerPerPlume = PowerInPlumes / NumberOfPlumes; + } else { NumberOfPlumes = 1.0; + PowerInPlumes = (1.0 - GainsFrac) * ConvGainsOccupiedSubzone; + PowerPerPlume = PowerInPlumes / NumberOfPlumes; } - PowerInPlumes = (1.0 - GainsFrac) * ConvGainsOccupiedSubzone; - PowerPerPlume = PowerInPlumes / NumberOfPlumes; - } else { - NumberOfPlumes = 1.0; - PowerInPlumes = (1.0 - GainsFrac) * ConvGainsOccupiedSubzone; - PowerPerPlume = PowerInPlumes / NumberOfPlumes; - } - // When AirflowNetwork is used verify if bottom apertures are inflowing and upper apertures are - // outflowing. The lower apertures have to be located below 0.8m and the upper apertures - // have to be located above 1.8m. - - if (state.afn->NumOfLinksMultiZone > 0) { - for (int Loop = 1; Loop <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Loop) { - // direct AirflowNetwork surface - int afnSurfNum = state.dataRoomAir->AFNSurfaceCrossVent(Loop, ZoneNum); - auto const &surfParams = state.dataRoomAir->SurfParametersCrossDispVent(afnSurfNum); - auto const &afnLinkSimu = state.afn->AirflowNetworkLinkSimu(afnSurfNum); - auto const &afnMzSurfData = state.afn->MultizoneSurfaceData(afnSurfNum); - auto const &afnMzSurf = state.dataSurface->Surface(afnMzSurfData.SurfNum); - if (afnMzSurf.Zone == ZoneNum) { - - if ((surfParams.Zmax < 0.8 && afnLinkSimu.VolFLOW > 0)) { - FlagApertures = 0; - break; - } - if (surfParams.Zmin > 1.8 && afnLinkSimu.VolFLOW2 > 0) { - FlagApertures = 0; - break; + // When AirflowNetwork is used verify if bottom apertures are inflowing and upper apertures are + // outflowing. The lower apertures have to be located below 0.8m and the upper apertures + // have to be located above 1.8m. + + if (state.afn->NumOfLinksMultiZone > 0) { + for (int Loop = 1; Loop <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Loop) { + // direct AirflowNetwork surface + int afnSurfNum = state.dataRoomAir->AFNSurfaceCrossVent(Loop, ZoneNum); + auto const &surfParams = state.dataRoomAir->SurfParametersCrossDispVent(afnSurfNum); + auto const &afnLinkSimu = state.afn->AirflowNetworkLinkSimu(afnSurfNum); + auto const &afnMzSurfData = state.afn->MultizoneSurfaceData(afnSurfNum); + auto const &afnMzSurf = state.dataSurface->Surface(afnMzSurfData.SurfNum); + if (afnMzSurf.Zone == ZoneNum) { + + if ((surfParams.Zmax < 0.8 && afnLinkSimu.VolFLOW > 0)) { + FlagApertures = 0; + break; + } + if (surfParams.Zmin > 1.8 && afnLinkSimu.VolFLOW2 > 0) { + FlagApertures = 0; + break; + } + + if ((surfParams.Zmin > 0.8 && surfParams.Zmin < 1.8) || (surfParams.Zmax > 0.8 && surfParams.Zmax < 1.8)) { + FlagApertures = 0; + break; + } + // indirect AirflowNetwork surface; this is an interzone surface + } else { + auto const &afnZone = state.dataHeatBal->Zone(afnMzSurf.Zone); + if (surfParams.Zmax + afnZone.OriginZ - zone.OriginZ < 0.8 && afnLinkSimu.VolFLOW2 > 0) { + FlagApertures = 0; + break; + } + if (surfParams.Zmin + afnZone.OriginZ - zone.OriginZ > 1.8 && afnLinkSimu.VolFLOW > 0) { + FlagApertures = 0; + break; + } + if ((surfParams.Zmin + afnZone.OriginZ - zone.OriginZ > 0.8 && surfParams.Zmin + afnZone.OriginZ - zone.OriginZ < 1.8) || + (surfParams.Zmax + afnZone.OriginZ - zone.OriginZ > 0.8 && surfParams.Zmax + afnZone.OriginZ - zone.OriginZ < 1.8)) { + FlagApertures = 0; + break; + } } + } + } - if ((surfParams.Zmin > 0.8 && surfParams.Zmin < 1.8) || (surfParams.Zmax > 0.8 && surfParams.Zmax < 1.8)) { - FlagApertures = 0; - break; + if ((PowerInPlumes == 0.0) || (MCpT_Total == 0.0) || FlagApertures == 0) { + // The system will mix + HeightFrac = 0.0; + } else { + Real64 const plume_fac(NumberOfPlumes * std::pow(PowerPerPlume, OneThird)); + HeightFrac = min(24.55 * std::pow(MCp_Total * 0.000833 / plume_fac, 0.6) / CeilingHeight, 1.0); + for (Ctd = 1; Ctd <= 4; ++Ctd) { + HcDispVent3Node(state, ZoneNum, HeightFrac); + // HeightFrac = min( 24.55 * std::pow( MCp_Total * 0.000833 / ( NumberOfPlumes * std::pow( PowerPerPlume, OneThird ) ), 0.6 ) / + // CeilingHeight, 1.0 ); //Tuned This does not vary in loop EPTeam-replaces above (cause diffs) HeightFrac = + // MIN(24.55d0*(MCp_Total*0.000833d0/(NumberOfPlumes*PowerPerPlume**(1.0d0/3.d0)))**0.6 / CeilingHeight , 1.0d0) + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + state.dataRoomAir->AIRRATFloor(ZoneNum) = + zone.Volume * min(state.dataRoomAir->HeightTransition(ZoneNum), state.dataDispVentMgr->HeightFloorSubzoneTop) / CeilingHeight * + zone.ZoneVolCapMultpSens * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATFloor(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; + state.dataRoomAir->AIRRATOC(ZoneNum) = + zone.Volume * (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / + CeilingHeight * zone.ZoneVolCapMultpSens * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; + state.dataRoomAir->AIRRATMX(ZoneNum) = + zone.Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * zone.ZoneVolCapMultpSens * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; + + if (state.dataHVACGlobal->UseZoneTimeStepHistory) { + state.dataRoomAir->ZTMFloor(ZoneNum)[2] = state.dataRoomAir->XMATFloor(ZoneNum)[2]; + state.dataRoomAir->ZTMFloor(ZoneNum)[1] = state.dataRoomAir->XMATFloor(ZoneNum)[1]; + state.dataRoomAir->ZTMFloor(ZoneNum)[0] = state.dataRoomAir->XMATFloor(ZoneNum)[0]; + + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; + + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; + + } else { + state.dataRoomAir->ZTMFloor(ZoneNum)[2] = state.dataRoomAir->DSXMATFloor(ZoneNum)[2]; + state.dataRoomAir->ZTMFloor(ZoneNum)[1] = state.dataRoomAir->DSXMATFloor(ZoneNum)[1]; + state.dataRoomAir->ZTMFloor(ZoneNum)[0] = state.dataRoomAir->DSXMATFloor(ZoneNum)[0]; + + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; + + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; } - // indirect AirflowNetwork surface; this is an interzone surface - } else { - auto const &afnZone = state.dataHeatBal->Zone(afnMzSurf.Zone); - if (surfParams.Zmax + afnZone.OriginZ - zone.OriginZ < 0.8 && afnLinkSimu.VolFLOW2 > 0) { - FlagApertures = 0; + + Real64 AirCap = state.dataRoomAir->AIRRATFloor(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMFloor(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMFloor(ZoneNum)[1] + + OneThird * state.dataRoomAir->ZTMFloor(ZoneNum)[2]); + TempDepCoef = state.dataDispVentMgr->HA_FLOOR + MCp_Total; + TempIndCoef = state.dataDispVentMgr->HAT_FLOOR + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + state.dataRoomAir->ZTFloor(ZoneNum) = calculateThirdOrderFloorTemperature(TempHistTerm, + state.dataDispVentMgr->HAT_FLOOR, + state.dataDispVentMgr->HA_FLOOR, + MCpT_Total, + MCp_Total, + state.dataRoomAir->ZTOC(ZoneNum), + thisZoneHB.NonAirSystemResponse, + ZoneMult, + AirCap); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->Zone1Floor(ZoneNum) + TempIndCoef / AirCap; + } else { + state.dataRoomAir->ZTFloor(ZoneNum) = + (state.dataRoomAir->Zone1Floor(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + state.dataRoomAir->ZTFloor(ZoneNum) = (AirCap * state.dataRoomAir->Zone1Floor(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: break; } - if (surfParams.Zmin + afnZone.OriginZ - zone.OriginZ > 1.8 && afnLinkSimu.VolFLOW > 0) { - FlagApertures = 0; + AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + + OneThird * state.dataRoomAir->ZTMOC(ZoneNum)[2]); + TempDepCoef = state.dataDispVentMgr->HA_OC + MCp_Total; + TempIndCoef = ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + state.dataRoomAir->ZTFloor(ZoneNum) * MCp_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + + 1.6 * state.dataRoomAir->ZTFloor(ZoneNum) * MCp_Total) / + ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_OC + 1.6 * MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; + } else { + if (AirCap == 0.0) { + state.dataRoomAir->ZTOC(ZoneNum) = TempIndCoef / TempDepCoef; + } else { + state.dataRoomAir->ZTOC(ZoneNum) = + (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + TempIndCoef / TempDepCoef; + } + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: break; } - if ((surfParams.Zmin + afnZone.OriginZ - zone.OriginZ > 0.8 && surfParams.Zmin + afnZone.OriginZ - zone.OriginZ < 1.8) || - (surfParams.Zmax + afnZone.OriginZ - zone.OriginZ > 0.8 && surfParams.Zmax + afnZone.OriginZ - zone.OriginZ < 1.8)) { - FlagApertures = 0; + AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + + OneThird * state.dataRoomAir->ZTMMX(ZoneNum)[2]); + TempDepCoef = state.dataDispVentMgr->HA_MX + MCp_Total; + TempIndCoef = ConvGainsOccupiedSubzone * (1.0 - GainsFrac) + ConvGainsMixedSubzone + state.dataDispVentMgr->HAT_MX + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + state.dataRoomAir->ZTMX(ZoneNum) = (TempHistTerm + ConvGainsOccupiedSubzone * (1.0 - GainsFrac) + ConvGainsMixedSubzone + + state.dataDispVentMgr->HAT_MX + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / + ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_MX + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; + } else { + if (AirCap == 0.0) { + state.dataRoomAir->ZTMX(ZoneNum) = TempIndCoef / TempDepCoef; + } else { + state.dataRoomAir->ZTMX(ZoneNum) = + (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + TempIndCoef / TempDepCoef; + } + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: break; } } - } - } - - if ((PowerInPlumes == 0.0) || (MCpT_Total == 0.0) || FlagApertures == 0) { - // The system will mix - HeightFrac = 0.0; - } else { - Real64 const plume_fac(NumberOfPlumes * std::pow(PowerPerPlume, OneThird)); - HeightFrac = min(24.55 * std::pow(MCp_Total * 0.000833 / plume_fac, 0.6) / CeilingHeight, 1.0); - for (Ctd = 1; Ctd <= 4; ++Ctd) { - HcDispVent3Node(state, ZoneNum, HeightFrac); - // HeightFrac = min( 24.55 * std::pow( MCp_Total * 0.000833 / ( NumberOfPlumes * std::pow( PowerPerPlume, OneThird ) ), 0.6 ) / - // CeilingHeight, 1.0 ); //Tuned This does not vary in loop EPTeam-replaces above (cause diffs) HeightFrac = - // MIN(24.55d0*(MCp_Total*0.000833d0/(NumberOfPlumes*PowerPerPlume**(1.0d0/3.d0)))**0.6 / CeilingHeight , 1.0d0) - state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - state.dataRoomAir->AIRRATFloor(ZoneNum) = - zone.Volume * min(state.dataRoomAir->HeightTransition(ZoneNum), state.dataDispVentMgr->HeightFloorSubzoneTop) / CeilingHeight * - zone.ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATFloor(ZoneNum), thisZoneHB.ZoneAirHumRat) * - PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - state.dataRoomAir->AIRRATOC(ZoneNum) = - zone.Volume * (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / - CeilingHeight * zone.ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * - PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - state.dataRoomAir->AIRRATMX(ZoneNum) = - zone.Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * zone.ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * - PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - - if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAir->ZTMFloor(ZoneNum)[2] = state.dataRoomAir->XMATFloor(ZoneNum)[2]; - state.dataRoomAir->ZTMFloor(ZoneNum)[1] = state.dataRoomAir->XMATFloor(ZoneNum)[1]; - state.dataRoomAir->ZTMFloor(ZoneNum)[0] = state.dataRoomAir->XMATFloor(ZoneNum)[0]; - - state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; - state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; - state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; - - state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; - state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; - state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; + // MinFlow for interface layer at z = 1.0 + MinFlow = MinFlow_pow_fac * plume_fac; + // EPTeam above replaces (cause diffs?) MinFlow = (1.0d0/24.55d0*1.0d0)**(1.0d0/0.6d0)*NumberOfPlumes*PowerPerPlume**(1.0/3.0) + if (MinFlow != 0.0) { + state.dataRoomAir->FracMinFlow(ZoneNum) = MCp_Total * 0.000833 / MinFlow; } else { - state.dataRoomAir->ZTMFloor(ZoneNum)[2] = state.dataRoomAir->DSXMATFloor(ZoneNum)[2]; - state.dataRoomAir->ZTMFloor(ZoneNum)[1] = state.dataRoomAir->DSXMATFloor(ZoneNum)[1]; - state.dataRoomAir->ZTMFloor(ZoneNum)[0] = state.dataRoomAir->DSXMATFloor(ZoneNum)[0]; - - state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; - state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; - state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; - - state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; - state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; - state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; + state.dataRoomAir->FracMinFlow(ZoneNum) = 9.999; } + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + } - Real64 AirCap = state.dataRoomAir->AIRRATFloor(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMFloor(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMFloor(ZoneNum)[1] + - OneThird * state.dataRoomAir->ZTMFloor(ZoneNum)[2]); - TempDepCoef = state.dataDispVentMgr->HA_FLOOR + MCp_Total; - TempIndCoef = state.dataDispVentMgr->HAT_FLOOR + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAir->ZTFloor(ZoneNum) = calculateThirdOrderFloorTemperature(TempHistTerm, - state.dataDispVentMgr->HAT_FLOOR, - state.dataDispVentMgr->HA_FLOOR, - MCpT_Total, - MCp_Total, - state.dataRoomAir->ZTOC(ZoneNum), - thisZoneHB.NonAirSystemResponse, - ZoneMult, - AirCap); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->Zone1Floor(ZoneNum) + TempIndCoef / AirCap; - } else { - state.dataRoomAir->ZTFloor(ZoneNum) = - (state.dataRoomAir->Zone1Floor(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + - TempIndCoef / TempDepCoef; - } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAir->ZTFloor(ZoneNum) = (AirCap * state.dataRoomAir->Zone1Floor(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; - } - AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + - OneThird * state.dataRoomAir->ZTMOC(ZoneNum)[2]); - TempDepCoef = state.dataDispVentMgr->HA_OC + MCp_Total; - TempIndCoef = ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + state.dataRoomAir->ZTFloor(ZoneNum) * MCp_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + ConvGainsOccupiedSubzone * GainsFrac + state.dataDispVentMgr->HAT_OC + - 1.6 * state.dataRoomAir->ZTFloor(ZoneNum) * MCp_Total) / - ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_OC + 1.6 * MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; - } else { - if (AirCap == 0.0) { - state.dataRoomAir->ZTOC(ZoneNum) = TempIndCoef / TempDepCoef; + //=============================== M I X E D Calculation ============================================== + if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || + HeightFrac * CeilingHeight < (state.dataDispVentMgr->HeightFloorSubzoneTop + state.dataDispVentMgr->ThickOccupiedSubzoneMin)) { + MIXFLAG = true; + HeightFrac = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + Real64 const thisZoneT1 = thisZoneHB.ZoneT1; + Real64 AirCap = thisZoneHB.AirPowerCap; + TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + OneThird * thisZoneHB.ZTM[2]); + + for (Ctd = 1; Ctd <= 3; ++Ctd) { + TempDepCoef = state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + state.dataDispVentMgr->HA_FLOOR + MCp_Total; + TempIndCoef = + ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + state.dataDispVentMgr->HAT_FLOOR + MCpT_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + ZTAveraged = (TempHistTerm + ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + + state.dataDispVentMgr->HAT_FLOOR + MCpT_Total) / + ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + + state.dataDispVentMgr->HA_FLOOR + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; } else { - state.dataRoomAir->ZTOC(ZoneNum) = - (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + - TempIndCoef / TempDepCoef; + ZTAveraged = + (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; - } - AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + - OneThird * state.dataRoomAir->ZTMMX(ZoneNum)[2]); - TempDepCoef = state.dataDispVentMgr->HA_MX + MCp_Total; - TempIndCoef = ConvGainsOccupiedSubzone * (1.0 - GainsFrac) + ConvGainsMixedSubzone + state.dataDispVentMgr->HAT_MX + - state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAir->ZTMX(ZoneNum) = (TempHistTerm + ConvGainsOccupiedSubzone * (1.0 - GainsFrac) + ConvGainsMixedSubzone + - state.dataDispVentMgr->HAT_MX + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / - ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_MX + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; - } else { - if (AirCap == 0.0) { - state.dataRoomAir->ZTMX(ZoneNum) = TempIndCoef / TempDepCoef; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; + HcDispVent3Node(state, ZoneNum, HeightFrac); + TempDepCoef = state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + state.dataDispVentMgr->HA_FLOOR + MCp_Total; + TempIndCoef = + ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + state.dataDispVentMgr->HAT_FLOOR + MCpT_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + ZTAveraged = (TempHistTerm + ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + + state.dataDispVentMgr->HAT_FLOOR + MCpT_Total) / + ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + + state.dataDispVentMgr->HA_FLOOR + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; } else { - state.dataRoomAir->ZTMX(ZoneNum) = - (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + - TempIndCoef / TempDepCoef; + ZTAveraged = + (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; } } + //========================================================================================= + + // Comfort temperature and temperature at the thermostat/temperature control sensor + + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + HeightMixedSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + HeightOccupiedSubzoneAve = (state.dataDispVentMgr->HeightFloorSubzoneTop + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + HeightFloorSubzoneAve = state.dataDispVentMgr->HeightFloorSubzoneTop / 2.0; + + // Comfort temperature - // MinFlow for interface layer at z = 1.0 - MinFlow = MinFlow_pow_fac * plume_fac; - // EPTeam above replaces (cause diffs?) MinFlow = (1.0d0/24.55d0*1.0d0)**(1.0d0/0.6d0)*NumberOfPlumes*PowerPerPlume**(1.0/3.0) - if (MinFlow != 0.0) { - state.dataRoomAir->FracMinFlow(ZoneNum) = MCp_Total * 0.000833 / MinFlow; + if (MIXFLAG) { + state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; } else { - state.dataRoomAir->FracMinFlow(ZoneNum) = 9.999; + if (HeightComfort >= 0.0 && HeightComfort < HeightFloorSubzoneAve) { + ShowWarningError(state, format("Displacement ventilation comfort height is in floor subzone in Zone: {}", zone.Name)); + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); + } else if (HeightComfort >= HeightFloorSubzoneAve && HeightComfort < HeightOccupiedSubzoneAve) { + state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightComfort) + + state.dataRoomAir->ZTOC(ZoneNum) * (HeightComfort - HeightFloorSubzoneAve)) / + (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); + //! TCMF(ZoneNum) = (ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightComfort) & + //! + ZTMX(ZoneNum) * (HeightComfort - HeightFloorSubzoneAve)) & + //! / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) + } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightMixedSubzoneAve) { + state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightMixedSubzoneAve - HeightComfort) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / + (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); + } else if (HeightComfort >= HeightMixedSubzoneAve && HeightComfort <= CeilingHeight) { + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + } else { + ShowFatalError(state, format("Displacement ventilation comfort height is above ceiling or below floor in Zone: {}", zone.Name)); + } } - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; - } - //=============================== M I X E D Calculation ============================================== - if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || - HeightFrac * CeilingHeight < (state.dataDispVentMgr->HeightFloorSubzoneTop + state.dataDispVentMgr->ThickOccupiedSubzoneMin)) { - MIXFLAG = true; - HeightFrac = 0.0; - state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; - state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; - Real64 const thisZoneT1 = thisZoneHB.ZoneT1; - Real64 AirCap = thisZoneHB.AirPowerCap; - TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + OneThird * thisZoneHB.ZTM[2]); - - for (Ctd = 1; Ctd <= 3; ++Ctd) { - TempDepCoef = state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + state.dataDispVentMgr->HA_FLOOR + MCp_Total; - TempIndCoef = ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + state.dataDispVentMgr->HAT_FLOOR + MCpT_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + - state.dataDispVentMgr->HAT_FLOOR + MCpT_Total) / - ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + state.dataDispVentMgr->HA_FLOOR + - MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; - } else { - ZTAveraged = (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; - } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; - } - state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; - HcDispVent3Node(state, ZoneNum, HeightFrac); - TempDepCoef = state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + state.dataDispVentMgr->HA_FLOOR + MCp_Total; - TempIndCoef = ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + state.dataDispVentMgr->HAT_FLOOR + MCpT_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + state.dataDispVentMgr->HAT_MX + state.dataDispVentMgr->HAT_OC + - state.dataDispVentMgr->HAT_FLOOR + MCpT_Total) / - ((11.0 / 6.0) * AirCap + state.dataDispVentMgr->HA_MX + state.dataDispVentMgr->HA_OC + state.dataDispVentMgr->HA_FLOOR + - MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; - } else { - ZTAveraged = (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; - } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; + // Temperature at the thermostat/temperature control sensor + + if (MIXFLAG) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = ZTAveraged; + } else { + if (HeightThermostat >= 0.0 && HeightThermostat < HeightFloorSubzoneAve) { + ShowWarningError(state, format("Displacement thermostat is in floor subzone in Zone: {}", zone.Name)); + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); + } else if (HeightThermostat >= HeightFloorSubzoneAve && HeightThermostat < HeightOccupiedSubzoneAve) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = + (state.dataRoomAir->ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightThermostat) + + state.dataRoomAir->ZTOC(ZoneNum) * (HeightThermostat - HeightFloorSubzoneAve)) / + (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); + //! TempTstatAir(ZoneNum) = (ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightThermostat) & + //! + ZTMX(ZoneNum) * (HeightThermostat - HeightFloorSubzoneAve)) & + //! / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) + } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightMixedSubzoneAve) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightMixedSubzoneAve - HeightThermostat) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / + (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); + } else if (HeightThermostat >= HeightMixedSubzoneAve && HeightThermostat <= CeilingHeight) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + } else { + ShowFatalError(state, format("Displacement ventilation thermostat height is above ceiling or below floor in Zone: {}", zone.Name)); } - state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; } - } - //========================================================================================= - - // Comfort temperature and temperature at the thermostat/temperature control sensor - - state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - HeightMixedSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; - HeightOccupiedSubzoneAve = (state.dataDispVentMgr->HeightFloorSubzoneTop + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; - HeightFloorSubzoneAve = state.dataDispVentMgr->HeightFloorSubzoneTop / 2.0; - - // Comfort temperature - - if (MIXFLAG) { - state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; - } else { - if (HeightComfort >= 0.0 && HeightComfort < HeightFloorSubzoneAve) { - ShowWarningError(state, format("Displacement ventilation comfort height is in floor subzone in Zone: {}", zone.Name)); - state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); - } else if (HeightComfort >= HeightFloorSubzoneAve && HeightComfort < HeightOccupiedSubzoneAve) { - state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightComfort) + - state.dataRoomAir->ZTOC(ZoneNum) * (HeightComfort - HeightFloorSubzoneAve)) / - (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); - //! TCMF(ZoneNum) = (ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightComfort) & - //! + ZTMX(ZoneNum) * (HeightComfort - HeightFloorSubzoneAve)) & - //! / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) - } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightMixedSubzoneAve) { - state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightMixedSubzoneAve - HeightComfort) + - state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / - (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); - } else if (HeightComfort >= HeightMixedSubzoneAve && HeightComfort <= CeilingHeight) { - state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + + // Temperature gradients + + if ((HeightMixedSubzoneAve - HeightFloorSubzoneAve) > 0.1) { + state.dataRoomAir->AvgTempGrad(ZoneNum) = + (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTFloor(ZoneNum)) / (HeightMixedSubzoneAve - HeightFloorSubzoneAve); } else { - ShowFatalError(state, format("Displacement ventilation comfort height is above ceiling or below floor in Zone: {}", zone.Name)); + state.dataRoomAir->AvgTempGrad(ZoneNum) = -9.999; } - } - - // Temperature at the thermostat/temperature control sensor - - if (MIXFLAG) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = ZTAveraged; - } else { - if (HeightThermostat >= 0.0 && HeightThermostat < HeightFloorSubzoneAve) { - ShowWarningError(state, format("Displacement thermostat is in floor subzone in Zone: {}", zone.Name)); - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTFloor(ZoneNum); - } else if (HeightThermostat >= HeightFloorSubzoneAve && HeightThermostat < HeightOccupiedSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightThermostat) + - state.dataRoomAir->ZTOC(ZoneNum) * (HeightThermostat - HeightFloorSubzoneAve)) / - (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); - //! TempTstatAir(ZoneNum) = (ZTFloor(ZoneNum) * (HeightOccupiedSubzoneAve - HeightThermostat) & - //! + ZTMX(ZoneNum) * (HeightThermostat - HeightFloorSubzoneAve)) & - //! / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) - } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightMixedSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightMixedSubzoneAve - HeightThermostat) + - state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / - (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); - } else if (HeightThermostat >= HeightMixedSubzoneAve && HeightThermostat <= CeilingHeight) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + if ((HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) > 0.1) { + state.dataRoomAir->MaxTempGrad(ZoneNum) = + (state.dataRoomAir->ZTOC(ZoneNum) - state.dataRoomAir->ZTFloor(ZoneNum)) / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); } else { - ShowFatalError(state, format("Displacement ventilation thermostat height is above ceiling or below floor in Zone: {}", zone.Name)); + state.dataRoomAir->MaxTempGrad(ZoneNum) = -9.999; + } + if ((HeightMixedSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { + MTGAUX = (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); + } else { + MTGAUX = -9.999; } - } - - // Temperature gradients - - if ((HeightMixedSubzoneAve - HeightFloorSubzoneAve) > 0.1) { - state.dataRoomAir->AvgTempGrad(ZoneNum) = - (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTFloor(ZoneNum)) / (HeightMixedSubzoneAve - HeightFloorSubzoneAve); - } else { - state.dataRoomAir->AvgTempGrad(ZoneNum) = -9.999; - } - if ((HeightOccupiedSubzoneAve - HeightFloorSubzoneAve) > 0.1) { - state.dataRoomAir->MaxTempGrad(ZoneNum) = - (state.dataRoomAir->ZTOC(ZoneNum) - state.dataRoomAir->ZTFloor(ZoneNum)) / (HeightOccupiedSubzoneAve - HeightFloorSubzoneAve); - } else { - state.dataRoomAir->MaxTempGrad(ZoneNum) = -9.999; - } - if ((HeightMixedSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { - MTGAUX = (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightMixedSubzoneAve - HeightOccupiedSubzoneAve); - } else { - MTGAUX = -9.999; - } - if (MTGAUX > state.dataRoomAir->MaxTempGrad(ZoneNum)) { - state.dataRoomAir->MaxTempGrad(ZoneNum) = MTGAUX; - } + if (MTGAUX > state.dataRoomAir->MaxTempGrad(ZoneNum)) { + state.dataRoomAir->MaxTempGrad(ZoneNum) = MTGAUX; + } - if (MIXFLAG) { - state.dataRoomAir->ZoneDispVent3NodeMixedFlag(ZoneNum) = 1; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; - } else { - state.dataRoomAir->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; - } + if (MIXFLAG) { + state.dataRoomAir->ZoneDispVent3NodeMixedFlag(ZoneNum) = 1; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + } else { + state.dataRoomAir->ZoneDispVent3NodeMixedFlag(ZoneNum) = 0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + } - if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) { - int ZoneNodeNum = zone.SystemZoneNodeNumber; - state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); - } + if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) { + int ZoneNodeNum = zone.SystemZoneNodeNumber; + state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); + } - // Mixed for reporting purposes - if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 1.0; - state.dataRoomAir->FracMinFlow(ZoneNum) = -1.0; - state.dataRoomAir->HeightTransition(ZoneNum) = -9.999; - state.dataRoomAir->AvgTempGrad(ZoneNum) = -9.999; - state.dataRoomAir->MaxTempGrad(ZoneNum) = -9.999; - } else { - state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 0.0; + // Mixed for reporting purposes + if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { + state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAir->FracMinFlow(ZoneNum) = -1.0; + state.dataRoomAir->HeightTransition(ZoneNum) = -9.999; + state.dataRoomAir->AvgTempGrad(ZoneNum) = -9.999; + state.dataRoomAir->MaxTempGrad(ZoneNum) = -9.999; + } else { + state.dataRoomAir->ZoneDispVent3NodeMixedFlagRep(ZoneNum) = 0.0; + } } -} } // namespace RoomAir } // namespace EnergyPlus diff --git a/src/EnergyPlus/EconomicLifeCycleCost.cc b/src/EnergyPlus/EconomicLifeCycleCost.cc index 3218175af2f..6eeff1a5ea9 100644 --- a/src/EnergyPlus/EconomicLifeCycleCost.cc +++ b/src/EnergyPlus/EconomicLifeCycleCost.cc @@ -857,8 +857,7 @@ void GetInputLifeCycleCostUsePriceEscalation(EnergyPlusData &state) // \key Water // \key OtherFuel1 // \key OtherFuel2 - elcc->UsePriceEscalation(iInObj).resource = - static_cast(getEnumValue(Constant::eResourceNamesUC, AlphaArray(2))); + elcc->UsePriceEscalation(iInObj).resource = static_cast(getEnumValue(Constant::eResourceNamesUC, AlphaArray(2))); if (NumAlphas > 3) { ShowWarningError(state, format("In {} contains more alpha fields than expected.", CurrentModuleObject)); } diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index 8bbc8146788..c301cb288e8 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -664,9 +664,9 @@ void GetInputEconomicsTariff(EnergyPlusData &state, bool &ErrorsFound) // true i } // associate the resource number with each tariff if (tariff(iInObj).reportMeterIndx >= 1) { - tariff(iInObj).resource = static_cast(getEnumValue( - Constant::eResourceNamesUC, - UtilityRoutines::makeUPPER(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType))); + tariff(iInObj).resource = static_cast( + getEnumValue(Constant::eResourceNamesUC, + UtilityRoutines::makeUPPER(state.dataOutputProcessor->EnergyMeters(tariff(iInObj).reportMeterIndx).ResourceType))); } } } diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 2f5bf7a5703..e08eb43e928 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -2207,8 +2207,7 @@ GeneratorController::GeneratorController(EnergyPlusData &state, case GeneratorType::PVWatts: { compPlantType = DataPlant::PlantEquipmentType::Invalid; - int ObjNum = - state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Generator:PVWatts", UtilityRoutines::makeUPPER(objectName)); + int ObjNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, "Generator:PVWatts", UtilityRoutines::makeUPPER(objectName)); assert(ObjNum >= 0); if (ObjNum == 0) { ShowFatalError(state, format("Cannot find Generator:PVWatts {}", objectName)); @@ -2263,8 +2262,7 @@ GeneratorController::GeneratorController(EnergyPlusData &state, // Except you need GetPVInput to have run already etc // Note: you can't use state.dataIPShortCut->cAlphaArgs etc or it'll override what will still need to be processed in // ElectPowerLoadCenter::ElectPowerLoadCenter after this function is called - int PVNum = - state.dataInputProcessing->inputProcessor->getObjectItemNum(state, objectType, UtilityRoutines::makeUPPER(objectName)); + int PVNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(state, objectType, UtilityRoutines::makeUPPER(objectName)); int NumAlphas; // Number of PV Array parameter alpha names being passed int NumNums; // Number of PV Array numeric parameters are being passed int IOStat; diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 39d7ba6c77a..a65e1fe157b 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -276,8 +276,7 @@ namespace EvaporativeFluidCoolers { if (state.dataIPShortCut->lAlphaFieldBlanks(6) || AlphArray(6).empty()) { thisEFC.capacityControl = CapacityControl::FanCycling; // FanCycling } else { - thisEFC.capacityControl = - static_cast(getEnumValue(controlNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); + thisEFC.capacityControl = static_cast(getEnumValue(controlNamesUC, UtilityRoutines::makeUPPER(AlphArray(6)))); if (thisEFC.capacityControl == CapacityControl::Invalid) { thisEFC.capacityControl = CapacityControl::FanCycling; ShowWarningError(state, diff --git a/src/EnergyPlus/FaultsManager.cc b/src/EnergyPlus/FaultsManager.cc index 13501c89f73..c2fec6464c3 100644 --- a/src/EnergyPlus/FaultsManager.cc +++ b/src/EnergyPlus/FaultsManager.cc @@ -854,8 +854,7 @@ namespace FaultsManager { } // Coil check and link - CoilType CoilTypeCheck = - static_cast(getEnumValue(CoilTypeNamesUC, UtilityRoutines::makeUPPER(faultsCoilSATFouling.CoilType))); + CoilType CoilTypeCheck = static_cast(getEnumValue(CoilTypeNamesUC, UtilityRoutines::makeUPPER(faultsCoilSATFouling.CoilType))); switch (CoilTypeCheck) { case CoilType::CoilHeatingElectric: case CoilType::CoilHeatingFuel: @@ -1772,8 +1771,7 @@ namespace FaultsManager { } } - faultsFoulCoil.FoulingInputMethod = - static_cast(getEnumValue(FouledCoilNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(5)))); + faultsFoulCoil.FoulingInputMethod = static_cast(getEnumValue(FouledCoilNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(5)))); if (faultsFoulCoil.FoulingInputMethod == FouledCoil::Invalid) { faultsFoulCoil.FoulingInputMethod = FouledCoil::UARated; } diff --git a/src/EnergyPlus/General.cc b/src/EnergyPlus/General.cc index b9cd9f90000..aada86ee9af 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -1236,8 +1236,7 @@ void ScanForReports(EnergyPlusData &state, state.dataRuntimeLang->OutputEMSActuatorAvailSmall = (CheckAvailRpt == AvailRpt::NotByUniqueKeyNames); state.dataRuntimeLang->OutputEMSActuatorAvailFull = (CheckAvailRpt == AvailRpt::Verbose); - CheckAvailRpt = - static_cast(getEnumValue(AvailRptNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + CheckAvailRpt = static_cast(getEnumValue(AvailRptNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); state.dataRuntimeLang->OutputEMSInternalVarsSmall = (CheckAvailRpt == AvailRpt::NotByUniqueKeyNames); state.dataRuntimeLang->OutputEMSInternalVarsFull = (CheckAvailRpt == AvailRpt::Verbose); @@ -1254,8 +1253,7 @@ void ScanForReports(EnergyPlusData &state, // Process the Scan Request DoReport = false; - ReportName rptName = - static_cast(getEnumValue(ReportNamesUC, UtilityRoutines::makeUPPER(UtilityRoutines::makeUPPER(reportName)))); + ReportName rptName = static_cast(getEnumValue(ReportNamesUC, UtilityRoutines::makeUPPER(UtilityRoutines::makeUPPER(reportName)))); switch (rptName) { case ReportName::Constructions: { if (present(ReportKey)) { diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index 1c38f08255b..db600f9d129 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -307,8 +307,7 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: if (j.find("ghe_vertical_responsefactors_object_name") != j.end()) { // Response factors come from IDF object - this->myRespFactors = - GetResponseFactor(state, UtilityRoutines::makeUPPER(j["ghe_vertical_responsefactors_object_name"].get())); + this->myRespFactors = GetResponseFactor(state, UtilityRoutines::makeUPPER(j["ghe_vertical_responsefactors_object_name"].get())); this->gFunctionsExist = true; } @@ -411,10 +410,9 @@ GLHEVert::GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann:: state.dataGroundHeatExchanger->prevTimeSteps = 0.0; // Initialize ground temperature model and get pointer reference - this->groundTempModel = - GetGroundTempModelAndInit(state, - UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()), - UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_name"].get())); + this->groundTempModel = GetGroundTempModelAndInit(state, + UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_type"].get()), + UtilityRoutines::makeUPPER(j["undisturbed_ground_temperature_model_name"].get())); // Check for Errors if (errorsFound) { diff --git a/src/EnergyPlus/HVACStandAloneERV.cc b/src/EnergyPlus/HVACStandAloneERV.cc index 09c45cb7b8b..2d150dda352 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -1139,7 +1139,8 @@ void InitStandAloneERV(EnergyPlusData &state, } if (allocated(state.dataHVACGlobal->ZoneComp)) { - auto &availMgr = state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator).ZoneCompAvailMgrs(StandAloneERVNum); + auto &availMgr = + state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator).ZoneCompAvailMgrs(StandAloneERVNum); if (state.dataHVACStandAloneERV->MyZoneEqFlag(StandAloneERVNum)) { // initialize the name of each availability manager list and zone number availMgr.AvailManagerListName = state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).AvailManagerListName; availMgr.ZoneNum = ZoneNum; diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index d69d6b75678..58ea7468487 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -2116,8 +2116,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) thisVrfSys.MaxOATCCHeater = rNumericArgs(19); if (!lAlphaFieldBlanks(31)) { - thisVrfSys.DefrostStrategy = - static_cast(getEnumValue(StandardRatings::DefrostStratUC, cAlphaArgs(31))); + thisVrfSys.DefrostStrategy = static_cast(getEnumValue(StandardRatings::DefrostStratUC, cAlphaArgs(31))); if (thisVrfSys.DefrostStrategy == StandardRatings::DefrostStrat::Invalid) { ShowSevereError(state, format("{}, \"{}\" {} not found: {}", cCurrentModuleObject, thisVrfSys.Name, cAlphaFieldNames(31), cAlphaArgs(31))); @@ -5663,7 +5662,8 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool } if (allocated(state.dataHVACGlobal->ZoneComp)) { - auto &availMgr = state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal).ZoneCompAvailMgrs(VRFTUNum); + auto &availMgr = + state.dataHVACGlobal->ZoneComp(DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal).ZoneCompAvailMgrs(VRFTUNum); if (state.dataHVACVarRefFlow->MyZoneEqFlag(VRFTUNum)) { // initialize the name of each availability manager list and zone number availMgr.AvailManagerListName = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).AvailManagerListName; availMgr.ZoneNum = ZoneNum; diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index b93dedb0fc4..7bd174b595f 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -129,15 +129,14 @@ constexpr std::array(AirflowSpecAlt::Num)> ai constexpr std::array(DataHeatBalance::VentilationType::Num)> ventilationTypeNamesUC = { "NATURAL", "INTAKE", "EXHAUST", "BALANCED"}; -constexpr std::array(RoomAir::RoomAirModel::Num)> roomAirModelNamesUC = { - "USERDEFINED", - "MIXING", - "ONENODEDISPLACEMENTVENTILATION", - "THREENODEDISPLACEMENTVENTILATION", - "CROSSVENTILATION", - "UNDERFLOORAIRDISTRIBUTIONINTERIOR", - "UNDERFLOORAIRDISTRIBUTIONEXTERIOR", - "AIRFLOWNETWORK"}; +constexpr std::array(RoomAir::RoomAirModel::Num)> roomAirModelNamesUC = {"USERDEFINED", + "MIXING", + "ONENODEDISPLACEMENTVENTILATION", + "THREENODEDISPLACEMENTVENTILATION", + "CROSSVENTILATION", + "UNDERFLOORAIRDISTRIBUTIONINTERIOR", + "UNDERFLOORAIRDISTRIBUTIONEXTERIOR", + "AIRFLOWNETWORK"}; constexpr std::array(RoomAir::CouplingScheme::Num)> couplingSchemeNamesUC = {"DIRECT", "INDIRECT"}; @@ -486,7 +485,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err { thisZoneAirBalance.BalanceMethod = static_cast( getEnumValue(DataHeatBalance::AirBalanceTypeNamesUC, - UtilityRoutines::makeUPPER(cAlphaArgs(3)))); // Air balance method type character input-->convert to enum + UtilityRoutines::makeUPPER(cAlphaArgs(3)))); // Air balance method type character input-->convert to enum if (thisZoneAirBalance.BalanceMethod == DataHeatBalance::AirBalance::Invalid) { thisZoneAirBalance.BalanceMethod = DataHeatBalance::AirBalance::None; ShowWarningError(state, @@ -746,8 +745,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err // Set space flow fractions // Infiltration equipment design level calculation method. - AirflowSpecAlt flow = - static_cast(getEnumValue(airflowAltNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) + AirflowSpecAlt flow = static_cast(getEnumValue(airflowAltNamesUC, cAlphaArgs(4))); // NOLINT(modernize-use-auto) switch (flow) { case AirflowSpecAlt::Flow: case AirflowSpecAlt::FlowPerZone: @@ -1529,8 +1527,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err if (cAlphaArgs(5).empty()) { thisVentilation.FanType = DataHeatBalance::VentilationType::Natural; } else { - thisVentilation.FanType = - static_cast(getEnumValue(ventilationTypeNamesUC, cAlphaArgs(5))); + thisVentilation.FanType = static_cast(getEnumValue(ventilationTypeNamesUC, cAlphaArgs(5))); if (thisVentilation.FanType == DataHeatBalance::VentilationType::Invalid) { ShowSevereError(state, format(R"({}{}="{}". invalid {}="{}".)", @@ -4604,9 +4601,9 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if state.dataIPShortCut->cAlphaArgs(2), cCurrentModuleObject, roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); - ShowContinueError(state, - format("Air Model Type for zone already set to {}", - roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); + ShowContinueError( + state, + format("Air Model Type for zone already set to {}", roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); ShowContinueError(state, format("Trying to overwrite with model type = {}", state.dataIPShortCut->cAlphaArgs(3))); ErrorsFound = true; } @@ -4614,7 +4611,7 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if // state.dataRoomAir->AirModel(ZoneNum).AirModelName = state.dataIPShortCut->cAlphaArgs(1); state.dataRoomAir->AirModel(ZoneNum).AirModel = - static_cast(getEnumValue(roomAirModelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); // is this arg1 or arg3? + static_cast(getEnumValue(roomAirModelNamesUC, state.dataIPShortCut->cAlphaArgs(3))); // is this arg1 or arg3? switch (state.dataRoomAir->AirModel(ZoneNum).AirModel) { case RoomAir::RoomAirModel::Mixing: // nothing to do here actually @@ -4763,14 +4760,17 @@ void GetRoomAirModelParameters(EnergyPlusData &state, bool &errFlag) // True if static constexpr std::string_view RoomAirHeader("! , Zone Name, Mixing/Mundt/UCSDDV/UCSDCV/UCSDUFI/UCSDUFE/User Defined\n"); print(state.files.eio, RoomAirHeader); for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - static constexpr std::array roomAirModelStrings = { - "UserDefined", "Mixing/Well-Stirred", - "OneNodeDisplacementVentilation", "ThreeNodeDisplacementVentilation", - "CrossVentilation", - "UnderFloorAirDistributionInterior", "UnderFloorAirDistributionExterior", - "AirflowNetwork"}; - - print(state.files.eio, "RoomAir Model,{},{}\n", + static constexpr std::array roomAirModelStrings = {"UserDefined", + "Mixing/Well-Stirred", + "OneNodeDisplacementVentilation", + "ThreeNodeDisplacementVentilation", + "CrossVentilation", + "UnderFloorAirDistributionInterior", + "UnderFloorAirDistributionExterior", + "AirflowNetwork"}; + + print(state.files.eio, + "RoomAir Model,{},{}\n", state.dataHeatBal->Zone(ZoneNum).Name, roomAirModelStrings[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel]); } diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 01fd0588aa7..3f9ffd3d51c 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -1162,8 +1162,7 @@ namespace HeatBalanceManager { } else { if (NumAlpha > 2) { { - int FlowTypeNum = - getEnumValue(DataHeatBalance::InfiltrationZoneTypeNamesUC, UtilityRoutines::makeUPPER(AlphaName(3))); + int FlowTypeNum = getEnumValue(DataHeatBalance::InfiltrationZoneTypeNamesUC, UtilityRoutines::makeUPPER(AlphaName(3))); state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones = static_cast(FlowTypeNum); AlphaName(3) = DataHeatBalance::InfiltrationZoneTypeNamesCC[FlowTypeNum]; if (state.dataHeatBal->ZoneAirMassFlow.InfiltrationForZones == DataHeatBalance::InfiltrationZoneType::Invalid) { diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 200fffc21b3..325b0777f10 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -509,8 +509,7 @@ namespace HeatRecovery { } // Added additional inputs for frost control - thisExchanger.FrostControlType = - static_cast(getEnumValue(frostControlNamesUC, state.dataIPShortCut->cAlphaArgs(9))); + thisExchanger.FrostControlType = static_cast(getEnumValue(frostControlNamesUC, state.dataIPShortCut->cAlphaArgs(9))); if (thisExchanger.FrostControlType == FrostControlOption::Invalid) { ShowSevereError(state, format("Invalid Frost Control method for {} = {}", thisExchanger.Name, state.dataIPShortCut->cAlphaArgs(9))); ErrorsFound = true; diff --git a/src/EnergyPlus/HybridUnitaryAirConditioners.cc b/src/EnergyPlus/HybridUnitaryAirConditioners.cc index 10b5bc9b5dc..b67a249ad3e 100644 --- a/src/EnergyPlus/HybridUnitaryAirConditioners.cc +++ b/src/EnergyPlus/HybridUnitaryAirConditioners.cc @@ -220,7 +220,7 @@ void InitZoneHybridUnitaryAirConditioners(EnergyPlusData &state, // set the availability status based on the availability manager list name if (allocated(ZoneComp)) { - auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::HybridEvaporativeCooler).ZoneCompAvailMgrs(UnitNum); + auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::HybridEvaporativeCooler).ZoneCompAvailMgrs(UnitNum); if (state.dataHybridUnitaryAC->MyZoneEqFlag(UnitNum)) { // initialize the name of each availability manager list and zone number availMgr.AvailManagerListName = state.dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(UnitNum).AvailManagerListName; availMgr.ZoneNum = ZoneNum; diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index adada631d31..51c3d227097 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -3196,13 +3196,12 @@ namespace InternalHeatGains { } // Environmental class - thisZoneITEq.Class = - static_cast(getEnumValue(ITEClassNamesUC, UtilityRoutines::makeUPPER(IHGAlphas(10)))); + thisZoneITEq.Class = static_cast(getEnumValue(ITEClassNamesUC, UtilityRoutines::makeUPPER(IHGAlphas(10)))); ErrorsFound = ErrorsFound || (thisZoneITEq.Class == ITEClass::Invalid); // Air and supply inlet connections - thisZoneITEq.AirConnectionType = static_cast( - getEnumValue(ITEInletConnectionNamesUC, UtilityRoutines::makeUPPER(IHGAlphas(11)))); + thisZoneITEq.AirConnectionType = + static_cast(getEnumValue(ITEInletConnectionNamesUC, UtilityRoutines::makeUPPER(IHGAlphas(11)))); if (thisZoneITEq.AirConnectionType == ITEInletConnection::RoomAirModel) { // ZoneITEq(Loop).AirConnectionType = ITEInletConnection::RoomAirModel; ShowWarningError(state, diff --git a/src/EnergyPlus/Material.cc b/src/EnergyPlus/Material.cc index fd0ab68199d..fed2f8430b3 100644 --- a/src/EnergyPlus/Material.cc +++ b/src/EnergyPlus/Material.cc @@ -268,8 +268,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = materialName; std::string roughness = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "roughness"); - thisMaterial->Roughness = - static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(roughness))); + thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(roughness))); thisMaterial->Thickness = ip->getRealFieldValue(objectFields, objectSchemaProps, "thickness"); thisMaterial->Conductivity = ip->getRealFieldValue(objectFields, objectSchemaProps, "conductivity"); @@ -346,8 +345,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->group = Group::Regular; thisMaterial->Name = MaterialNames(1); - thisMaterial->Roughness = - static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(MaterialNames(2)))); + thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(MaterialNames(2)))); thisMaterial->Resistance = MaterialProps(1); thisMaterial->ROnly = true; @@ -1300,8 +1298,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { // Get gap vent type - thisMaterial->gapVentType = - static_cast(getEnumValue(GapVentTypeUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); + thisMaterial->gapVentType = static_cast(getEnumValue(GapVentTypeUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); } if (gasType == GasType::Custom) { @@ -2394,8 +2391,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if // MaximizeSolar or BlockBeamSolar thisMaterial->slatAngleType = SlatAngleType::FixedSlatAngle; if (!state.dataIPShortCut->lAlphaFieldBlanks(3)) { - thisMaterial->slatAngleType = - static_cast(getEnumValue(SlatAngleTypeUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); + thisMaterial->slatAngleType = static_cast(getEnumValue(SlatAngleTypeUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); } if (thisMaterial->SlatWidth < thisMaterial->SlatSeparation) { ShowWarningError(state, format("{}=\"{}\", Slat Seperation/Width", state.dataHeatBalMgr->CurrentModuleObject, MaterialNames(1))); @@ -2524,8 +2520,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if thisMaterial->Name = MaterialNames(1); // need to treat the A2 with is just the name of the soil(it is // not important) - thisMaterial->Roughness = - static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); + thisMaterial->Roughness = static_cast(getEnumValue(SurfaceRoughnessUC, UtilityRoutines::makeUPPER(MaterialNames(3)))); if (UtilityRoutines::SameString(MaterialNames(4), "Simple")) { thisMaterial->EcoRoofCalculationMethod = 1; } else if (UtilityRoutines::SameString(MaterialNames(4), "Advanced") || state.dataIPShortCut->lAlphaFieldBlanks(4)) { diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index aa7c07e8aac..18e8d96b765 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -1041,8 +1041,7 @@ void GetOutsideAirSysInputs(EnergyPlusData &state) for (int OASysNum = 1; OASysNum <= state.dataAirLoop->NumOASystems; ++OASysNum) { auto &OASys = state.dataAirLoop->OutsideAirSys(OASysNum); for (int CompNum = 1; CompNum <= OASys.NumComponents; ++CompNum) { - OASys.ComponentTypeEnum(CompNum) = - static_cast(getEnumValue(CompTypeNamesUC, OASys.ComponentType(CompNum))); + OASys.ComponentTypeEnum(CompNum) = static_cast(getEnumValue(CompTypeNamesUC, OASys.ComponentType(CompNum))); if (OASys.ComponentTypeEnum(CompNum) == SimAirServingZones::CompType::Fan_System_Object) { // construct fan object state.dataHVACFan->fanObjs.emplace_back(new HVACFan::FanSystem(state, OASys.ComponentName(CompNum))); diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index f2874bcbb0b..901859e3561 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -263,12 +263,10 @@ namespace RoomAir { AirNodeFoundFlag = false; for (AirNodeNum = AirNodeBeginNum; AirNodeNum <= state.dataRoomAir->TotNumOfAirNodes; ++AirNodeNum) { if (UtilityRoutines::SameString(state.dataRoomAir->AirNode(AirNodeNum).ZoneName, thisZone.Name)) { - state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType = - state.dataRoomAir->AirNode(AirNodeNum).ClassType; + state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).ClassType = state.dataRoomAir->AirNode(AirNodeNum).ClassType; state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).AirNodeName = state.dataRoomAir->AirNode(AirNodeNum).Name; state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).Height = state.dataRoomAir->AirNode(AirNodeNum).Height; - state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).SurfMask = - state.dataRoomAir->AirNode(AirNodeNum).SurfMask; + state.dataMundtSimMgr->LineNode(NodeNum, MundtZoneIndex).SurfMask = state.dataRoomAir->AirNode(AirNodeNum).SurfMask; SetupOutputVariable(state, "Room Air Node Air Temperature", OutputProcessor::Unit::C, @@ -427,8 +425,8 @@ namespace RoomAir { //***************************************************************************************** void SetupDispVent1Node(EnergyPlusData &state, - int const ZoneNum, // index number for the specified zone - bool &ErrorsFound // true if problems setting up model + int const ZoneNum, // index number for the specified zone + bool &ErrorsFound // true if problems setting up model ) { diff --git a/src/EnergyPlus/MundtSimMgr.hh b/src/EnergyPlus/MundtSimMgr.hh index 539f65b8ba8..d8c8007de31 100644 --- a/src/EnergyPlus/MundtSimMgr.hh +++ b/src/EnergyPlus/MundtSimMgr.hh @@ -69,11 +69,11 @@ namespace RoomAir { struct DefineLinearModelNode { // Members - std::string AirNodeName = ""; // Name of air nodes + std::string AirNodeName = ""; // Name of air nodes RoomAir::AirNodeType ClassType = RoomAir::AirNodeType::Invalid; // Type of air nodes - Real64 Height = 0.0; // Z coordinates [m] node's Control Vol. center - Real64 Temp = 0.0; // Surface temperature BC - Array1D_bool SurfMask; // Limit of 60 surfaces at current sizing + Real64 Height = 0.0; // Z coordinates [m] node's Control Vol. center + Real64 Temp = 0.0; // Surface temperature BC + Array1D_bool SurfMask; // Limit of 60 surfaces at current sizing }; struct DefineSurfaceSettings @@ -108,8 +108,8 @@ namespace RoomAir { //***************************************************************************************** void SetupDispVent1Node(EnergyPlusData &state, - int ZoneNum, // index number for the specified zone - bool &ErrorsFound // true if problems setting up model + int ZoneNum, // index number for the specified zone + bool &ErrorsFound // true if problems setting up model ); //***************************************************************************************** diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 88718c9b661..1d0c1ed71f4 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -510,8 +510,7 @@ namespace OutdoorAirUnit { if (!lAlphaBlanks(9)) { constexpr std::array(OAUnitCtrlType::Num)> ctrlTypeNamesUC = { "NEUTRALCONTROL", "INVALID-UNCONDITIONED", "TEMPERATURECONTROL"}; - OAUnitCtrlType const tmpCtrlType = - static_cast(getEnumValue(ctrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); + OAUnitCtrlType const tmpCtrlType = static_cast(getEnumValue(ctrlTypeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); switch (tmpCtrlType) { case OAUnitCtrlType::Neutral: case OAUnitCtrlType::Temperature: @@ -1192,7 +1191,7 @@ namespace OutdoorAirUnit { if (allocated(ZoneComp)) { auto &availMgr = ZoneComp(DataZoneEquipment::ZoneEquipType::OutdoorAirUnit).ZoneCompAvailMgrs(OAUnitNum); if (state.dataOutdoorAirUnit->MyZoneEqFlag(OAUnitNum)) { // initialize the name of each availability manager list and zone number - availMgr.AvailManagerListName = thisOutAirUnit.AvailManagerListName; + availMgr.AvailManagerListName = thisOutAirUnit.AvailManagerListName; availMgr.ZoneNum = ZoneNum; state.dataOutdoorAirUnit->MyZoneEqFlag(OAUnitNum) = false; } diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 71a912ef988..d02795b869b 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -208,8 +208,8 @@ namespace PhotovoltaicThermalCollectors { state.dataIPShortCut->cNumericFieldNames); auto &thisTmpSimplePVTperf = tmpSimplePVTperf(Item); thisTmpSimplePVTperf.Name = state.dataIPShortCut->cAlphaArgs(1); - thisTmpSimplePVTperf.ThermEfficMode = static_cast( - getEnumValue(ThermEfficTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + thisTmpSimplePVTperf.ThermEfficMode = + static_cast(getEnumValue(ThermEfficTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); thisTmpSimplePVTperf.ThermalActiveFract = state.dataIPShortCut->rNumericArgs(1); thisTmpSimplePVTperf.ThermEffic = state.dataIPShortCut->rNumericArgs(2); thisTmpSimplePVTperf.ThermEffSchedNum = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(3)); diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index b45b410966f..df6af1ff71c 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -597,8 +597,8 @@ void GetPlantLoopData(EnergyPlusData &state) if (NumAlphas >= PressSimAlphaIndex) { MatchedPressureString = false; - this_loop.PressureSimType = static_cast( - getEnumValue(PressureSimTypeNamesUC, UtilityRoutines::makeUPPER(Alpha(PressSimAlphaIndex)))); + this_loop.PressureSimType = + static_cast(getEnumValue(PressureSimTypeNamesUC, UtilityRoutines::makeUPPER(Alpha(PressSimAlphaIndex)))); switch (this_loop.PressureSimType) { // Check all types case DataPlant::PressSimType::NoPressure: @@ -875,8 +875,7 @@ void GetPlantInput(EnergyPlusData &state) this_comp.TypeOf = this_comp_type; this_comp.location = EnergyPlus::PlantLocation(LoopNum, LoopSideNum, BranchNum, CompNum); - this_comp.Type = - static_cast(getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_comp_type))); + this_comp.Type = static_cast(getEnumValue(PlantEquipTypeNamesUC, UtilityRoutines::makeUPPER(this_comp_type))); switch (this_comp.Type) { case PlantEquipmentType::Pipe: { diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index 08868a882e9..65549cb997d 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -432,8 +432,7 @@ namespace PlantChillers { thisChiller.SizFac = state.dataIPShortCut->rNumericArgs(22); if (thisChiller.SizFac <= 0.0) thisChiller.SizFac = 1.0; - thisChiller.FlowMode = - static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(7))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(7))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -2514,8 +2513,7 @@ namespace PlantChillers { } } - thisChiller.FlowMode = - static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(15))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(15))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -4471,8 +4469,7 @@ namespace PlantChillers { } } - thisChiller.FlowMode = - static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(9))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); @@ -6292,8 +6289,7 @@ namespace PlantChillers { } } - thisChiller.FlowMode = - static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(7))); + thisChiller.FlowMode = static_cast(getEnumValue(DataPlant::FlowModeNamesUC, state.dataIPShortCut->cAlphaArgs(7))); if (thisChiller.FlowMode == DataPlant::FlowMode::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 6b735186ac7..520b2628540 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -2029,8 +2029,7 @@ void EIRFuelFiredHeatPump::processInputForEIRPLHP(EnergyPlusData &state) thisPLHP.oaTempCurveInputVar = static_cast(getEnumValue(OATempCurveVarNamesUC, oaTempCurveInputVar)); // A10 water_temperature_curve_input_variable - std::string waterTempCurveInputVar = - UtilityRoutines::makeUPPER(fields.at("water_temperature_curve_input_variable").get()); + std::string waterTempCurveInputVar = UtilityRoutines::makeUPPER(fields.at("water_temperature_curve_input_variable").get()); thisPLHP.waterTempCurveInputVar = static_cast(getEnumValue(WaterTempCurveVarNamesUC, waterTempCurveInputVar)); // A11 normalized_capacity_function_of_temperature_curve_name diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index 24a32be8f9d..7e9e1359905 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -1773,8 +1773,7 @@ namespace PlantPipingSystemsManager { thisSegment.PipeLocation = PointF(state.dataIPShortCut->rNumericArgs(1), state.dataIPShortCut->rNumericArgs(2)); // Read in the flow direction - thisSegment.FlowDirection = - static_cast(getEnumValue(flowDirectionNamesUC, stripped(state.dataIPShortCut->cAlphaArgs(2)))); + thisSegment.FlowDirection = static_cast(getEnumValue(flowDirectionNamesUC, stripped(state.dataIPShortCut->cAlphaArgs(2)))); if (thisSegment.FlowDirection == SegmentFlow::Invalid) { CurIndex = 2; IssueSevereInputFieldError(state, diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 31f236099c4..c83bceb2693 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -498,8 +498,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s } std::string inputFileDirFlagUC = "YES"; try { - inputFileDirFlagUC = - EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_input_file_directory_to_search_path").get()); + inputFileDirFlagUC = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_input_file_directory_to_search_path").get()); } catch (nlohmann::json::out_of_range &e) { // defaulted to YES } @@ -510,8 +509,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s std::string epInDirFlagUC = "YES"; try { - epInDirFlagUC = - EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_epin_environment_variable_to_search_path").get()); + epInDirFlagUC = EnergyPlus::UtilityRoutines::makeUPPER(fields.at("add_epin_environment_variable_to_search_path").get()); } catch (nlohmann::json::out_of_range &e) { // defaulted to YES } diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 99e813ac623..537827e7551 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -317,8 +317,7 @@ void GetPIUs(EnergyPlusData &state) thisPIU.MaxPriAirVolFlow = state.dataIPShortCut->rNumericArgs(2); thisPIU.MinPriAirFlowFrac = state.dataIPShortCut->rNumericArgs(3); - thisPIU.HCoilType = - static_cast(getEnumValue(HCoilNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + thisPIU.HCoilType = static_cast(getEnumValue(HCoilNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); switch (thisPIU.HCoilType) { case HtgCoilType::SimpleHeating: { thisPIU.HCoil_PlantType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 96af8356ce2..440331f1b81 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -319,8 +319,8 @@ void GetPumpInput(EnergyPlusData &state) ObjectIsNotParent); TestCompSet(state, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaArgs(2), thisInput->cAlphaArgs(3), "Water Nodes"); - thisPump.PumpControl = static_cast( - getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + thisPump.PumpControl = + static_cast(getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(4))); @@ -407,8 +407,8 @@ void GetPumpInput(EnergyPlusData &state) thisPump.HasVFD = false; } else { thisPump.HasVFD = true; - thisPump.VFD.VFDControlType = static_cast( - getEnumValue(controlTypeVFDNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(7)))); + thisPump.VFD.VFDControlType = + static_cast(getEnumValue(controlTypeVFDNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(7)))); switch (thisPump.VFD.VFDControlType) { case ControlTypeVFD::VFDManual: { thisPump.VFD.ManualRPMSchedIndex = GetScheduleIndex(state, thisInput->cAlphaArgs(8)); @@ -587,8 +587,8 @@ void GetPumpInput(EnergyPlusData &state) thisPump.Energy = 0.0; thisPump.Power = 0.0; - thisPump.PumpControl = static_cast( - getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + thisPump.PumpControl = + static_cast(getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(4))); @@ -875,8 +875,8 @@ void GetPumpInput(EnergyPlusData &state) thisPump.SequencingScheme = PumpBankControlSeq::SequentialScheme; } - thisPump.PumpControl = static_cast( - getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + thisPump.PumpControl = + static_cast(getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, format("{}{}=\"{}\", Invalid {}", RoutineName, cCurrentModuleObject, thisPump.Name, thisInput->cAlphaFieldNames(5))); @@ -1021,8 +1021,8 @@ void GetPumpInput(EnergyPlusData &state) thisPump.SequencingScheme = PumpBankControlSeq::SequentialScheme; } - thisPump.PumpControl = static_cast( - getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); + thisPump.PumpControl = + static_cast(getEnumValue(pumpCtrlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(5)))); if (thisPump.PumpControl == PumpControlType::Invalid) { ShowWarningError(state, diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index ef04bd0664d..6d827781c4a 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -612,12 +612,10 @@ void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVec DataZoneEquipment::ZoneEquipType equipType = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipType(equipLoop); if (equipType == DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal || equipType == DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator || - equipType == DataZoneEquipment::ZoneEquipType::FourPipeFanCoil || - equipType == DataZoneEquipment::ZoneEquipType::OutdoorAirUnit || + equipType == DataZoneEquipment::ZoneEquipType::FourPipeFanCoil || equipType == DataZoneEquipment::ZoneEquipType::OutdoorAirUnit || equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner || equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump || - equipType == DataZoneEquipment::ZoneEquipType::UnitHeater || - equipType == DataZoneEquipment::ZoneEquipType::UnitVentilator || + equipType == DataZoneEquipment::ZoneEquipType::UnitHeater || equipType == DataZoneEquipment::ZoneEquipType::UnitVentilator || equipType == DataZoneEquipment::ZoneEquipType::VentilatedSlab || equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir || equipType == DataZoneEquipment::ZoneEquipType::WindowAirConditioner || @@ -633,7 +631,6 @@ void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVec c->typeHVACname += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipTypeName(equipLoop); c->userNameforHVACsystem += " or " + state.dataZoneEquip->ZoneEquipList(c->zoneEqNum).EquipName(equipLoop); } - } } } @@ -668,8 +665,7 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) equipType == DataZoneEquipment::ZoneEquipType::OutdoorAirUnit || equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner || equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump || - equipType == DataZoneEquipment::ZoneEquipType::UnitHeater || - equipType == DataZoneEquipment::ZoneEquipType::UnitVentilator || + equipType == DataZoneEquipment::ZoneEquipType::UnitHeater || equipType == DataZoneEquipment::ZoneEquipType::UnitVentilator || equipType == DataZoneEquipment::ZoneEquipType::VentilatedSlab || equipType == DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir || equipType == DataZoneEquipment::ZoneEquipType::WindowAirConditioner || @@ -685,8 +681,8 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) } } } // for (equipLoop) - } // if (zoneEquipList.numOfEquipTypes > 0) - } // if (c->ZoneEqNum > 0) + } // if (zoneEquipList.numOfEquipTypes > 0) + } // if (c->ZoneEqNum > 0) if (c->airloopNum > 0 && c->zoneEqNum == 0) { c->coilLocation = "AirLoop"; diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 4d93f23b000..e482cb1b0d0 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -156,8 +156,7 @@ namespace RoomAir { //**************************************************** - void InitRoomAirModelAFN(EnergyPlusData &state, - int const zoneNum, + void InitRoomAirModelAFN(EnergyPlusData &state, int const zoneNum, int const roomAirNodeNum) // index number for the specified zone { @@ -266,14 +265,15 @@ namespace RoomAir { auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(iZone); auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(iZone); - + // find supply air node number for (auto &afnNode : afnZoneInfo.Node) { for (auto &afnHVAC : afnNode.HVAC) { for (int I = 1; I <= zoneEquipList.NumOfEquipTypes; ++I) { // loop over all equip types if (zoneEquipList.EquipType(I) == DataZoneEquipment::ZoneEquipType::AirDistributionUnit) { if (numAirDistUnits == 0) - numAirDistUnits = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "ZoneHVAC:AirDistributionUnit"); + numAirDistUnits = + state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "ZoneHVAC:AirDistributionUnit"); if (state.dataZoneAirLoopEquipmentManager->GetAirDistUnitsFlag) { ZoneAirLoopEquipmentManager::GetZoneAirLoopEquipment(state); state.dataZoneAirLoopEquipmentManager->GetAirDistUnitsFlag = false; @@ -309,7 +309,8 @@ namespace RoomAir { } // Verify inlet nodes int inletNodeIndex = 0; - for (int iNode = 1; iNode <= zoneEquipConfig.NumInletNodes; ++iNode) { // loop over all supply inlet nodes in a single zone + for (int iNode = 1; iNode <= zoneEquipConfig.NumInletNodes; + ++iNode) { // loop over all supply inlet nodes in a single zone // !Get node conditions if (zoneEquipConfig.InletNode(iNode) == afnHVAC.SupNodeNum) { NodeFound(iNode) = true; @@ -363,17 +364,13 @@ namespace RoomAir { if (ISum > zoneEquipConfig.NumInletNodes) { ShowSevereError( state, "GetRoomAirflowNetworkData: The number of equipment listed in RoomAirflowNetwork:Node:HVACEquipment objects"); - ShowContinueError( - state, - format("is greater than the number of zone configuration inlet nodes in {}", zone.Name)); + ShowContinueError(state, format("is greater than the number of zone configuration inlet nodes in {}", zone.Name)); ShowContinueError(state, "Please check inputs of both objects."); ErrorsFound = true; } else { ShowSevereError( state, "GetRoomAirflowNetworkData: The number of equipment listed in RoomAirflowNetwork:Node:HVACEquipment objects"); - ShowContinueError( - state, - format("is less than the number of zone configuration inlet nodes in {}", zone.Name)); + ShowContinueError(state, format("is less than the number of zone configuration inlet nodes in {}", zone.Name)); ShowContinueError(state, "Please check inputs of both objects."); ErrorsFound = true; } @@ -385,8 +382,7 @@ namespace RoomAir { ShowSevereError(state, "GetRoomAirflowNetworkData: The equipment listed in ZoneEquipList is not found in the lsit of " "RoomAir:Node:AirflowNetwork:HVACEquipment objects ="); - ShowContinueError( - state, format("{}. Please check inputs of both objects.", zoneEquipList.EquipName(I))); + ShowContinueError(state, format("{}. Please check inputs of both objects.", zoneEquipList.EquipName(I))); ErrorsFound = true; } } @@ -395,9 +391,8 @@ namespace RoomAir { for (int I = 1; I <= zoneEquipList.NumOfEquipTypes; ++I) { // loop over all equip types if (std::abs(SupplyFrac(I) - 1.0) > 0.001) { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, zone supply fractions do not sum to 1.0"); - ShowContinueError(state, - format("Entered in {} defined in RoomAir:Node:AirflowNetwork:HVACEquipment", - zoneEquipList.EquipName(I))); + ShowContinueError( + state, format("Entered in {} defined in RoomAir:Node:AirflowNetwork:HVACEquipment", zoneEquipList.EquipName(I))); ShowContinueError(state, "The Fraction of supply fraction values across all the roomair nodes in a zone needs to sum to 1.0."); ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SupplyFrac(I))); @@ -405,9 +400,8 @@ namespace RoomAir { } if (std::abs(ReturnFrac(I) - 1.0) > 0.001) { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, zone return fractions do not sum to 1.0"); - ShowContinueError(state, - format("Entered in {} defined in RoomAir:Node:AirflowNetwork:HVACEquipment", - zoneEquipList.EquipName(I))); + ShowContinueError( + state, format("Entered in {} defined in RoomAir:Node:AirflowNetwork:HVACEquipment", zoneEquipList.EquipName(I))); ShowContinueError(state, "The Fraction of return fraction values across all the roomair nodes in a zone needs to sum to 1.0."); ShowContinueError(state, format("The sum of fractions entered = {:.3R}", ReturnFrac(I))); @@ -421,7 +415,7 @@ namespace RoomAir { ShowFatalError(state, "GetRoomAirflowNetworkData: Errors found getting air model input. Program terminates."); } } // if (allocated) - } // if (OneTimeFlagConf) + } // if (OneTimeFlagConf) if (state.dataGlobal->BeginEnvrnFlag && state.dataRoomAirflowNetModel->EnvrnFlag) { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { @@ -462,7 +456,7 @@ namespace RoomAir { auto &afnNode = afnZoneInfo.Node(roomAirNodeNum); if (allocated(afnNode.SurfMask)) { - CalcSurfaceMoistureSums(state, zoneNum, roomAirNodeNum, afnNode.SumHmAW, afnNode.SumHmARa, afnNode.SumHmARaW, afnNode.SurfMask); + CalcSurfaceMoistureSums(state, zoneNum, roomAirNodeNum, afnNode.SumHmAW, afnNode.SumHmARa, afnNode.SumHmARaW, afnNode.SurfMask); } // prepare AirflowNetwor flow rates and temperatures @@ -470,7 +464,7 @@ namespace RoomAir { Real64 SumLinkMCpT = 0.0; Real64 SumLinkM = 0.0; Real64 SumLinkMW = 0.0; - + if (afnNode.AFNNodeID > 0) { for (int iLink = 1; iLink <= afnNode.NumOfAirflowLinks; ++iLink) { auto &afnLink = afnNode.Link(iLink); @@ -513,8 +507,7 @@ namespace RoomAir { //***************************************************************************************** - void CalcRoomAirModelAFN(EnergyPlusData &state, - int const zoneNum, + void CalcRoomAirModelAFN(EnergyPlusData &state, int const zoneNum, int const roomAirNodeNum) // index number for the specified zone and node { @@ -568,8 +561,8 @@ namespace RoomAir { } // solve for node drybulb temperature Real64 TempDepCoef = afnNode.SumHA + afnNode.SumLinkMCp + afnNode.SumSysMCp; - Real64 TempIndCoef = afnNode.SumIntSensibleGain + afnNode.SumHATsurf - afnNode.SumHATref + afnNode.SumLinkMCpT + - afnNode.SumSysMCpT + afnNode.NonAirSystemResponse + afnNode.SysDepZoneLoadsLagged; + Real64 TempIndCoef = afnNode.SumIntSensibleGain + afnNode.SumHATsurf - afnNode.SumHATref + afnNode.SumLinkMCpT + afnNode.SumSysMCpT + + afnNode.NonAirSystemResponse + afnNode.SysDepZoneLoadsLagged; Real64 AirCap = afnNode.AirVolume * state.dataHeatBal->Zone(zoneNum).ZoneVolCapMultpSens * afnNode.RhoAir * afnNode.CpAir / TimeStepSysSec; if (state.dataHeatBal->ZoneAirSolutionAlgo == DataHeatBalance::SolutionAlgo::AnalyticalSolution) { @@ -582,7 +575,7 @@ namespace RoomAir { afnNode.AirTemp = (AirCap * AirTempT1 + TempIndCoef) / (AirCap + TempDepCoef); } else { afnNode.AirTemp = (TempIndCoef + AirCap * (3.0 * NodeTempX[0] - (3.0 / 2.0) * NodeTempX[1] + (1.0 / 3.0) * NodeTempX[2])) / - ((11.0 / 6.0) * AirCap + TempDepCoef); + ((11.0 / 6.0) * AirCap + TempDepCoef); } // solve for node humidity ratio using 3 algorithms @@ -607,12 +600,12 @@ namespace RoomAir { afnNode.AirCap = AirCap; afnNode.AirHumRat = C; - afnNode.RelHumidity = PsyRhFnTdbWPb(state, afnNode.AirTemp, afnNode.HumRat, state.dataEnvrn->OutBaroPress, "CalcRoomAirModelAirflowNetwork") * 100.0; + afnNode.RelHumidity = + PsyRhFnTdbWPb(state, afnNode.AirTemp, afnNode.HumRat, state.dataEnvrn->OutBaroPress, "CalcRoomAirModelAirflowNetwork") * 100.0; } // CalcRoomAirModelAirflowNetwork - void UpdateRoomAirModelAFN(EnergyPlusData &state, - int const zoneNum) + void UpdateRoomAirModelAFN(EnergyPlusData &state, int const zoneNum) { // SUBROUTINE INFORMATION: @@ -652,9 +645,7 @@ namespace RoomAir { } } // UpdateRoomAirModelAirflowNetwork - void CalcNodeSums(EnergyPlusData &state, - int const zoneNum, - int const roomAirNodeNum) + void CalcNodeSums(EnergyPlusData &state, int const zoneNum, int const roomAirNodeNum) { // SUBROUTINE INFORMATION: @@ -692,31 +683,28 @@ namespace RoomAir { bool Found; // Real64 SumIntGain = 0.0; // node sum of convective internal gains - Real64 SumHA = 0.0; // Zone sum of Hc*Area + Real64 SumHA = 0.0; // Zone sum of Hc*Area Real64 SumHATsurf = 0.0; // Zone sum of Hc*Area*Tsurf - Real64 SumHATref = 0.0; // Zone sum of Hc*Area*Tref, for ceiling diffuser convection correlation - Real64 SumSysMCp = 0.0; // Zone sum of air system MassFlowRate*Cp + Real64 SumHATref = 0.0; // Zone sum of Hc*Area*Tref, for ceiling diffuser convection correlation + Real64 SumSysMCp = 0.0; // Zone sum of air system MassFlowRate*Cp Real64 SumSysMCpT = 0.0; // Zone sum of air system MassFlowRate*Cp*T - Real64 SumSysM = 0.0; // Zone sum of air system MassFlowRate - Real64 SumSysMW = 0.0; // Zone sum of air system MassFlowRate*W + Real64 SumSysM = 0.0; // Zone sum of air system MassFlowRate + Real64 SumSysMW = 0.0; // Zone sum of air system MassFlowRate*W auto const &zone = state.dataHeatBal->Zone(zoneNum); auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); auto &afnNode = afnZoneInfo.Node(roomAirNodeNum); // Sum all convective internal gains: SumIntGain - afnNode.SumIntSensibleGain = - SumInternalConvectionGainsByIndices(state, - afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); + afnNode.SumIntSensibleGain = SumInternalConvectionGainsByIndices( + state, afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); - afnNode.SumIntLatentGain = - SumInternalLatentGainsByIndices(state, - afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); + afnNode.SumIntLatentGain = SumInternalLatentGainsByIndices( + state, afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); // Add heat to return air if zonal system(no return air) or cycling system(return air frequently very low or zero) if (state.dataHeatBal->Zone(zoneNum).NoHeatToReturnAir) { // ******************************************* - SumIntGain = - SumReturnAirConvectionGainsByIndices(state, - afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); + SumIntGain = SumReturnAirConvectionGainsByIndices( + state, afnNode.NumIntGains, afnNode.intGainsDeviceSpaces, afnNode.IntGainsDeviceIndices, afnNode.IntGainsFractions); afnNode.SumIntSensibleGain += SumIntGain; } @@ -727,13 +715,13 @@ namespace RoomAir { if (state.dataZonePlenum->ZoneRetPlenCond(iPlenum).ActualZoneNum != zoneNum) continue; zoneRetPlenumNum = iPlenum; break; - } + } bool zoneSupPlenumNum = false; for (int iPlenum = 1; iPlenum <= state.dataZonePlenum->NumZoneSupplyPlenums; ++iPlenum) { if (state.dataZonePlenum->ZoneSupPlenCond(iPlenum).ActualZoneNum != zoneNum) continue; zoneSupPlenumNum = iPlenum; break; - } + } // Plenum and controlled zones have a different set of inlet nodes which must be calculated. auto &zoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(zoneNum); @@ -890,8 +878,7 @@ namespace RoomAir { // check whether this zone is a controlled zone or not if (!zone.IsControlled) { ShowFatalError(state, - format("Zones must be controlled for Ceiling-Diffuser Convection model. No system serves zone {}", - zone.Name)); + format("Zones must be controlled for Ceiling-Diffuser Convection model. No system serves zone {}", zone.Name)); return; } // determine supply air temperature as a weighted average of the inlet temperatures. @@ -947,7 +934,7 @@ namespace RoomAir { SumHmARaW = 0.0; auto &afnZoneInfo = state.dataRoomAir->AFNZoneInfo(zoneNum); - + int surfCount = 1; for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); @@ -983,10 +970,11 @@ namespace RoomAir { RhoVaporAirIn(SurfNum), "RhoAirZone")); - Real64 Wsurf = PsyWFnTdbRhPb(state, - state.dataHeatBalSurf->SurfTempInTmp(SurfNum), - PsyRhFnTdbRhov(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), RhoVaporSurfIn(SurfNum), "Wsurf"), - state.dataEnvrn->OutBaroPress); + Real64 Wsurf = + PsyWFnTdbRhPb(state, + state.dataHeatBalSurf->SurfTempInTmp(SurfNum), + PsyRhFnTdbRhov(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), RhoVaporSurfIn(SurfNum), "Wsurf"), + state.dataEnvrn->OutBaroPress); SumHmARa += HMassConvInFD(SurfNum) * surf.Area * RhoAirZone; SumHmARaW += HMassConvInFD(SurfNum) * surf.Area * RhoAirZone * Wsurf; @@ -999,24 +987,22 @@ namespace RoomAir { SumHmAW += HMassConvInFD(SurfNum) * surf.Area * (RhoVaporSurfIn(SurfNum) - RhoVaporAirIn(SurfNum)); SumHmARa += HMassConvInFD(SurfNum) * surf.Area * - PsyRhoAirFnPbTdbW( - state, - state.dataEnvrn->OutBaroPress, - state.dataHeatBalSurf->SurfTempInTmp(SurfNum), - PsyWFnTdbRhPb(state, - state.dataHeatBalSurf->SurfTempInTmp(SurfNum), - PsyRhFnTdbRhovLBnd0C(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), RhoVaporAirIn(SurfNum)), - state.dataEnvrn->OutBaroPress)); + PsyRhoAirFnPbTdbW( + state, + state.dataEnvrn->OutBaroPress, + state.dataHeatBalSurf->SurfTempInTmp(SurfNum), + PsyWFnTdbRhPb(state, + state.dataHeatBalSurf->SurfTempInTmp(SurfNum), + PsyRhFnTdbRhovLBnd0C(state, state.dataHeatBalSurf->SurfTempInTmp(SurfNum), RhoVaporAirIn(SurfNum)), + state.dataEnvrn->OutBaroPress)); SumHmARaW += HMassConvInFD(SurfNum) * surf.Area * RhoVaporSurfIn(SurfNum); } } // for (SurfNum) - } // for (spaceNum) + } // for (spaceNum) } // CalcSurfaceMoistureSums - void SumNonAirSystemResponseForNode(EnergyPlusData &state, - int const zoneNum, - int const roomAirNodeNum) + void SumNonAirSystemResponseForNode(EnergyPlusData &state, int const zoneNum, int const roomAirNodeNum) { // SUBROUTINE INFORMATION: @@ -1102,7 +1088,7 @@ namespace RoomAir { default: { } break; - } // switch + } // switch // Zone sum of system convective gains, collected via NonAirSystemResponse } @@ -1111,8 +1097,7 @@ namespace RoomAir { //***************************************************************************************** - void SumSystemDepResponseForNode(EnergyPlusData &state, - int const zoneNum) + void SumSystemDepResponseForNode(EnergyPlusData &state, int const zoneNum) { // SUBROUTINE INFORMATION: // AUTHOR B.Griffith @@ -1139,13 +1124,7 @@ namespace RoomAir { for (auto &afnHVAC : afnNode.HVAC) { if (afnHVAC.zoneEquipType == DataZoneEquipment::ZoneEquipType::DehumidifierDX) { if (SysOutputProvided == 0.0) - SimZoneDehumidifier(state, - afnHVAC.Name, - zoneNum, - false, - SysOutputProvided, - LatOutputProvided, - afnHVAC.CompIndex); + SimZoneDehumidifier(state, afnHVAC.Name, zoneNum, false, SysOutputProvided, LatOutputProvided, afnHVAC.CompIndex); if (SysOutputProvided > 0.0) break; } } diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.hh b/src/EnergyPlus/RoomAirModelAirflowNetwork.hh index 023f301dbc2..3e4db9ce82f 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.hh +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.hh @@ -71,8 +71,7 @@ namespace RoomAir { void UpdateRoomAirModelAFN(EnergyPlusData &state, int const zoneNum); // index number for the specified zone - void CalcNodeSums(EnergyPlusData &state, - int const zoneNum, + void CalcNodeSums(EnergyPlusData &state, int const zoneNum, int const roomAirNodeNum); // index number for the specified zone and room air node void SumNonAirSystemResponseForNode(EnergyPlusData &state, @@ -80,7 +79,7 @@ namespace RoomAir { int const roomAirNodeNum); // index number for the specified zone and room air node void SumSystemDepResponseForNode(EnergyPlusData &state, - int const zoneNum); // index number for the specified zone and room air node + int const zoneNum); // index number for the specified zone and room air node void CalcSurfaceMoistureSums(EnergyPlusData &state, int const zoneNum, diff --git a/src/EnergyPlus/RoomAirModelManager.cc b/src/EnergyPlus/RoomAirModelManager.cc index 731c13329df..5f3369b7a75 100644 --- a/src/EnergyPlus/RoomAirModelManager.cc +++ b/src/EnergyPlus/RoomAirModelManager.cc @@ -99,20 +99,19 @@ namespace RoomAir { // PURPOSE OF THIS MODULE: // Contains subroutines for managing the room air models - constexpr std::array roomAirModelNamesUC = - { "USERDEFINED", "MIXING", "MUNDT", "UCSD_DV", "UCSD_CV", "UCSD_UFI", "UCSD_UFE", "AIRFLOWNETWORK"}; + constexpr std::array roomAirModelNamesUC = { + "USERDEFINED", "MIXING", "MUNDT", "UCSD_DV", "UCSD_CV", "UCSD_UFI", "UCSD_UFE", "AIRFLOWNETWORK"}; - constexpr std::array airNodeTypeNamesUC = - {"INLET", "FLOOR", "CONTROL", "CEILING", "MUNDTROOM", "RETURN", "AIRFLOWNETWORK", "PLUME", "REESROOM"}; + constexpr std::array airNodeTypeNamesUC = { + "INLET", "FLOOR", "CONTROL", "CEILING", "MUNDTROOM", "RETURN", "AIRFLOWNETWORK", "PLUME", "REESROOM"}; - constexpr std::array comfortNamesUC = - {"JET", "RECIRCULATION"}; + constexpr std::array comfortNamesUC = {"JET", "RECIRCULATION"}; - constexpr std::array diffuserNamesUC = - {"SWIRL", "VARIABLEAREA", "HORIZONTALSWIRL", "LINEARBARGRILLE", "CUSTOM"}; - - constexpr std::array userDefinedPatternModeNamesUC = - {"OUTDOORDRYBULBTEMPERATURE", "SENSIBLECOOLINGLOAD", "SENSIBLEHEATINGLOAD", "ZONEDRYBULBTEMPERATURE", "ZONEANDOUTDOORTEMPERATUREDIFFERENCE"}; + constexpr std::array diffuserNamesUC = { + "SWIRL", "VARIABLEAREA", "HORIZONTALSWIRL", "LINEARBARGRILLE", "CUSTOM"}; + + constexpr std::array userDefinedPatternModeNamesUC = { + "OUTDOORDRYBULBTEMPERATURE", "SENSIBLECOOLINGLOAD", "SENSIBLEHEATINGLOAD", "ZONEDRYBULBTEMPERATURE", "ZONEANDOUTDOORTEMPERATUREDIFFERENCE"}; void ManageAirModel(EnergyPlusData &state, int const ZoneNum) { @@ -143,7 +142,7 @@ namespace RoomAir { break; case RoomAirModel::Mixing: // Mixing air model - break; // do nothing + break; // do nothing case RoomAirModel::DispVent1Node: // Mundt air model // simulate room airflow using Mundt model @@ -256,21 +255,18 @@ namespace RoomAir { int Status; // Notes if there was an error in processing the input auto &ipsc = state.dataIPShortCut; - + // access input file and setup - state.dataRoomAir->numTempDistContrldZones = - state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cUserDefinedControlObject); + state.dataRoomAir->numTempDistContrldZones = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cUserDefinedControlObject); state.dataRoomAir->NumConstantGradient = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternConstGradientObject); - state.dataRoomAir->NumTwoGradientInterp = - state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternTwoGradientObject); - state.dataRoomAir->NumNonDimensionalHeight = - state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternNDHeightObject); + state.dataRoomAir->NumTwoGradientInterp = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternTwoGradientObject); + state.dataRoomAir->NumNonDimensionalHeight = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternNDHeightObject); state.dataRoomAir->NumSurfaceMapping = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cTempPatternSurfMapObject); state.dataRoomAir->NumAirTempPatterns = state.dataRoomAir->NumConstantGradient + state.dataRoomAir->NumTwoGradientInterp + - state.dataRoomAir->NumNonDimensionalHeight + state.dataRoomAir->NumSurfaceMapping; + state.dataRoomAir->NumNonDimensionalHeight + state.dataRoomAir->NumSurfaceMapping; ipsc->cCurrentModuleObject = cUserDefinedControlObject; if (state.dataRoomAir->numTempDistContrldZones == 0) { if (state.dataRoomAir->NumAirTempPatterns != 0) { // user may have missed control object @@ -325,8 +321,7 @@ namespace RoomAir { } } - airPatternZoneInfo.PatternCntrlSched = - ipsc->cAlphaArgs(4); // Schedule Name for Leading Pattern Control for this Zone + airPatternZoneInfo.PatternCntrlSched = ipsc->cAlphaArgs(4); // Schedule Name for Leading Pattern Control for this Zone airPatternZoneInfo.PatternSchedID = GetScheduleIndex(state, ipsc->cAlphaArgs(4)); if (airPatternZoneInfo.PatternSchedID == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4)); @@ -422,7 +417,6 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - auto &roomAirPattern = state.dataRoomAir->AirPattern(thisPattern); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; roomAirPattern.PatternMode = UserDefinedPatternType::TwoGradInterp; @@ -448,8 +442,7 @@ namespace RoomAir { roomAirPattern.TwoGradPatrn.LowerBoundHeatRateScale = ipsc->rNumericArgs(10); // now test the input some - if (roomAirPattern.TwoGradPatrn.HiGradient == - roomAirPattern.TwoGradPatrn.LowGradient) { + if (roomAirPattern.TwoGradPatrn.HiGradient == roomAirPattern.TwoGradPatrn.LowGradient) { ShowWarningError(state, format("Upper and lower gradients equal, use {} instead ", cTempPatternConstGradientObject)); ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); } @@ -514,8 +507,7 @@ namespace RoomAir { // TODO check order (TODO sort ? ) for (int i = 2; i <= NumPairs; ++i) { if (roomAirPattern.VertPatrn.ZetaPatrn(i) < roomAirPattern.VertPatrn.ZetaPatrn(i - 1)) { - ShowSevereError( - state, format("Zeta values not in increasing order in {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowSevereError(state, format("Zeta values not in increasing order in {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ErrorsFound = true; } } @@ -524,7 +516,7 @@ namespace RoomAir { ipsc->cCurrentModuleObject = cTempPatternSurfMapObject; for (int ObjNum = 1; ObjNum <= state.dataRoomAir->NumSurfaceMapping; ++ObjNum) { int thisPattern = state.dataRoomAir->NumConstantGradient + state.dataRoomAir->NumTwoGradientInterp + - state.dataRoomAir->NumNonDimensionalHeight + ObjNum; + state.dataRoomAir->NumNonDimensionalHeight + ObjNum; state.dataInputProcessing->inputProcessor->getObjectItem(state, ipsc->cCurrentModuleObject, @@ -541,7 +533,7 @@ namespace RoomAir { auto &roomAirPattern = state.dataRoomAir->AirPattern(thisPattern); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - + roomAirPattern.PatternMode = UserDefinedPatternType::SurfMapTemp; roomAirPattern.Name = ipsc->cAlphaArgs(1); roomAirPattern.PatrnID = ipsc->rNumericArgs(1); @@ -552,8 +544,7 @@ namespace RoomAir { int NumPairs = NumNumbers - 4; if (NumPairs != (NumAlphas - 1)) { - ShowSevereError(state, - format("Error in number of entries in {} object: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowSevereError(state, format("Error in number of entries in {} object: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ErrorsFound = true; } roomAirPattern.MapPatrn.SurfName.allocate(NumPairs); @@ -570,7 +561,7 @@ namespace RoomAir { roomAirPattern.MapPatrn.DeltaTai(i) = ipsc->rNumericArgs(i + 4); roomAirPattern.MapPatrn.SurfID(i) = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(i + 1), state.dataSurface->Surface); if (roomAirPattern.MapPatrn.SurfID(i) == 0) { - ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i+1), ipsc->cAlphaArgs(i+1)); + ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(i + 1), ipsc->cAlphaArgs(i + 1)); ErrorsFound = true; } } @@ -637,13 +628,13 @@ namespace RoomAir { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int NumAlphas; // States which alpha value to read from a // "Number" line - int NumNumbers; // Number of numbers encountered - int Status; // Notes if there was an error in processing the input + int NumNumbers; // Number of numbers encountered + int Status; // Notes if there was an error in processing the input if (!state.dataRoomAir->DispVent1NodeModelUsed) return; auto &ipsc = state.dataIPShortCut; - + // Initialize default values for air nodes state.dataRoomAir->TotNumOfZoneAirNodes.allocate(state.dataGlobal->NumOfZones); state.dataRoomAir->TotNumOfAirNodes = 0; @@ -704,7 +695,7 @@ namespace RoomAir { } airNode.Height = ipsc->rNumericArgs(1); // Air node height - int NumSurfsInvolved = NumAlphas - 3; // Number of surfaces involved with air nodes + int NumSurfsInvolved = NumAlphas - 3; // Number of surfaces involved with air nodes // Initialize airNode.SurfMask = false; @@ -712,27 +703,28 @@ namespace RoomAir { if (NumSurfsInvolved <= 0) { // report severe error since the following air nodes require surfaces associated with them - if (airNode.ClassType == AirNodeType::Floor || airNode.ClassType == AirNodeType::Ceiling || - airNode.ClassType == AirNodeType::Mundt || airNode.ClassType == AirNodeType::Plume || - airNode.ClassType == AirNodeType::Rees) { // Are there really Rees 1-4? + if (airNode.ClassType == AirNodeType::Floor || airNode.ClassType == AirNodeType::Ceiling || airNode.ClassType == AirNodeType::Mundt || + airNode.ClassType == AirNodeType::Plume || airNode.ClassType == AirNodeType::Rees) { // Are there really Rees 1-4? // terminate the program due to a severe error in the specified input - ShowSevereError(state, format("GetAirNodeData: {}=\"{}\" invalid air node specification.", ipsc->cCurrentModuleObject, airNode.Name)); - ShowContinueError(state, format("Mundt Room Air Model: No surface names specified. Air node=\"{} requires surfaces associated with it.", - airNode.Name)); + ShowSevereError(state, + format("GetAirNodeData: {}=\"{}\" invalid air node specification.", ipsc->cCurrentModuleObject, airNode.Name)); + ShowContinueError(state, + format("Mundt Room Air Model: No surface names specified. Air node=\"{} requires surfaces associated with it.", + airNode.Name)); ErrorsFound = true; - } + } continue; } // report warning error since the following air nodes do not require surfaces associated with them // and assign .FALSE. to 'SurfNeeded' - if (airNode.ClassType == AirNodeType::Inlet || airNode.ClassType == AirNodeType::Control || - airNode.ClassType == AirNodeType::Return || airNode.ClassType == AirNodeType::Plume) { + if (airNode.ClassType == AirNodeType::Inlet || airNode.ClassType == AirNodeType::Control || airNode.ClassType == AirNodeType::Return || + airNode.ClassType == AirNodeType::Plume) { ShowWarningError(state, format("GetAirNodeData: {}=\"{}\" invalid linkage", ipsc->cCurrentModuleObject, airNode.Name)); - ShowContinueError(state, format("Mundt Room Air Model: No surface names needed. Air node=\"{} does not relate to any surfaces.", - airNode.Name)); + ShowContinueError( + state, format("Mundt Room Air Model: No surface names needed. Air node=\"{} does not relate to any surfaces.", airNode.Name)); continue; - } + } // this air node is in this zone; hence, first get name of all surfaces in this zone auto const &zone = state.dataHeatBal->Zone(airNode.ZonePtr); @@ -744,10 +736,11 @@ namespace RoomAir { // terminate the program due to a severe error in the specified input if (NumSurfsInvolved > NumOfSurfs) { - ShowFatalError(state, - format("GetAirNodeData: Mundt Room Air Model: Number of surfaces connected to {} is greater than number of surfaces in {}", - airNode.Name, - zone.Name)); + ShowFatalError( + state, + format("GetAirNodeData: Mundt Room Air Model: Number of surfaces connected to {} is greater than number of surfaces in {}", + airNode.Name, + zone.Name)); return; } @@ -771,10 +764,9 @@ namespace RoomAir { // report warning error since surface names are specified correctly if ((NumSurfsInvolved) != SurfCount) { - ShowWarningError(state, - format("GetAirNodeData: Mundt Room Air Model: Some surface names specified for {} are not in {}", - airNode.Name, - zone.Name)); + ShowWarningError( + state, + format("GetAirNodeData: Mundt Room Air Model: Some surface names specified for {} are not in {}", airNode.Name, zone.Name)); } } // for (AirNodeNum) @@ -782,7 +774,7 @@ namespace RoomAir { for (int AirNodeNum = 1; AirNodeNum <= state.dataRoomAir->TotNumOfAirNodes; ++AirNodeNum) { auto const &airNode = state.dataRoomAir->AirNode(AirNodeNum); // this zone uses other air model so skip the rest - if (state.dataRoomAir->AirModel(airNode.ZonePtr).AirModel == RoomAirModel::DispVent1Node) + if (state.dataRoomAir->AirModel(airNode.ZonePtr).AirModel == RoomAirModel::DispVent1Node) ++state.dataRoomAir->TotNumOfZoneAirNodes(airNode.ZonePtr); } } @@ -814,7 +806,7 @@ namespace RoomAir { int NumOfMundtContrl; // Number of Mundt Model Controls auto &ipsc = state.dataIPShortCut; - + if (!state.dataRoomAir->DispVent1NodeModelUsed) return; // Initialize default values for Mundt model controls @@ -853,7 +845,6 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ""}; int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); if (ZoneNum == 0) { @@ -862,11 +853,9 @@ namespace RoomAir { continue; } if (state.dataRoomAir->AirModel(ZoneNum).AirModel != RoomAirModel::DispVent1Node) { - ShowSevereError( - state, - format("Zone specified=\"{}\", Air Model type is not OneNodeDisplacementVentilation.", ipsc->cAlphaArgs(1))); - ShowContinueError( - state, format("Air Model Type for zone={}", roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); + ShowSevereError(state, format("Zone specified=\"{}\", Air Model type is not OneNodeDisplacementVentilation.", ipsc->cAlphaArgs(1))); + ShowContinueError(state, + format("Air Model Type for zone={}", roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); ErrorsFound = true; continue; } @@ -941,7 +930,7 @@ namespace RoomAir { } else if ((zoneDV3N.SchedGainsPtr = GetScheduleIndex(state, ipsc->cAlphaArgs(2))) == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2)); ErrorsFound = true; - } + } zoneDV3N.NumPlumesPerOcc = ipsc->rNumericArgs(1); zoneDV3N.ThermostatHeight = ipsc->rNumericArgs(2); @@ -968,7 +957,7 @@ namespace RoomAir { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: constexpr std::string_view routineName = "GetCrossVentData"; - + int IOStat; int NumAlpha; int NumNumber; @@ -1020,10 +1009,10 @@ namespace RoomAir { // Third Alpha is a string: JET or RECIRCULATION if (ipsc->lAlphaFieldBlanks(3)) { for (int Loop2 = 1; Loop2 <= state.dataHeatBal->TotPeople; ++Loop2) { - if (state.dataHeatBal->People(Loop2).ZonePtr != zoneCV.ZonePtr) continue; - if (!state.dataHeatBal->People(Loop2).Fanger) continue; - ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(3)); - ErrorsFound = true; + if (state.dataHeatBal->People(Loop2).ZonePtr != zoneCV.ZonePtr) continue; + if (!state.dataHeatBal->People(Loop2).Fanger) continue; + ShowSevereEmptyField(state, eoh, ipsc->cAlphaFieldNames(3)); + ErrorsFound = true; } } else if ((zoneCV.VforComfort = static_cast(getEnumValue(comfortNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(3))))) == Comfort::Invalid) { @@ -1035,9 +1024,8 @@ namespace RoomAir { // Following depend on valid zone - if (UtilityRoutines::FindItemInList(state.dataHeatBal->Zone(zoneCV.ZonePtr).Name, - state.afn->MultizoneZoneData, - &AirflowNetwork::MultizoneZoneProp::ZoneName) == 0) { + if (UtilityRoutines::FindItemInList( + state.dataHeatBal->Zone(zoneCV.ZonePtr).Name, state.afn->MultizoneZoneData, &AirflowNetwork::MultizoneZoneProp::ZoneName) == 0) { ShowSevereError(state, format("Problem with {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, "AirflowNetwork airflow model must be active in this zone"); ErrorsFound = true; @@ -1066,9 +1054,9 @@ namespace RoomAir { state.afn->MultizoneSurfaceCrackData(typeNum).exponent)); } } - } // if - } // for (iLink) - } // for (Loop) + } // if + } // for (iLink) + } // for (Loop) } void GetUFADZoneData(EnergyPlusData &state, bool &ErrorsFound) // True if errors found during this get input routine @@ -1089,7 +1077,7 @@ namespace RoomAir { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: constexpr std::string_view routineName = "GetUFADZoneData"; - + int IOStat; int NumAlpha; int NumNumber; @@ -1101,7 +1089,7 @@ namespace RoomAir { } auto &ipsc = state.dataIPShortCut; - + ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionInterior"; state.dataRoomAir->TotUFADInt = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); ipsc->cCurrentModuleObject = "RoomAirSettings:UnderFloorAirDistributionExterior"; @@ -1129,7 +1117,7 @@ namespace RoomAir { // First is Zone Name auto &zoneUI = state.dataRoomAir->ZoneUFAD(Loop); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - + zoneUI.ZoneName = ipsc->cAlphaArgs(1); zoneUI.ZonePtr = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), state.dataHeatBal->Zone); state.dataRoomAir->ZoneUFADPtr(zoneUI.ZonePtr) = Loop; @@ -1291,7 +1279,6 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; int ZoneNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone, state.dataGlobal->NumOfZones); if (ZoneNum == 0) { @@ -1301,10 +1288,9 @@ namespace RoomAir { } if (state.dataRoomAir->AirModel(ZoneNum).AirModel != RoomAirModel::AirflowNetwork) { ShowSevereError(state, - format("GetRoomAirflowNetworkData: Zone specified='{}', Air Model type is not AirflowNetwork.", - ipsc->cAlphaArgs(1))); - ShowContinueError( - state, format("Air Model Type for zone ={}", roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); + format("GetRoomAirflowNetworkData: Zone specified='{}', Air Model type is not AirflowNetwork.", ipsc->cAlphaArgs(1))); + ShowContinueError(state, + format("Air Model Type for zone ={}", roomAirModelNamesUC[(int)state.dataRoomAir->AirModel(ZoneNum).AirModel])); ErrorsFound = true; continue; } @@ -1320,31 +1306,31 @@ namespace RoomAir { if (roomAFNZoneInfo.NumOfAirNodes > 0) { roomAFNZoneInfo.Node.allocate(roomAFNZoneInfo.NumOfAirNodes); } else { - ShowSevereError( - state, - format("GetRoomAirflowNetworkData: Incomplete input in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); + ShowSevereError(state, + format("GetRoomAirflowNetworkData: Incomplete input in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ErrorsFound = true; } for (int iAirNode = 1; iAirNode <= roomAFNZoneInfo.NumOfAirNodes; ++iAirNode) { - roomAFNZoneInfo.Node(iAirNode).Name = ipsc->cAlphaArgs(iAirNode+3); + roomAFNZoneInfo.Node(iAirNode).Name = ipsc->cAlphaArgs(iAirNode + 3); } // control point node - roomAFNZoneInfo.ControlAirNodeID = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(3), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); + roomAFNZoneInfo.ControlAirNodeID = + UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(3), roomAFNZoneInfo.Node, roomAFNZoneInfo.NumOfAirNodes); if (roomAFNZoneInfo.ControlAirNodeID == 0) { ShowSevereItemNotFound(state, eoh, ipsc->cAlphaFieldNames(3), ipsc->cAlphaArgs(3)); ErrorsFound = true; continue; } - + roomAFNZoneInfo.totNumSurfs = 0; for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { auto &thisSpace = state.dataHeatBal->space(spaceNum); roomAFNZoneInfo.totNumSurfs += thisSpace.HTSurfaceLast - thisSpace.HTSurfaceFirst + 1; } } // for (Loop) - + ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork"; state.dataRoomAir->TotNumOfRoomAFNNodes = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cCurrentModuleObject); for (int Loop = 1; Loop <= state.dataRoomAir->TotNumOfRoomAFNNodes; ++Loop) { @@ -1414,18 +1400,15 @@ namespace RoomAir { ipsc->cAlphaFieldNames, ipsc->cNumericFieldNames); - for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { // find surface list int RAFNNodeNum = 0; auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); if (roomAFNZoneInfo.NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), - roomAFNZoneInfo.Node, - &AFNAirNodeNested::NodeSurfListName, - roomAFNZoneInfo.NumOfAirNodes); + RAFNNodeNum = UtilityRoutines::FindItemInList( + ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, &AFNAirNodeNested::NodeSurfListName, roomAFNZoneInfo.NumOfAirNodes); } - + if (RAFNNodeNum == 0) continue; // found it @@ -1468,10 +1451,7 @@ namespace RoomAir { } } if (NumSurfsThisNode != SurfCount) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - ipsc->cAlphaFieldNames(1), - ipsc->cAlphaArgs(1))); + ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, "Some surface names were not found in the zone"); ErrorsFound = true; @@ -1479,10 +1459,7 @@ namespace RoomAir { } // for (iZone) if (!foundList) { // throw error - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - ipsc->cAlphaFieldNames(1), - ipsc->cAlphaArgs(1))); + ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, "Did not find a RoomAir:Node:AirflowNetwork object that references this object"); ErrorsFound = true; @@ -1507,12 +1484,11 @@ namespace RoomAir { ipsc->cNumericFieldNames); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - + if (mod((NumAlphas + NumNumbers - 1), 3) != 0) { ShowSevereError(state, format("GetRoomAirflowNetworkData: For {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); - ShowContinueError(state, - format("Extensible field set are not evenly divisable by 3. Number of data entries = {}", - NumAlphas + NumNumbers - 1)); + ShowContinueError( + state, format("Extensible field set are not evenly divisable by 3. Number of data entries = {}", NumAlphas + NumNumbers - 1)); ErrorsFound = true; break; } @@ -1522,10 +1498,8 @@ namespace RoomAir { // find surface list int RAFNNodeNum = 0; if (roomAFNZoneInfo.NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), - roomAFNZoneInfo.Node, - &AFNAirNodeNested::NodeIntGainsListName, - roomAFNZoneInfo.NumOfAirNodes); + RAFNNodeNum = UtilityRoutines::FindItemInList( + ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, &AFNAirNodeNested::NodeIntGainsListName, roomAFNZoneInfo.NumOfAirNodes); } if (RAFNNodeNum == 0) continue; @@ -1536,16 +1510,13 @@ namespace RoomAir { int maxNumGains = numInputGains * numSpacesInZone; auto &roomAFNZoneNode = roomAFNZoneInfo.Node(RAFNNodeNum); if (allocated(roomAFNZoneNode.IntGain)) { - ShowSevereError(state, - format("GetRoomAirflowNetworkData: Invalid {} = {}", - ipsc->cAlphaFieldNames(1), - ipsc->cAlphaArgs(1))); + ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", ipsc->cAlphaFieldNames(1), ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Entered in {} = {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, format("Duplicate {} name.", ipsc->cCurrentModuleObject)); ErrorsFound = true; continue; } - + roomAFNZoneNode.IntGain.allocate(maxNumGains); roomAFNZoneNode.IntGainsDeviceIndices.allocate(maxNumGains); roomAFNZoneNode.intGainsDeviceSpaces.allocate(maxNumGains); @@ -1554,27 +1525,27 @@ namespace RoomAir { int numGainsFound = 0; for (int gainsLoop = 1; gainsLoop <= numInputGains; ++gainsLoop) { auto &intGain = roomAFNZoneNode.IntGain(gainsLoop); - intGain.type = static_cast(getEnumValue(DataHeatBalance::IntGainTypeNamesUC, - UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(gainsLoop * 2)))); - + intGain.type = static_cast( + getEnumValue(DataHeatBalance::IntGainTypeNamesUC, UtilityRoutines::makeUPPER(ipsc->cAlphaArgs(gainsLoop * 2)))); + if (intGain.type == DataHeatBalance::IntGainType::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(gainsLoop * 2), ipsc->cAlphaArgs(gainsLoop * 2)); ErrorsFound = true; continue; } intGain.Name = ipsc->cAlphaArgs(gainsLoop * 2 + 1); - + bool gainFound = false; // check all spaces in this zone for matching gains for (int spaceNum : state.dataHeatBal->Zone(iZone).spaceIndexes) { // verify type and name and get pointer to device in internal gains structure array int intGainIndex = GetInternalGainDeviceIndex(state, spaceNum, intGain.type, intGain.Name); if (intGainIndex >= 0) { - gainFound = true; - ++numGainsFound; - roomAFNZoneNode.intGainsDeviceSpaces(numGainsFound) = spaceNum; - roomAFNZoneNode.IntGainsDeviceIndices(numGainsFound) = intGainIndex; - roomAFNZoneNode.IntGainsFractions(numGainsFound) = ipsc->rNumericArgs(gainsLoop); + gainFound = true; + ++numGainsFound; + roomAFNZoneNode.intGainsDeviceSpaces(numGainsFound) = spaceNum; + roomAFNZoneNode.IntGainsDeviceIndices(numGainsFound) = intGainIndex; + roomAFNZoneNode.IntGainsFractions(numGainsFound) = ipsc->rNumericArgs(gainsLoop); } } if (gainFound) { @@ -1589,8 +1560,8 @@ namespace RoomAir { ErrorsFound = true; } } // for (gainsLoop) - } //for (iZone) - } // loop thru TotNumOfRAFNNodeGainsLists + } // for (iZone) + } // loop thru TotNumOfRAFNNodeGainsLists // Get data of HVAC equipment ipsc->cCurrentModuleObject = "RoomAir:Node:AirflowNetwork:HVACEquipment"; @@ -1610,7 +1581,7 @@ namespace RoomAir { ipsc->cNumericFieldNames); ErrorObjectHeader eoh{routineName, ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1)}; - + if (mod((NumAlphas + NumNumbers - 1), 4) != 0) { ShowSevereError(state, format("GetRoomAirflowNetworkData: For {}: {}", ipsc->cCurrentModuleObject, ipsc->cAlphaArgs(1))); ShowContinueError(state, @@ -1619,16 +1590,14 @@ namespace RoomAir { ErrorsFound = true; break; } - + for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); // find surface list - int RAFNNodeNum = 0; + int RAFNNodeNum = 0; if (roomAFNZoneInfo.NumOfAirNodes > 0) { - RAFNNodeNum = UtilityRoutines::FindItemInList(ipsc->cAlphaArgs(1), - roomAFNZoneInfo.Node, - &AFNAirNodeNested::NodeHVACListName, - roomAFNZoneInfo.NumOfAirNodes); + RAFNNodeNum = UtilityRoutines::FindItemInList( + ipsc->cAlphaArgs(1), roomAFNZoneInfo.Node, &AFNAirNodeNested::NodeHVACListName, roomAFNZoneInfo.NumOfAirNodes); } if (RAFNNodeNum == 0) continue; @@ -1649,14 +1618,14 @@ namespace RoomAir { for (int iEquip = 1; iEquip <= roomAFNNode.NumHVACs; ++iEquip) { int iEquipArg = 2 + (iEquip - 1) * 2; auto &roomAFNNodeHVAC = roomAFNNode.HVAC(iEquip); - roomAFNNodeHVAC.zoneEquipType = - static_cast(getEnumValue(DataZoneEquipment::zoneEquipTypeNamesUC, ipsc->cAlphaArgs(iEquipArg))); + roomAFNNodeHVAC.zoneEquipType = static_cast( + getEnumValue(DataZoneEquipment::zoneEquipTypeNamesUC, ipsc->cAlphaArgs(iEquipArg))); if (roomAFNNodeHVAC.zoneEquipType == DataZoneEquipment::ZoneEquipType::Invalid) { ShowSevereInvalidKey(state, eoh, ipsc->cAlphaFieldNames(iEquipArg), ipsc->cAlphaArgs(iEquipArg)); ErrorsFound = true; } roomAFNNodeHVAC.Name = ipsc->cAlphaArgs(3 + (iEquip - 1) * 2); - + // verify type and name and get pointer to device in HVAC equipment type and name structure array TotNumEquip = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, ipsc->cAlphaArgs(iEquipArg)); if (TotNumEquip == 0) { @@ -1665,15 +1634,14 @@ namespace RoomAir { } roomAFNNodeHVAC.SupplyFraction = ipsc->rNumericArgs(iEquipArg); roomAFNNodeHVAC.ReturnFraction = ipsc->rNumericArgs(iEquipArg); - - IntEquipError = CheckEquipName( - state, + + IntEquipError = CheckEquipName(state, roomAFNNodeHVAC.Name, roomAFNNodeHVAC.SupplyNodeName, roomAFNNodeHVAC.ReturnNodeName, TotNumEquip, roomAFNNodeHVAC.zoneEquipType); - + if (!IntEquipError) { ShowSevereError(state, format("GetRoomAirflowNetworkData: Invalid {} = {}", @@ -1687,14 +1655,13 @@ namespace RoomAir { // TYPE RoomAirflowNetworkHVACStruct // INTEGER::EquipConfigIndex = 0 } // for (iEquip) - } // for (Zone) - } // loop thru TotNumOfRAFNNodeHVACLists + } // for (Zone) + } // loop thru TotNumOfRAFNNodeHVACLists // do some checks on input data for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); - if (roomAFNZoneInfo.NumOfAirNodes == 0) - continue; + if (roomAFNZoneInfo.NumOfAirNodes == 0) continue; // Check zone volume fraction Real64 SumFraction = 0.0; @@ -1703,8 +1670,7 @@ namespace RoomAir { } if (std::abs(SumFraction - 1.0) > 0.001) { ShowSevereError(state, "GetRoomAirflowNetworkData: Invalid, zone volume fractions do not sum to 1.0"); - ShowContinueError(state, - format("Entered in RoomAir:Node:AirflowNetwork with Zone Name = {}", state.dataHeatBal->Zone(iZone).Name)); + ShowContinueError(state, format("Entered in RoomAir:Node:AirflowNetwork with Zone Name = {}", state.dataHeatBal->Zone(iZone).Name)); ShowContinueError(state, "The Fraction of Zone Air Volume values across all the nodes needs to sum to 1.0."); ShowContinueError(state, format("The sum of fractions entered = {:.3R}", SumFraction)); ErrorsFound = true; @@ -1741,16 +1707,15 @@ namespace RoomAir { ErrorsFound = true; } } // for (iGain) - } // for (iRoomAFNNode) - } // for (iZone) + } // for (iRoomAFNNode) + } // for (iZone) + + if (ErrorsFound) return; - if (ErrorsFound) - return; - for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { auto &roomAFNZoneInfo = state.dataRoomAir->AFNZoneInfo(iZone); if (!roomAFNZoneInfo.IsUsed || roomAFNZoneInfo.NumOfAirNodes == 0) continue; - + for (int iAirNode = 1; iAirNode <= roomAFNZoneInfo.NumOfAirNodes; ++iAirNode) { auto &roomAFNZoneNode = roomAFNZoneInfo.Node(iAirNode); SetupOutputVariable(state, @@ -1775,7 +1740,7 @@ namespace RoomAir { OutputProcessor::SOVStoreType::Average, roomAFNZoneNode.Name); } // for (iAirNodE) - } // for (iZone) + } // for (iZone) } void SharedDVCVUFDataInit(EnergyPlusData &state, int const ZoneNum) @@ -1840,15 +1805,15 @@ namespace RoomAir { state.dataRoomAir->APos_Wall = 0; state.dataRoomAir->APos_Floor = 0; state.dataRoomAir->APos_Ceiling = 0; - std::fill(state.dataRoomAir->PosZ_Wall.begin(),state.dataRoomAir->PosZ_Wall.end(), BegEnd()); - std::fill(state.dataRoomAir->PosZ_Floor.begin(),state.dataRoomAir->PosZ_Floor.end(), BegEnd()); - std::fill(state.dataRoomAir->PosZ_Ceiling.begin(),state.dataRoomAir->PosZ_Ceiling.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Wall.begin(), state.dataRoomAir->PosZ_Wall.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Floor.begin(), state.dataRoomAir->PosZ_Floor.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Ceiling.begin(), state.dataRoomAir->PosZ_Ceiling.end(), BegEnd()); state.dataRoomAir->APos_Window = 0; state.dataRoomAir->APos_Door = 0; state.dataRoomAir->APos_Internal = 0; - std::fill(state.dataRoomAir->PosZ_Window.begin(),state.dataRoomAir->PosZ_Window.end(), BegEnd()); - std::fill(state.dataRoomAir->PosZ_Door.begin(),state.dataRoomAir->PosZ_Door.end(), BegEnd()); - std::fill(state.dataRoomAir->PosZ_Internal.begin(),state.dataRoomAir->PosZ_Internal.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Window.begin(), state.dataRoomAir->PosZ_Window.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Door.begin(), state.dataRoomAir->PosZ_Door.end(), BegEnd()); + std::fill(state.dataRoomAir->PosZ_Internal.begin(), state.dataRoomAir->PosZ_Internal.end(), BegEnd()); state.dataRoomAir->HCeiling = 0.0; state.dataRoomAir->HWall = 0.0; state.dataRoomAir->HFloor = 0.0; @@ -1859,7 +1824,7 @@ namespace RoomAir { int contWall = 0, contFloor = 0, contCeiling = 0, contWindow = 0, contInternal = 0, contDoor = 0; int contWallBeg = 0, contFloorBeg = 0, contCeilingBeg = 0, contWindowBeg = 0, contInternalBeg = 0, contDoorBeg = 0; int contWallLast = 0, contFloorLast = 0, contCeilingLast = 0, contWindowLast = 0, contInternalLast = 0, contDoorLast = 0; - + // Put the surface and zone information in Apos and PosZ arrays for (int ZNum = 1; ZNum <= state.dataGlobal->NumOfZones; ++ZNum) { // advance ONE position in the arrays PosZ because this is a new zone @@ -1884,8 +1849,12 @@ namespace RoomAir { // Recalculate lowest and highest height for the zone for (int i = 1, u = surf.Sides; i <= u; ++i) { Real64 const z_i = surf.Vertex(i).z; - if (z_i < Z1ofZone) { Z1ofZone = z_i; }; - if (z_i > Z2ofZone) { Z2ofZone = z_i; }; + if (z_i < Z1ofZone) { + Z1ofZone = z_i; + }; + if (z_i > Z2ofZone) { + Z2ofZone = z_i; + }; } } @@ -1954,8 +1923,7 @@ namespace RoomAir { ++AuxSurf(mzSurf.Zone); ++state.dataRoomAir->CrossVentNumAFNSurfaces; // Check if this is an interzone airflow network surface - if (mzSurf.ExtBoundCond > 0 && - (state.afn->MultizoneSurfaceData(iMzLink).SurfNum != mzSurf.ExtBoundCond)) { + if (mzSurf.ExtBoundCond > 0 && (state.afn->MultizoneSurfaceData(iMzLink).SurfNum != mzSurf.ExtBoundCond)) { ++AuxSurf(state.dataSurface->Surface(mzSurf.ExtBoundCond).Zone); ++state.dataRoomAir->CrossVentNumAFNSurfaces; } @@ -1983,9 +1951,8 @@ namespace RoomAir { for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { // the 0 component of the array has the number of relevant AirflowNetwork surfaces for the zone state.dataRoomAir->AFNSurfaceCrossVent(0, iZone) = AuxSurf(iZone); - if (AuxSurf(iZone) == 0) - continue; - + if (AuxSurf(iZone) == 0) continue; + Real64 const ceilingHeight = state.dataRoomAir->ZoneCeilingHeight1(iZone); int SurfNum = 1; @@ -2029,20 +1996,22 @@ namespace RoomAir { } surfParams.Width = WidthFactMax * mzSurf.Width; surfParams.Height = HeightFactMax * mzSurf.Height; - - } else if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK + + } else if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == + AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK surfParams.Width = mzSurf.Width / 2; auto const &zoneHeatBal = state.dataZoneTempPredictorCorrector->zoneHeatBalance(iZone); - Real64 AinCV = - state.afn->MultizoneSurfaceCrackData(typeNum).coefficient / - (BaseDischargeCoef * - std::sqrt(2.0 / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, zoneHeatBal.MAT, zoneHeatBal.ZoneAirHumRat))); + Real64 AinCV = state.afn->MultizoneSurfaceCrackData(typeNum).coefficient / + (BaseDischargeCoef * + std::sqrt(2.0 / PsyRhoAirFnPbTdbW( + state, state.dataEnvrn->OutBaroPress, zoneHeatBal.MAT, zoneHeatBal.ZoneAirHumRat))); surfParams.Height = AinCV / surfParams.Width; } // calculate the surface Zmin and Zmax - if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP || - state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK + if (state.afn->AirflowNetworkCompData(compNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP || + state.afn->AirflowNetworkCompData(compNum).CompTypeNum == + AirflowNetwork::iComponentTypeNum::SCR) { // surface type = CRACK Real64 z_min(std::numeric_limits::max()), z_max(std::numeric_limits::lowest()); for (int i = 1; i <= mzSurf.Sides; ++i) { Real64 const z_i = mzSurf.Vertex(i).z; @@ -2068,7 +2037,7 @@ namespace RoomAir { } } } // for (Loop2) - } // for (iZone) + } // for (iZone) AuxSurf.deallocate(); @@ -2237,7 +2206,7 @@ namespace RoomAir { OutputProcessor::SOVStoreType::State, state.dataHeatBal->Zone(iZone).Name); } // for (iZone) - } // if (any(IsZoneDV)) + } // if (any(IsZoneDV)) if (any(state.dataRoomAir->IsZoneUFAD)) { state.dataRoomAir->ZoneUFADMixedFlag.allocate(state.dataGlobal->NumOfZones); @@ -2252,11 +2221,10 @@ namespace RoomAir { state.dataRoomAir->ZoneUFADGamma = 0.0; state.dataRoomAir->ZoneUFADPowInPlumes = 0.0; state.dataRoomAir->ZoneUFADPowInPlumesfromWindows = 0.0; - + // Output variables and UF zone flag for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::UFADInt) - continue; // don't set these up if they don't make sense + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::UFADInt) continue; // don't set these up if they don't make sense auto &zone = state.dataHeatBal->Zone(iZone); // CurrentModuleObject='RoomAirSettings:UnderFloorAirDistributionInterior' @@ -2335,10 +2303,8 @@ namespace RoomAir { state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(iZone)).ZoneEquipPtr = iZone; } // for (iZone) - for (int iZone = 1; iZone <= state.dataGlobal->NumOfZones; ++iZone) { - if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::UFADExt) - continue; // don't set these up if they don't make sense + if (state.dataRoomAir->AirModel(iZone).AirModel != RoomAirModel::UFADExt) continue; // don't set these up if they don't make sense // CurrentModuleObject='RoomAirSettings:UnderFloorAirDistributionExterior' auto const &zone = state.dataHeatBal->Zone(iZone); SetupOutputVariable(state, @@ -2478,10 +2444,9 @@ namespace RoomAir { if (state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum).IsControlled) { state.dataRoomAir->IsZoneCrossVent(iZone) = false; state.dataRoomAir->AirModel(iZone).SimAirModel = false; - ShowSevereError(state, - format("Unmixed Flow: Cross Ventilation cannot be applied for Zone={}", zone.Name)); - ShowContinueError(state, - format("An HVAC system is present in the zone. Fully mixed airflow model will be used for Zone={}", zone.Name)); + ShowSevereError(state, format("Unmixed Flow: Cross Ventilation cannot be applied for Zone={}", zone.Name)); + ShowContinueError( + state, format("An HVAC system is present in the zone. Fully mixed airflow model will be used for Zone={}", zone.Name)); continue; } // CurrentModuleObject='RoomAirSettings:CrossVentilation' @@ -2551,18 +2516,17 @@ namespace RoomAir { for (int i = 1; i <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++i) { int N = state.afn->AirflowNetworkLinkageData(i).CompNum; if (state.afn->AirflowNetworkCompData(N).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) { - SetupOutputVariable( - state, - "Room Air Window Jet Region Average Air Velocity", - OutputProcessor::Unit::m_s, - state.dataRoomAir->CrossVentJetRecFlows(i, iZone).Ujet, - OutputProcessor::SOVTimeStepType::Zone, - OutputProcessor::SOVStoreType::Average, - state.afn->MultizoneSurfaceData(i).SurfName); + SetupOutputVariable(state, + "Room Air Window Jet Region Average Air Velocity", + OutputProcessor::Unit::m_s, + state.dataRoomAir->CrossVentJetRecFlows(i, iZone).Ujet, + OutputProcessor::SOVTimeStepType::Zone, + OutputProcessor::SOVStoreType::Average, + state.afn->MultizoneSurfaceData(i).SurfName); } } } // for (iZone) - } // if (any(isZoneCV)) + } // if (any(isZoneCV)) state.dataRoomAir->MyEnvrnFlag = true; @@ -2713,8 +2677,7 @@ namespace RoomAir { std::string &SupplyNodeName, // Supply node name std::string &ReturnNodeName, // Return node name int TotNumEquip, // how many of this equipment type - DataZoneEquipment::ZoneEquipType zoneEquipType - ) + DataZoneEquipment::ZoneEquipType zoneEquipType) { // FUNCTION INFORMATION: @@ -2782,14 +2745,14 @@ namespace RoomAir { switch (zoneEquipType) { case DataZoneEquipment::ZoneEquipType::VariableRefrigerantFlowTerminal: { // ZoneHVAC:TerminalUnit : VariableRefrigerantFlow SupplyNodeName = Alphas(4); - ReturnNodeName = ""; // Zone return node + ReturnNodeName = ""; // Zone return node } break; case DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator: { // ZoneHVAC : EnergyRecoveryVentilator int nodeNum = GetFanOutletNode(state, "Fan:OnOff", Alphas(4), errorfound); if (errorfound) { } - SupplyNodeName = state.dataLoopNodes->NodeID(nodeNum); // ????? - ReturnNodeName = ""; // Zone exhaust node + SupplyNodeName = state.dataLoopNodes->NodeID(nodeNum); // ????? + ReturnNodeName = ""; // Zone exhaust node } break; case DataZoneEquipment::ZoneEquipType::FourPipeFanCoil: { // ZoneHVAC : FourPipeFanCoil SupplyNodeName = Alphas(6); @@ -2828,7 +2791,7 @@ namespace RoomAir { ReturnNodeName = Alphas(3); } break; case DataZoneEquipment::ZoneEquipType::BaseboardElectric: { // ZoneHVAC : Baseboard : RadiantConvective : Electric - SupplyNodeName = ""; // convection only + SupplyNodeName = ""; // convection only } break; case DataZoneEquipment::ZoneEquipType::BaseboardWater: { // ZoneHVAC : Baseboard : RadiantConvective : Water SupplyNodeName = ""; @@ -2861,8 +2824,8 @@ namespace RoomAir { SupplyNodeName = Alphas(11); ReturnNodeName = Alphas(9); } break; - case DataZoneEquipment::ZoneEquipType::ExhaustFan: { // Fan : ZoneExhaust - SupplyNodeName = ""; // ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? May not use + case DataZoneEquipment::ZoneEquipType::ExhaustFan: { // Fan : ZoneExhaust + SupplyNodeName = ""; // ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? May not use } break; case DataZoneEquipment::ZoneEquipType::HeatPumpWaterHeater: { // WaterHeater : HeatPump SupplyNodeName = Alphas(8); @@ -2882,7 +2845,7 @@ namespace RoomAir { ReturnNodeName = ""; } break; case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctConstantVolumeNoReheat: { // AirTerminal : SingleDuct : - // ConstantVolume : NoReheat + // ConstantVolume : NoReheat SupplyNodeName = Alphas(4); ReturnNodeName = ""; } break; @@ -2903,27 +2866,27 @@ namespace RoomAir { ReturnNodeName = ""; } break; case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctCAVFourPipeInduction: { // AirTerminal : SingleDuct : - // ConstantVolume : FourPipeInduction + // ConstantVolume : FourPipeInduction SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctVAVReheatVariableSpeedFan: { // AirTerminal : SingleDuct : VAV - // : Reheat : VariableSpeedFan + // : Reheat : VariableSpeedFan SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctVAVHeatAndCoolReheat: { // AirTerminal : SingleDuct : VAV : - // HeatAndCool : Reheat + // HeatAndCool : Reheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctVAVHeatAndCoolNoReheat: { // AirTerminal : SingleDuct : VAV : - // HeatAndCool : NoReheat + // HeatAndCool : NoReheat SupplyNodeName = Alphas(1); ReturnNodeName = ""; } break; case DataZoneEquipment::ZoneEquipType::AirTerminalSingleDuctConstantVolumeCooledBeam: { // AirTerminal : SingleDuct : - // ConstantVolume : CooledBeam + // ConstantVolume : CooledBeam SupplyNodeName = Alphas(5); ReturnNodeName = ""; } break; @@ -2932,14 +2895,14 @@ namespace RoomAir { ReturnNodeName = ""; } break; case DataZoneEquipment::ZoneEquipType::AirLoopHVACReturnAir: { // AirLoopHVACReturnAir - SupplyNodeName = Alphas(4); // - ReturnNodeName = ""; // + SupplyNodeName = Alphas(4); // + ReturnNodeName = ""; // } break; default: { assert(false); } break; - - } // switch + + } // switch // Need to find a better to handle allocate and deallocate if (MaxAlphas > NumAlphas) { diff --git a/src/EnergyPlus/RoomAirModelManager.hh b/src/EnergyPlus/RoomAirModelManager.hh index d7dc0182c03..b01b6952ff1 100644 --- a/src/EnergyPlus/RoomAirModelManager.hh +++ b/src/EnergyPlus/RoomAirModelManager.hh @@ -86,11 +86,11 @@ namespace RoomAir { bool &Errorfound); // find zone number and node number based on the node name bool CheckEquipName(EnergyPlusData &state, - std::string const &EquipName, // Equipment Name - std::string &SupplyNodeName, // Supply node name - std::string &ReturnNodeName, // Return node name - int TotNumEquip, // how many of this equipment type - DataZoneEquipment::ZoneEquipType zoneEquipType); // equipment type number + std::string const &EquipName, // Equipment Name + std::string &SupplyNodeName, // Supply node name + std::string &ReturnNodeName, // Return node name + int TotNumEquip, // how many of this equipment type + DataZoneEquipment::ZoneEquipType zoneEquipType); // equipment type number } // namespace RoomAir diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index 9ea43a42dec..fd8b5ec4c22 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -322,7 +322,7 @@ void FigureHeightPattern(EnergyPlusData &state, int const PattrnID, int const Zo if ((hiSideZeta - lowSideZeta) != 0.0) { Real64 fractBtwn = (zeta - lowSideZeta) / (hiSideZeta - lowSideZeta); tmpDeltaTai = pattern.VertPatrn.DeltaTaiPatrn(lowSideID) + - fractBtwn * (pattern.VertPatrn.DeltaTaiPatrn(highSideID) - pattern.VertPatrn.DeltaTaiPatrn(lowSideID)); + fractBtwn * (pattern.VertPatrn.DeltaTaiPatrn(highSideID) - pattern.VertPatrn.DeltaTaiPatrn(lowSideID)); } else { // would divide by zero, using low side value @@ -354,7 +354,7 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c // calculations vary by mode // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 Grad; // vertical temperature gradient C/m + Real64 Grad; // vertical temperature gradient C/m auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); auto &pattern = state.dataRoomAir->AirPattern(PattrnID); @@ -383,7 +383,10 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c switch (pattern.TwoGradPatrn.InterpolationMode) { case UserDefinedPatternMode::OutdoorDryBulb: { Grad = OutdoorDryBulbGrad(state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp, - twoGrad.UpperBoundTempScale, twoGrad.HiGradient, twoGrad.LowerBoundTempScale, twoGrad.LowGradient); + twoGrad.UpperBoundTempScale, + twoGrad.HiGradient, + twoGrad.LowerBoundTempScale, + twoGrad.LowGradient); } break; case UserDefinedPatternMode::ZoneAirTemp: { if (Tmean >= twoGrad.UpperBoundTempScale) { @@ -394,9 +397,8 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c // bad user input, trapped during get input Grad = twoGrad.LowGradient; } else { - Grad = twoGrad.LowGradient + - ((Tmean - twoGrad.LowerBoundTempScale) / (twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale)) * - (twoGrad.HiGradient - twoGrad.LowGradient); + Grad = twoGrad.LowGradient + ((Tmean - twoGrad.LowerBoundTempScale) / (twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } break; case UserDefinedPatternMode::DeltaOutdoorZone: { @@ -408,9 +410,8 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c } else if ((twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale) == 0.0) { Grad = twoGrad.LowGradient; } else { - Grad = twoGrad.LowGradient + - ((DeltaT - twoGrad.LowerBoundTempScale) / (twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale)) * - (twoGrad.HiGradient - twoGrad.LowGradient); + Grad = twoGrad.LowGradient + ((DeltaT - twoGrad.LowerBoundTempScale) / (twoGrad.UpperBoundTempScale - twoGrad.LowerBoundTempScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } break; case UserDefinedPatternMode::SensibleCooling: { @@ -428,7 +429,7 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c Grad = twoGrad.LowGradient + ((CoolLoad - twoGrad.LowerBoundHeatRateScale) / (twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale)) * - (twoGrad.HiGradient - twoGrad.LowGradient); + (twoGrad.HiGradient - twoGrad.LowGradient); } } } break; @@ -442,8 +443,8 @@ void FigureTwoGradInterpPattern(EnergyPlusData &state, int const PattrnID, int c Grad = twoGrad.LowGradient; } else { Grad = twoGrad.LowGradient + - ((HeatLoad - twoGrad.LowerBoundHeatRateScale) / (twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale)) * - (twoGrad.HiGradient - twoGrad.LowGradient); + ((HeatLoad - twoGrad.LowerBoundHeatRateScale) / (twoGrad.UpperBoundHeatRateScale - twoGrad.LowerBoundHeatRateScale)) * + (twoGrad.HiGradient - twoGrad.LowGradient); } } break; default: @@ -475,7 +476,7 @@ Real64 OutdoorDryBulbGrad(Real64 DryBulbTemp, // Zone(ZoneNum).OutDryBulbTemp return HiGradient; } else if (DryBulbTemp <= LowerBound) { return LowGradient; - } else if ((UpperBound - LowerBound) == 0.0) { + } else if ((UpperBound - LowerBound) == 0.0) { return LowGradient; } else { return LowGradient + ((DryBulbTemp - LowerBound) / (UpperBound - LowerBound)) * (HiGradient - LowGradient); @@ -491,7 +492,7 @@ void FigureConstGradPattern(EnergyPlusData &state, int const PattrnID, int const auto &patternZoneInfo = state.dataRoomAir->AirPatternZoneInfo(ZoneNum); auto &pattern = state.dataRoomAir->AirPattern(PattrnID); - Real64 Tmean = patternZoneInfo.TairMean; // MAT + Real64 Tmean = patternZoneInfo.TairMean; // MAT Real64 Grad = pattern.GradPatrn.Gradient; // Vertical temperature gradient Real64 ZetaTmean = 0.5; // non-dimensional height for MAT @@ -561,7 +562,7 @@ Real64 FigureNDheightInZone(EnergyPlusData &state, int const thisHBsurf) // inde } ZFlrAvg = (FloorCount > 0.0) ? (ZFlrAvg / FloorCount) : ZMin; - + Real64 ZoneZorig = ZFlrAvg; // Z floor [M] Real64 ZoneCeilHeight = zone.CeilingHeight; @@ -573,9 +574,7 @@ Real64 FigureNDheightInZone(EnergyPlusData &state, int const thisHBsurf) // inde if (SurfMinZ < (ZoneZorig - TolValue)) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "RoomAirModelUserTempPattern: Problem in non-dimensional height calculation"); - ShowContinueError( - state, - format("too low surface: {} in zone: {}", state.dataSurface->Surface(thisHBsurf).Name, zone.Name)); + ShowContinueError(state, format("too low surface: {} in zone: {}", state.dataSurface->Surface(thisHBsurf).Name, zone.Name)); ShowContinueError(state, format("**** Average floor height of zone is: {:.3R}", ZoneZorig)); ShowContinueError(state, format("**** Surface minimum height is: {:.3R}", SurfMinZ)); } else { @@ -586,9 +585,7 @@ Real64 FigureNDheightInZone(EnergyPlusData &state, int const thisHBsurf) // inde if (SurfMaxZ > (ZoneZorig + ZoneCeilHeight + TolValue)) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "RoomAirModelUserTempPattern: Problem in non-dimensional height calculation"); - ShowContinueError( - state, - format(" too high surface: {} in zone: {}", state.dataSurface->Surface(thisHBsurf).Name, zone.Name)); + ShowContinueError(state, format(" too high surface: {} in zone: {}", state.dataSurface->Surface(thisHBsurf).Name, zone.Name)); ShowContinueError(state, format("**** Average Ceiling height of zone is: {:.3R}", (ZoneZorig + ZoneCeilHeight))); ShowContinueError(state, format("**** Surface Maximum height is: {:.3R}", SurfMaxZ)); } else { @@ -598,8 +595,10 @@ Real64 FigureNDheightInZone(EnergyPlusData &state, int const thisHBsurf) // inde // non dimensionalize. Real64 Zeta = (Zcm - ZoneZorig) / ZoneCeilHeight; - if (Zeta > 0.99) Zeta = 0.99; - else if (Zeta < 0.01) Zeta = 0.01; + if (Zeta > 0.99) + Zeta = 0.99; + else if (Zeta < 0.01) + Zeta = 0.01; return Zeta; } @@ -643,7 +642,7 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // } // What if ZoneNodeID is 0? - + auto &zoneNode = state.dataLoopNodes->Node(patternZoneInfo.ZoneNodeID); auto &zone = state.dataHeatBal->Zone(ZoneNum); auto &zoneHeatBal = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); @@ -678,11 +677,10 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // for (int SurfNum = thisSpace.HTSurfaceFirst; SurfNum <= thisSpace.HTSurfaceLast; ++SurfNum) { if (state.dataSurface->SurfWinAirflowThisTS(SurfNum) > 0.0 && state.dataSurface->SurfWinAirflowDestination(SurfNum) == DataSurfaces::WindowAirFlowDestination::Return) { - Real64 FlowThisTS = PsyRhoAirFnPbTdbW(state, - state.dataEnvrn->OutBaroPress, - state.dataSurface->SurfWinTAirflowGapOutlet(SurfNum), - zoneNode.HumRat) * - state.dataSurface->SurfWinAirflowThisTS(SurfNum) * state.dataSurface->Surface(SurfNum).Width; + Real64 FlowThisTS = + PsyRhoAirFnPbTdbW( + state, state.dataEnvrn->OutBaroPress, state.dataSurface->SurfWinTAirflowGapOutlet(SurfNum), zoneNode.HumRat) * + state.dataSurface->SurfWinAirflowThisTS(SurfNum) * state.dataSurface->Surface(SurfNum).Width; WinGapFlowToRA += FlowThisTS; WinGapFlowTtoRA += FlowThisTS * state.dataSurface->SurfWinTAirflowGapOutlet(SurfNum); } @@ -753,7 +751,7 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // returnNode.HumRat = zoneNode.HumRat; state.dataHeatBal->RefrigCaseCredit(ZoneNum).LatCaseCreditToZone += state.dataHeatBal->RefrigCaseCredit(ZoneNum).LatCaseCreditToHVAC; // shouldn't the HVAC term be zeroed out then? - + zoneHeatBal.ZoneLatentGain += SumAllReturnAirLatentGains(state, ZoneNum, returnNodeNum); } diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index 132b9ac5978..929afbc2c98 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -467,8 +467,7 @@ void ParseStack(EnergyPlusData &state, int const StackNum) } else { Pos = scan(Remainder, ' '); if (Pos == std::string::npos) Pos = Remainder.length(); - Variable = - UtilityRoutines::makeUPPER(stripped(Remainder.substr(0, Pos))); // really the subroutine, or reference to instruction set + Variable = UtilityRoutines::makeUPPER(stripped(Remainder.substr(0, Pos))); // really the subroutine, or reference to instruction set StackNum2 = UtilityRoutines::FindItemInList(Variable, state.dataRuntimeLang->ErlStack); if (StackNum2 == 0) { AddError(state, StackNum, LineNum, "Program or Subroutine name [" + Variable + "] not found for the RUN instruction."); diff --git a/src/EnergyPlus/SQLiteProcedures.hh b/src/EnergyPlus/SQLiteProcedures.hh index 54736a9a94c..956a83827a6 100644 --- a/src/EnergyPlus/SQLiteProcedures.hh +++ b/src/EnergyPlus/SQLiteProcedures.hh @@ -971,9 +971,8 @@ private: std::shared_ptr const &db, int const roomAirModelNumber, RoomAir::AirModelData const &roomAirModelData) - : SQLiteData(errorStream, db), number(roomAirModelNumber), airModelName(roomAirModelData.Name), - airModel(roomAirModelData.AirModel), tempCoupleScheme(roomAirModelData.TempCoupleScheme), - simAirModel(roomAirModelData.SimAirModel) + : SQLiteData(errorStream, db), number(roomAirModelNumber), airModelName(roomAirModelData.Name), airModel(roomAirModelData.AirModel), + tempCoupleScheme(roomAirModelData.TempCoupleScheme), simAirModel(roomAirModelData.SimAirModel) { } diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index c62868b275d..a44fd91983d 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -1677,8 +1677,8 @@ void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound) state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType = cAlphaArgs(2); // setup program flow control integers. - state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = static_cast(getEnumValue( - controlTypeNameUC, UtilityRoutines::makeUPPER(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType))); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = static_cast( + getEnumValue(controlTypeNameUC, UtilityRoutines::makeUPPER(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ctrlVarType))); if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == CtrlVarType::Invalid) { // should not come here if idd type choice and key list is working ShowSevereError(state, format("{}: {}=\"{}\", invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1))); diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 8743c5d2bd5..301edadf7d4 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -2480,8 +2480,7 @@ void ProcessInputOARequirements(EnergyPlusData &state, auto &thisOARequirements(state.dataSize->OARequirements(OAIndex)); if (NumAlphas > 1) { - thisOARequirements.OAFlowMethod = - static_cast(getEnumValue(OAFlowCalcMethodNamesUC, UtilityRoutines::makeUPPER(Alphas(2)))); + thisOARequirements.OAFlowMethod = static_cast(getEnumValue(OAFlowCalcMethodNamesUC, UtilityRoutines::makeUPPER(Alphas(2)))); if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Invalid) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name)); ShowContinueError(state, format("...Invalid {}=\"{}\",", cAlphaFields(2), Alphas(2))); @@ -3423,8 +3422,8 @@ void GetZoneSizingInput(EnergyPlusData &state) ErrorsFound = true; } } - zoneSizingIndex.zoneSizingMethod = static_cast( - getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + zoneSizingIndex.zoneSizingMethod = + static_cast(getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (zoneSizingIndex.zoneSizingMethod != ZoneSizing::SensibleOnly) { zoneSizingIndex.zoneLatentSizing = true; state.dataHeatBal->DoLatentSizing = true; @@ -4261,8 +4260,8 @@ void GetPlantSizingInput(EnergyPlusData &state) constexpr static std::array(DataSizing::TypeOfPlantLoop::Num)> TypeOfPlantLoopNamesUC = { "HEATING", "COOLING", "CONDENSER", "STEAM"}; - state.dataSize->PlantSizData(PltSizIndex).LoopType = static_cast( - getEnumValue(TypeOfPlantLoopNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + state.dataSize->PlantSizData(PltSizIndex).LoopType = + static_cast(getEnumValue(TypeOfPlantLoopNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); assert(state.dataSize->PlantSizData(PltSizIndex).LoopType != TypeOfPlantLoop::Invalid); if (NumAlphas > 2) { diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index 10124cd192e..70db3acca88 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -704,7 +704,8 @@ namespace SteamBaseboardRadiator { // search zone equipment list structure for zone index for (int ctrlZone = 1; ctrlZone <= state.dataGlobal->NumOfZones; ++ctrlZone) { for (int zoneEquipTypeNum = 1; zoneEquipTypeNum <= state.dataZoneEquip->ZoneEquipList(ctrlZone).NumOfEquipTypes; ++zoneEquipTypeNum) { - if (state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipType(zoneEquipTypeNum) == DataZoneEquipment::ZoneEquipType::BaseboardSteam && + if (state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipType(zoneEquipTypeNum) == + DataZoneEquipment::ZoneEquipType::BaseboardSteam && state.dataZoneEquip->ZoneEquipList(ctrlZone).EquipName(zoneEquipTypeNum) == state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID) { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).ZonePtr = ctrlZone; diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index bf72eaa1ff9..e602cc04571 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -337,8 +337,7 @@ namespace SteamCoils { ObjectIsNotParent); std::string controlMode = UtilityRoutines::makeUPPER(AlphArray(7)); - state.dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil = - static_cast(getEnumValue(coilControlTypeNames, controlMode)); + state.dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil = static_cast(getEnumValue(coilControlTypeNames, controlMode)); switch (state.dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil) { case CoilControlType::TemperatureSetPoint: state.dataSteamCoils->SteamCoil(CoilNum).TempSetPointNodeNum = GetOnlySingleNode(state, diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index fd3bac92a01..dc620b6838a 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -8556,16 +8556,14 @@ namespace SurfaceGeometry { if (TempSchName != groundSurface.end()) { std::string gnd_surf_TempSchName = TempSchName.value().get(); if (!gnd_surf_TempSchName.empty()) { - thisGndSurf.TempSchPtr = - ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(gnd_surf_TempSchName)); + thisGndSurf.TempSchPtr = ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(gnd_surf_TempSchName)); } } auto ReflSchName = groundSurface.find("ground_surface_reflectance_schedule_name"); if (ReflSchName != groundSurface.end()) { std::string gnd_surf_ReflSchName = ReflSchName.value().get(); if (!gnd_surf_ReflSchName.empty()) { - thisGndSurf.ReflSchPtr = - ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(gnd_surf_ReflSchName)); + thisGndSurf.ReflSchPtr = ScheduleManager::GetScheduleIndex(state, UtilityRoutines::makeUPPER(gnd_surf_ReflSchName)); } } thisGndSurfsObj.GndSurfs.push_back(thisGndSurf); @@ -10137,8 +10135,8 @@ namespace SurfaceGeometry { state.dataIPShortCut->cAlphaFieldNames(7), state.dataIPShortCut->cAlphaFieldNames(5))); } - windowShadingControl.slatAngleControl = static_cast( - getEnumValue(SlatAngleNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); + windowShadingControl.slatAngleControl = + static_cast(getEnumValue(SlatAngleNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); // For upward compatibility change old "noninsulating" and "insulating" shade types to // INTERIORSHADE or EXTERIORSHADE @@ -12175,8 +12173,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->cAlphaArgs(3), state.dataMaterial->Material, state.dataMaterial->TotMaterials); auto *thisMaterial = state.dataMaterial->Material(MaterNum); SchNum = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(4)); - InsulationType insulationType = - static_cast(getEnumValue(insulationTypeNamesUC, state.dataIPShortCut->cAlphaArgs(1))); + InsulationType insulationType = static_cast(getEnumValue(insulationTypeNamesUC, state.dataIPShortCut->cAlphaArgs(1))); if (insulationType == InsulationType::Invalid) { ShowSevereError(state, format("{}, {}=\"{}\", invalid data.", diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index cc49cbc0544..132927a7847 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -605,14 +605,14 @@ namespace SystemAvailabilityManager { ErrorsFound = true; } - nightCycleMgr.nightCycleControlType = static_cast( - getEnumValue(NightCycleControlTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); + nightCycleMgr.nightCycleControlType = + static_cast(getEnumValue(NightCycleControlTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); assert(nightCycleMgr.nightCycleControlType != NightCycleControlType::Invalid); // Cycling Run Time Control Type - nightCycleMgr.cyclingRunTimeControl = static_cast( - getEnumValue(CyclingRunTimeControlNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(5)))); + nightCycleMgr.cyclingRunTimeControl = + static_cast(getEnumValue(CyclingRunTimeControlNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(5)))); assert(nightCycleMgr.cyclingRunTimeControl != CyclingRunTimeControl::Invalid); @@ -808,8 +808,8 @@ namespace SystemAvailabilityManager { optimumStartMgr.MaxOptStartTime = rNumericArgs(1); - optimumStartMgr.optimumStartControlType = static_cast( - getEnumValue(OptimumStartControlTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); + optimumStartMgr.optimumStartControlType = + static_cast(getEnumValue(OptimumStartControlTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(4)))); if (optimumStartMgr.optimumStartControlType == OptimumStartControlType::Invalid) { optimumStartMgr.optimumStartControlType = OptimumStartControlType::ControlZone; diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index 02f7d05b3b0..b37bdbc1392 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -2221,7 +2221,7 @@ void CreateEnergyReportStructure(EnergyPlusData &state) for (CompNum = 1; CompNum <= state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { DataLoopNode::ConnectionObjectType TypeOfComp = static_cast( EnergyPlus::getEnumValue(BranchNodeConnections::ConnectionObjectTypeNamesUC, - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf)); + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).TypeOf)); std::string &NameOfComp = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).Name; // Get complete list of components for complex branches if (BranchNodeConnections::IsParentObject(state, TypeOfComp, NameOfComp)) { @@ -2277,10 +2277,9 @@ void CreateEnergyReportStructure(EnergyPlusData &state) // check for 'grandchildren' for (SubCompNum = 1; SubCompNum <= NumChildren; ++SubCompNum) { - DataLoopNode::ConnectionObjectType TypeOfSubComp = - static_cast(EnergyPlus::getEnumValue( - BranchNodeConnections::ConnectionObjectTypeNamesUC, - state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).SubComp(SubCompNum).TypeOf)); + DataLoopNode::ConnectionObjectType TypeOfSubComp = static_cast(EnergyPlus::getEnumValue( + BranchNodeConnections::ConnectionObjectTypeNamesUC, + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).SubComp(SubCompNum).TypeOf)); std::string &NameOfSubComp = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Branch(BranchNum).Comp(CompNum).SubComp(SubCompNum).Name; if (BranchNodeConnections::IsParentObject(state, TypeOfSubComp, NameOfSubComp)) { @@ -4170,7 +4169,7 @@ void ReportVentilationLoads(EnergyPlusData &state) ZFAUZoneVentLoad += 0.0; } } break; - + case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPump: case DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner: case DataZoneEquipment::ZoneEquipType::PackagedTerminalHeatPumpWaterToAir: { @@ -4189,7 +4188,7 @@ void ReportVentilationLoads(EnergyPlusData &state) ZFAUZoneVentLoad += (ZFAUFlowRate) * (ZFAUEnthMixedAir - ZFAUEnthReturnAir) * TimeStepSysSec; //*KJperJ } } break; - + case DataZoneEquipment::ZoneEquipType::FourPipeFanCoil: { int OutAirNode = FanCoilUnits::GetFanCoilOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4207,7 +4206,7 @@ void ReportVentilationLoads(EnergyPlusData &state) ZFAUZoneVentLoad += 0.0; } } break; - + case DataZoneEquipment::ZoneEquipType::UnitVentilator: { int OutAirNode = UnitVentilator::GetUnitVentilatorOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4225,7 +4224,7 @@ void ReportVentilationLoads(EnergyPlusData &state) ZFAUZoneVentLoad += 0.0; } } break; - + case DataZoneEquipment::ZoneEquipType::PurchasedAir: { ZFAUOutAirFlow += PurchasedAirManager::GetPurchasedAirOutAirMassFlow(state, thisEquipIndex); int ZoneInletAirNode = PurchasedAirManager::GetPurchasedAirZoneInletAirNode(state, thisEquipIndex); @@ -4242,7 +4241,7 @@ void ReportVentilationLoads(EnergyPlusData &state) ZFAUZoneVentLoad += 0.0; } } break; - + case DataZoneEquipment::ZoneEquipType::EnergyRecoveryVentilator: { int OutAirNode = HVACStandAloneERV::GetStandAloneERVOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4260,7 +4259,7 @@ void ReportVentilationLoads(EnergyPlusData &state) ZFAUZoneVentLoad += 0.0; } } break; - + case DataZoneEquipment::ZoneEquipType::UnitarySystem: { // add accounting for OA when unitary system is used as zone equipment } break; @@ -4281,7 +4280,7 @@ void ReportVentilationLoads(EnergyPlusData &state) ZFAUZoneVentLoad += 0.0; } } break; - + case DataZoneEquipment::ZoneEquipType::HybridEvaporativeCooler: { int OutAirNode = HybridUnitaryAirConditioners::GetHybridUnitaryACOutAirNode(state, thisEquipIndex); if (OutAirNode > 0) ZFAUOutAirFlow += Node(OutAirNode).MassFlowRate; @@ -4300,7 +4299,7 @@ void ReportVentilationLoads(EnergyPlusData &state) ZFAUZoneVentLoad += 0.0; } } break; - + case DataZoneEquipment::ZoneEquipType::UnitHeater: case DataZoneEquipment::ZoneEquipType::VentilatedSlab: // ZoneHVAC:EvaporativeCoolerUnit ????? @@ -4324,7 +4323,7 @@ void ReportVentilationLoads(EnergyPlusData &state) case DataZoneEquipment::ZoneEquipType::CoolingPanel: { // do nothing, OA not included } break; - + default: { ShowFatalError(state, "ReportMaxVentilationLoads: Developer must either create accounting for OA or include in final else if " diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 1352de7be4a..c8159bb98b8 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -78,54 +78,26 @@ namespace EnergyPlus { namespace RoomAir { -// Module containing the routines dealing with the UnderFloor Air -// Distribution zone model - -// MODULE INFORMATION: -// AUTHOR Fred Buhl -// DATE WRITTEN August 2005 - -// PURPOSE OF THIS MODULE: -// Encapsulate the routines that do the simulation of the UCSD UFAD non-uniform -// zone models - -// METHODOLOGY EMPLOYED: -// 2-node zone model with the node heights varying as a function of internal loads -// and supply air flow (and other factors) - -// REFERENCES: -// See the EnergyPlus Engineering Reference and the PhD thesis of Anna Liu, UC San Diego - -// OTHER NOTES: -// na - -// Using/Aliasing -using namespace DataLoopNode; -using namespace DataEnvironment; -using namespace DataHeatBalance; -using namespace DataHeatBalSurface; -using namespace DataSurfaces; -using Convect::CalcDetailedHcInForDVModel; - -void ManageUFAD(EnergyPlusData &state, - int const ZoneNum, // index number for the specified zone - RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 -) -{ - - // SUBROUTINE INFORMATION: + // Module containing the routines dealing with the UnderFloor Air + // Distribution zone model + + // MODULE INFORMATION: // AUTHOR Fred Buhl - // DATE WRITTEN August, 2005 - // MODIFIED na - // RE-ENGINEERED na + // DATE WRITTEN August 2005 - // PURPOSE OF THIS SUBROUTINE: - // Manages the simulation of the 2-node nonuniform zone models for underfloor air - // distribution systems (UFAD). Called from RoomAirManager, ManageAirModel + // PURPOSE OF THIS MODULE: + // Encapsulate the routines that do the simulation of the UCSD UFAD non-uniform + // zone models // METHODOLOGY EMPLOYED: - // uses Init and Calc routines in the standard EPlus manner to manage the calculation - // Note that much of the initialization is done in RoomAirManager, SharedDVCVUFDataInit + // 2-node zone model with the node heights varying as a function of internal loads + // and supply air flow (and other factors) + + // REFERENCES: + // See the EnergyPlus Engineering Reference and the PhD thesis of Anna Liu, UC San Diego + + // OTHER NOTES: + // na // Using/Aliasing using namespace DataLoopNode; @@ -135,406 +107,477 @@ void ManageUFAD(EnergyPlusData &state, using namespace DataSurfaces; using Convect::CalcDetailedHcInForDVModel; - // input was obtained in RoomAirManager, GetUFADIntZoneData - - InitUFAD(state, ZoneNum, ZoneModelType); // initialize some module variables - - switch (ZoneModelType) { - case RoomAirModel::UFADInt: { // UCSD UFAD interior zone model - // simulate room airflow using the UCSDUFI model - CalcUFADInt(state, ZoneNum); - } break; - case RoomAirModel::UFADExt: { // UCSD UFAD exterior zone model - // simulate room airflow using the UCSDUFE model - CalcUFADExt(state, ZoneNum); - } break; - default: - break; + void ManageUFAD(EnergyPlusData &state, + int const ZoneNum, // index number for the specified zone + RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + ) + { + + // SUBROUTINE INFORMATION: + // AUTHOR Fred Buhl + // DATE WRITTEN August, 2005 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // Manages the simulation of the 2-node nonuniform zone models for underfloor air + // distribution systems (UFAD). Called from RoomAirManager, ManageAirModel + + // METHODOLOGY EMPLOYED: + // uses Init and Calc routines in the standard EPlus manner to manage the calculation + // Note that much of the initialization is done in RoomAirManager, SharedDVCVUFDataInit + + // Using/Aliasing + using namespace DataLoopNode; + using namespace DataEnvironment; + using namespace DataHeatBalance; + using namespace DataHeatBalSurface; + using namespace DataSurfaces; + using Convect::CalcDetailedHcInForDVModel; + + // input was obtained in RoomAirManager, GetUFADIntZoneData + + InitUFAD(state, ZoneNum, ZoneModelType); // initialize some module variables + + switch (ZoneModelType) { + case RoomAirModel::UFADInt: { // UCSD UFAD interior zone model + // simulate room airflow using the UCSDUFI model + CalcUFADInt(state, ZoneNum); + } break; + case RoomAirModel::UFADExt: { // UCSD UFAD exterior zone model + // simulate room airflow using the UCSDUFE model + CalcUFADExt(state, ZoneNum); + } break; + default: + break; + } } -} -void InitUFAD(EnergyPlusData &state, - int const ZoneNum, - RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 -) -{ + void InitUFAD(EnergyPlusData &state, + int const ZoneNum, + RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 + ) + { - // SUBROUTINE INFORMATION: - // AUTHOR Fred Buhl - // DATE WRITTEN August 2005 + // SUBROUTINE INFORMATION: + // AUTHOR Fred Buhl + // DATE WRITTEN August 2005 - // PURPOSE OF THIS SUBROUTINE: - // initialize arrays & variables used by the UCSD UFAD zone models + // PURPOSE OF THIS SUBROUTINE: + // initialize arrays & variables used by the UCSD UFAD zone models - // METHODOLOGY EMPLOYED: - // Note that much of the initialization is done in RoomAirManager, SharedDVCVUFDataInit + // METHODOLOGY EMPLOYED: + // Note that much of the initialization is done in RoomAirManager, SharedDVCVUFDataInit - Real64 NumShadesDown(0.0); + Real64 NumShadesDown(0.0); - // Do the one time initializations - if (state.dataUFADManager->MyOneTimeFlag) { - state.dataUFADManager->HeightFloorSubzoneTop = 0.2; - state.dataUFADManager->ThickOccupiedSubzoneMin = 0.2; - state.dataUFADManager->HeightIntMassDefault = 2.0; - state.dataUFADManager->MyOneTimeFlag = false; - state.dataUFADManager->MySizeFlag.dimension(state.dataGlobal->NumOfZones, true); - } + // Do the one time initializations + if (state.dataUFADManager->MyOneTimeFlag) { + state.dataUFADManager->HeightFloorSubzoneTop = 0.2; + state.dataUFADManager->ThickOccupiedSubzoneMin = 0.2; + state.dataUFADManager->HeightIntMassDefault = 2.0; + state.dataUFADManager->MyOneTimeFlag = false; + state.dataUFADManager->MySizeFlag.dimension(state.dataGlobal->NumOfZones, true); + } - if (state.dataUFADManager->MySizeFlag(ZoneNum)) { - SizeUFAD(state, ZoneNum, ZoneModelType); - state.dataUFADManager->MySizeFlag(ZoneNum) = false; - } + if (state.dataUFADManager->MySizeFlag(ZoneNum)) { + SizeUFAD(state, ZoneNum, ZoneModelType); + state.dataUFADManager->MySizeFlag(ZoneNum) = false; + } + + // initialize these variables every timestep - // initialize these variables every timestep - - state.dataUFADManager->HeightIntMass = state.dataUFADManager->HeightIntMassDefault; - state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; - state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; - NumShadesDown = 0.0; - for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Window(Ctd); - if (SurfNum == 0) continue; - auto &surf = state.dataSurface->Surface(SurfNum); - if (surf.ExtBoundCond == ExternalEnvironment || - surf.ExtBoundCond == OtherSideCoefNoCalcExt || - surf.ExtBoundCond == OtherSideCoefCalcExt || - surf.ExtBoundCond == OtherSideCondModeledExt) { - if (ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { - ++NumShadesDown; + state.dataUFADManager->HeightIntMass = state.dataUFADManager->HeightIntMassDefault; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + NumShadesDown = 0.0; + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); + if (SurfNum == 0) continue; + auto &surf = state.dataSurface->Surface(SurfNum); + if (surf.ExtBoundCond == ExternalEnvironment || surf.ExtBoundCond == OtherSideCoefNoCalcExt || + surf.ExtBoundCond == OtherSideCoefCalcExt || surf.ExtBoundCond == OtherSideCondModeledExt) { + if (ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) { + ++NumShadesDown; + } } } + if (ZoneModelType == RoomAirModel::UFADExt) { + auto &zoneUE = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); + zoneUE.ShadeDown = (zoneUE.NumExtWin > 1.0) && (NumShadesDown / zoneUE.NumExtWin >= 0.5); + } } - if (ZoneModelType == RoomAirModel::UFADExt) { - auto &zoneUE = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); - zoneUE.ShadeDown = (zoneUE.NumExtWin > 1.0) && (NumShadesDown / zoneUE.NumExtWin >= 0.5); - } -} -void SizeUFAD(EnergyPlusData &state, - int const ZoneNum, - RoomAirModel const model // type of zone model; UCSDUFI = 6 -) -{ + void SizeUFAD(EnergyPlusData &state, + int const ZoneNum, + RoomAirModel const model // type of zone model; UCSDUFI = 6 + ) + { - // SUBROUTINE INFORMATION: - // AUTHOR Fred Buhl - // DATE WRITTEN August 2005 + // SUBROUTINE INFORMATION: + // AUTHOR Fred Buhl + // DATE WRITTEN August 2005 - // PURPOSE OF THIS SUBROUTINE: - // set some smart defaults for UFAD systems + // PURPOSE OF THIS SUBROUTINE: + // set some smart defaults for UFAD systems - // METHODOLOGY EMPLOYED: - // use data from Center for Built Environment + // METHODOLOGY EMPLOYED: + // use data from Center for Built Environment - using DataSizing::AutoSize; + using DataSizing::AutoSize; - Real64 ZoneElecConv(0.0); // zone elec equip design convective gain [W] - Real64 ZoneGasConv(0.0); // zone gas equip design convective gain [W] - Real64 ZoneOthEqConv(0.0); // zone other equip design convective gain [W] - Real64 ZoneHWEqConv(0.0); // zone hot water equip design convective gain [W] - Real64 ZoneSteamEqConv(0.0); // zone steam equip design convective gain [W] + Real64 ZoneElecConv(0.0); // zone elec equip design convective gain [W] + Real64 ZoneGasConv(0.0); // zone gas equip design convective gain [W] + Real64 ZoneOthEqConv(0.0); // zone other equip design convective gain [W] + Real64 ZoneHWEqConv(0.0); // zone hot water equip design convective gain [W] + Real64 ZoneSteamEqConv(0.0); // zone steam equip design convective gain [W] - // This is for both UFADInt and UFADExt - auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); + // This is for both UFADInt and UFADExt + auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); - std::string_view cCMO = (model == RoomAirModel::UFADExt) ? - "RoomAirSettings:UnderFloorAirDistributionExterior" : "RoomAirSettings:UnderFloorAirDistributionInterior"; - - Real64 NumberOfOccupants = 0.0; - for (auto const &people : state.dataHeatBal->People) { - if (people.ZonePtr == ZoneNum) NumberOfOccupants += people.NumberOfPeople; - } + std::string_view cCMO = (model == RoomAirModel::UFADExt) ? "RoomAirSettings:UnderFloorAirDistributionExterior" + : "RoomAirSettings:UnderFloorAirDistributionInterior"; - if (model == RoomAirModel::UFADExt) { - // calculate total window width in zone - for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Window(Ctd); - if (SurfNum == 0) continue; - auto &surf = state.dataSurface->Surface(SurfNum); - if (surf.ExtBoundCond == ExternalEnvironment || - surf.ExtBoundCond == OtherSideCoefNoCalcExt || - surf.ExtBoundCond == OtherSideCoefCalcExt || - surf.ExtBoundCond == OtherSideCondModeledExt) { - zoneU.WinWidth += surf.Width; - ++zoneU.NumExtWin; + Real64 NumberOfOccupants = 0.0; + for (auto const &people : state.dataHeatBal->People) { + if (people.ZonePtr == ZoneNum) NumberOfOccupants += people.NumberOfPeople; + } + + if (model == RoomAirModel::UFADExt) { + // calculate total window width in zone + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); + if (SurfNum == 0) continue; + auto &surf = state.dataSurface->Surface(SurfNum); + if (surf.ExtBoundCond == ExternalEnvironment || surf.ExtBoundCond == OtherSideCoefNoCalcExt || + surf.ExtBoundCond == OtherSideCoefCalcExt || surf.ExtBoundCond == OtherSideCondModeledExt) { + zoneU.WinWidth += surf.Width; + ++zoneU.NumExtWin; + } } + if (zoneU.WinWidth <= 0.0) { + ShowWarningError( + state, + format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {} there are no exterior windows.", zoneU.ZoneName)); + ShowContinueError(state, " The zone will be treated as a UFAD interior zone"); + } + } // if (model == RoomAirModel::UFADExt) + + if (zoneU.DiffArea == AutoSize) { + constexpr std::array diffArea = {0.0075, 0.035, 0.0060, 0.03, 0.0075}; + zoneU.DiffArea = diffArea[(int)zoneU.DiffuserType]; + // 4 ft x 4 inches; 75 cfm per linear foot; area is .025 m2/m + + BaseSizer::reportSizerOutput(state, cCMO, zoneU.ZoneName, "Design effective area of diffuser", zoneU.DiffArea); } - if (zoneU.WinWidth <= 0.0) { - ShowWarningError(state, - format("For RoomAirSettings:UnderFloorAirDistributionExterior for Zone {} there are no exterior windows.", - zoneU.ZoneName)); - ShowContinueError(state, " The zone will be treated as a UFAD interior zone"); + if (zoneU.DiffAngle == AutoSize) { + constexpr std::array diffAngle = {28.0, 45.0, 73.0, 15.0, 28.0}; + zoneU.DiffAngle = diffAngle[(int)zoneU.DiffuserType]; + + BaseSizer::reportSizerOutput(state, cCMO, zoneU.ZoneName, "Angle between diffuser slots and the vertical", zoneU.DiffAngle); } - } // if (model == RoomAirModel::UFADExt) - - if (zoneU.DiffArea == AutoSize) { - constexpr std::array diffArea = {0.0075, 0.035, 0.0060, 0.03, 0.0075}; - zoneU.DiffArea = diffArea[(int)zoneU.DiffuserType]; - // 4 ft x 4 inches; 75 cfm per linear foot; area is .025 m2/m - - BaseSizer::reportSizerOutput(state, - cCMO, - zoneU.ZoneName, - "Design effective area of diffuser", - zoneU.DiffArea); + if (zoneU.TransHeight == AutoSize) { + zoneU.CalcTransHeight = true; + zoneU.TransHeight = 0.0; + } else { + zoneU.CalcTransHeight = false; } - if (zoneU.DiffAngle == AutoSize) { - constexpr std::array diffAngle = {28.0, 45.0, 73.0, 15.0, 28.0}; - zoneU.DiffAngle = diffAngle[(int)zoneU.DiffuserType]; - - BaseSizer::reportSizerOutput(state, - cCMO, - zoneU.ZoneName, - "Angle between diffuser slots and the vertical", - zoneU.DiffAngle); - } - if (zoneU.TransHeight == AutoSize) { - zoneU.CalcTransHeight = true; - zoneU.TransHeight = 0.0; - } else { - zoneU.CalcTransHeight = false; - } - if (zoneU.DiffuserType != Diffuser::Custom && - (zoneU.A_Kc != Constant::AutoCalculate || - zoneU.B_Kc != Constant::AutoCalculate || - zoneU.C_Kc != Constant::AutoCalculate || - zoneU.D_Kc != Constant::AutoCalculate || - zoneU.E_Kc != Constant::AutoCalculate)) { - ShowWarningError(state, - format("For {} for Zone {}, input for Coefficients A - E will be " - "ignored when Floor Diffuser Type = {}.", cCMO, zoneU.ZoneName, diffuserNamesUC[(int)zoneU.DiffuserType])); - ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); - } - - if (zoneU.DiffuserType == Diffuser::Swirl) { - zoneU.A_Kc = 0.0; - zoneU.B_Kc = 0.0; - zoneU.C_Kc = 0.6531; - zoneU.D_Kc = 0.0069; - zoneU.E_Kc = -0.00004; - } else if (zoneU.DiffuserType == Diffuser::VarArea) { - zoneU.A_Kc = 0.0; - zoneU.B_Kc = 0.0; - zoneU.C_Kc = (model == RoomAirModel::UFADExt) ? 0.83 : 0.88; - zoneU.D_Kc = 0.0; - zoneU.E_Kc = 0.0; - } else if (zoneU.DiffuserType == Diffuser::DisplVent) { - zoneU.A_Kc = 0.0; - zoneU.B_Kc = 0.0; - zoneU.C_Kc = 0.67; - zoneU.D_Kc = 0.0; - zoneU.E_Kc = 0.0; - } else if (zoneU.DiffuserType == Diffuser::LinBarGrille) { - zoneU.A_Kc = 0.0; - zoneU.B_Kc = 0.0; - zoneU.C_Kc = (model == RoomAirModel::UFADExt) ? 0.8214 : 0.8; - zoneU.D_Kc = (model == RoomAirModel::UFADExt) ? -0.0263 : 0.0; - zoneU.E_Kc = (model == RoomAirModel::UFADExt) ? 0.0014 : 0.0; - } else if (zoneU.A_Kc == Constant::AutoCalculate || - zoneU.B_Kc == Constant::AutoCalculate || - zoneU.C_Kc == Constant::AutoCalculate || - zoneU.D_Kc == Constant::AutoCalculate || - zoneU.E_Kc == Constant::AutoCalculate) { - ShowFatalError(state, - format("For {} for Zone {}, input for Coefficients A - E must be " - "specified when Floor Diffuser Type = Custom.", cCMO, zoneU.ZoneName)); - } + if (zoneU.DiffuserType != Diffuser::Custom && + (zoneU.A_Kc != Constant::AutoCalculate || zoneU.B_Kc != Constant::AutoCalculate || zoneU.C_Kc != Constant::AutoCalculate || + zoneU.D_Kc != Constant::AutoCalculate || zoneU.E_Kc != Constant::AutoCalculate)) { + ShowWarningError(state, + format("For {} for Zone {}, input for Coefficients A - E will be " + "ignored when Floor Diffuser Type = {}.", + cCMO, + zoneU.ZoneName, + diffuserNamesUC[(int)zoneU.DiffuserType])); + ShowContinueError(state, " To input these Coefficients, use Floor Diffuser Type = Custom."); + } - if (zoneU.PowerPerPlume == Constant::AutoCalculate) { - Real64 NumberOfPlumes = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; + if (zoneU.DiffuserType == Diffuser::Swirl) { + zoneU.A_Kc = 0.0; + zoneU.B_Kc = 0.0; + zoneU.C_Kc = 0.6531; + zoneU.D_Kc = 0.0069; + zoneU.E_Kc = -0.00004; + } else if (zoneU.DiffuserType == Diffuser::VarArea) { + zoneU.A_Kc = 0.0; + zoneU.B_Kc = 0.0; + zoneU.C_Kc = (model == RoomAirModel::UFADExt) ? 0.83 : 0.88; + zoneU.D_Kc = 0.0; + zoneU.E_Kc = 0.0; + } else if (zoneU.DiffuserType == Diffuser::DisplVent) { + zoneU.A_Kc = 0.0; + zoneU.B_Kc = 0.0; + zoneU.C_Kc = 0.67; + zoneU.D_Kc = 0.0; + zoneU.E_Kc = 0.0; + } else if (zoneU.DiffuserType == Diffuser::LinBarGrille) { + zoneU.A_Kc = 0.0; + zoneU.B_Kc = 0.0; + zoneU.C_Kc = (model == RoomAirModel::UFADExt) ? 0.8214 : 0.8; + zoneU.D_Kc = (model == RoomAirModel::UFADExt) ? -0.0263 : 0.0; + zoneU.E_Kc = (model == RoomAirModel::UFADExt) ? 0.0014 : 0.0; + } else if (zoneU.A_Kc == Constant::AutoCalculate || zoneU.B_Kc == Constant::AutoCalculate || zoneU.C_Kc == Constant::AutoCalculate || + zoneU.D_Kc == Constant::AutoCalculate || zoneU.E_Kc == Constant::AutoCalculate) { + ShowFatalError(state, + format("For {} for Zone {}, input for Coefficients A - E must be " + "specified when Floor Diffuser Type = Custom.", + cCMO, + zoneU.ZoneName)); + } - ZoneElecConv = 0.0; - for (auto const &zoneElectric : state.dataHeatBal->ZoneElectric) { - if (zoneElectric.ZonePtr == ZoneNum) { - // Is the behavior for Exterior UFAD supposed to be different than for Interior UFAD? - ZoneElecConv += (model == RoomAirModel::UFADExt) ? zoneElectric.DesignLevel : (zoneElectric.DesignLevel * zoneElectric.FractionConvected); + if (zoneU.PowerPerPlume == Constant::AutoCalculate) { + Real64 NumberOfPlumes = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; + + ZoneElecConv = 0.0; + for (auto const &zoneElectric : state.dataHeatBal->ZoneElectric) { + if (zoneElectric.ZonePtr == ZoneNum) { + // Is the behavior for Exterior UFAD supposed to be different than for Interior UFAD? + ZoneElecConv += + (model == RoomAirModel::UFADExt) ? zoneElectric.DesignLevel : (zoneElectric.DesignLevel * zoneElectric.FractionConvected); + } } - } - ZoneGasConv = 0.0; - for (auto const &zoneGas : state.dataHeatBal->ZoneGas) { - if (zoneGas.ZonePtr == ZoneNum) { - ZoneGasConv += (model == RoomAirModel::UFADExt) ? zoneGas.DesignLevel : (zoneGas.DesignLevel * zoneGas.FractionConvected); + ZoneGasConv = 0.0; + for (auto const &zoneGas : state.dataHeatBal->ZoneGas) { + if (zoneGas.ZonePtr == ZoneNum) { + ZoneGasConv += (model == RoomAirModel::UFADExt) ? zoneGas.DesignLevel : (zoneGas.DesignLevel * zoneGas.FractionConvected); + } } - } - ZoneOthEqConv = 0.0; - for (auto const &zoneOtherEq : state.dataHeatBal->ZoneOtherEq) { - if (zoneOtherEq.ZonePtr == ZoneNum) { - ZoneOthEqConv += (model == RoomAirModel::UFADExt) ? zoneOtherEq.DesignLevel : (zoneOtherEq.DesignLevel * zoneOtherEq.FractionConvected); + ZoneOthEqConv = 0.0; + for (auto const &zoneOtherEq : state.dataHeatBal->ZoneOtherEq) { + if (zoneOtherEq.ZonePtr == ZoneNum) { + ZoneOthEqConv += + (model == RoomAirModel::UFADExt) ? zoneOtherEq.DesignLevel : (zoneOtherEq.DesignLevel * zoneOtherEq.FractionConvected); + } } - } - ZoneHWEqConv = 0.0; - for (auto const &zoneHWEq : state.dataHeatBal->ZoneHWEq) { - if (zoneHWEq.ZonePtr == ZoneNum) { - ZoneHWEqConv += (model == RoomAirModel::UFADExt) ? zoneHWEq.DesignLevel : (zoneHWEq.DesignLevel * zoneHWEq.FractionConvected); + ZoneHWEqConv = 0.0; + for (auto const &zoneHWEq : state.dataHeatBal->ZoneHWEq) { + if (zoneHWEq.ZonePtr == ZoneNum) { + ZoneHWEqConv += (model == RoomAirModel::UFADExt) ? zoneHWEq.DesignLevel : (zoneHWEq.DesignLevel * zoneHWEq.FractionConvected); + } } - } - for (auto const &zoneSteamEq : state.dataHeatBal->ZoneSteamEq) { - ZoneSteamEqConv = 0.0; // I'm 99.72% sure this is a bug. - if (zoneSteamEq.ZonePtr == ZoneNum) { - ZoneSteamEqConv += (model == RoomAirModel::UFADExt) ? zoneSteamEq.DesignLevel : (zoneSteamEq.DesignLevel * zoneSteamEq.FractionConvected); + for (auto const &zoneSteamEq : state.dataHeatBal->ZoneSteamEq) { + ZoneSteamEqConv = 0.0; // I'm 99.72% sure this is a bug. + if (zoneSteamEq.ZonePtr == ZoneNum) { + ZoneSteamEqConv += + (model == RoomAirModel::UFADExt) ? zoneSteamEq.DesignLevel : (zoneSteamEq.DesignLevel * zoneSteamEq.FractionConvected); + } } - } - zoneU.PowerPerPlume = (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; + zoneU.PowerPerPlume = + (NumberOfOccupants * 73.0 + ZoneElecConv + ZoneGasConv + ZoneOthEqConv + ZoneHWEqConv + ZoneSteamEqConv) / NumberOfPlumes; - BaseSizer::reportSizerOutput(state, - cCMO, - zoneU.ZoneName, - "Power per plume [W]", - zoneU.PowerPerPlume); + BaseSizer::reportSizerOutput(state, cCMO, zoneU.ZoneName, "Power per plume [W]", zoneU.PowerPerPlume); + + if (zoneU.DiffusersPerZone == AutoSize) { + zoneU.DiffusersPerZone = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; + BaseSizer::reportSizerOutput(state, cCMO, zoneU.ZoneName, "Number of diffusers per zone", zoneU.DiffusersPerZone); + } + } if (zoneU.DiffusersPerZone == AutoSize) { zoneU.DiffusersPerZone = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; - BaseSizer::reportSizerOutput(state, - cCMO, - zoneU.ZoneName, - "Number of diffusers per zone", - zoneU.DiffusersPerZone); + + BaseSizer::reportSizerOutput(state, cCMO, zoneU.ZoneName, "Number of diffusers per zone", zoneU.DiffusersPerZone); } } - if (zoneU.DiffusersPerZone == AutoSize) { - zoneU.DiffusersPerZone = (NumberOfOccupants > 0.0) ? NumberOfOccupants : 1.0; - - BaseSizer::reportSizerOutput(state, - cCMO, - zoneU.ZoneName, - "Number of diffusers per zone", - zoneU.DiffusersPerZone); - } -} + void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight, UFADConvCoef &ufadCC) + { + + // SUBROUTINE INFORMATION: + // AUTHOR G. Carrilho da Graca + // DATE WRITTEN February 2004 + + // PURPOSE OF THIS SUBROUTINE: + // Main subroutine for convection calculation in the UCSD Displacement Ventilation model. + // It calls CalcDetailedHcInForDVModel for convection coefficient + // initial calculations and averages the final result comparing the position of the surface with + // the interface subzone height. + + // Using/Aliasing + using namespace DataEnvironment; + using namespace DataHeatBalance; + + // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? + if (!state.dataRoomAir->IsZoneUFAD(ZoneNum)) return; + + ufadCC.HAT_MX = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone + ufadCC.HAT_MXWin = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone (windows only) + ufadCC.HA_MX = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone + ufadCC.HA_MXWin = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone (windows only) + ufadCC.HAT_OC = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone + ufadCC.HAT_OCWin = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone (windows only) + ufadCC.HA_OC = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone + ufadCC.HA_OCWin = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone (windows only) + ufadCC.HAT_FLOOR = 0.0; // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone + ufadCC.HA_FLOOR = 0.0; // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone + + Real64 zoneCeilingHeight1 = state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + Real64 zoneCeilingHeight2 = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum); + + Real64 LayH = FractionHeight * (zoneCeilingHeight2 - zoneCeilingHeight1); // Height of the Occupied/Mixed subzone interface + + // WALL Hc, HA and HAT calculation + for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Wall(Ctd); + if (SurfNum == 0) continue; -void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeight, UFADConvCoef &ufadCC) -{ + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; // highest height for this surface + Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; // lowest height for this surface - // SUBROUTINE INFORMATION: - // AUTHOR G. Carrilho da Graca - // DATE WRITTEN February 2004 + // The Wall surface is in the upper subzone + if (ZInfSurf > LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); + } - // PURPOSE OF THIS SUBROUTINE: - // Main subroutine for convection calculation in the UCSD Displacement Ventilation model. - // It calls CalcDetailedHcInForDVModel for convection coefficient - // initial calculations and averages the final result comparing the position of the surface with - // the interface subzone height. + // The Wall surface is in the lower subzone + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); + } - // Using/Aliasing - using namespace DataEnvironment; - using namespace DataHeatBalance; + if (std::abs(ZInfSurf - ZSupSurf) < 1.e-10) { + ShowSevereError(state, "RoomAirModelUFAD:HcUCSDUF: Surface values will cause divide by zero."); + ShowContinueError(state, format("Zone=\"{}\", Surface=\"{}\".", state.dataHeatBal->Zone(surf.Zone).Name, surf.Name)); + ShowContinueError(state, format("ZInfSurf=[{:.4R}], LayH=[{:.4R}].", ZInfSurf, LayH)); + ShowContinueError(state, format("ZSupSurf=[{:.4R}], LayH=[{:.4R}].", ZSupSurf, LayH)); + ShowFatalError(state, "...Previous condition causes termination."); + } - // Is the air flow model for this zone set to UCSDDV Displacement Ventilation? - if (!state.dataRoomAir->IsZoneUFAD(ZoneNum)) - return; - - ufadCC.HAT_MX = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone - ufadCC.HAT_MXWin = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone (windows only) - ufadCC.HA_MX = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone - ufadCC.HA_MXWin = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone (windows only) - ufadCC.HAT_OC = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone - ufadCC.HAT_OCWin = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone (windows only) - ufadCC.HA_OC = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone - ufadCC.HA_OCWin = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone (windows only) - ufadCC.HAT_FLOOR = 0.0; // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone - ufadCC.HA_FLOOR = 0.0; // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone - - Real64 zoneCeilingHeight1 = state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - Real64 zoneCeilingHeight2 = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum); - - Real64 LayH = FractionHeight * (zoneCeilingHeight2 - zoneCeilingHeight1); // Height of the Occupied/Mixed subzone interface - - // WALL Hc, HA and HAT calculation - for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Wall(Ctd); - if (SurfNum == 0) continue; - - auto &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z)- zoneCeilingHeight1; // highest height for this surface - Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; // lowest height for this surface - - // The Wall surface is in the upper subzone - if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); - ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWall(Ctd); - } + // The Wall surface is partially in upper and partially in lower subzone + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface + Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); // Average temperature for DV + state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; + } - // The Wall surface is in the lower subzone - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWall(Ctd); - } + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWall(Ctd); - if (std::abs(ZInfSurf - ZSupSurf) < 1.e-10) { - ShowSevereError(state, "RoomAirModelUFAD:HcUCSDUF: Surface values will cause divide by zero."); - ShowContinueError(state, - format("Zone=\"{}\", Surface=\"{}\".", - state.dataHeatBal->Zone(surf.Zone).Name, - surf.Name)); - ShowContinueError(state, format("ZInfSurf=[{:.4R}], LayH=[{:.4R}].", ZInfSurf, LayH)); - ShowContinueError(state, format("ZSupSurf=[{:.4R}], LayH=[{:.4R}].", ZSupSurf, LayH)); - ShowFatalError(state, "...Previous condition causes termination."); - } + } // END WALL - // The Wall surface is partially in upper and partially in lower subzone - if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface - Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); // Average temperature for DV - state.dataRoomAir->HWall(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; - } - - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWall(Ctd); - - } // END WALL - - // WINDOW Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Window(Ctd); - if (SurfNum == 0) continue; - - auto &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - - if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall - Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; - Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; - - if (ZInfSurf > LayH) { + // WINDOW Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Window(Ctd); + if (SurfNum == 0) continue; + + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + + if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall + Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; + Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; + + if (ZInfSurf > LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_MXWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_MXWin += surf.Area * state.dataRoomAir->HWindow(Ctd); + } + + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); + ufadCC.HAT_OCWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); + ufadCC.HA_OCWin += surf.Area * state.dataRoomAir->HWindow(Ctd); + } + + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface + Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); // Average temperature + + state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + ufadCC.HA_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + ufadCC.HAT_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HA_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; + } + } + + if (surf.Tilt <= 10.0) { // Window Ceiling state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); - ufadCC.HAT_MXWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - ufadCC.HA_MXWin += surf.Area * state.dataRoomAir->HWindow(Ctd); - } - - if (ZSupSurf < LayH) { + } else if (surf.Tilt >= 170.0) { // Window Floor state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); - ufadCC.HAT_OCWin += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - ufadCC.HA_OCWin += surf.Area * state.dataRoomAir->HWindow(Ctd); + } + + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); + + } // END WINDOW + + // DOOR Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR + int SurfNum = state.dataRoomAir->APos_Door(Ctd); + if (SurfNum == 0) continue; + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + + Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; + Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; + + if (ZInfSurf > LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); + } + + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { @@ -545,355 +588,266 @@ void HcUFAD(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHeigh CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); // Average temperature - - state.dataRoomAir->HWindow(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + (ZSupSurf - ZInfSurf); // Average temperature + state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - ufadCC.HA_MXWin += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - ufadCC.HAT_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - ufadCC.HA_OCWin += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - } - - if (surf.Tilt <= 10.0) { // Window Ceiling - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - ufadCC.HA_MX += surf.Area * state.dataRoomAir->HWindow(Ctd); - } else if (surf.Tilt >= 170.0) { // Window Floor - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HWindow(Ctd); - } - - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd); - - } // END WINDOW - - // DOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR - int SurfNum = state.dataRoomAir->APos_Door(Ctd); - if (SurfNum == 0) continue; - auto &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - - Real64 ZSupSurf = maxval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; - Real64 ZInfSurf = minval(surf.Vertex, &Vector::z) - zoneCeilingHeight1; - - if (ZInfSurf > LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); - ufadCC.HA_MX += surf.Area * state.dataRoomAir->HDoor(Ctd); - } - - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HDoor(Ctd); - } - if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface - Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); // Average temperature - state.dataRoomAir->HDoor(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; - } - - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HDoor(Ctd); - - } // END DOOR - - // INTERNAL Hc, HA and HAT CALCULATION - state.dataUFADManager->HeightIntMass = min(state.dataUFADManager->HeightIntMassDefault, (zoneCeilingHeight2 - zoneCeilingHeight1)); - for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Internal(Ctd); - if (SurfNum == 0) continue; - - auto &surf = state.dataSurface->Surface(SurfNum); - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - Real64 ZSupSurf = state.dataUFADManager->HeightIntMass; - Real64 ZInfSurf = 0.0; - - if (ZSupSurf < LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); - } + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HDoor(Ctd); - if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface - Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / - (ZSupSurf - ZInfSurf); // Average temperature - state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); - ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; - ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; - ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; - ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; - } - - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HInternal(Ctd); - } // END INTERNAL - - // CEILING Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); - if (SurfNum == 0) continue; - auto &surf = state.dataSurface->Surface(SurfNum); - - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); - ufadCC.HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); - } // END CEILING - - // FLOOR Hc, HA and HAT CALCULATION - for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { - int SurfNum = state.dataRoomAir->APos_Floor(Ctd); - if (SurfNum == 0) continue; - auto &surf = state.dataSurface->Surface(SurfNum); - - state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; - state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); - CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); - state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); - ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); - ufadCC.HA_OC += surf.Area * state.dataRoomAir->HFloor(Ctd); - state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); - state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); - } // END FLOOR -} - -static constexpr std::array IntGainTypesOccupied = { - DataHeatBalance::IntGainType::People, - DataHeatBalance::IntGainType::WaterHeaterMixed, - DataHeatBalance::IntGainType::WaterHeaterStratified, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::ElectricEquipment, - DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, - DataHeatBalance::IntGainType::GasEquipment, - DataHeatBalance::IntGainType::HotWaterEquipment, - DataHeatBalance::IntGainType::SteamEquipment, - DataHeatBalance::IntGainType::OtherEquipment, - DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::WaterUseEquipment, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::RefrigerationCase, - DataHeatBalance::IntGainType::RefrigerationCompressorRack, - DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, - DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, - DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, - DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, - DataHeatBalance::IntGainType::RefrigerationWalkIn}; - -static constexpr std::array IntGainTypesUpSubzone = { - DataHeatBalance::IntGainType::DaylightingDeviceTubular, - DataHeatBalance::IntGainType::Lights}; - -void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone -{ - - // SUBROUTINE INFORMATION: - // AUTHOR Fred Buhl - // DATE WRITTEN August 2005 - // MODIFIED Brent Griffith June 2008 for new interpolation and time history - // RE-ENGINEERED na + } // END DOOR - // PURPOSE OF THIS SUBROUTINE: - // Using the UCSD UFAD interior zone model, this subroutine calculates the occupied subzone height, - // surface heat transfer coefficients, the occupied subzone temperature, and the upper subzone temperature. + // INTERNAL Hc, HA and HAT CALCULATION + state.dataUFADManager->HeightIntMass = min(state.dataUFADManager->HeightIntMassDefault, (zoneCeilingHeight2 - zoneCeilingHeight1)); + for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Internal(Ctd); + if (SurfNum == 0) continue; - // METHODOLOGY EMPLOYED: - // The zone is divided into 2 subzones with a variable transition height. + auto &surf = state.dataSurface->Surface(SurfNum); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + Real64 ZSupSurf = state.dataUFADManager->HeightIntMass; + Real64 ZInfSurf = 0.0; - // REFERENCES: - // The model is described in the EnergyPlus Engineering Reference in Anna Liu's UCSD PhD thesis. + if (ZSupSurf < LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HInternal(Ctd); + } - // Using/Aliasing - using Psychrometrics::PsyCpAirFnW; - using Psychrometrics::PsyRhoAirFnPbTdbW; - Real64 TimeStepSys = state.dataHVACGlobal->TimeStepSys; - Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; - using InternalHeatGains::SumInternalConvectionGainsByTypes; - using InternalHeatGains::SumReturnAirConvectionGainsByTypes; - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - - Real64 HeightFrac; // Fractional height of transition between occupied and upper subzones - Real64 Gamma; // dimensionless height parameter; higher gamma means interface height will be - // higher, smaller gamma means interface height will be lower. - Real64 ZTAveraged; - - // Exact solution or Euler method - if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { - if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { - if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); - } else { - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); + if (ZInfSurf <= LayH && ZSupSurf >= LayH) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLU = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the upper area of surface + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTOC(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + Real64 HLD = state.dataRoomAir->UFADHcIn(SurfNum); // Convection coefficient for the lower area of surface + Real64 TmedDV = ((ZSupSurf - LayH) * state.dataRoomAir->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAir->ZTOC(ZoneNum)) / + (ZSupSurf - ZInfSurf); // Average temperature + state.dataRoomAir->HInternal(Ctd) = ((LayH - ZInfSurf) * HLD + (ZSupSurf - LayH) * HLU) / (ZSupSurf - ZInfSurf); + ufadCC.HAT_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLU; + ufadCC.HA_MX += surf.Area * (ZSupSurf - LayH) / (ZSupSurf - ZInfSurf) * HLU; + ufadCC.HAT_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * HLD; + ufadCC.HA_OC += surf.Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } - } else { - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); - } - } - auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - bool MIXFLAG = false; - state.dataRoomAir->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; - Real64 SumSysMCp = 0.0; // Sum of system mass flow rate * specific heat for this zone [W/K] - Real64 SumSysMCpT = 0.0; // Sum of system mass flow rate * specific heat * temperature for this zone [W] - Real64 TSupK = 0.0; // supply temperature [K] - Real64 SumSysM = 0.0; // Sum of systems mass flow rate [kg/s] - Real64 TotSysFlow = 0.0; // [m3/s] - int ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; - Real64 CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - - auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); - Real64 HeightThermostat = zoneU.ThermostatHeight; // height of the thermostat above the floor [m] - Real64 HeightComfort = zoneU.ComfortHeight; // height at which comfort temperature is calculated - Real64 TempDiffCritRep = zoneU.TempTrigger; // Minimum temperature difference between upper and occupied subzones for reporting - Real64 DiffArea = zoneU.DiffArea; // diffuser effective area [m2] - Real64 ThrowAngle = Constant::DegToRadians * zoneU.DiffAngle; // diffuser slot angle relative to vertical [radians] - Real64 SourceHeight = 0.0; // height of plume sources above the floor [m] - Real64 NumDiffusers = zoneU.DiffusersPerZone; - Real64 PowerPerPlume = zoneU.PowerPerPlume; - // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, - // baseboards (nonthermostatic), water heater skin loss - Real64 ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); - - // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very - // low or zero) - if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { - ConvGainsOccSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); - } + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HInternal(Ctd); + } // END INTERNAL - // Add convection from pool cover to occupied region - ConvGainsOccSubzone += state.dataHeatBalFanSys->SumConvPool(ZoneNum); + // CEILING Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd); + if (SurfNum == 0) continue; + auto &surf = state.dataSurface->Surface(SurfNum); - // gains from lights (ceiling), tubular daylighting devices, high temp radiant heaters + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTMX(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HCeiling(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_MX += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HCeiling(Ctd); + ufadCC.HA_MX += surf.Area * state.dataRoomAir->HCeiling(Ctd); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd); + } // END CEILING + + // FLOOR Hc, HA and HAT CALCULATION + for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) { + int SurfNum = state.dataRoomAir->APos_Floor(Ctd); + if (SurfNum == 0) continue; + auto &surf = state.dataSurface->Surface(SurfNum); - Real64 ConvGainsUpSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); - ConvGainsUpSubzone += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum); - if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { - ConvGainsUpSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); + state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp; + state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)]; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->UFADHcIn); + state.dataRoomAir->HFloor(Ctd) = state.dataRoomAir->UFADHcIn(SurfNum); + ufadCC.HAT_OC += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HFloor(Ctd); + ufadCC.HA_OC += surf.Area * state.dataRoomAir->HFloor(Ctd); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTFloor(ZoneNum); + state.dataRoomAir->UFADHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd); + } // END FLOOR } - Real64 ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; - Real64 ZoneEquipConfigNum = zoneU.ZoneEquipPtr; - if (ZoneEquipConfigNum > 0) { - auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum); - for (int InNodeIndex = 1; InNodeIndex <= zoneEquipConfig.NumInletNodes; ++InNodeIndex) { - Real64 NodeTemp = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).Temp; - Real64 MassFlowRate = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).MassFlowRate; - Real64 CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); - SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; - TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, NodeTemp, thisZoneHB.ZoneAirHumRat); - TSupK += MassFlowRate * NodeTemp; - SumSysM += MassFlowRate; + static constexpr std::array IntGainTypesOccupied = { + DataHeatBalance::IntGainType::People, + DataHeatBalance::IntGainType::WaterHeaterMixed, + DataHeatBalance::IntGainType::WaterHeaterStratified, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + DataHeatBalance::IntGainType::ElectricEquipment, + DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, + DataHeatBalance::IntGainType::GasEquipment, + DataHeatBalance::IntGainType::HotWaterEquipment, + DataHeatBalance::IntGainType::SteamEquipment, + DataHeatBalance::IntGainType::OtherEquipment, + DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, + DataHeatBalance::IntGainType::GeneratorFuelCell, + DataHeatBalance::IntGainType::WaterUseEquipment, + DataHeatBalance::IntGainType::GeneratorMicroCHP, + DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, + DataHeatBalance::IntGainType::PipeIndoor, + DataHeatBalance::IntGainType::RefrigerationCase, + DataHeatBalance::IntGainType::RefrigerationCompressorRack, + DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, + DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, + DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, + DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, + DataHeatBalance::IntGainType::RefrigerationWalkIn}; + + static constexpr std::array IntGainTypesUpSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, + DataHeatBalance::IntGainType::Lights}; + + void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone + { + + // SUBROUTINE INFORMATION: + // AUTHOR Fred Buhl + // DATE WRITTEN August 2005 + // MODIFIED Brent Griffith June 2008 for new interpolation and time history + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // Using the UCSD UFAD interior zone model, this subroutine calculates the occupied subzone height, + // surface heat transfer coefficients, the occupied subzone temperature, and the upper subzone temperature. + + // METHODOLOGY EMPLOYED: + // The zone is divided into 2 subzones with a variable transition height. + + // REFERENCES: + // The model is described in the EnergyPlus Engineering Reference in Anna Liu's UCSD PhD thesis. + + // Using/Aliasing + using Psychrometrics::PsyCpAirFnW; + using Psychrometrics::PsyRhoAirFnPbTdbW; + Real64 TimeStepSys = state.dataHVACGlobal->TimeStepSys; + Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; + using InternalHeatGains::SumInternalConvectionGainsByTypes; + using InternalHeatGains::SumReturnAirConvectionGainsByTypes; + + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + + Real64 HeightFrac; // Fractional height of transition between occupied and upper subzones + Real64 Gamma; // dimensionless height parameter; higher gamma means interface height will be + // higher, smaller gamma means interface height will be lower. + Real64 ZTAveraged; + + // Exact solution or Euler method + if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { + if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { + if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); + } else { + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); + } + } else { + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + } } - if (TotSysFlow > 0.0) { - TSupK = TSupK / SumSysM + Constant::KelvinConv; - } else { - TSupK = 0.0; + + auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); + bool MIXFLAG = false; + state.dataRoomAir->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; + Real64 SumSysMCp = 0.0; // Sum of system mass flow rate * specific heat for this zone [W/K] + Real64 SumSysMCpT = 0.0; // Sum of system mass flow rate * specific heat * temperature for this zone [W] + Real64 TSupK = 0.0; // supply temperature [K] + Real64 SumSysM = 0.0; // Sum of systems mass flow rate [kg/s] + Real64 TotSysFlow = 0.0; // [m3/s] + int ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; + Real64 CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + + auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); + Real64 HeightThermostat = zoneU.ThermostatHeight; // height of the thermostat above the floor [m] + Real64 HeightComfort = zoneU.ComfortHeight; // height at which comfort temperature is calculated + Real64 TempDiffCritRep = zoneU.TempTrigger; // Minimum temperature difference between upper and occupied subzones for reporting + Real64 DiffArea = zoneU.DiffArea; // diffuser effective area [m2] + Real64 ThrowAngle = Constant::DegToRadians * zoneU.DiffAngle; // diffuser slot angle relative to vertical [radians] + Real64 SourceHeight = 0.0; // height of plume sources above the floor [m] + Real64 NumDiffusers = zoneU.DiffusersPerZone; + Real64 PowerPerPlume = zoneU.PowerPerPlume; + // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, + // baseboards (nonthermostatic), water heater skin loss + Real64 ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); + + // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very + // low or zero) + if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { + ConvGainsOccSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); } - } - // mass flow rate * specific heat for this zone for infiltration, ventilation, mixing [W/K] - Real64 SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MCPE + thisZoneHB.MCPC + thisZoneHB.MDotCPOA; - // mass flow rate * specific heat* temp for this zone for infiltration, ventilation, mixing [W] - Real64 SumMCpT = thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MCPTE + thisZoneHB.MCPTC + - thisZoneHB.MDotCPOA * state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp; - Real64 MCp_Total = SumMCp + SumSysMCp; // total mass flow rate * specific heat for this zone [W/K] - Real64 MCpT_Total = SumMCpT + SumSysMCpT; // total mass flow rate * specific heat* temp for this zone [W] - // For the York MIT diffusers (variable area) the area varies with the flow rate. Assume 400 ft/min velocity - // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is - // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by - // (TotSysFlow/(NumDiffusers*.0708))*.035 - if (zoneU.DiffuserType == Diffuser::VarArea) { - DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); - } - // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. - UFADConvCoef ufadCC; - HcUFAD(state, ZoneNum, 0.5, ufadCC); - Real64 PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); - - Real64 NumberOfPlumes = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (PowerInPlumes / PowerPerPlume) : 1.0; - Real64 NumDiffusersPerPlume = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (NumDiffusers / NumberOfPlumes) : 1.0; - - if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::KelvinConv) > thisZoneHB.MAT) { - // The system will mix - HeightFrac = 0.0; - } else { - Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / - (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); - if (zoneU.CalcTransHeight) { - HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; - } else { - HeightFrac = zoneU.TransHeight / CeilingHeight; + + // Add convection from pool cover to occupied region + ConvGainsOccSubzone += state.dataHeatBalFanSys->SumConvPool(ZoneNum); + + // gains from lights (ceiling), tubular daylighting devices, high temp radiant heaters + + Real64 ConvGainsUpSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); + ConvGainsUpSubzone += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum); + if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { + ConvGainsUpSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); } - HeightFrac = max(0.0, min(1.0, HeightFrac)); - for (int Ctd = 1; Ctd <= 4; ++Ctd) { - HcUFAD(state, ZoneNum, HeightFrac, ufadCC); - PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); - if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { - NumberOfPlumes = PowerInPlumes / PowerPerPlume; - NumDiffusersPerPlume = NumDiffusers / NumberOfPlumes; + + Real64 ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; + Real64 ZoneEquipConfigNum = zoneU.ZoneEquipPtr; + if (ZoneEquipConfigNum > 0) { + auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum); + for (int InNodeIndex = 1; InNodeIndex <= zoneEquipConfig.NumInletNodes; ++InNodeIndex) { + Real64 NodeTemp = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).Temp; + Real64 MassFlowRate = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).MassFlowRate; + Real64 CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); + SumSysMCp += MassFlowRate * CpAir; + SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, NodeTemp, thisZoneHB.ZoneAirHumRat); + TSupK += MassFlowRate * NodeTemp; + SumSysM += MassFlowRate; + } + if (TotSysFlow > 0.0) { + TSupK = TSupK / SumSysM + Constant::KelvinConv; } else { - NumberOfPlumes = 1.0; - NumDiffusersPerPlume = 1.0; + TSupK = 0.0; } - if (PowerInPlumes <= 0.0) break; + } + // mass flow rate * specific heat for this zone for infiltration, ventilation, mixing [W/K] + Real64 SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MCPE + thisZoneHB.MCPC + thisZoneHB.MDotCPOA; + // mass flow rate * specific heat* temp for this zone for infiltration, ventilation, mixing [W] + Real64 SumMCpT = thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MCPTE + thisZoneHB.MCPTC + + thisZoneHB.MDotCPOA * state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp; + Real64 MCp_Total = SumMCp + SumSysMCp; // total mass flow rate * specific heat for this zone [W/K] + Real64 MCpT_Total = SumMCpT + SumSysMCpT; // total mass flow rate * specific heat* temp for this zone [W] + // For the York MIT diffusers (variable area) the area varies with the flow rate. Assume 400 ft/min velocity + // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is + // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by + // (TotSysFlow/(NumDiffusers*.0708))*.035 + if (zoneU.DiffuserType == Diffuser::VarArea) { + DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); + } + // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. + UFADConvCoef ufadCC; + HcUFAD(state, ZoneNum, 0.5, ufadCC); + Real64 PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + ufadCC.HAT_MX - + ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + + Real64 NumberOfPlumes = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (PowerInPlumes / PowerPerPlume) : 1.0; + Real64 NumDiffusersPerPlume = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (NumDiffusers / NumberOfPlumes) : 1.0; + + if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::KelvinConv) > thisZoneHB.MAT) { + // The system will mix + HeightFrac = 0.0; + } else { Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); if (zoneU.CalcTransHeight) { @@ -902,714 +856,740 @@ void CalcUFADInt(EnergyPlusData &state, int const ZoneNum) // index number for t HeightFrac = zoneU.TransHeight / CeilingHeight; } HeightFrac = max(0.0, min(1.0, HeightFrac)); - state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - Real64 GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + zoneU.C_Kc + zoneU.D_Kc * Gamma + zoneU.E_Kc * pow_2(Gamma); - GainsFrac = max(0.6, min(GainsFrac, 1.0)); - state.dataRoomAir->AIRRATOC(ZoneNum) = - state.dataHeatBal->Zone(ZoneNum).Volume * - (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * - state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * - PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - state.dataRoomAir->AIRRATMX(ZoneNum) = - state.dataHeatBal->Zone(ZoneNum).Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * - state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * - PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - - if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; - state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; - state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; - - state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; - state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; - state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; + for (int Ctd = 1; Ctd <= 4; ++Ctd) { + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + ufadCC.HAT_MX - + ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + if (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) { + NumberOfPlumes = PowerInPlumes / PowerPerPlume; + NumDiffusersPerPlume = NumDiffusers / NumberOfPlumes; + } else { + NumberOfPlumes = 1.0; + NumDiffusersPerPlume = 1.0; + } + if (PowerInPlumes <= 0.0) break; + Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / + (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); + if (zoneU.CalcTransHeight) { + HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; + } else { + HeightFrac = zoneU.TransHeight / CeilingHeight; + } + HeightFrac = max(0.0, min(1.0, HeightFrac)); + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + Real64 GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + zoneU.C_Kc + zoneU.D_Kc * Gamma + zoneU.E_Kc * pow_2(Gamma); + GainsFrac = max(0.6, min(GainsFrac, 1.0)); + state.dataRoomAir->AIRRATOC(ZoneNum) = + state.dataHeatBal->Zone(ZoneNum).Volume * + (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * + state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; + state.dataRoomAir->AIRRATMX(ZoneNum) = + state.dataHeatBal->Zone(ZoneNum).Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * + state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; + + if (state.dataHVACGlobal->UseZoneTimeStepHistory) { + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; + + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; - } else { - state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; - state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; - state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; + } else { + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; - state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; - state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; - state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; - } + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; + } - Real64 AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); - Real64 TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + - (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); - // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A - Real64 TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; - Real64 TempIndCoef = GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + - MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + - GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + - MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult) / - ((11.0 / 6.0) * AirCap + GainsFrac * ufadCC.HA_OC + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; - } else { + Real64 AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); + Real64 TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); + // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A + Real64 TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; + Real64 TempIndCoef = GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { state.dataRoomAir->ZTOC(ZoneNum) = - (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + - TempIndCoef / TempDepCoef; + (TempHistTerm + GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult) / + ((11.0 / 6.0) * AirCap + GainsFrac * ufadCC.HA_OC + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; + } else { + state.dataRoomAir->ZTOC(ZoneNum) = + (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; - } - AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + - (1.0 / 3.0) * state.dataRoomAir->ZTMMX(ZoneNum)[2]); - TempDepCoef = (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total; - TempIndCoef = (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + - state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAir->ZTMX(ZoneNum) = - (TempHistTerm + - (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + - state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / - ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; - } else { + AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAir->ZTMMX(ZoneNum)[2]); + TempDepCoef = (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total; + TempIndCoef = (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { state.dataRoomAir->ZTMX(ZoneNum) = - (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + - TempIndCoef / TempDepCoef; + (TempHistTerm + + (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / + ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; + } else { + state.dataRoomAir->ZTMX(ZoneNum) = + (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; + state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + } + if (PowerInPlumes <= 0.0) { + HeightFrac = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + } else { + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = Gamma; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; } - state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); } - if (PowerInPlumes <= 0.0) { + + //=============================== M I X E D Calculation ============================================== + if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || + HeightFrac * CeilingHeight < state.dataUFADManager->ThickOccupiedSubzoneMin) { + MIXFLAG = true; HeightFrac = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; - state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; - state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; - } else { - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAir->ZoneUFADGamma(ZoneNum) = Gamma; - state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; + Real64 AirCap = thisZoneHB.AirPowerCap; + Real64 TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); + + for (int Ctd = 1; Ctd <= 3; ++Ctd) { + Real64 TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; + Real64 const thisZoneT1 = thisZoneHB.ZoneT1; + // Formerly CoefSumhat, coef in zone temp equation with dimensions of h*A(T1 + Real64 TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / + ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; + } else { + ZTAveraged = + (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; + } + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; + TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / + ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; + } else { + ZTAveraged = + (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; + } + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; + } } - } + //========================================================================================= - //=============================== M I X E D Calculation ============================================== - if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || - HeightFrac * CeilingHeight < state.dataUFADManager->ThickOccupiedSubzoneMin) { - MIXFLAG = true; - HeightFrac = 0.0; - state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; - state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; - Real64 AirCap = thisZoneHB.AirPowerCap; - Real64 TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); - - for (int Ctd = 1; Ctd <= 3; ++Ctd) { - Real64 TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; - Real64 const thisZoneT1 = thisZoneHB.ZoneT1; - // Formerly CoefSumhat, coef in zone temp equation with dimensions of h*A(T1 - Real64 TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / - ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; - } else { - ZTAveraged = (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; - } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; + // Comfort temperature and temperature at the thermostat/temperature control sensor + + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + Real64 HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + Real64 HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; + // Comfort temperature + + if (MIXFLAG) { + state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; + } else { + if (HeightComfort < HeightOccupiedSubzoneAve) { + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightUpSubzoneAve) { + state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightComfort) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / + (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); + } else if (HeightComfort >= HeightUpSubzoneAve && HeightComfort <= CeilingHeight) { + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + } else { + ShowFatalError(state, + format("UFAD comfort height is above ceiling or below floor in Zone: {}", state.dataHeatBal->Zone(ZoneNum).Name)); } - state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; - HcUFAD(state, ZoneNum, HeightFrac, ufadCC); - TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; - TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / - ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; - } else { - ZTAveraged = (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; - } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; + } + + // Temperature at the thermostat/temperature control sensor + + if (MIXFLAG) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = ZTAveraged; + } else { + if (HeightThermostat < HeightOccupiedSubzoneAve) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightUpSubzoneAve) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightThermostat) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / + (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); + } else if (HeightThermostat >= HeightUpSubzoneAve && HeightThermostat <= CeilingHeight) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + } else { + ShowFatalError(state, + format("Underfloor air distribution thermostat height is above ceiling or below floor in Zone: {}", + state.dataHeatBal->Zone(ZoneNum).Name)); } - state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; } - } - //========================================================================================= - - // Comfort temperature and temperature at the thermostat/temperature control sensor - - state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; - Real64 HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; - Real64 HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; - // Comfort temperature - - if (MIXFLAG) { - state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; - } else { - if (HeightComfort < HeightOccupiedSubzoneAve) { - state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); - } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightUpSubzoneAve) { - state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightComfort) + - state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / - (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); - } else if (HeightComfort >= HeightUpSubzoneAve && HeightComfort <= CeilingHeight) { - state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + + // Temperature gradients + if ((HeightUpSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { + state.dataRoomAir->AvgTempGrad(ZoneNum) = + (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); } else { - ShowFatalError(state, format("UFAD comfort height is above ceiling or below floor in Zone: {}", state.dataHeatBal->Zone(ZoneNum).Name)); + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; } - } - // Temperature at the thermostat/temperature control sensor - - if (MIXFLAG) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = ZTAveraged; - } else { - if (HeightThermostat < HeightOccupiedSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); - } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightUpSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightThermostat) + - state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / - (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); - } else if (HeightThermostat >= HeightUpSubzoneAve && HeightThermostat <= CeilingHeight) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + if (MIXFLAG) { + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 1; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; } else { - ShowFatalError(state, - format("Underfloor air distribution thermostat height is above ceiling or below floor in Zone: {}", - state.dataHeatBal->Zone(ZoneNum).Name)); + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; } - } - // Temperature gradients - if ((HeightUpSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { - state.dataRoomAir->AvgTempGrad(ZoneNum) = - (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); - } else { - state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; - } + if (ZoneEquipConfigNum > 0) { + int ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; + state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); + } - if (MIXFLAG) { - state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 1; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; - } else { - state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 0; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; - } + if (MIXFLAG) { + state.dataRoomAir->Phi(ZoneNum) = 1.0; + } else { + state.dataRoomAir->Phi(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / + (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); + } - if (ZoneEquipConfigNum > 0) { - int ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; - state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); + // Mixed for reporting purposes + if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAir->HeightTransition(ZoneNum) = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + } else { + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; + } } - if (MIXFLAG) { - state.dataRoomAir->Phi(ZoneNum) = 1.0; - } else { - state.dataRoomAir->Phi(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / - (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); - } + void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone + { - // Mixed for reporting purposes - if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; - state.dataRoomAir->HeightTransition(ZoneNum) = 0.0; - state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; - } else { - state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; - } -} + // SUBROUTINE INFORMATION: + // AUTHOR Fred Buhl + // DATE WRITTEN January 2006 + // MODIFIED Brent Griffith June 2008 for new interpolation and time history + // RE-ENGINEERED na -void CalcUFADExt(EnergyPlusData &state, int const ZoneNum) // index number for the specified zone -{ + // PURPOSE OF THIS SUBROUTINE: + // Using the UCSD UFAD exterior zone model, this subroutine calculates the occupied subzone height, + // surface heat transfer coefficients, the occupied subzone temperature, and the upper subzone temperature. - // SUBROUTINE INFORMATION: - // AUTHOR Fred Buhl - // DATE WRITTEN January 2006 - // MODIFIED Brent Griffith June 2008 for new interpolation and time history - // RE-ENGINEERED na + // METHODOLOGY EMPLOYED: + // The zone is divided into 2 subzones with a variable transition height. - // PURPOSE OF THIS SUBROUTINE: - // Using the UCSD UFAD exterior zone model, this subroutine calculates the occupied subzone height, - // surface heat transfer coefficients, the occupied subzone temperature, and the upper subzone temperature. + // REFERENCES: + // The model is described in the EnergyPlus Engineering Reference in Anna Liu's UCSD PhD thesis. - // METHODOLOGY EMPLOYED: - // The zone is divided into 2 subzones with a variable transition height. + // Using/Aliasing + using Psychrometrics::PsyCpAirFnW; + using Psychrometrics::PsyRhoAirFnPbTdbW; + Real64 TimeStepSys = state.dataHVACGlobal->TimeStepSys; + Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; + using InternalHeatGains::SumInternalConvectionGainsByTypes; + using InternalHeatGains::SumReturnAirConvectionGainsByTypes; - // REFERENCES: - // The model is described in the EnergyPlus Engineering Reference in Anna Liu's UCSD PhD thesis. + // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // Using/Aliasing - using Psychrometrics::PsyCpAirFnW; - using Psychrometrics::PsyRhoAirFnPbTdbW; - Real64 TimeStepSys = state.dataHVACGlobal->TimeStepSys; - Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; - using InternalHeatGains::SumInternalConvectionGainsByTypes; - using InternalHeatGains::SumReturnAirConvectionGainsByTypes; - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - - Real64 PowerInPlumesPerMeter; // Power in Plumes per meter of window length [W/m] - Real64 ZTAveraged; - - // Exact solution or Euler method - if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { - if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { - if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); + Real64 PowerInPlumesPerMeter; // Power in Plumes per meter of window length [W/m] + Real64 ZTAveraged; + + // Exact solution or Euler method + if (state.dataHeatBal->ZoneAirSolutionAlgo != DataHeatBalance::SolutionAlgo::ThirdOrder) { + if (state.dataHVACGlobal->ShortenTimeStepSysRoomAir && TimeStepSys < state.dataGlobal->TimeStepZone) { + if (state.dataHVACGlobal->PreviousTimeStep < state.dataGlobal->TimeStepZone) { + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneM2OC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneM2MX(ZoneNum); + } else { + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); + } } else { - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZoneMXOC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZoneMXMX(ZoneNum); + state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } - } else { - state.dataRoomAir->Zone1OC(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); - state.dataRoomAir->Zone1MX(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); } - } - auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); - Real64 HeightFrac = 0.0; // Fractional height of transition between occupied and upper subzones - bool MIXFLAG = false; - state.dataRoomAir->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; - Real64 SumSysMCp = 0.0; // Sum of system mass flow rate * specific heat for this zone [W/K] - Real64 SumSysMCpT = 0.0; // Sum of system mass flow rate * specific heat * temperature for this zone [W] - Real64 TotSysFlow = 0.0; // [m3/s] - Real64 TSupK = 0.0; // supply temperature [K] - Real64 SumSysM = 0.0; // Sum of systems mass flow rate [kg/s] - Real64 PowerInPlumes = 0.0; // [W] - Real64 Gamma = 0.0; // dimensionless height parameter; higher gamma means interface height will be - // higher, smaller gamma means interface height will be lower. - int ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; - Real64 CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); - - auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); - Real64 HeightThermostat = zoneU.ThermostatHeight; // height of the thermostat above the floor [m] - Real64 HeightComfort = zoneU.ComfortHeight; // height at which comfort temperature is calculated - Real64 TempDiffCritRep = zoneU.TempTrigger; // Minimum temperature difference between upper and occupied subzones for reporting - Real64 DiffArea = zoneU.DiffArea; // diffuser effective area [m2] - Real64 ThrowAngle = Constant::DegToRadians * zoneU.DiffAngle; // diffuser slot angle relative to vertical [radians] - Real64 SourceHeight = zoneU.HeatSrcHeight; // height of plume sources above the floor [m] - Real64 NumDiffusers = zoneU.DiffusersPerZone; - Real64 PowerPerPlume = zoneU.PowerPerPlume; - // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, - // baseboards (nonthermostatic), water heater skin loss - Real64 ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); - - // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very - // low or zero) - if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { - ConvGainsOccSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); - } - - // Add convection from pool cover to occupied region - ConvGainsOccSubzone += state.dataHeatBalFanSys->SumConvPool(ZoneNum); - - // gains from lights (ceiling), tubular daylighting devices, high temp radiant heaters - Real64 ConvGainsUpSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); // convective heat gains into the upper subzone [W] - ConvGainsUpSubzone += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum); - if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { - ConvGainsUpSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); - } - Real64 ConvGains = ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; // total zone convective gains (excluding surfaces) [W] - int ZoneEquipConfigNum = zoneU.ZoneEquipPtr; - if (ZoneEquipConfigNum > 0) { - auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum); - for (int InNodeIndex = 1; InNodeIndex <= zoneEquipConfig.NumInletNodes; ++InNodeIndex) { - Real64 NodeTemp = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).Temp; - Real64 MassFlowRate = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).MassFlowRate; - Real64 CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); - SumSysMCp += MassFlowRate * CpAir; - SumSysMCpT += MassFlowRate * CpAir * NodeTemp; - TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, NodeTemp, thisZoneHB.ZoneAirHumRat); - TSupK += MassFlowRate * NodeTemp; - SumSysM += MassFlowRate; - } - if (TotSysFlow > 0.0) { - TSupK = TSupK / SumSysM + Constant::KelvinConv; - } else { - TSupK = 0.0; + auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); + Real64 HeightFrac = 0.0; // Fractional height of transition between occupied and upper subzones + bool MIXFLAG = false; + state.dataRoomAir->UFADHcIn = state.dataHeatBalSurf->SurfHConvInt; + Real64 SumSysMCp = 0.0; // Sum of system mass flow rate * specific heat for this zone [W/K] + Real64 SumSysMCpT = 0.0; // Sum of system mass flow rate * specific heat * temperature for this zone [W] + Real64 TotSysFlow = 0.0; // [m3/s] + Real64 TSupK = 0.0; // supply temperature [K] + Real64 SumSysM = 0.0; // Sum of systems mass flow rate [kg/s] + Real64 PowerInPlumes = 0.0; // [W] + Real64 Gamma = 0.0; // dimensionless height parameter; higher gamma means interface height will be + // higher, smaller gamma means interface height will be lower. + int ZoneMult = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; + Real64 CeilingHeight = state.dataRoomAir->ZoneCeilingHeight2(ZoneNum) - state.dataRoomAir->ZoneCeilingHeight1(ZoneNum); + + auto &zoneU = state.dataRoomAir->ZoneUFAD(state.dataRoomAir->ZoneUFADPtr(ZoneNum)); + Real64 HeightThermostat = zoneU.ThermostatHeight; // height of the thermostat above the floor [m] + Real64 HeightComfort = zoneU.ComfortHeight; // height at which comfort temperature is calculated + Real64 TempDiffCritRep = zoneU.TempTrigger; // Minimum temperature difference between upper and occupied subzones for reporting + Real64 DiffArea = zoneU.DiffArea; // diffuser effective area [m2] + Real64 ThrowAngle = Constant::DegToRadians * zoneU.DiffAngle; // diffuser slot angle relative to vertical [radians] + Real64 SourceHeight = zoneU.HeatSrcHeight; // height of plume sources above the floor [m] + Real64 NumDiffusers = zoneU.DiffusersPerZone; + Real64 PowerPerPlume = zoneU.PowerPerPlume; + // gains from occupants, task lighting, elec equip, gas equip, other equip, hot water equip, steam equip, + // baseboards (nonthermostatic), water heater skin loss + Real64 ConvGainsOccSubzone = SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); + + // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very + // low or zero) + if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { + ConvGainsOccSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesOccupied); } - } - - // mass flow rate * specific heat for this zone for infiltration, ventilation, mixing [W/K] - Real64 SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MDotCPOA; - // mass flow rate * specific heat* temp for this zone for infiltration, ventilation, mixing [W] - Real64 SumMCpT = thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MDotCPOA * state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp; - Real64 MCp_Total = SumMCp + SumSysMCp; // total mass flow rate * specific heat for this zone [W/K] - Real64 MCpT_Total = SumMCpT + SumSysMCpT; // total mass flow rate * specific heat* temp for this zone [W] + // Add convection from pool cover to occupied region + ConvGainsOccSubzone += state.dataHeatBalFanSys->SumConvPool(ZoneNum); - // For the York MIT diffusers (variable area) the area varies with the flow rate. Assume 400 ft/min velocity - // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is - // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by - // (TotSysFlow/(NumDiffusers*.0708))*.035 - if (zoneU.DiffuserType == Diffuser::VarArea) { - DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); - } - // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. - UFADConvCoef ufadCC; - HcUFAD(state, ZoneNum, 0.5, ufadCC); - Real64 ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - // ZoneEquipConfig index for this UFAD zone - ufadCC.HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - - ufadCC.HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); - PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); - // NumberOfPlumes = PowerInPlumes / PowerPerPlume - Real64 NumberOfPlumes = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (PowerInPlumes / PowerPerPlume) : 1.0; - Real64 NumDiffusersPerPlume = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (NumDiffusers / NumberOfPlumes) : 1.0; - - if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::KelvinConv) > thisZoneHB.MAT) { - // The system will mix - HeightFrac = 0.0; - } else { - if (PowerInPlumes > 0.0) { - if (zoneU.WinWidth > 0.0) { // exterior zone formula - PowerInPlumesPerMeter = PowerInPlumes / zoneU.WinWidth; - Gamma = (TotSysFlow * std::cos(ThrowAngle)) / (NumDiffusers * DiffArea * std::pow(0.0281 * 0.001 * PowerInPlumesPerMeter, 0.333333)); - } else { // interior zone formula - Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / - (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); - } - } else { - Gamma = 1000.0; + // gains from lights (ceiling), tubular daylighting devices, high temp radiant heaters + Real64 ConvGainsUpSubzone = + SumInternalConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); // convective heat gains into the upper subzone [W] + ConvGainsUpSubzone += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum); + if (state.dataHeatBal->Zone(ZoneNum).NoHeatToReturnAir) { + ConvGainsUpSubzone += SumReturnAirConvectionGainsByTypes(state, ZoneNum, IntGainTypesUpSubzone); } - if (zoneU.CalcTransHeight) { - if (zoneU.WinWidth > 0.0) { // use exterior zone formula - HeightFrac = (std::sqrt(DiffArea) * (11.03 * std::log(Gamma) - 10.73) + 0.5 * SourceHeight) / CeilingHeight; - } else { // use interior zone formula - HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; + Real64 ConvGains = + ConvGainsOccSubzone + ConvGainsUpSubzone + thisZoneHB.SysDepZoneLoadsLagged; // total zone convective gains (excluding surfaces) [W] + int ZoneEquipConfigNum = zoneU.ZoneEquipPtr; + if (ZoneEquipConfigNum > 0) { + auto const &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ZoneEquipConfigNum); + for (int InNodeIndex = 1; InNodeIndex <= zoneEquipConfig.NumInletNodes; ++InNodeIndex) { + Real64 NodeTemp = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).Temp; + Real64 MassFlowRate = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(InNodeIndex)).MassFlowRate; + Real64 CpAir = PsyCpAirFnW(thisZoneHB.ZoneAirHumRat); + SumSysMCp += MassFlowRate * CpAir; + SumSysMCpT += MassFlowRate * CpAir * NodeTemp; + TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, NodeTemp, thisZoneHB.ZoneAirHumRat); + TSupK += MassFlowRate * NodeTemp; + SumSysM += MassFlowRate; + } + if (TotSysFlow > 0.0) { + TSupK = TSupK / SumSysM + Constant::KelvinConv; + } else { + TSupK = 0.0; } - } else { - HeightFrac = zoneU.TransHeight / CeilingHeight; } - HeightFrac = max(0.0, min(1.0, HeightFrac)); - Real64 GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + zoneU.C_Kc + zoneU.D_Kc * Gamma + zoneU.E_Kc * pow_2(Gamma); - GainsFrac = max(0.7, min(GainsFrac, 1.0)); - if (zoneU.ShadeDown) { - GainsFrac -= 0.2; + + // mass flow rate * specific heat for this zone for infiltration, ventilation, mixing [W/K] + Real64 SumMCp = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MDotCPOA; + // mass flow rate * specific heat* temp for this zone for infiltration, ventilation, mixing [W] + Real64 SumMCpT = + thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MDotCPOA * state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp; + + Real64 MCp_Total = SumMCp + SumSysMCp; // total mass flow rate * specific heat for this zone [W/K] + Real64 MCpT_Total = SumMCpT + SumSysMCpT; // total mass flow rate * specific heat* temp for this zone [W] + + // For the York MIT diffusers (variable area) the area varies with the flow rate. Assume 400 ft/min velocity + // at the diffuser, and a design flow rate of 150 cfm (.0708 m3/s). Then the design area for each diffuser is + // 150 ft3/min / 400 ft/min = .375 ft2 = .035 m2. This is adjusted each time step by + // (TotSysFlow/(NumDiffusers*.0708))*.035 + if (zoneU.DiffuserType == Diffuser::VarArea) { + DiffArea = 0.035 * TotSysFlow / (0.0708 * NumDiffusers); } - state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; - for (int Ctd = 1; Ctd <= 4; ++Ctd) { - HcUFAD(state, ZoneNum, HeightFrac, ufadCC); - ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - ufadCC.HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - - ufadCC.HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); - ConvGainsWindows = max(ConvGainsWindows, 0.0); - PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + - ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); - // NumberOfPlumes = PowerInPlumes / PowerPerPlume - NumberOfPlumes = 1.0; - if (PowerInPlumes <= 0.0) break; - if (zoneU.WinWidth > 0.0) { // use exterior zone formula - PowerInPlumesPerMeter = PowerInPlumes / zoneU.WinWidth; - Gamma = (TotSysFlow * std::cos(ThrowAngle)) / (NumDiffusers * DiffArea * std::pow(0.0281 * 0.001 * PowerInPlumesPerMeter, 0.333333)); - } else { // use interior zone formula - Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / - (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); + // initial estimate of convective transfer from surfaces; assume HeightFrac is 0.5. + UFADConvCoef ufadCC; + HcUFAD(state, ZoneNum, 0.5, ufadCC); + Real64 ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - // ZoneEquipConfig index for this UFAD zone + ufadCC.HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - ufadCC.HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); + PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + ufadCC.HAT_MX - + ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + // NumberOfPlumes = PowerInPlumes / PowerPerPlume + Real64 NumberOfPlumes = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (PowerInPlumes / PowerPerPlume) : 1.0; + Real64 NumDiffusersPerPlume = (PowerPerPlume > 0.0 && PowerInPlumes > 0.0) ? (NumDiffusers / NumberOfPlumes) : 1.0; + + if ((PowerInPlumes <= 0.0) || (TotSysFlow == 0.0) || (TSupK - Constant::KelvinConv) > thisZoneHB.MAT) { + // The system will mix + HeightFrac = 0.0; + } else { + if (PowerInPlumes > 0.0) { + if (zoneU.WinWidth > 0.0) { // exterior zone formula + PowerInPlumesPerMeter = PowerInPlumes / zoneU.WinWidth; + Gamma = + (TotSysFlow * std::cos(ThrowAngle)) / (NumDiffusers * DiffArea * std::pow(0.0281 * 0.001 * PowerInPlumesPerMeter, 0.333333)); + } else { // interior zone formula + Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / + (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); + } + } else { + Gamma = 1000.0; } if (zoneU.CalcTransHeight) { - if (zoneU.WinWidth > 0.0) { // exterior zone formula + if (zoneU.WinWidth > 0.0) { // use exterior zone formula HeightFrac = (std::sqrt(DiffArea) * (11.03 * std::log(Gamma) - 10.73) + 0.5 * SourceHeight) / CeilingHeight; - } else { // interior zone formula + } else { // use interior zone formula HeightFrac = (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; } } else { HeightFrac = zoneU.TransHeight / CeilingHeight; } - HeightFrac = min(1.0, HeightFrac); - state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + HeightFrac = max(0.0, min(1.0, HeightFrac)); Real64 GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + zoneU.C_Kc + zoneU.D_Kc * Gamma + zoneU.E_Kc * pow_2(Gamma); GainsFrac = max(0.7, min(GainsFrac, 1.0)); if (zoneU.ShadeDown) { GainsFrac -= 0.2; } - state.dataRoomAir->AIRRATOC(ZoneNum) = - state.dataHeatBal->Zone(ZoneNum).Volume * - (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * - state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * - PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - state.dataRoomAir->AIRRATMX(ZoneNum) = - state.dataHeatBal->Zone(ZoneNum).Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * - state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * - PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; - - if (state.dataHVACGlobal->UseZoneTimeStepHistory) { - state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; - state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; - state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; - - state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; - state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; - state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; + for (int Ctd = 1; Ctd <= 4; ++Ctd) { + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + ConvGainsWindows = ufadCC.HAT_MXWin + ufadCC.HAT_OCWin - ufadCC.HA_MXWin * state.dataRoomAir->ZTMX(ZoneNum) - + ufadCC.HA_OCWin * state.dataRoomAir->ZTOC(ZoneNum); + ConvGainsWindows = max(ConvGainsWindows, 0.0); + PowerInPlumes = ConvGains + ufadCC.HAT_OC - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum) + ufadCC.HAT_MX - + ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum); + // NumberOfPlumes = PowerInPlumes / PowerPerPlume + NumberOfPlumes = 1.0; + if (PowerInPlumes <= 0.0) break; + if (zoneU.WinWidth > 0.0) { // use exterior zone formula + PowerInPlumesPerMeter = PowerInPlumes / zoneU.WinWidth; + Gamma = + (TotSysFlow * std::cos(ThrowAngle)) / (NumDiffusers * DiffArea * std::pow(0.0281 * 0.001 * PowerInPlumesPerMeter, 0.333333)); + } else { // use interior zone formula + Gamma = std::pow(TotSysFlow * std::cos(ThrowAngle), 1.5) / + (NumberOfPlumes * std::pow(NumDiffusersPerPlume * DiffArea, 1.25) * std::sqrt(0.0281 * 0.001 * PowerInPlumes)); + } + if (zoneU.CalcTransHeight) { + if (zoneU.WinWidth > 0.0) { // exterior zone formula + HeightFrac = (std::sqrt(DiffArea) * (11.03 * std::log(Gamma) - 10.73) + 0.5 * SourceHeight) / CeilingHeight; + } else { // interior zone formula + HeightFrac = + (std::sqrt(NumDiffusersPerPlume * DiffArea) * (7.43 * std::log(Gamma) - 1.35) + 0.5 * SourceHeight) / CeilingHeight; + } + } else { + HeightFrac = zoneU.TransHeight / CeilingHeight; + } + HeightFrac = min(1.0, HeightFrac); + state.dataRoomAir->HeightTransition(ZoneNum) = HeightFrac * CeilingHeight; + Real64 GainsFrac = zoneU.A_Kc * std::pow(Gamma, zoneU.B_Kc) + zoneU.C_Kc + zoneU.D_Kc * Gamma + zoneU.E_Kc * pow_2(Gamma); + GainsFrac = max(0.7, min(GainsFrac, 1.0)); + if (zoneU.ShadeDown) { + GainsFrac -= 0.2; + } + state.dataRoomAir->AIRRATOC(ZoneNum) = + state.dataHeatBal->Zone(ZoneNum).Volume * + (state.dataRoomAir->HeightTransition(ZoneNum) - min(state.dataRoomAir->HeightTransition(ZoneNum), 0.2)) / CeilingHeight * + state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATOC(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; + state.dataRoomAir->AIRRATMX(ZoneNum) = + state.dataHeatBal->Zone(ZoneNum).Volume * (CeilingHeight - state.dataRoomAir->HeightTransition(ZoneNum)) / CeilingHeight * + state.dataHeatBal->Zone(ZoneNum).ZoneVolCapMultpSens * + PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, state.dataRoomAir->MATMX(ZoneNum), thisZoneHB.ZoneAirHumRat) * + PsyCpAirFnW(thisZoneHB.ZoneAirHumRat) / TimeStepSysSec; + + if (state.dataHVACGlobal->UseZoneTimeStepHistory) { + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->XMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->XMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->XMATOC(ZoneNum)[0]; + + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->XMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->XMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->XMATMX(ZoneNum)[0]; - } else { - state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; - state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; - state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; + } else { + state.dataRoomAir->ZTMOC(ZoneNum)[2] = state.dataRoomAir->DSXMATOC(ZoneNum)[2]; + state.dataRoomAir->ZTMOC(ZoneNum)[1] = state.dataRoomAir->DSXMATOC(ZoneNum)[1]; + state.dataRoomAir->ZTMOC(ZoneNum)[0] = state.dataRoomAir->DSXMATOC(ZoneNum)[0]; - state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; - state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; - state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; - } + state.dataRoomAir->ZTMMX(ZoneNum)[2] = state.dataRoomAir->DSXMATMX(ZoneNum)[2]; + state.dataRoomAir->ZTMMX(ZoneNum)[1] = state.dataRoomAir->DSXMATMX(ZoneNum)[1]; + state.dataRoomAir->ZTMMX(ZoneNum)[0] = state.dataRoomAir->DSXMATMX(ZoneNum)[0]; + } - Real64 AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); - Real64 TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + - (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); - Real64 TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; - Real64 TempIndCoef = GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + - MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAir->ZTOC(ZoneNum) = (TempHistTerm + - GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + - MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult) / - ((11.0 / 6.0) * AirCap + GainsFrac * ufadCC.HA_OC + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; - } else { + Real64 AirCap = state.dataRoomAir->AIRRATOC(ZoneNum); + Real64 TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMOC(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMOC(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAir->ZTMOC(ZoneNum)[2]); + Real64 TempDepCoef = GainsFrac * ufadCC.HA_OC + MCp_Total; + Real64 TempIndCoef = GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { state.dataRoomAir->ZTOC(ZoneNum) = - (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + - TempIndCoef / TempDepCoef; + (TempHistTerm + GainsFrac * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_MX * state.dataRoomAir->ZTMX(ZoneNum)) + + MCpT_Total + thisZoneHB.NonAirSystemResponse / ZoneMult) / + ((11.0 / 6.0) * AirCap + GainsFrac * ufadCC.HA_OC + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + state.dataRoomAir->ZTOC(ZoneNum) = state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef / AirCap; + } else { + state.dataRoomAir->ZTOC(ZoneNum) = + (state.dataRoomAir->Zone1OC(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAir->ZTOC(ZoneNum) = (AirCap * state.dataRoomAir->Zone1OC(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; - } - AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); - TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + - (1.0 / 3.0) * state.dataRoomAir->ZTMMX(ZoneNum)[2]); - TempDepCoef = (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total; - TempIndCoef = (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + - state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - state.dataRoomAir->ZTMX(ZoneNum) = + AirCap = state.dataRoomAir->AIRRATMX(ZoneNum); + TempHistTerm = AirCap * (3.0 * state.dataRoomAir->ZTMMX(ZoneNum)[0] - (3.0 / 2.0) * state.dataRoomAir->ZTMMX(ZoneNum)[1] + + (1.0 / 3.0) * state.dataRoomAir->ZTMMX(ZoneNum)[2]); + TempDepCoef = (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total; + TempIndCoef = (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + state.dataRoomAir->ZTMX(ZoneNum) = (TempHistTerm + (1.0 - GainsFrac) * (ConvGains + ufadCC.HAT_OC + ufadCC.HAT_MX - ufadCC.HA_OC * state.dataRoomAir->ZTOC(ZoneNum)) + - state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; - } else { - state.dataRoomAir->ZTMX(ZoneNum) = - (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + - TempIndCoef / TempDepCoef; + state.dataRoomAir->ZTOC(ZoneNum) * MCp_Total) / + ((11.0 / 6.0) * AirCap + (1.0 - GainsFrac) * ufadCC.HA_MX + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + state.dataRoomAir->ZTMX(ZoneNum) = state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef / AirCap; + } else { + state.dataRoomAir->ZTMX(ZoneNum) = + (state.dataRoomAir->Zone1MX(ZoneNum) - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - state.dataRoomAir->ZTMX(ZoneNum) = (AirCap * state.dataRoomAir->Zone1MX(ZoneNum) + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; + state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + } + if (PowerInPlumes <= 0.0) { + HeightFrac = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; + state.dataRoomAir->ZoneUFADPowInPlumesfromWindows(ZoneNum) = 0.0; + } else { + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + state.dataRoomAir->ZoneUFADGamma(ZoneNum) = Gamma; + state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; + state.dataRoomAir->ZoneUFADPowInPlumesfromWindows(ZoneNum) = ConvGainsWindows; } - state.dataRoomAir->ZTFloor(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); } - if (PowerInPlumes <= 0.0) { + + //=============================== M I X E D Calculation ============================================== + if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || + HeightFrac * CeilingHeight < state.dataUFADManager->ThickOccupiedSubzoneMin) { + MIXFLAG = true; HeightFrac = 0.0; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; - state.dataRoomAir->ZoneUFADGamma(ZoneNum) = 0.0; - state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = 0.0; - state.dataRoomAir->ZoneUFADPowInPlumesfromWindows(ZoneNum) = 0.0; - } else { - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; - state.dataRoomAir->ZoneUFADGamma(ZoneNum) = Gamma; - state.dataRoomAir->ZoneUFADPowInPlumes(ZoneNum) = PowerInPlumes; - state.dataRoomAir->ZoneUFADPowInPlumesfromWindows(ZoneNum) = ConvGainsWindows; - } - } + Real64 const thisZoneT1 = thisZoneHB.ZoneT1; - //=============================== M I X E D Calculation ============================================== - if (state.dataRoomAir->ZTMX(ZoneNum) < state.dataRoomAir->ZTOC(ZoneNum) || MCp_Total <= 0.0 || - HeightFrac * CeilingHeight < state.dataUFADManager->ThickOccupiedSubzoneMin) { - MIXFLAG = true; - HeightFrac = 0.0; - Real64 const thisZoneT1 = thisZoneHB.ZoneT1; - - state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; - state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; - Real64 AirCap = thisZoneHB.AirPowerCap; - Real64 TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); - - for (int Ctd = 1; Ctd <= 3; ++Ctd) { - Real64 TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; - Real64 TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / - ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; - } else { - ZTAveraged = (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->MaxTempGrad(ZoneNum) = 0.0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + Real64 AirCap = thisZoneHB.AirPowerCap; + Real64 TempHistTerm = AirCap * (3.0 * thisZoneHB.ZTM[0] - (3.0 / 2.0) * thisZoneHB.ZTM[1] + (1.0 / 3.0) * thisZoneHB.ZTM[2]); + + for (int Ctd = 1; Ctd <= 3; ++Ctd) { + Real64 TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; + Real64 TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / + ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; + } else { + ZTAveraged = + (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; - } - state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; - HcUFAD(state, ZoneNum, HeightFrac, ufadCC); - TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; - TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; - switch (state.dataHeatBal->ZoneAirSolutionAlgo) { - case DataHeatBalance::SolutionAlgo::ThirdOrder: { - ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / - ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); - } break; - case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { - if (TempDepCoef == 0.0) { // B=0 - ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; - } else { - ZTAveraged = (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; + HcUFAD(state, ZoneNum, HeightFrac, ufadCC); + TempDepCoef = ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total; + TempIndCoef = ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total; + switch (state.dataHeatBal->ZoneAirSolutionAlgo) { + case DataHeatBalance::SolutionAlgo::ThirdOrder: { + ZTAveraged = (TempHistTerm + ConvGains + ufadCC.HAT_MX + ufadCC.HAT_OC + MCpT_Total) / + ((11.0 / 6.0) * AirCap + ufadCC.HA_MX + ufadCC.HA_OC + MCp_Total); + } break; + case DataHeatBalance::SolutionAlgo::AnalyticalSolution: { + if (TempDepCoef == 0.0) { // B=0 + ZTAveraged = thisZoneT1 + TempIndCoef / AirCap; + } else { + ZTAveraged = + (thisZoneT1 - TempIndCoef / TempDepCoef) * std::exp(min(700.0, -TempDepCoef / AirCap)) + TempIndCoef / TempDepCoef; + } + } break; + case DataHeatBalance::SolutionAlgo::EulerMethod: { + ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); + } break; + default: + break; } - } break; - case DataHeatBalance::SolutionAlgo::EulerMethod: { - ZTAveraged = (AirCap * thisZoneT1 + TempIndCoef) / (AirCap + TempDepCoef); - } break; - default: - break; + state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; + state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; } - state.dataRoomAir->ZTOC(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTMX(ZoneNum) = ZTAveraged; - state.dataRoomAir->ZTFloor(ZoneNum) = ZTAveraged; } - } - //========================================================================================= - - // Comfort temperature and temperature at the thermostat/temperature control sensor - - Real64 HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; - Real64 HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; - // Comfort temperature - - if (MIXFLAG) { - state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; - } else { - if (HeightComfort < HeightOccupiedSubzoneAve) { - state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); - } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightUpSubzoneAve) { - state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightComfort) + - state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / - (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); - } else if (HeightComfort >= HeightUpSubzoneAve && HeightComfort <= CeilingHeight) { - state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + //========================================================================================= + + // Comfort temperature and temperature at the thermostat/temperature control sensor + + Real64 HeightUpSubzoneAve = (CeilingHeight + state.dataRoomAir->HeightTransition(ZoneNum)) / 2.0; + Real64 HeightOccupiedSubzoneAve = state.dataRoomAir->HeightTransition(ZoneNum) / 2.0; + // Comfort temperature + + if (MIXFLAG) { + state.dataRoomAir->TCMF(ZoneNum) = ZTAveraged; } else { - ShowFatalError(state, format("UFAD comfort height is above ceiling or below floor in Zone: {}", state.dataHeatBal->Zone(ZoneNum).Name)); + if (HeightComfort < HeightOccupiedSubzoneAve) { + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + } else if (HeightComfort >= HeightOccupiedSubzoneAve && HeightComfort < HeightUpSubzoneAve) { + state.dataRoomAir->TCMF(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightComfort) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightComfort - HeightOccupiedSubzoneAve)) / + (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); + } else if (HeightComfort >= HeightUpSubzoneAve && HeightComfort <= CeilingHeight) { + state.dataRoomAir->TCMF(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + } else { + ShowFatalError(state, + format("UFAD comfort height is above ceiling or below floor in Zone: {}", state.dataHeatBal->Zone(ZoneNum).Name)); + } } - } - // Temperature at the thermostat/temperature control sensor - - if (MIXFLAG) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = ZTAveraged; - } else { - if (HeightThermostat < HeightOccupiedSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); - } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightUpSubzoneAve) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightThermostat) + - state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / - (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); - } else if (HeightThermostat >= HeightUpSubzoneAve && HeightThermostat <= CeilingHeight) { - state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + // Temperature at the thermostat/temperature control sensor + + if (MIXFLAG) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = ZTAveraged; } else { - ShowFatalError(state, - format("Underfloor air distribution thermostat height is above ceiling or below floor in Zone: {}", - state.dataHeatBal->Zone(ZoneNum).Name)); + if (HeightThermostat < HeightOccupiedSubzoneAve) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTOC(ZoneNum); + } else if (HeightThermostat >= HeightOccupiedSubzoneAve && HeightThermostat < HeightUpSubzoneAve) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) * (HeightUpSubzoneAve - HeightThermostat) + + state.dataRoomAir->ZTMX(ZoneNum) * (HeightThermostat - HeightOccupiedSubzoneAve)) / + (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); + } else if (HeightThermostat >= HeightUpSubzoneAve && HeightThermostat <= CeilingHeight) { + state.dataHeatBalFanSys->TempTstatAir(ZoneNum) = state.dataRoomAir->ZTMX(ZoneNum); + } else { + ShowFatalError(state, + format("Underfloor air distribution thermostat height is above ceiling or below floor in Zone: {}", + state.dataHeatBal->Zone(ZoneNum).Name)); + } } - } - // Temperature gradients - if ((HeightUpSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { - state.dataRoomAir->AvgTempGrad(ZoneNum) = - (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); - } else { - state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; - } + // Temperature gradients + if ((HeightUpSubzoneAve - HeightOccupiedSubzoneAve) > 0.1) { + state.dataRoomAir->AvgTempGrad(ZoneNum) = + (state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) / (HeightUpSubzoneAve - HeightOccupiedSubzoneAve); + } else { + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + } - if (MIXFLAG) { - state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 1; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; - } else { - state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 0; - state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; - } + if (MIXFLAG) { + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 1; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false; + } else { + state.dataRoomAir->ZoneUFADMixedFlag(ZoneNum) = 0; + state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true; + } - if (ZoneEquipConfigNum > 0) { - int ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; - state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); - } + if (ZoneEquipConfigNum > 0) { + int ZoneNodeNum = state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber; + state.dataLoopNodes->Node(ZoneNodeNum).Temp = state.dataRoomAir->ZTMX(ZoneNum); + } - if (MIXFLAG) { - state.dataRoomAir->Phi(ZoneNum) = 1.0; - } else { - state.dataRoomAir->Phi(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / - (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); - } + if (MIXFLAG) { + state.dataRoomAir->Phi(ZoneNum) = 1.0; + } else { + state.dataRoomAir->Phi(ZoneNum) = (state.dataRoomAir->ZTOC(ZoneNum) - (TSupK - Constant::KelvinConv)) / + (state.dataRoomAir->ZTMX(ZoneNum) - (TSupK - Constant::KelvinConv)); + } - // Mixed for reporting purposes - if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { - state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; - state.dataRoomAir->HeightTransition(ZoneNum) = 0.0; - state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; - } else { - state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; + // Mixed for reporting purposes + if ((MIXFLAG) || ((state.dataRoomAir->ZTMX(ZoneNum) - state.dataRoomAir->ZTOC(ZoneNum)) < TempDiffCritRep)) { + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 1.0; + state.dataRoomAir->HeightTransition(ZoneNum) = 0.0; + state.dataRoomAir->AvgTempGrad(ZoneNum) = 0.0; + } else { + state.dataRoomAir->ZoneUFADMixedFlagRep(ZoneNum) = 0.0; + } } -} -} // namespace RoomAir +} // namespace RoomAir } // namespace EnergyPlus diff --git a/src/EnergyPlus/UFADManager.hh b/src/EnergyPlus/UFADManager.hh index e639db6c6dc..634f0620b14 100644 --- a/src/EnergyPlus/UFADManager.hh +++ b/src/EnergyPlus/UFADManager.hh @@ -61,20 +61,20 @@ namespace RoomAir { struct UFADConvCoef { - Real64 HAT_MX = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone - Real64 HAT_MXWin = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone (windows only) - Real64 HA_MX = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone - Real64 HA_MXWin = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone (windows only) - Real64 HAT_OC = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone - Real64 HAT_OCWin = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone (windows only) - Real64 HA_OC = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone - Real64 HA_OCWin = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone (windows only) - Real64 HAT_FLOOR = 0.0; // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone - Real64 HA_FLOOR = 0.0; // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone + Real64 HAT_MX = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone + Real64 HAT_MXWin = 0.0; // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone (windows only) + Real64 HA_MX = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone + Real64 HA_MXWin = 0.0; // HA_MX Convection Coefficient times Area for the upper subzone (windows only) + Real64 HAT_OC = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone + Real64 HAT_OCWin = 0.0; // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone (windows only) + Real64 HA_OC = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone + Real64 HA_OCWin = 0.0; // HA_OC Convection Coefficient times Area for the lower subzone (windows only) + Real64 HAT_FLOOR = 0.0; // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone + Real64 HA_FLOOR = 0.0; // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone }; - + void ManageUFAD(EnergyPlusData &state, - int const ZoneNum, // index number for the specified zone + int const ZoneNum, // index number for the specified zone RoomAir::RoomAirModel const ZoneModelType // type of zone model; UCSDUFI = 6 ); diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 6f3c6f22504..cb6da9c0af0 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -376,7 +376,8 @@ namespace UnitVentilator { if (unitVent.ATMixerType == DataHVACGlobals::ATMixer_InletSide || unitVent.ATMixerType == DataHVACGlobals::ATMixer_SupplySide) { unitVent.ATMixerExists = true; } - unitVent.ZonePtr = DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::UnitVentilator, unitVent.Name); + unitVent.ZonePtr = + DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::UnitVentilator, unitVent.Name); if (unitVent.ZonePtr == 0) { ErrorsFound = true; } diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index cd574f67f83..904a3eea405 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -2164,11 +2164,11 @@ namespace UnitarySystems { this->m_CoolingCoilType_Num == DataHVACGlobals::Coil_CoolingWaterDetailed) { WaterCoils::SimulateWaterCoilComponents( state, this->m_CoolingCoilName, FirstHVACIteration, this->m_CoolingCoilIndex, QActual, this->m_FanOpMode, 1.0); - EqSizing.DesCoolingLoad = WaterCoils::GetWaterCoilCapacity( - state, - UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), - this->m_CoolingCoilName, - ErrFound); + EqSizing.DesCoolingLoad = + WaterCoils::GetWaterCoilCapacity(state, + UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_CoolingCoilType_Num)), + this->m_CoolingCoilName, + ErrFound); } } this->m_MaxNoCoolHeatAirVolFlow *= EqSizing.DesCoolingLoad; @@ -2181,11 +2181,11 @@ namespace UnitarySystems { if (this->m_HeatingCoilType_Num == DataHVACGlobals::Coil_HeatingWater) { WaterCoils::SimulateWaterCoilComponents( state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex, QActual, this->m_FanOpMode, 1.0); - EqSizing.DesHeatingLoad = WaterCoils::GetWaterCoilCapacity( - state, - UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), - this->m_HeatingCoilName, - ErrFound); + EqSizing.DesHeatingLoad = + WaterCoils::GetWaterCoilCapacity(state, + UtilityRoutines::makeUPPER(DataHVACGlobals::cAllCoilTypes(this->m_HeatingCoilType_Num)), + this->m_HeatingCoilName, + ErrFound); } } this->m_MaxNoCoolHeatAirVolFlow *= EqSizing.DesHeatingLoad; @@ -7192,8 +7192,7 @@ namespace UnitarySystems { availScheduleName = UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); } thisSys.input_specs.availability_schedule_name = availScheduleName; - thisSys.input_specs.cooling_coil_object_type = - UtilityRoutines::makeUPPER(fields.at("cooling_coil_object_type").get()); + thisSys.input_specs.cooling_coil_object_type = UtilityRoutines::makeUPPER(fields.at("cooling_coil_object_type").get()); thisSys.input_specs.cooling_coil_name = UtilityRoutines::makeUPPER(fields.at("cooling_coil_name").get()); // why is this cooling coil does not have a field for Design Air Vol Flow Rate // set it "SupplyAirFlowRate" to avoid blank, which lead to fatal out during get input @@ -7353,13 +7352,11 @@ namespace UnitarySystems { thisSys.input_specs.availability_schedule_name = UtilityRoutines::makeUPPER(fields.at("availability_schedule_name").get()); } - thisSys.input_specs.air_inlet_node_name = - UtilityRoutines::makeUPPER(fields.at("air_inlet_node_name").get()); // required + thisSys.input_specs.air_inlet_node_name = UtilityRoutines::makeUPPER(fields.at("air_inlet_node_name").get()); // required thisSys.input_specs.air_outlet_node_name = UtilityRoutines::makeUPPER(fields.at("air_outlet_node_name").get()); // required - if (fields.find("supply_fan_object_type") != fields.end()) { // not required field - thisSys.input_specs.supply_fan_object_type = - UtilityRoutines::makeUPPER(fields.at("supply_fan_object_type").get()); + if (fields.find("supply_fan_object_type") != fields.end()) { // not required field + thisSys.input_specs.supply_fan_object_type = UtilityRoutines::makeUPPER(fields.at("supply_fan_object_type").get()); } if (fields.find("supply_fan_name") != fields.end()) { // not required field @@ -17120,8 +17117,7 @@ namespace UnitarySystems { this->NodeNumOfControlledZone = zoneEquipConfig.ZoneNode; TotalFloorAreaOnAirLoop = state.dataHeatBal->Zone(this->ControlZoneNum).FloorArea; this->m_AirLoopEquipment = false; - if (zoneEquipConfig.EquipListIndex == 0) - return; + if (zoneEquipConfig.EquipListIndex == 0) return; auto &zoneEquipList = state.dataZoneEquip->ZoneEquipList(zoneEquipConfig.EquipListIndex); for (int EquipNum = 1; EquipNum <= zoneEquipList.NumOfEquipTypes; ++EquipNum) { diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index 15e4d3d46e9..67b68a69d01 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -653,8 +653,8 @@ namespace UserDefinedComponents { { state.dataUserDefinedComponents->UserPlantComp(CompLoop).Loop(ConnectionLoop).FlowPriority = - static_cast(getEnumValue( - DataPlant::LoopFlowStatusTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(aArgCount + 3)))); + static_cast( + getEnumValue(DataPlant::LoopFlowStatusTypeNamesUC, UtilityRoutines::makeUPPER(cAlphaArgs(aArgCount + 3)))); } // find program manager for initial setup, begin environment and sizing of this plant connection diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index b3e2641cfaf..660a5c9169e 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -1660,13 +1660,12 @@ void ShowSevereInvalidKey(EnergyPlusData &state, ErrorObjectHeader const &eoh, s ShowContinueError(state, format("{} = {}, invalid key", fieldName, fieldVal)); } -void ShowSevereEmptyField(EnergyPlusData &state, ErrorObjectHeader const &eoh, - std::string_view fieldName, - std::string_view depFieldName, - std::string_view depFieldVal) +void ShowSevereEmptyField( + EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view depFieldName, std::string_view depFieldVal) { ShowSevereError(state, format("{}: {} = {}", eoh.routineName, eoh.objectType, eoh.objectName)); - ShowContinueError(state, format("{} cannot be empty{}.", fieldName, depFieldName.empty() ? "" : format (" when {} = {}", depFieldName, depFieldVal))); + ShowContinueError(state, + format("{} cannot be empty{}.", fieldName, depFieldName.empty() ? "" : format(" when {} = {}", depFieldName, depFieldVal))); } } // namespace EnergyPlus diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index 0cfaf1eddf7..f1cac345051 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -229,11 +229,12 @@ struct ErrorObjectHeader void ShowSevereItemNotFound(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); void ShowSevereInvalidKey(EnergyPlusData &state, ErrorObjectHeader const &eoh, std::string_view fieldName, std::string_view fieldValue); -void ShowSevereEmptyField(EnergyPlusData &state, ErrorObjectHeader const &eoh, - std::string_view fieldName, +void ShowSevereEmptyField(EnergyPlusData &state, + ErrorObjectHeader const &eoh, + std::string_view fieldName, std::string_view depFieldName = {}, std::string_view depFieldVal = {}); - + namespace UtilityRoutines { static constexpr std::array MonthNamesCC{ diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 9609749f21d..ddf6fe0bd8a 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -610,8 +610,8 @@ namespace VentilatedSlab { } // Process the temperature control type - ventSlab.controlType = static_cast( - getEnumValue(ControlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); + ventSlab.controlType = + static_cast(getEnumValue(ControlTypeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(9)))); if (ventSlab.controlType == ControlType::Invalid) { ShowSevereError( diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 20d1296498c..98e6249a998 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -2403,8 +2403,8 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) } // Validate Heater Control Type - Tank.ControlType = static_cast( - getEnumValue(HeaterControlModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + Tank.ControlType = + static_cast(getEnumValue(HeaterControlModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.ControlType) { case HeaterControlMode::Cycle: { Tank.MinCapacity = Tank.MaxCapacity; @@ -2543,8 +2543,8 @@ bool getWaterHeaterMixedInputs(EnergyPlusData &state) Tank.OnCycParaFracToTank = state.dataIPShortCut->rNumericArgs(12); - Tank.AmbientTempIndicator = static_cast( - getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + Tank.AmbientTempIndicator = + static_cast(getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { Tank.AmbientTempSchedule = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(9)); @@ -2862,8 +2862,7 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.HeightWasAutoSized = true; } - Tank.Shape = - static_cast(getEnumValue(TankShapeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.Shape) { case TankShape::HorizCylinder: case TankShape::VertCylinder: { @@ -3004,8 +3003,8 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) // Validate Heater Fuel Type Tank.FuelType = static_cast( getEnumValue(Constant::eFuelNamesUC, - state.dataIPShortCut->cAlphaArgs( - 7))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported + state.dataIPShortCut->cAlphaArgs( + 7))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported if (Tank.FuelType == Constant::eFuel::Invalid) { ShowSevereError(state, format("{} = {}: Invalid Heater Fuel Type entered={}", @@ -3032,8 +3031,8 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) // Validate Off-Cycle Parasitic Fuel Type Tank.OffCycParaFuelType = static_cast( getEnumValue(Constant::eFuelNamesUC, - state.dataIPShortCut->cAlphaArgs( - 8))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported + state.dataIPShortCut->cAlphaArgs( + 8))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported if (Tank.OffCycParaFuelType == Constant::eFuel::Invalid) { if (state.dataIPShortCut->cAlphaArgs(8).empty()) { Tank.OffCycParaFuelType = Tank.FuelType; @@ -3055,10 +3054,10 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.OnCycParaLoad = state.dataIPShortCut->rNumericArgs(15); // Validate On-Cycle Parasitic Fuel Type - Tank.OnCycParaFuelType = static_cast(getEnumValue( - Constant::eFuelNamesUC, - state.dataIPShortCut->cAlphaArgs( - 9))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported/empty + Tank.OnCycParaFuelType = static_cast( + getEnumValue(Constant::eFuelNamesUC, + state.dataIPShortCut->cAlphaArgs( + 9))); // returns all kinds of fuels including district heat and cool + steam, returns unassigned if unsupported/empty if (Tank.OnCycParaFuelType == Constant::eFuel::Invalid) { if (state.dataIPShortCut->cAlphaArgs(9).empty()) { Tank.OnCycParaFuelType = Tank.FuelType; @@ -3077,8 +3076,8 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) Tank.OnCycParaFracToTank = state.dataIPShortCut->rNumericArgs(16); Tank.OnCycParaHeight = state.dataIPShortCut->rNumericArgs(17); - Tank.AmbientTempIndicator = static_cast( - getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); + Tank.AmbientTempIndicator = + static_cast(getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(10)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3371,8 +3370,8 @@ bool getWaterHeaterStratifiedInput(EnergyPlusData &state) } // Validate inlet mode - Tank.InletMode = static_cast( - getEnumValue(InletPositionModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(20)))); + Tank.InletMode = + static_cast(getEnumValue(InletPositionModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(20)))); Tank.Nodes = state.dataIPShortCut->rNumericArgs(32); int specifiedNodes = 0; @@ -3530,8 +3529,8 @@ bool getWaterTankMixedInput(EnergyPlusData &state) Tank.OnCycParaFuelType = Constant::eFuel::Electricity; Tank.OnCycParaFracToTank = 0.0; - Tank.AmbientTempIndicator = static_cast( - getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + Tank.AmbientTempIndicator = + static_cast(getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -3793,8 +3792,7 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) Tank.HeightWasAutoSized = true; } - Tank.Shape = - static_cast(getEnumValue(TankShapeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); + Tank.Shape = static_cast(getEnumValue(TankShapeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(2)))); switch (Tank.Shape) { case TankShape::HorizCylinder: case TankShape::VertCylinder: { @@ -3867,8 +3865,8 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) Tank.OnCycParaFracToTank = 0.0; Tank.OnCycParaHeight = 0.0; - Tank.AmbientTempIndicator = static_cast( - getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + Tank.AmbientTempIndicator = + static_cast(getEnumValue(TankAmbientTempNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); switch (Tank.AmbientTempIndicator) { case WTTAmbientTemp::Schedule: { @@ -4112,8 +4110,8 @@ bool getWaterTankStratifiedInput(EnergyPlusData &state) } // Validate inlet mode - Tank.InletMode = static_cast( - getEnumValue(InletPositionModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(14)))); + Tank.InletMode = + static_cast(getEnumValue(InletPositionModeNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(14)))); Tank.Nodes = state.dataIPShortCut->rNumericArgs(18); Tank.AdditionalCond = state.dataIPShortCut->rNumericArgs(19); @@ -4507,8 +4505,7 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) int TankCoolingPriority = 0; int TankHeatingPriority = 0; auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(ZoneEquipListNum); - for (int EquipmentTypeNum = 1; EquipmentTypeNum <= zoneEquipList.NumOfEquipTypes; - ++EquipmentTypeNum) { + for (int EquipmentTypeNum = 1; EquipmentTypeNum <= zoneEquipList.NumOfEquipTypes; ++EquipmentTypeNum) { if (zoneEquipList.EquipName(EquipmentTypeNum) != HPWH.Name) continue; FoundTankInList = true; TankCoolingPriority = zoneEquipList.CoolingPriority(EquipmentTypeNum); @@ -4526,7 +4523,8 @@ bool GetWaterThermalTankInput(EnergyPlusData &state) // check that tank has lower priority than all other non-HPWH objects in Zone // Equipment List for (int EquipmentTypeNum = 1; EquipmentTypeNum <= zoneEquipList.NumOfEquipTypes; ++EquipmentTypeNum) { - if (UtilityRoutines::SameString(zoneEquipList.EquipTypeName(EquipmentTypeNum), state.dataIPShortCut->cCurrentModuleObject)) + if (UtilityRoutines::SameString(zoneEquipList.EquipTypeName(EquipmentTypeNum), + state.dataIPShortCut->cCurrentModuleObject)) continue; if (TankCoolingPriority > zoneEquipList.CoolingPriority(EquipmentTypeNum) || TankHeatingPriority > zoneEquipList.HeatingPriority(EquipmentTypeNum)) { diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index aad01f4e860..1b63ea1c7cb 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -363,8 +363,7 @@ namespace WaterToAirHeatPump { heatPump.PowerLosses = NumArray(10); heatPump.LossFactor = NumArray(11); - heatPump.compressorType = - static_cast(getEnumValue(CompressTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(2)))); + heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(2)))); switch (heatPump.compressorType) { case CompressorType::Reciprocating: { @@ -547,8 +546,7 @@ namespace WaterToAirHeatPump { heatPump.PowerLosses = NumArray(7); heatPump.LossFactor = NumArray(8); - heatPump.compressorType = - static_cast(getEnumValue(CompressTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(2)))); + heatPump.compressorType = static_cast(getEnumValue(CompressTypeNamesUC, UtilityRoutines::makeUPPER(AlphArray(2)))); switch (heatPump.compressorType) { case CompressorType::Reciprocating: { heatPump.CompPistonDisp = NumArray(9); diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index e7f36da4bae..d55bb5eace3 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -501,8 +501,8 @@ namespace WaterUse { if ((!state.dataIPShortCut->lAlphaFieldBlanks(8)) && (state.dataIPShortCut->cAlphaArgs(8) != "NONE")) { waterConnection.HeatRecovery = true; - waterConnection.HeatRecoveryHX = static_cast( - getEnumValue(HeatRecoverHXNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); + waterConnection.HeatRecoveryHX = + static_cast(getEnumValue(HeatRecoverHXNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(8)))); if (waterConnection.HeatRecoveryHX == HeatRecovHX::Invalid) { ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(8), state.dataIPShortCut->cAlphaArgs(8))); diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc index 1e618f56007..9225de5cdac 100644 --- a/src/EnergyPlus/WindTurbine.cc +++ b/src/EnergyPlus/WindTurbine.cc @@ -281,8 +281,8 @@ namespace WindTurbine { } } // Select rotor type - windTurbine.rotorType = static_cast( - getEnumValue(WindTurbine::RotorNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); + windTurbine.rotorType = + static_cast(getEnumValue(WindTurbine::RotorNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(3)))); if (windTurbine.rotorType == RotorType::Invalid) { if (state.dataIPShortCut->cAlphaArgs(3).empty()) { windTurbine.rotorType = RotorType::HorizontalAxis; @@ -298,8 +298,8 @@ namespace WindTurbine { } // Select control type - windTurbine.controlType = static_cast( - getEnumValue(WindTurbine::ControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); + windTurbine.controlType = + static_cast(getEnumValue(WindTurbine::ControlNamesUC, UtilityRoutines::makeUPPER(state.dataIPShortCut->cAlphaArgs(4)))); if (windTurbine.controlType == ControlType::Invalid) { if (state.dataIPShortCut->cAlphaArgs(4).empty()) { windTurbine.controlType = ControlType::VariableSpeedVariablePitch; diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 532d5276aa0..5418957db74 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -3134,7 +3134,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += NonAirSysOutput; SysOutputProvided = NonAirSysOutput + AirSysOutput; } break; - + case ZoneEquipType::VariableRefrigerantFlowTerminal: { // 'ZoneHVAC:TerminalUnit:VariableRefrigerantFlow' bool HeatingActive = false; bool CoolingActive = false; @@ -3154,7 +3154,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool SysOutputProvided, LatOutputProvided); } break; - + case ZoneEquipType::WindowAirConditioner: { // 'ZoneHVAC:WindowAirConditioner' WindowAC::SimWindowAC(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3165,10 +3165,10 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool zoneEquipList.EquipIndex(EquipPtr)); } break; - case ZoneEquipType::PackagedTerminalHeatPump: // 'ZoneHVAC:PackagedTerminalHeatPump' - case ZoneEquipType::PackagedTerminalAirConditioner: // 'ZoneHVAC:PackagedTerminalAirConditioner' + case ZoneEquipType::PackagedTerminalHeatPump: // 'ZoneHVAC:PackagedTerminalHeatPump' + case ZoneEquipType::PackagedTerminalAirConditioner: // 'ZoneHVAC:PackagedTerminalAirConditioner' case ZoneEquipType::PackagedTerminalHeatPumpWaterToAir: // 'ZoneHVAC:WaterToAirHeatPump' - case ZoneEquipType::UnitarySystem: { // 'AirloopHVAC:UnitarySystem' + case ZoneEquipType::UnitarySystem: { // 'AirloopHVAC:UnitarySystem' int AirLoopNum = 0; bool HeatingActive = false; bool CoolingActive = false; @@ -3203,7 +3203,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool // temperature) SysOutputProvided amount was already sent above to // next Predict-Correct series of calcs via SysDepZoneLoads } break; - + case ZoneEquipType::FourPipeFanCoil: { // 'ZoneHVAC:FourPipeFanCoil' FanCoilUnits::SimFanCoilUnit(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3213,7 +3213,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::UnitVentilator: { // 'ZoneHVAC:UnitVentilator' UnitVentilator::SimUnitVentilator(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3223,7 +3223,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::UnitHeater: { // 'ZoneHVAC:UnitHeater' UnitHeater::SimUnitHeater(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3255,7 +3255,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - + case ZoneEquipType::BaseboardSteam: { // 'ZoneHVAC:Baseboard:RadiantConvective:Steam' SteamBaseboardRadiator::SimSteamBaseboard(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3267,7 +3267,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - + case ZoneEquipType::BaseboardConvectiveWater: { // 'ZoneHVAC:Baseboard:Convective:Water' BaseboardRadiator::SimBaseboard(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3290,7 +3290,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - + case ZoneEquipType::CoolingPanel: { // 'ZoneHVAC:CoolingPanel:RadiantConvective:Water' CoolingPanelSimple::SimCoolingPanel(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3302,7 +3302,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This cooling panel does not add/remove any latent heat } break; - + case ZoneEquipType::HighTemperatureRadiant: { // 'ZoneHVAC:HighTemperatureRadiant' HighTempRadiantSystem::SimHighTempRadiantSystem(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3312,9 +3312,9 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided = 0.0; // This baseboard currently sends its latent heat gain directly to predictor/corrector // via SumLatentHTRadSys... so setting LatOutputProvided = 0.0 } break; - + case ZoneEquipType::LowTemperatureRadiant: { // 'ZoneHVAC:LowTemperatureRadiant:VariableFlow', - // 'ZoneHVAC:LowTemperatureRadiant:ConstantFlow' + // 'ZoneHVAC:LowTemperatureRadiant:ConstantFlow' // 'ZoneHVAC:LowTemperatureRadiant:Electric' LowTempRadiantSystem::SimLowTempRadiantSystem(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3323,7 +3323,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool zoneEquipList.EquipIndex(EquipPtr)); LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - + case ZoneEquipType::ExhaustFan: { // 'Fan:ZoneExhaust' // Air loop system availability manager status only applies to PIU and exhaust fans // Check to see if System Availability Managers are asking for fans to cycle on or shut off @@ -3342,7 +3342,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool zoneEquipList.EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::HeatExchanger: { // 'HeatExchanger:AirToAir:FlatPlate' HeatRecovery::SimHeatRecovery(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3350,7 +3350,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool zoneEquipList.EquipIndex(EquipPtr), DataHVACGlobals::ContFanCycCoil); } break; - + case ZoneEquipType::EnergyRecoveryVentilator: { // 'ZoneHVAC:EnergyRecoveryVentilator' HVACStandAloneERV::SimStandAloneERV(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3360,7 +3360,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::HeatPumpWaterHeater: { // 'WaterHeater:HeatPump:PumpedCondenser' WaterThermalTanks::SimHeatPumpWaterHeater(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3369,7 +3369,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, state.dataZoneEquip->ZoneEquipList(ControlledZoneNum).EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::VentilatedSlab: { // 'ZoneHVAC:VentilatedSlab' VentilatedSlab::SimVentilatedSlab(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3379,7 +3379,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::OutdoorAirUnit: { // 'ZoneHVAC:OutdoorAirUnit' OutdoorAirUnit::SimOutdoorAirUnit(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3389,7 +3389,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::BaseboardElectric: { // 'ZoneHVAC:Baseboard:RadiantConvective:Electric' ElectricBaseboardRadiator::SimElecBaseboard(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3401,7 +3401,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool thisZoneHB.NonAirSystemResponse += SysOutputProvided; LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat } break; - + case ZoneEquipType::RefrigerationChillerSet: { // 'ZoneHVAC:RefrigerationChillerSet' RefrigeratedCase::SimAirChillerSet(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3422,7 +3422,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::EvaporativeCooler: { EvaporativeCoolers::SimZoneEvaporativeCoolerUnit(state, state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipName, @@ -3431,7 +3431,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - + case ZoneEquipType::HybridEvaporativeCooler: { HybridUnitaryAirConditioners::SimZoneHybridUnitaryAirConditioners( state, @@ -3441,7 +3441,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool LatOutputProvided, zoneEquipList.EquipIndex(EquipPtr)); } break; - + default: break; } diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 80efa38801f..51803ea04d0 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -1259,9 +1259,9 @@ void GetZoneAirSetPoints(EnergyPlusData &state) ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum) = cAlphaArgs(nint(2.0 * ControlTypeNum - 1 + 5)); ComfortControlledZone(ComfortControlledZoneNum).ControlTypeName(ControlTypeNum) = cAlphaArgs(nint(2.0 * ControlTypeNum + 5)); if (ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum) != "") { - CTIndex = getEnumValue( - ValidComfortControlTypesUC, - UtilityRoutines::makeUPPER(ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum))); + CTIndex = + getEnumValue(ValidComfortControlTypesUC, + UtilityRoutines::makeUPPER(ComfortControlledZone(ComfortControlledZoneNum).ControlType(ControlTypeNum))); if (CTIndex == 0) { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\"", @@ -3592,21 +3592,16 @@ void ZoneSpaceHeatBalanceData::predictSystemLoad( if (afnZoneInfo.IsUsed) { int RoomAirNode = afnZoneInfo.ControlAirNodeID; RoomAir::LoadPredictionRoomAirModelAFN(state, zoneNum, RoomAirNode); - this->TempDepCoef = - afnZoneInfo.Node(RoomAirNode).SumHA + afnZoneInfo.Node(RoomAirNode).SumLinkMCp; - this->TempIndCoef = afnZoneInfo.Node(RoomAirNode).SumIntSensibleGain + - afnZoneInfo.Node(RoomAirNode).SumHATsurf - - afnZoneInfo.Node(RoomAirNode).SumHATref + - afnZoneInfo.Node(RoomAirNode).SumLinkMCpT + + this->TempDepCoef = afnZoneInfo.Node(RoomAirNode).SumHA + afnZoneInfo.Node(RoomAirNode).SumLinkMCp; + this->TempIndCoef = afnZoneInfo.Node(RoomAirNode).SumIntSensibleGain + afnZoneInfo.Node(RoomAirNode).SumHATsurf - + afnZoneInfo.Node(RoomAirNode).SumHATref + afnZoneInfo.Node(RoomAirNode).SumLinkMCpT + afnZoneInfo.Node(RoomAirNode).SysDepZoneLoadsLagged; - this->AirPowerCap = afnZoneInfo.Node(RoomAirNode).AirVolume * - state.dataHeatBal->Zone(zoneNum).ZoneVolCapMultpSens * afnZoneInfo.Node(RoomAirNode).RhoAir * - afnZoneInfo.Node(RoomAirNode).CpAir / TimeStepSysSec; + this->AirPowerCap = afnZoneInfo.Node(RoomAirNode).AirVolume * state.dataHeatBal->Zone(zoneNum).ZoneVolCapMultpSens * + afnZoneInfo.Node(RoomAirNode).RhoAir * afnZoneInfo.Node(RoomAirNode).CpAir / TimeStepSysSec; this->TempHistoryTerm = this->AirPowerCap * (3.0 * this->ZTM[0] - (3.0 / 2.0) * this->ZTM[1] + (1.0 / 3.0) * this->ZTM[2]); this->TempDepZnLd = (11.0 / 6.0) * this->AirPowerCap + this->TempDepCoef; this->TempIndZnLd = this->TempHistoryTerm + this->TempIndCoef; - if (afnZoneInfo.Node(RoomAirNode).HasHVACAssigned) - RAFNFrac = afnZoneInfo.Node(RoomAirNode).HVAC(1).SupplyFraction; + if (afnZoneInfo.Node(RoomAirNode).HasHVACAssigned) RAFNFrac = afnZoneInfo.Node(RoomAirNode).HVAC(1).SupplyFraction; } } } @@ -4401,9 +4396,7 @@ Real64 ZoneSpaceHeatBalanceData::correctAirTemp( } } else if (thisAirModel.AirModel == RoomAir::RoomAirModel::AirflowNetwork) { // Zone node used in the RoomAirflowNetwork model - this->ZT = state.dataRoomAir->AFNZoneInfo(zoneNum) - .Node(state.dataRoomAir->AFNZoneInfo(zoneNum).ControlAirNodeID) - .AirTemp; + this->ZT = state.dataRoomAir->AFNZoneInfo(zoneNum).Node(state.dataRoomAir->AFNZoneInfo(zoneNum).ControlAirNodeID).AirTemp; thisSystemNode.Temp = this->ZT; // SpaceHB TODO: What to do here if this is for space if (spaceNum == 0) { @@ -4599,8 +4592,7 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || - thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || + if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADExt) { state.dataRoomAir->XMATFloor(zoneNum)[3] = state.dataRoomAir->XMATFloor(zoneNum)[2]; state.dataRoomAir->XMATFloor(zoneNum)[2] = state.dataRoomAir->XMATFloor(zoneNum)[1]; @@ -4644,8 +4636,7 @@ void ZoneSpaceHeatBalanceData::pushZoneTimestepHistory(EnergyPlusData &state, in this->ZoneWMX = this->ZoneAirHumRatAvg; // using average for whole zone time step. // SpaceHB TODO: For now, room air model is only for zones if (spaceNum == 0) { - if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || - thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || + if (thisAirModel.AirModel == RoomAir::RoomAirModel::DispVent3Node || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADInt || thisAirModel.AirModel == RoomAir::RoomAirModel::UFADExt) { state.dataRoomAir->ZoneM2Floor(zoneNum) = state.dataRoomAir->ZoneMXFloor(zoneNum); state.dataRoomAir->ZoneMXFloor(zoneNum) = state.dataRoomAir->ZTFloor(zoneNum); // using average for whole zone time step. @@ -7124,34 +7115,18 @@ void ZoneSpaceHeatBalanceData::updateTemperatures(EnergyPlusData &state, if (spaceNum == 0 && state.dataRoomAir->anyNonMixingRoomAirModel) { if (state.dataRoomAir->IsZoneDispVent3Node(zoneNum) || state.dataRoomAir->IsZoneUFAD(zoneNum)) { - state.dataRoomAir->MATFloor(zoneNum) = - DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - state.dataRoomAir->XMATFloor(zoneNum), - state.dataRoomAir->DSXMATFloor(zoneNum)); - state.dataRoomAir->MATOC(zoneNum) = - DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - state.dataRoomAir->XMATOC(zoneNum), - state.dataRoomAir->DSXMATOC(zoneNum)); - state.dataRoomAir->MATMX(zoneNum) = - DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - state.dataRoomAir->XMATMX(zoneNum), - state.dataRoomAir->DSXMATMX(zoneNum)); - + state.dataRoomAir->MATFloor(zoneNum) = DownInterpolate4HistoryValues( + PriorTimeStep, TimeStepSys, state.dataRoomAir->XMATFloor(zoneNum), state.dataRoomAir->DSXMATFloor(zoneNum)); + state.dataRoomAir->MATOC(zoneNum) = DownInterpolate4HistoryValues( + PriorTimeStep, TimeStepSys, state.dataRoomAir->XMATOC(zoneNum), state.dataRoomAir->DSXMATOC(zoneNum)); + state.dataRoomAir->MATMX(zoneNum) = DownInterpolate4HistoryValues( + PriorTimeStep, TimeStepSys, state.dataRoomAir->XMATMX(zoneNum), state.dataRoomAir->DSXMATMX(zoneNum)); } if (state.dataRoomAir->AirModel(zoneNum).AirModel == RoomAir::RoomAirModel::AirflowNetwork) { for (auto &afnNode : state.dataRoomAir->AFNZoneInfo(zoneNum).Node) { - afnNode.AirTemp = DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - afnNode.AirTempX, - afnNode.AirTempDSX); - - afnNode.HumRat = DownInterpolate4HistoryValues(PriorTimeStep, - TimeStepSys, - afnNode.HumRatX, - afnNode.HumRatDSX); + afnNode.AirTemp = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, afnNode.AirTempX, afnNode.AirTempDSX); + + afnNode.HumRat = DownInterpolate4HistoryValues(PriorTimeStep, TimeStepSys, afnNode.HumRatX, afnNode.HumRatDSX); } } }