diff --git a/scripts/dev/analyze_state.py b/scripts/dev/analyze_state.py new file mode 100755 index 00000000000..71a14000fce --- /dev/null +++ b/scripts/dev/analyze_state.py @@ -0,0 +1,108 @@ +from pathlib import Path +from typing import List, Set +from re import compile + + +class StateClass: + def __init__(self, struct_name: str, instance_name: str): + self.struct_name = struct_name + self.instance_name = instance_name + self.constructed = False + self.construction_call_matches_struct = False + self.clear_state_executed = False + + def validate(self) -> bool: + """ + Checks all the identified conditions are met and if not issues warnings. + + :return: Returns True if the state class is validated or False if not + """ + valid = True + if not self.constructed: + print("::warning file=EnergyPlusData.cc::State not constructed: " + self.instance_name) + valid = False + + if not self.construction_call_matches_struct: + print("::warning file=EnergyPlusData.cc::State constructed with different type: " + self.instance_name) + valid = False + + if not self.clear_state_executed: + print("::warning file=EnergyPlusData.cc::State clear_state() call missing: " + self.instance_name) + valid = False + return valid + + +class StateChecker: + + def __init__(self, repo_root_path: Path): + self.repo_root = repo_root_path + self.member_variables: Set[StateClass] = set() + + # read the state file contents -- if we ever split the data into files this will require modification + header_file_path = self.repo_root / 'src' / 'EnergyPlus' / 'Data' / 'EnergyPlusData.hh' + self.header_file_lines: List[str] = header_file_path.open().readlines() + source_file_path = self.repo_root / 'src' / 'EnergyPlus' / 'Data' / 'EnergyPlusData.cc' + self.source_file_lines: List[str] = source_file_path.open().readlines() + + def determine_member_variables(self) -> None: + """ + Finds all member variables using a pretty simplistic clue, the unique_ptr declaration. + This would change if we ever go to raw pointers or another storage method. + Currently it looks for lines of the form: + std::unique_ptr dataAirflowNetworkBalanceManager; + """ + pattern = compile(r'\s*std::unique_ptr<(\w+)> (\w+);') + for li in self.header_file_lines: + m = pattern.match(li) + if m: + underlying_struct_name = m.group(1) + member_var_name = m.group(2) + self.member_variables.add(StateClass(underlying_struct_name, member_var_name)) + + def validate_member_variable_construction(self): + """ + Validates that the state member variables are constructed using a clue of the `make_unique` function. + """ + pattern = compile(r'\s*this->(\w+) = std::make_unique<(\w+)>\(\);') + for li in self.source_file_lines: + if li.strip().startswith('#'): + continue + m = pattern.match(li) + if m: + member_var_name = m.group(1) + underlying_struct_name = m.group(2) + for v in self.member_variables: + if v.instance_name == member_var_name: + v.constructed = True + if v.struct_name == underlying_struct_name: + v.construction_call_matches_struct = True + + def validate_member_variable_clear_state(self): + """ + Validates the member's clear_state call is made in an uncommented line + """ + pattern = compile(r'\s*this->(\w+)->clear_state\(\);') + for li in self.source_file_lines: + if li.strip().startswith('#'): + continue + m = pattern.match(li) + if m: + member_var_name = m.group(1) + for v in self.member_variables: + if v.instance_name == member_var_name: + v.clear_state_executed = True + + +if __name__ == '__main__': + this_file_path = Path(__file__).resolve() # should be in scripts/dev + repo_root = this_file_path.parent.parent.parent # dev, scripts, repo_root + sc = StateChecker(repo_root) + sc.determine_member_variables() + sc.validate_member_variable_construction() + sc.validate_member_variable_clear_state() + all_good = True + for mv in sc.member_variables: + if not mv.validate(): + all_good = False + if not all_good: + print("::error file=EnergyPlusData.cc::Problems with State Variables!") diff --git a/scripts/dev/custom_check.sh b/scripts/dev/custom_check.sh index 2ea493bd095..4b4621dffcc 100755 --- a/scripts/dev/custom_check.sh +++ b/scripts/dev/custom_check.sh @@ -15,5 +15,6 @@ python3 "$REPO_ROOT"/scripts/dev/check_for_tabs_in_idfs.py || EXIT_STATUS=$? python3 "$REPO_ROOT"/scripts/dev/check_for_bom_in_idfs.py || EXIT_STATUS=$? python3 "$REPO_ROOT"/scripts/dev/verify_cmake_dirs.py || EXIT_STATUS=$? python3 "$REPO_ROOT"/scripts/dev/find_included_cc_files.py || EXIT_STATUS=$? +python3 "$REPO_ROOT"/scripts/dev/analyze_state.py || EXIT_STATUS=$? exit $EXIT_STATUS diff --git a/src/EnergyPlus/Data/CommonIncludes.hh b/src/EnergyPlus/Data/CommonIncludes.hh index 06323fbb461..a4e6a2dab4a 100644 --- a/src/EnergyPlus/Data/CommonIncludes.hh +++ b/src/EnergyPlus/Data/CommonIncludes.hh @@ -87,6 +87,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index ff9d221ffd8..918d3fb090d 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -56,78 +56,84 @@ namespace EnergyPlus { // todo, try to eliminate the need for the singleton IOFiles::setSingleton(&files); - this->dataAirflowNetworkBalanceManager = std::unique_ptr(new AirflowNetworkBalanceManagerData); - this->dataAirLoop = std::unique_ptr(new DataAirLoopData); - this->dataAirLoopHVACDOAS = std::unique_ptr(new AirLoopHVACDOASData); - this->dataAirSystemsData = std::unique_ptr(new AirSystemsData); - this->dataBaseboardElectric = std::unique_ptr(new BaseboardElectricData); - this->dataBaseboardRadiator = std::unique_ptr(new BaseboardRadiatorData); - this->dataBoilers = std::unique_ptr(new BoilersData); - this->dataBoilerSteam = std::unique_ptr(new BoilerSteamData); - this->dataBranchAirLoopPlant = std::unique_ptr(new DataBranchAirLoopPlantData); - this->dataBranchInputManager = std::unique_ptr(new BranchInputManagerData); - this->dataBranchNodeConnections = std::unique_ptr(new BranchNodeConnectionsData); - this->dataChilledCeilingPanelSimple = std::unique_ptr(new ChilledCeilingPanelSimpleData); - this->dataChillerAbsorber = std::unique_ptr(new ChillerAbsorberData); - this->dataChillerElectricEIR = std::unique_ptr(new ChillerElectricEIRData); - this->dataChillerExhaustAbsorption = std::unique_ptr(new ChillerExhaustAbsorptionData); - this->dataChillerGasAbsorption = std::unique_ptr(new ChillerGasAbsorptionData); - this->dataChillerIndirectAbsorption = std::unique_ptr(new ChillerIndirectAbsoprtionData); - this->dataChillerReformulatedEIR = std::unique_ptr(new ChillerReformulatedEIRData); - this->dataCondenserLoopTowers = std::unique_ptr(new CondenserLoopTowersData); - this->dataConstruction = std::unique_ptr(new ConstructionData); - this->dataConvectionCoefficient = std::unique_ptr(new ConvectionCoefficientsData); - this->dataCoolTower = std::unique_ptr(new CoolTowerData); - this->dataCostEstimateManager = std::unique_ptr(new CostEstimateManagerData); - this->dataCrossVentMgr = std::unique_ptr(new CrossVentMgrData); - this->dataCTElectricGenerator = std::unique_ptr(new CTElectricGeneratorData); - this->dataCurveManager = std::unique_ptr(new CurveManagerData); - this->dataExteriorEnergyUse = std::unique_ptr(new ExteriorEnergyUseData); - this->dataFans = std::unique_ptr(new FansData); - this->dataGlobal = std::unique_ptr(new DataGlobal); - this->dataPipes = std::unique_ptr(new PipesData); - this->dataPlantChillers = std::unique_ptr(new PlantChillersData); - this->dataSolarCollectors = std::unique_ptr(new SolarCollectorsData); - this->dataSolarReflectionManager = std::unique_ptr(new SolarReflectionManagerData); - this->dataSolarShading = std::unique_ptr(new SolarShadingData); - this->dataSplitterComponent = std::unique_ptr(new SplitterComponentData); - this->dataSteamBaseboardRadiator = std::unique_ptr(new SteamBaseboardRadiatorData); - this->dataSteamCoils = std::unique_ptr(new SteamCoilsData); - this->dataSurfaceGeometry = std::unique_ptr(new SurfaceGeometryData); - this->dataSurfaceGroundHeatExchangers = std::unique_ptr(new SurfaceGroundHeatExchangersData); - this->dataSwimmingPools = std::unique_ptr(new SwimmingPoolsData); - this->dataSystemAvailabilityManager = std::unique_ptr(new SystemAvailabilityManagerData); - this->dataThermalChimneys = std::unique_ptr(new ThermalChimneysData); - this->dataThermalComforts = std::unique_ptr(new ThermalComfortsData); - this->dataTranspiredCollector = std::unique_ptr(new TranspiredCollectorData); - this->dataTimingsData = std::unique_ptr(new DataTimingsData); - this->dataUFADManager = std::unique_ptr(new UFADManagerData); - this->dataUnitarySystems = std::unique_ptr(new UnitarySystemsData); - this->dataUnitHeaters = std::unique_ptr(new UnitHeatersData); - this->dataUnitVentilators = std::unique_ptr(new UnitVentilatorsData); - this->dataUserDefinedComponents = std::unique_ptr(new UserDefinedComponentsData); - this->dataUtilityRoutines = std::unique_ptr(new UtilityRoutinesData); - this->dataVariableSpeedCoils = std::unique_ptr(new VariableSpeedCoilsData); - this->dataVentilatedSlab = std::unique_ptr(new VentilatedSlabData); - this->dataWaterCoils = std::unique_ptr(new WaterCoilsData); - this->dataWaterData = std::unique_ptr(new DataWaterData); - this->dataWaterManager = std::unique_ptr(new WaterManagerData); - this->dataWaterThermalTanks = std::unique_ptr(new WaterThermalTanksData); - this->dataWaterToAirHeatPump = std::unique_ptr(new WaterToAirHeatPumpData); - this->dataWaterToAirHeatPumpSimple = std::unique_ptr(new WaterToAirHeatPumpSimpleData); - this->dataWaterUse = std::unique_ptr(new WaterUseData); - this->dataWeatherManager = std::unique_ptr(new WeatherManagerData); - this->dataWindowAC = std::unique_ptr(new WindowACData); - this->dataWindowComplexManager = std::unique_ptr(new WindowComplexManagerData); - this->dataWindowEquivalentLayer = std::unique_ptr(new WindowEquivalentLayerData); - this->dataWindowManager = std::unique_ptr(new WindowManagerData); - this->dataWindTurbine = std::unique_ptr(new WindTurbineData); - this->dataZoneAirLoopEquipmentManager = std::unique_ptr(new ZoneAirLoopEquipmentManagerData); - this->dataZoneContaminantPredictorCorrector = std::unique_ptr(new ZoneContaminantPredictorCorrectorData); - this->dataZoneDehumidifier = std::unique_ptr(new ZoneDehumidifierData); - this->dataZoneEquipmentManager = std::unique_ptr(new ZoneEquipmentManagerData); - this->dataZonePlenum = std::unique_ptr(new ZonePlenumData); - this->dataZoneTempPredictorCorrector = std::unique_ptr(new ZoneTempPredictorCorrectorData); + this->dataAirflowNetworkBalanceManager = std::make_unique(); + this->dataAirLoop = std::make_unique(); + this->dataAirLoopHVACDOAS = std::make_unique(); + this->dataAirSystemsData = std::make_unique(); + this->dataBaseboardElectric = std::make_unique(); + this->dataBaseboardRadiator = std::make_unique(); + this->dataBoilers = std::make_unique(); + this->dataBoilerSteam = std::make_unique(); + this->dataBranchAirLoopPlant = std::make_unique(); + this->dataBranchInputManager = std::make_unique(); + this->dataBranchNodeConnections = std::make_unique(); + this->dataChilledCeilingPanelSimple = std::make_unique(); + this->dataChillerAbsorber = std::make_unique(); + this->dataChillerElectricEIR = std::make_unique(); + this->dataChillerExhaustAbsorption = std::make_unique(); + this->dataChillerGasAbsorption = std::make_unique(); + this->dataChillerIndirectAbsorption = std::make_unique(); + this->dataChillerReformulatedEIR = std::make_unique(); + this->dataCondenserLoopTowers = std::make_unique(); + this->dataConstruction = std::make_unique(); + this->dataConvectionCoefficient = std::make_unique(); + this->dataCoolTower = std::make_unique(); + this->dataCostEstimateManager = std::make_unique(); + this->dataCrossVentMgr = std::make_unique(); + this->dataCTElectricGenerator = std::make_unique(); + this->dataCurveManager = std::make_unique(); + this->dataEIRPlantLoopHeatPump = std::make_unique(); + this->dataExteriorEnergyUse = std::make_unique(); + this->dataFans = std::make_unique(); + this->dataGlobal = std::make_unique(); + this->dataPipes = std::make_unique(); + this->dataPlantChillers = std::make_unique(); + this->dataPlantValves = std::make_unique(); + this->dataSetPointManager = std::make_unique(); + this->dataSimulationManager = std::make_unique(); + this->dataSingleDuct = std::make_unique(); + this->dataSizingManager = std::make_unique(); + this->dataSolarCollectors = std::make_unique(); + this->dataSolarReflectionManager = std::make_unique(); + this->dataSolarShading = std::make_unique(); + this->dataSplitterComponent = std::make_unique(); + this->dataSteamBaseboardRadiator = std::make_unique(); + this->dataSteamCoils = std::make_unique(); + this->dataSurfaceGeometry = std::make_unique(); + this->dataSurfaceGroundHeatExchangers = std::make_unique(); + this->dataSwimmingPools = std::make_unique(); + this->dataSystemAvailabilityManager = std::make_unique(); + this->dataThermalChimneys = std::make_unique(); + this->dataThermalComforts = std::make_unique(); + this->dataTranspiredCollector = std::make_unique(); + this->dataTimingsData = std::make_unique(); + this->dataUFADManager = std::make_unique(); + this->dataUnitarySystems = std::make_unique(); + this->dataUnitHeaters = std::make_unique(); + this->dataUnitVentilators = std::make_unique(); + this->dataUserDefinedComponents = std::make_unique(); + this->dataUtilityRoutines = std::make_unique(); + this->dataVariableSpeedCoils = std::make_unique(); + this->dataVentilatedSlab = std::make_unique(); + this->dataWaterCoils = std::make_unique(); + this->dataWaterData = std::make_unique(); + this->dataWaterManager = std::make_unique(); + this->dataWaterThermalTanks = std::make_unique(); + this->dataWaterToAirHeatPump = std::make_unique(); + this->dataWaterToAirHeatPumpSimple = std::make_unique(); + this->dataWaterUse = std::make_unique(); + this->dataWeatherManager = std::make_unique(); + this->dataWindowAC = std::make_unique(); + this->dataWindowComplexManager = std::make_unique(); + this->dataWindowEquivalentLayer = std::make_unique(); + this->dataWindowManager = std::make_unique(); + this->dataWindTurbine = std::make_unique(); + this->dataZoneAirLoopEquipmentManager = std::make_unique(); + this->dataZoneContaminantPredictorCorrector = std::make_unique(); + this->dataZoneDehumidifier = std::make_unique(); + this->dataZoneEquipmentManager = std::make_unique(); + this->dataZonePlenum = std::make_unique(); + this->dataZoneTempPredictorCorrector = std::make_unique(); } void EnergyPlusData::clear_state() { @@ -157,12 +163,19 @@ namespace EnergyPlus { this->dataCrossVentMgr->clear_state(); this->dataCTElectricGenerator->clear_state(); this->dataCurveManager->clear_state(); + this->dataEIRPlantLoopHeatPump->clear_state(); this->dataExteriorEnergyUse->clear_state(); this->dataFans->clear_state(); this->dataGlobal->clear_state(); this->dataPipes->clear_state(); this->dataPlantChillers->clear_state(); + this->dataPlantValves->clear_state(); + this->dataSetPointManager->clear_state(); + this->dataSimulationManager->clear_state(); + this->dataSingleDuct->clear_state(); + this->dataSizingManager->clear_state(); this->dataSolarCollectors->clear_state(); + this->dataSolarReflectionManager->clear_state(); this->dataSolarShading->clear_state(); this->dataSplitterComponent->clear_state(); this->dataSteamBaseboardRadiator->clear_state(); diff --git a/src/EnergyPlus/Data/EnergyPlusData.hh b/src/EnergyPlus/Data/EnergyPlusData.hh index a5d5fb13be9..758c31a9787 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.hh +++ b/src/EnergyPlus/Data/EnergyPlusData.hh @@ -94,10 +94,16 @@ struct DataBranchAirLoopPlantData; struct DataGlobal; struct DataTimingsData; struct DataWaterData; +struct EIRPlantLoopHeatPumpsData; struct ExteriorEnergyUseData; struct FansData; struct PipesData; struct PlantChillersData; +struct PlantValvesData; +struct SetPointManagerData; +struct SimulationManagerData; +struct SingleDuctData; +struct SizingManagerData; struct SolarCollectorsData; struct SolarReflectionManagerData; struct SolarShadingData; @@ -171,10 +177,16 @@ struct EnergyPlusData : BaseGlobalStruct { std::unique_ptr dataAirLoop; std::unique_ptr dataGlobal; std::unique_ptr dataWaterData; + std::unique_ptr dataEIRPlantLoopHeatPump; std::unique_ptr dataExteriorEnergyUse; std::unique_ptr dataFans; std::unique_ptr dataPipes; std::unique_ptr dataPlantChillers; + std::unique_ptr dataPlantValves; + std::unique_ptr dataSetPointManager; + std::unique_ptr dataSimulationManager; + std::unique_ptr dataSingleDuct; + std::unique_ptr dataSizingManager; std::unique_ptr dataSolarCollectors; std::unique_ptr dataSolarReflectionManager; std::unique_ptr dataSolarShading; diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 78087944cea..a6ef801e8d3 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -93,6 +93,7 @@ struct EnergyPlusData; std::function externalHVACManager; bool externalHVACManagerInitialized = false; DataGlobalConstants::KindOfSim KindOfSim = DataGlobalConstants::KindOfSim::Unassigned; + bool sizingAnalysisEioHeaderDoneOnce = false; bool EndDayFlag = false; // True at the end of each day (last time step of last hour of day) bool EndHourFlag = false; // True at the end of each hour (last time step of hour) int PreviousHour = 0; // Previous Hour Index @@ -186,6 +187,7 @@ struct EnergyPlusData; this->stopSimulation= false; this->externalHVACManager = nullptr; this->externalHVACManagerInitialized = false; + this->sizingAnalysisEioHeaderDoneOnce = false; this->KindOfSim = DataGlobalConstants::KindOfSim::Unassigned; this->EndDayFlag = false; this->EndHourFlag = false; diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index 4b7ea45cf24..a944fba951d 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -551,8 +551,7 @@ namespace HVACControllers { using EMSManager::iTemperatureSetPoint; using MixedAir::CheckForControllerWaterCoil; using NodeInputManager::GetOnlySingleNode; - using SetPointManager::iCtrlVarType_MaxHumRat; - using SetPointManager::iCtrlVarType_Temp; + using SetPointManager::iCtrlVarType; using SetPointManager::NodeHasSPMCtrlVarType; using SetPointManager::ResetHumidityRatioCtrlVarType; using WaterCoils::CheckActuatorNode; @@ -712,7 +711,7 @@ namespace HVACControllers { CheckIfNodeSetPointManagedByEMS(state, ControllerProps(Num).SensedNode, iTemperatureSetPoint, EMSSetPointErrorFlag); DataLoopNode::NodeSetpointCheck(ControllerProps(Num).SensedNode).needsSetpointChecking = false; if (EMSSetPointErrorFlag) { - if (!NodeHasSPMCtrlVarType(state, ControllerProps(Num).SensedNode, iCtrlVarType_Temp)) { + if (!NodeHasSPMCtrlVarType(state, ControllerProps(Num).SensedNode, iCtrlVarType::Temp)) { ShowContinueError(state, " ..Temperature setpoint not found on coil air outlet node."); ShowContinueError(state, " ..The setpoint may have been placed on a node downstream of the coil or on an airloop outlet node."); @@ -723,7 +722,7 @@ namespace HVACControllers { CheckIfNodeSetPointManagedByEMS(state, ControllerProps(Num).SensedNode, iHumidityRatioMaxSetPoint, EMSSetPointErrorFlag); DataLoopNode::NodeSetpointCheck(ControllerProps(Num).SensedNode).needsSetpointChecking = false; if (EMSSetPointErrorFlag) { - if (!NodeHasSPMCtrlVarType(state, ControllerProps(Num).SensedNode, iCtrlVarType_MaxHumRat)) { + if (!NodeHasSPMCtrlVarType(state, ControllerProps(Num).SensedNode, iCtrlVarType::MaxHumRat)) { ShowContinueError(state, " ..Humidity ratio setpoint not found on coil air outlet node."); ShowContinueError(state, " ..The setpoint may have been placed on a node downstream of the coil or on an airloop outlet node."); @@ -734,7 +733,7 @@ namespace HVACControllers { CheckIfNodeSetPointManagedByEMS(state, ControllerProps(Num).SensedNode, iTemperatureSetPoint, EMSSetPointErrorFlag); DataLoopNode::NodeSetpointCheck(ControllerProps(Num).SensedNode).needsSetpointChecking = false; if (EMSSetPointErrorFlag) { - if (!NodeHasSPMCtrlVarType(state, ControllerProps(Num).SensedNode, iCtrlVarType_Temp)) { + if (!NodeHasSPMCtrlVarType(state, ControllerProps(Num).SensedNode, iCtrlVarType::Temp)) { ShowContinueError(state, " ..Temperature setpoint not found on coil air outlet node."); ShowContinueError(state, " ..The setpoint may have been placed on a node downstream of the coil or on an airloop outlet node."); @@ -745,7 +744,7 @@ namespace HVACControllers { CheckIfNodeSetPointManagedByEMS(state, ControllerProps(Num).SensedNode, iHumidityRatioMaxSetPoint, EMSSetPointErrorFlag); DataLoopNode::NodeSetpointCheck(ControllerProps(Num).SensedNode).needsSetpointChecking = false; if (EMSSetPointErrorFlag) { - if (!NodeHasSPMCtrlVarType(state, ControllerProps(Num).SensedNode, iCtrlVarType_MaxHumRat)) { + if (!NodeHasSPMCtrlVarType(state, ControllerProps(Num).SensedNode, iCtrlVarType::MaxHumRat)) { ShowContinueError(state, " ..Humidity ratio setpoint not found on coil air outlet node."); ShowContinueError(state, " ..The setpoint may have been placed on a node downstream of the coil or on an airloop outlet node."); @@ -950,9 +949,7 @@ namespace HVACControllers { using PlantUtilities::SetActuatedBranchFlowRate; using RootFinder::SetupRootFinder; using SetPointManager::GetHumidityRatioVariableType; - using SetPointManager::iCtrlVarType_HumRat; - using SetPointManager::iCtrlVarType_MaxHumRat; - using SetPointManager::iCtrlVarType_MinHumRat; + using SetPointManager::iCtrlVarType; static std::string const RoutineName("InitController"); @@ -1018,9 +1015,9 @@ namespace HVACControllers { } } else if (SELECT_CASE_var == iHumidityRatio) { // 'HumidityRatio' ControllerProps(ControllerIndex).HumRatCntrlType = GetHumidityRatioVariableType(state, SensedNode); - if ((ControllerProps(ControlNum).HumRatCntrlType == iCtrlVarType_HumRat && + if ((ControllerProps(ControlNum).HumRatCntrlType == iCtrlVarType::HumRat && Node(SensedNode).HumRatSetPoint == SensedNodeFlagValue) || - (ControllerProps(ControlNum).HumRatCntrlType == iCtrlVarType_MaxHumRat && + (ControllerProps(ControlNum).HumRatCntrlType == iCtrlVarType::MaxHumRat && Node(SensedNode).HumRatMax == SensedNodeFlagValue)) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "HVACControllers: Missing humidity ratio setpoint for controller type=" + @@ -1043,7 +1040,7 @@ namespace HVACControllers { } } - } else if (ControllerProps(ControlNum).HumRatCntrlType == iCtrlVarType_MinHumRat) { + } else if (ControllerProps(ControlNum).HumRatCntrlType == iCtrlVarType::MinHumRat) { ShowSevereError(state, "HVACControllers: incorrect humidity ratio setpoint for controller type=" + ControllerProps(ControllerIndex).ControllerType + " Name=\"" + ControllerProps(ControllerIndex).ControllerName + "\""); @@ -1273,7 +1270,7 @@ namespace HVACControllers { if (!ControllerProps(ControlNum).IsSetPointDefinedFlag) { { auto const SELECT_CASE_var1(ControllerProps(ControlNum).HumRatCntrlType); - if (SELECT_CASE_var1 == iCtrlVarType_MaxHumRat) { + if (SELECT_CASE_var1 == iCtrlVarType::MaxHumRat) { ControllerProps(ControlNum).SetPointValue = Node(SensedNode).HumRatMax; } else { ControllerProps(ControlNum).SetPointValue = Node(SensedNode).HumRatSetPoint; diff --git a/src/EnergyPlus/HVACControllers.hh b/src/EnergyPlus/HVACControllers.hh index 5c59697aab1..1a2754efe46 100644 --- a/src/EnergyPlus/HVACControllers.hh +++ b/src/EnergyPlus/HVACControllers.hh @@ -58,6 +58,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -216,7 +217,7 @@ namespace HVACControllers { Real64 SensedValue; // The sensed control variable of any type Real64 DeltaSensed; // Difference of sensed to setpoint value for calculating proportional gain Real64 Offset; // This is the tolerance or droop from the error - int HumRatCntrlType; // iCtrlVarType_HumRat=4,iCtrlVarType_MaxHumRat=5,iCtrlVarType_MinHumRat=6 + SetPointManager::iCtrlVarType HumRatCntrlType; // iCtrlVarType_HumRat=4,iCtrlVarType_MaxHumRat=5,iCtrlVarType_MinHumRat=6 // -------------------- // Other controller inputs, not yet used // -------------------- @@ -246,7 +247,7 @@ namespace HVACControllers { SolutionTrackers(2), MaxAvailActuated(0.0), MaxAvailSensed(0.0), MinAvailActuated(0.0), MinAvailSensed(0.0), MaxVolFlowActuated(0.0), MinVolFlowActuated(0.0), MaxActuated(0.0), MinActuated(0.0), ActuatedNode(0), ActuatedValue(0.0), NextActuatedValue(0.0), ActuatedNodePlantLoopNum(0), ActuatedNodePlantLoopSide(0), ActuatedNodePlantLoopBranchNum(0), SensedNode(0), - IsSetPointDefinedFlag(false), SetPointValue(0.0), SensedValue(0.0), DeltaSensed(0.0), Offset(0.0), HumRatCntrlType(0), Range(0.0), + IsSetPointDefinedFlag(false), SetPointValue(0.0), SensedValue(0.0), DeltaSensed(0.0), Offset(0.0), HumRatCntrlType(SetPointManager::iCtrlVarType::Unknown), Range(0.0), Limit(0.0), FirstTraceFlag(true), BadActionErrCount(0), BadActionErrIndex(0), FaultyCoilSATFlag(false), FaultyCoilSATIndex(0), FaultyCoilSATOffset(0.0), BypassControllerCalc(false), AirLoopControllerIndex(0), HumRatCtrlOverride(false) { diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 0df08170899..7896817d841 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -324,8 +324,8 @@ namespace HVACUnitaryBypassVAV { // set outlet node SP for mixed air SP manager DataLoopNode::Node(CBVAV(CBVAVNum).AirOutNode).TempSetPoint = CalcSetPointTempTarget(CBVAVNum); if (CBVAV(CBVAVNum).OutNodeSPMIndex > 0) { // update mixed air SPM if exists - SetPointManager::MixedAirSetPtMgr(CBVAV(CBVAVNum).OutNodeSPMIndex).calculate(state); // update mixed air SP based on new mode - SetPointManager::UpdateMixedAirSetPoints(); // need to know control node to fire off just one of these, do this later + state.dataSetPointManager->MixedAirSetPtMgr(CBVAV(CBVAVNum).OutNodeSPMIndex).calculate(state); // update mixed air SP based on new mode + SetPointManager::UpdateMixedAirSetPoints(state); // need to know control node to fire off just one of these, do this later } } @@ -1569,7 +1569,7 @@ namespace HVACUnitaryBypassVAV { state.dataAirLoop->AirLoopControlInfo(AirLoopNum).FanOpMode = CBVAV(CBVAVNum).OpMode; // check for set point manager on outlet node of CBVAV CBVAV(CBVAVNum).OutNodeSPMIndex = SetPointManager::getSPMBasedOnNode( - state, OutNode, SetPointManager::iCtrlVarType_Temp, SetPointManager::iSPMType_MixedAir, SetPointManager::CtrlNodeType::reference); + state, OutNode, SetPointManager::iCtrlVarType::Temp, SetPointManager::SetPointManagerType::MixedAir, SetPointManager::CtrlNodeType::reference); MySizeFlag(CBVAVNum) = false; } diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 070c5f08660..b19baa3aef3 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -4050,9 +4050,9 @@ namespace InternalHeatGains { Real64 TAirInSizing = 0.0; // Set the TAirInSizing to the maximun setpoint value to do sizing based on the maximum fan and cpu power of the ite object SetPointManager::GetSetPointManagerInputData(state, ErrorsFound); - for (int SetPtMgrNum = 1; SetPtMgrNum <= SetPointManager::NumSZClSetPtMgrs; ++SetPtMgrNum) { - if (SetPointManager::SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == Loop) { - TAirInSizing = SetPointManager::SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp; + for (int SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { + if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == Loop) { + TAirInSizing = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp; } } diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 724c34447dc..08b67581031 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -311,7 +311,7 @@ namespace EnergyPlus { using namespace DataIPShortCuts; // Data for field names, blank numerics using ScheduleManager::GetScheduleIndex; using SetPointManager::IsNodeOnSetPtManager; - auto &localTempSetPt(SetPointManager::iCtrlVarType_Temp); + auto localTempSetPt = SetPointManager::iCtrlVarType::Temp; using NodeInputManager::GetOnlySingleNode; using namespace BranchInputManager; using DataConvergParams::PlantConvergence; diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 610d74985e8..14088a716e0 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -74,18 +74,7 @@ #include #include -namespace EnergyPlus { -namespace EIRPlantLoopHeatPumps { - - bool getInputsPLHP(true); - std::vector heatPumps; - std::string static const __EQUIP__ = "EIRPlantLoopHeatPump "; // NOLINT(cert-err58-cpp) - - void EIRPlantLoopHeatPump::clear_state() - { - getInputsPLHP = true; - heatPumps.clear(); - } +namespace EnergyPlus::EIRPlantLoopHeatPumps { void EIRPlantLoopHeatPump::simulate(EnergyPlusData &state, const EnergyPlus::PlantLocation &calledFromLocation, @@ -94,8 +83,6 @@ namespace EIRPlantLoopHeatPumps { bool const RunFlag) { - std::string const routineName = "PlantLoopHeatPumpEIR::simulate"; - // Call initialize to set flow rates, run flag, and entering temperatures this->running = RunFlag; @@ -133,7 +120,7 @@ namespace EIRPlantLoopHeatPumps { DataLoopNode::Node(this->sourceSideNodes.outlet).Temp = this->sourceSideOutletTemp; } - Real64 EIRPlantLoopHeatPump::getLoadSideOutletSetPointTemp(EnergyPlusData &state) + Real64 EIRPlantLoopHeatPump::getLoadSideOutletSetPointTemp(EnergyPlusData &state) const { auto &thisLoadPlantLoop = DataPlant::PlantLoop(this->loadSideLocation.loopNum); auto &thisLoadLoopSide = thisLoadPlantLoop.LoopSide(this->loadSideLocation.loopSideNum); @@ -355,7 +342,7 @@ namespace EIRPlantLoopHeatPumps { void EIRPlantLoopHeatPump::onInitLoopEquip(EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation) { // This function does all one-time and begin-environment initialization - std::string const routineName = EIRPlantLoopHeatPumps::__EQUIP__ + ':' + __FUNCTION__; + std::string static const routineName = std::string("EIRPlantLoopHeatPump :") + __FUNCTION__; if (this->oneTimeInit) { bool errFlag = false; @@ -913,15 +900,15 @@ namespace EIRPlantLoopHeatPumps { } } - PlantComponent *EIRPlantLoopHeatPump::factory(EnergyPlusData &state, int hp_type_of_num, std::string hp_name) + PlantComponent *EIRPlantLoopHeatPump::factory(EnergyPlusData &state, int hp_type_of_num, const std::string& hp_name) { - if (getInputsPLHP) { + if (state.dataEIRPlantLoopHeatPump->getInputsPLHP) { EIRPlantLoopHeatPump::processInputForEIRPLHP(state); EIRPlantLoopHeatPump::pairUpCompanionCoils(state); - getInputsPLHP = false; + state.dataEIRPlantLoopHeatPump->getInputsPLHP = false; } - for (auto &plhp : heatPumps) { + for (auto &plhp : state.dataEIRPlantLoopHeatPump->heatPumps) { if (plhp.name == UtilityRoutines::MakeUPPERCase(hp_name) && plhp.plantTypeOfNum == hp_type_of_num) { return &plhp; } @@ -933,12 +920,12 @@ namespace EIRPlantLoopHeatPumps { void EIRPlantLoopHeatPump::pairUpCompanionCoils(EnergyPlusData &state) { - for (auto &thisHP : heatPumps) { + for (auto &thisHP : state.dataEIRPlantLoopHeatPump->heatPumps) { if (!thisHP.companionCoilName.empty()) { auto thisCoilName = UtilityRoutines::MakeUPPERCase(thisHP.name); auto &thisCoilType = thisHP.plantTypeOfNum; auto targetCompanionName = UtilityRoutines::MakeUPPERCase(thisHP.companionCoilName); - for (auto &potentialCompanionCoil : heatPumps) { + for (auto &potentialCompanionCoil : state.dataEIRPlantLoopHeatPump->heatPumps) { auto &potentialCompanionType = potentialCompanionCoil.plantTypeOfNum; auto potentialCompanionName = UtilityRoutines::MakeUPPERCase(potentialCompanionCoil.name); if (potentialCompanionName == thisCoilName) { @@ -1177,7 +1164,7 @@ namespace EIRPlantLoopHeatPumps { thisPLHP.calcSourceOutletTemp = classToInput.calcSourceOutletTemp; if (!errorsFound) { - heatPumps.push_back(thisPLHP); + state.dataEIRPlantLoopHeatPump->heatPumps.push_back(thisPLHP); } } } @@ -1200,7 +1187,7 @@ namespace EIRPlantLoopHeatPumps { // companion index values as I warn against their partner, so then I would have to add the values to the // vector each pass, and check then each loop. This seemed really bulky and inefficient, so I chose to // leave a tight loop here of just reporting for each coil if it and the companion are running. - for (auto &thisPLHP : heatPumps) { + for (auto &thisPLHP : state.dataEIRPlantLoopHeatPump->heatPumps) { if (!thisPLHP.companionHeatPumpCoil) { continue; } @@ -1211,5 +1198,4 @@ namespace EIRPlantLoopHeatPumps { } } } -} // namespace EIRPlantLoopHeatPumps -} // namespace EnergyPlus +} // namespace EnergyPlus::EIRPlantLoopHeatPumps diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.hh b/src/EnergyPlus/PlantLoopHeatPumpEIR.hh index 31476768c5b..0e5a93440e5 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.hh +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.hh @@ -54,6 +54,7 @@ #include // EnergyPlus headers +#include #include #include #include @@ -79,9 +80,9 @@ namespace EIRPlantLoopHeatPumps { { // fixed configuration parameters - std::string name = ""; + std::string name; int plantTypeOfNum = -1; - std::string companionCoilName = ""; + std::string companionCoilName; EIRPlantLoopHeatPump *companionHeatPumpCoil = nullptr; Real64 sizingFactor = 1.0; bool waterSource = false; @@ -161,7 +162,7 @@ namespace EIRPlantLoopHeatPumps { void sizeSrcSideASHP(EnergyPlusData &state); - Real64 getLoadSideOutletSetPointTemp(EnergyPlusData &state); + Real64 getLoadSideOutletSetPointTemp(EnergyPlusData &state) const; void setOperatingFlowRatesASHP(EnergyPlusData &state); @@ -169,14 +170,12 @@ namespace EIRPlantLoopHeatPumps { void resetReportingVariables(); - static PlantComponent *factory(EnergyPlusData &state, int hp_type_of_num, std::string hp_name); + static PlantComponent *factory(EnergyPlusData &state, int hp_type_of_num, const std::string& hp_name); static void pairUpCompanionCoils(EnergyPlusData &state); static void processInputForEIRPLHP(EnergyPlusData &state); - static void clear_state(); - static void checkConcurrentOperation(EnergyPlusData &state); static Real64 add(Real64 const a, Real64 const b) @@ -190,8 +189,17 @@ namespace EIRPlantLoopHeatPumps { } }; - extern std::vector heatPumps; } // namespace EIRPlantLoopHeatPumps + +struct EIRPlantLoopHeatPumpsData { + std::vector heatPumps; + bool getInputsPLHP = true; + void clear_state() { + getInputsPLHP = true; + heatPumps.clear(); + } +}; + } // namespace EnergyPlus #endif // ENERGYPLUS_PLANTLOOPHEATPUMPEIR_HH diff --git a/src/EnergyPlus/PlantValves.cc b/src/EnergyPlus/PlantValves.cc index 8cc8f635648..01d94fd22a0 100644 --- a/src/EnergyPlus/PlantValves.cc +++ b/src/EnergyPlus/PlantValves.cc @@ -86,22 +86,14 @@ namespace PlantValves { using namespace DataLoopNode; - // MODULE VARIABLE DECLARATIONS: - int NumTemperingValves; - bool GetTemperingValves(true); - bool OneTimeInitFlag(true); - - // Object Data - Array1D TemperValve; // dimension to No. of TemperingValve objects - PlantComponent *TemperValveData::factory(EnergyPlusData &state, std::string objectName) { // Process the input data for valves if it hasn't been done already - if (GetTemperingValves) { + if (state.dataPlantValves->GetTemperingValves) { GetPlantValvesInput(state); - GetTemperingValves = false; + state.dataPlantValves->GetTemperingValves = false; } // Now look for this particular pipe in the list - for (auto &valve : TemperValve) { + for (auto &valve : state.dataPlantValves->TemperValve) { if (valve.Name == objectName) { return &valve; } @@ -113,13 +105,6 @@ namespace PlantValves { return nullptr; // LCOV_EXCL_LINE } - void clear_state() { - GetTemperingValves = true; - OneTimeInitFlag = true; - NumTemperingValves = 0; - TemperValve.deallocate(); - } - void TemperValveData::simulate(EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation, [[maybe_unused]] bool FirstHVACIteration, @@ -185,31 +170,31 @@ namespace PlantValves { std::string CurrentModuleObject; // for ease in renaming. CurrentModuleObject = "TemperingValve"; - NumTemperingValves = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); + state.dataPlantValves->NumTemperingValves = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); - TemperValve.allocate(NumTemperingValves); + state.dataPlantValves->TemperValve.allocate(state.dataPlantValves->NumTemperingValves); - for (Item = 1; Item <= NumTemperingValves; ++Item) { + for (Item = 1; Item <= state.dataPlantValves->NumTemperingValves; ++Item) { inputProcessor->getObjectItem(state, CurrentModuleObject, Item, Alphas, NumAlphas, Numbers, NumNumbers, IOStatus); // - TemperValve(Item).Name = Alphas(1); + state.dataPlantValves->TemperValve(Item).Name = Alphas(1); // Get Plant Inlet Node - TemperValve(Item).PltInletNodeNum = GetOnlySingleNode( + state.dataPlantValves->TemperValve(Item).PltInletNodeNum = GetOnlySingleNode( state, Alphas(2), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); // Get Plant Outlet Node - TemperValve(Item).PltOutletNodeNum = GetOnlySingleNode( + state.dataPlantValves->TemperValve(Item).PltOutletNodeNum = GetOnlySingleNode( state, Alphas(3), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); // Get Stream 2 Source Node - TemperValve(Item).PltStream2NodeNum = GetOnlySingleNode( + state.dataPlantValves->TemperValve(Item).PltStream2NodeNum = GetOnlySingleNode( state, Alphas(4), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Water, NodeConnectionType_Sensor, 1, ObjectIsNotParent); // Get Mixed water Setpoint - TemperValve(Item).PltSetPointNodeNum = GetOnlySingleNode( + state.dataPlantValves->TemperValve(Item).PltSetPointNodeNum = GetOnlySingleNode( state, Alphas(5), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Water, NodeConnectionType_SetPoint, 1, ObjectIsNotParent); // Get Pump outlet - TemperValve(Item).PltPumpOutletNodeNum = GetOnlySingleNode( + state.dataPlantValves->TemperValve(Item).PltPumpOutletNodeNum = GetOnlySingleNode( state, Alphas(6), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Water, NodeConnectionType_Sensor, 1, ObjectIsNotParent); // Note most checks on user input are made in second pass thru init routine @@ -217,14 +202,14 @@ namespace PlantValves { TestCompSet(state, CurrentModuleObject, Alphas(1), Alphas(2), Alphas(3), "Supply Side Water Nodes"); } - for (Item = 1; Item <= NumTemperingValves; ++Item) { + for (Item = 1; Item <= state.dataPlantValves->NumTemperingValves; ++Item) { SetupOutputVariable(state, "Tempering Valve Flow Fraction", OutputProcessor::Unit::None, - TemperValve(Item).FlowDivFract, + state.dataPlantValves->TemperValve(Item).FlowDivFract, "System", "Average", - TemperValve(Item).Name); + state.dataPlantValves->TemperValve(Item).Name); } if (ErrorsFound) { @@ -261,8 +246,8 @@ namespace PlantValves { bool errFlag; - if (OneTimeInitFlag) { - OneTimeInitFlag = false; + if (state.dataPlantValves->OneTimeInitFlag) { + state.dataPlantValves->OneTimeInitFlag = false; } else { // delay checks one pass so more of plant data structure gets filled in if (this->compDelayedInitFlag) { diff --git a/src/EnergyPlus/PlantValves.hh b/src/EnergyPlus/PlantValves.hh index e531a84f8a0..b9f24d3d154 100644 --- a/src/EnergyPlus/PlantValves.hh +++ b/src/EnergyPlus/PlantValves.hh @@ -52,6 +52,7 @@ #include // EnergyPlus Headers +#include #include #include #include @@ -63,14 +64,11 @@ struct EnergyPlusData; namespace PlantValves { - // MODULE VARIABLE DECLARATIONS: - extern int NumTemperingValves; - struct TemperValveData : PlantComponent { // Members // user input data - std::string Name = ""; // User identifier + std::string Name; // User identifier int PltInletNodeNum = 0; // Node number on the inlet side of the plant int PltOutletNodeNum = 0; // Node number on the outlet side of the plant int PltStream2NodeNum = 0; // Node number on the outlet side of the second stream @@ -111,15 +109,25 @@ namespace PlantValves { }; - void clear_state(); - void GetPlantValvesInput(EnergyPlusData &state); - // Object Data - extern Array1D TemperValve; // dimension to No. of TemperingValve objects - } // namespace PlantValves +struct PlantValvesData : BaseGlobalStruct { + + bool GetTemperingValves = true; + bool OneTimeInitFlag = true; + int NumTemperingValves = 0; + Array1D TemperValve; // dimension to No. of TemperingValve objects + + void clear_state() override { + GetTemperingValves = true; + OneTimeInitFlag = true; + NumTemperingValves = 0; + TemperValve.deallocate(); + } +}; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 165ccf1e3fb..605b3a0609e 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -80,9 +80,7 @@ #include #include -namespace EnergyPlus { - -namespace SetPointManager { +namespace EnergyPlus::SetPointManager { // Module containing the SetPoint Manager routines @@ -128,13 +126,6 @@ namespace SetPointManager { // Previous time step node data will be used, in a set of fixed, precoded algorithms, // to determine the current time step's controller setpoints. - // REFERENCES: - - // OTHER NOTES: - - // USE STATEMENTS: - // Use statements for data only modules - // Using/Aliasing using namespace DataLoopNode; using namespace DataAirLoop; using DataEnvironment::OutBaroPress; @@ -144,326 +135,9 @@ namespace SetPointManager { using namespace ScheduleManager; using DataHVACGlobals::NumPrimaryAirSys; using namespace CurveManager; - - // USE STATEMENTS using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; - // Data - // MODULE PARAMETER DEFINITIONS: - int const MaxTemp(1); - int const MinTemp(2); - int const TempFirst(1); - int const FlowFirst(2); - int const iRefTempType_WetBulb(1); - int const iRefTempType_DryBulb(2); - int const iRefGroundTempObjType_BuildingSurface(1); - int const iRefGroundTempObjType_Shallow(2); - int const iRefGroundTempObjType_Deep(3); - int const iRefGroundTempObjType_FCfactorMethod(4); - - // following are used to reduce string comparisons related to CtrlVarType - int const iCtrlVarType_Temp(1); // control type 'Temperature' - int const iCtrlVarType_MaxTemp(2); // control type 'MaximumTemperature' - int const iCtrlVarType_MinTemp(3); // control type 'MinimumTemperature' - int const iCtrlVarType_HumRat(4); // control Type 'HumidityRatio' - int const iCtrlVarType_MaxHumRat(5); // control Type 'MaximumHumidityRatio' - int const iCtrlVarType_MinHumRat(6); // control Type 'MinimumHumidityRatio' - int const iCtrlVarType_MassFlow(7); // control type 'MassFlowRate' - int const iCtrlVarType_MaxMassFlow(8); // control Type 'MaximumMassFlowRate' - int const iCtrlVarType_MinMassFlow(9); // control Type 'MinimumMassFlowRate' - - int const NumValidCtrlTypes(9); - Array1D_string const cValidCtrlTypes(NumValidCtrlTypes, - {"Temperature", - "MaximumTemperature", - "MinimumTemperature", - "HumidityRatio", - "MaximumHumidityRatio", - "MinimumHumidityRatio", - "MassFlowRate", - "MaximumMassFlowRate", - "MinimumMassFlowRate"}); - - // following are used to reduce string comparisons related to CtrlVarType - int const iSPMType_Scheduled(1); - int const iSPMType_ScheduledDual(2); - int const iSPMType_OutsideAir(3); - int const iSPMType_SZReheat(4); - int const iSPMType_SZHeating(5); - int const iSPMType_SZCooling(6); - int const iSPMType_SZMinHum(7); - int const iSPMType_SZMaxHum(8); - int const iSPMType_MixedAir(9); - int const iSPMType_OutsideAirPretreat(10); - int const iSPMType_Warmest(11); - int const iSPMType_Coldest(12); - int const iSPMType_WarmestTempFlow(13); - int const iSPMType_RAB(14); - int const iSPMType_MZCoolingAverage(15); - int const iSPMType_MZHeatingAverage(16); - int const iSPMType_MZMinHumAverage(17); - int const iSPMType_MZMaxHumAverage(18); - int const iSPMType_MZMinHum(19); - int const iSPMType_MZMaxHum(20); - int const iSPMType_FollowOATemp(21); - int const iSPMType_FollowSysNodeTemp(22); - int const iSPMType_GroundTemp(23); - int const iSPMType_CondEntReset(24); - int const iSPMType_IdealCondEntReset(25); - int const iSPMType_SZOneStageCooling(26); - int const iSPMType_SZOneStageHeating(27); - int const iSPMType_ReturnWaterResetChW(28); - int const iSPMType_ReturnWaterResetHW(29); - int const iSPMType_TESScheduled(30); - - int const NumValidSPMTypes(30); - Array1D_string const cValidSPMTypes(NumValidSPMTypes, - {"SetpointManager:Scheduled", - "SetpointManager:Scheduled:DualSetpoint", - "SetpointManager:OutdoorAirReset", - "SetpointManager:SingleZone:Reheat", - "SetpointManager:SingleZone:Heating", - "SetpointManager:SingleZone:Cooling", - "SetpointManager:SingleZone:Humidity:Minimum", - "SetpointManager:SingleZone:Humidity:Maximum", - "SetpointManager:MixedAir", - "SetpointManager:OutdoorAirPretreat", - "SetpointManager:Warmest", - "SetpointManager:Coldest", - "SetpointManager:WarmestTemperatureFlow", - "SetpointManager:ReturnAirBypassFlow", - "SetpointManager:MultiZone:Cooling:Average", - "SetpointManager:MultiZone:Heating:Average", - "SetpointManager:MultiZone:MinimumHumidity:Average", - "SetpointManager:MultiZone:MaximumHumidity:Average", - "SetpointManager:MultiZone:Humidity:Minimum", - "SetpointManager:MultiZone:Humidity:Maximum", - "SetpointManager:FollowOutdoorAirTemperature", - "SetpointManager:FollowSystemNodeTemperature", - "SetpointManager:FollowGroundTemperature", - "SetpointManager:CondenserEnteringReset", - "SetpointManager:CondenserEnteringReset:Ideal", - "SetpointManager:SingleZone:OneStageCooling", - "SetpointManager:SingleZone:OneStageHeating", - "SetpointManager:ReturnTemperature:ChilledWater", - "SetpointManager:ReturnTemperature:HotWater", - "SetpointManager:ScheduledTES"}); - - // Type declarations in SetPointManager module - - // This one is used for conflicting node checks and is DEALLOCATED at the end of VerifySetPointManagers - // Aug 2014 (RKS) The AllSetPtMgr structure is no longer deallocated because of additions of new ScheduledTES managers after all others are read - - // MODULE VARIABLE DECLARATIONS: - int NumAllSetPtMgrs(0); // Number of all Setpoint Managers found in input - int NumSchSetPtMgrs(0); // Number of Scheduled Setpoint Managers found in input - int NumDualSchSetPtMgrs(0); // Number of Scheduled Dual Setpoint Managers found in input - int NumOutAirSetPtMgrs(0); // Number of Outside Air Setpoint Managers found in input - int NumSZRhSetPtMgrs(0); // number of single zone reheat setpoint managers - int NumSZHtSetPtMgrs(0); // number of single zone heating setpoint managers - int NumSZClSetPtMgrs(0); // number of single zone cooling setpoint managers - int NumSZMinHumSetPtMgrs(0); // number of Single Zone Minimum Humidity Setpoint Managers - int NumSZMaxHumSetPtMgrs(0); // number of Single Zone Maximum Humidity Setpoint Managers - int NumMixedAirSetPtMgrs(0); // number of mixed air setpoint managers - int NumOAPretreatSetPtMgrs(0); // number of outside air pretreat setpoint managers - int NumWarmestSetPtMgrs(0); // number of Warmest setpoint managers - int NumColdestSetPtMgrs(0); // number of Coldest setpoint managers - int NumWarmestSetPtMgrsTempFlow(0); // number of Warmest Temp Flow setpoint managers - int NumRABFlowSetPtMgrs(0); // number of return air bypass temperature-based flow setpoint manager - int NumMZClgAverageSetPtMgrs(0); // number of Multizone:Cooling:Average setpoint managers - int NumMZHtgAverageSetPtMgrs(0); // number of Multizone:Heating:Average setpoint managers - int NumMZAverageMinHumSetPtMgrs(0); // number of MultiZone:MinimumHumidity:Average setpoint managers - int NumMZAverageMaxHumSetPtMgrs(0); // number of MultiZone:MaximumHumidity:Average setpoint managers - int NumMZMinHumSetPtMgrs(0); // number of MultiZone:Humidity:Minimum setpoint managers - int NumMZMaxHumSetPtMgrs(0); // number of MultiZone:Humidity:Maximum setpoint managers - int NumFollowOATempSetPtMgrs(0); // number of SetpointManager:FollowOutdoorAirTemperature setpoint managers - int NumFollowSysNodeTempSetPtMgrs(0); // number of SetpointManager:FollowSystemNodeTemperature setpoint managers - int NumGroundTempSetPtMgrs(0); // number of SetpointManager:FollowGroundTemperature setpoint managers - int NumCondEntSetPtMgrs(0); // number of Condenser Entering Reset setpoint managers - int NumIdealCondEntSetPtMgrs(0); // number of Ideal Condenser Entering Temperature setpoint managers - int NumSZOneStageCoolingSetPtMgrs(0); // number of single zone one stage cooling setpoint managers - int NumSZOneStageHeatingSetPtMgrs(0); // number of singel zone one stage heating setpoint managers - int NumReturnWaterResetChWSetPtMgrs(0); // number of return water reset setpoint managers - int NumReturnWaterResetHWSetPtMgrs(0); // number of hot-water return water reset setpoint managers - int NumSchTESSetPtMgrs(0); // number of TES scheduled setpoint managers (created internally, not by user input) - - bool ManagerOn(false); - bool GetInputFlag(true); // First time, input is "gotten" - namespace { - bool InitSetPointManagersOneTimeFlag(true); - bool InitSetPointManagersOneTimeFlag2(true); - Real64 DCESPMDsn_EntCondTemp(0.0); - Real64 DCESPMDsn_MinCondSetpt(0.0); - Real64 DCESPMCur_MinLiftTD(0.0); - Real64 DCESPMDesign_Load_Sum(0.0); - Real64 DCESPMActual_Load_Sum(0.0); - Real64 DCESPMWeighted_Actual_Load_Sum(0.0); - Real64 DCESPMWeighted_Design_Load_Sum(0.0); - Real64 DCESPMWeighted_Ratio(0.0); - Real64 DCESPMMin_DesignWB(0.0); - Real64 DCESPMMin_ActualWb(0.0); - Real64 DCESPMOpt_CondEntTemp(0.0); - Real64 DCESPMDesignClgCapacity_Watts(0.0); - Real64 DCESPMCurrentLoad_Watts(0.0); - Real64 DCESPMCondInletTemp(0.0); - Real64 DCESPMEvapOutletTemp(0.0); - bool NoSurfaceGroundTempObjWarning(true); // This will cause a warning to be issued if no "surface" ground - // temperature object was input. - bool NoShallowGroundTempObjWarning(true); // This will cause a warning to be issued if no "shallow" ground - // temperature object was input. - bool NoDeepGroundTempObjWarning(true); // This will cause a warning to be issued if no "deep" ground - // temperature object was input. - bool NoFCGroundTempObjWarning(true); // This will cause a warning to be issued if no ground - // temperature object was input for FC Factor method - bool InitSetPointManagersMyEnvrnFlag(true); // flag for init once at start of environment - bool RunSubOptCondEntTemp(false); - bool RunFinalOptCondEntTemp(false); - } // namespace - // temperature-based flow control manager - // Average Cooling Set Pt Mgr - // Average Heating Set Pt Mgr - // Average Minimum humidity ratio Set Pt Mgr - // Average Maximum humidity ratio Set Pt Mgr - - // Temperature Setpoint Manager data - // Node Temp Setpoint Manager data - // Manager data - - // SUBROUTINE SPECIFICATIONS FOR MODULE SetPointManager - - // Object Data - Array1D AllSetPtMgr; // Array for all Setpoint Manager data(warnings) - Array1D SchSetPtMgr; // Array for Scheduled Setpoint Manager data - Array1D DualSchSetPtMgr; // Dual Scheduled Setpoint Manager data - Array1D OutAirSetPtMgr; // Array for Outside Air Setpoint Manager data - Array1D SingZoneRhSetPtMgr; // Array for SZRH Set Pt Mgr - Array1D SingZoneHtSetPtMgr; // Array for SZ Heating Set Pt Mgr - Array1D SingZoneClSetPtMgr; // Array for SZ Cooling Set Pt Mgr - Array1D SZMinHumSetPtMgr; // Array for SZ Min Hum Set Pt Mgr - Array1D SZMaxHumSetPtMgr; // Array for SZ Max Hum Set Pt Mgr - Array1D MixedAirSetPtMgr; // Array for Mixed Air Set Pt Mgr - Array1D OAPretreatSetPtMgr; // Array for OA Pretreat Set Pt Mgr - Array1D WarmestSetPtMgr; // Array for Warmest Set Pt Mgr - Array1D ColdestSetPtMgr; // Array for Coldest Set Pt Mgr - Array1D WarmestSetPtMgrTempFlow; // Array for Warmest Set Pt Mgr - Array1D RABFlowSetPtMgr; // Array for return air bypass - Array1D MZAverageCoolingSetPtMgr; // Array for MultiZone - Array1D MZAverageHeatingSetPtMgr; // Array for MultiZone - Array1D MZAverageMinHumSetPtMgr; // Array for MultiZone - Array1D MZAverageMaxHumSetPtMgr; // Array for MultiZone - Array1D MZMinHumSetPtMgr; // Multizone min humidity rat Set Pt Mgr - Array1D MZMaxHumSetPtMgr; // Multizone max humidity rat Set Pt Mgr - Array1D FollowOATempSetPtMgr; // Array for Follow Outdoor Air - Array1D FollowSysNodeTempSetPtMgr; // Array for Follow System - Array1D GroundTempSetPtMgr; // Array for Ground Temp Setpoint - Array1D CondEntSetPtMgr; // Condenser Entering Water Set Pt Mgr - Array1D IdealCondEntSetPtMgr; // Ideal Condenser Entering Set Pt Mgr - Array1D SZOneStageCoolingSetPtMgr; // single zone 1 stage cool - Array1D SZOneStageHeatingSetPtMgr; // single zone 1 stage heat - Array1D ReturnWaterResetChWSetPtMgr; // return water reset - Array1D ReturnWaterResetHWSetPtMgr; // hot-water return water reset - Array1D SchTESSetPtMgr; // Array for TES Scheduled Setpoint Manager data - - // Functions - - void clear_state() - { - - NumAllSetPtMgrs = 0; // Number of all Setpoint Managers found in input - NumSchSetPtMgrs = 0; // Number of Scheduled Setpoint Managers found in input - NumDualSchSetPtMgrs = 0; // Number of Scheduled Dual Setpoint Managers found in input - NumOutAirSetPtMgrs = 0; // Number of Outside Air Setpoint Managers found in input - NumSZRhSetPtMgrs = 0; // number of single zone reheat setpoint managers - NumSZHtSetPtMgrs = 0; // number of single zone heating setpoint managers - NumSZClSetPtMgrs = 0; // number of single zone cooling setpoint managers - NumSZMinHumSetPtMgrs = 0; // number of Single Zone Minimum Humidity Setpoint Managers - NumSZMaxHumSetPtMgrs = 0; // number of Single Zone Maximum Humidity Setpoint Managers - NumMixedAirSetPtMgrs = 0; // number of mixed air setpoint managers - NumOAPretreatSetPtMgrs = 0; // number of outside air pretreat setpoint managers - NumWarmestSetPtMgrs = 0; // number of Warmest setpoint managers - NumColdestSetPtMgrs = 0; // number of Coldest setpoint managers - NumWarmestSetPtMgrsTempFlow = 0; // number of Warmest Temp Flow setpoint managers - NumRABFlowSetPtMgrs = 0; // number of return air bypass temperature-based flow setpoint manager - NumMZClgAverageSetPtMgrs = 0; // number of Multizone:Cooling:Average setpoint managers - NumMZHtgAverageSetPtMgrs = 0; // number of Multizone:Heating:Average setpoint managers - NumMZAverageMinHumSetPtMgrs = 0; // number of MultiZone:MinimumHumidity:Average setpoint managers - NumMZAverageMaxHumSetPtMgrs = 0; // number of MultiZone:MaximumHumidity:Average setpoint managers - NumMZMinHumSetPtMgrs = 0; // number of MultiZone:Humidity:Minimum setpoint managers - NumMZMaxHumSetPtMgrs = 0; // number of MultiZone:Humidity:Maximum setpoint managers - NumFollowOATempSetPtMgrs = 0; // number of SetpointManager:FollowOutdoorAirTemperature setpoint managers - NumFollowSysNodeTempSetPtMgrs = 0; // number of SetpointManager:FollowSystemNodeTemperature setpoint managers - NumGroundTempSetPtMgrs = 0; // number of SetpointManager:FollowGroundTemperature setpoint managers - NumCondEntSetPtMgrs = 0; // number of Condenser Entering Reset setpoint managers - NumIdealCondEntSetPtMgrs = 0; // number of Ideal Condenser Entering Temperature setpoint managers - NumSZOneStageCoolingSetPtMgrs = 0; // number of single zone one stage cooling setpoint managers - NumSZOneStageHeatingSetPtMgrs = 0; // number of singel zone one stage heating setpoint managers - NumReturnWaterResetChWSetPtMgrs = 0; // number of return water reset setpoint managers - NumReturnWaterResetHWSetPtMgrs = 0; // number of hot-water return water reset setpoint managers - NumSchTESSetPtMgrs = 0; // number of TES Scheduled setpoint Managers - - DCESPMDsn_EntCondTemp = 0.0; - DCESPMDsn_MinCondSetpt = 0.0; - DCESPMCur_MinLiftTD = 0.0; - DCESPMDesign_Load_Sum = 0.0; - DCESPMActual_Load_Sum = 0.0; - DCESPMWeighted_Actual_Load_Sum = 0.0; - DCESPMWeighted_Design_Load_Sum = 0.0; - DCESPMWeighted_Ratio = 0.0; - DCESPMMin_DesignWB = 0.0; - DCESPMMin_ActualWb = 0.0; - DCESPMOpt_CondEntTemp = 0.0; - DCESPMDesignClgCapacity_Watts = 0.0; - DCESPMCurrentLoad_Watts = 0.0; - DCESPMCondInletTemp = 0.0; - DCESPMEvapOutletTemp = 0.0; - - ManagerOn = false; - GetInputFlag = true; // First time, input is "gotten" - // Object Data - InitSetPointManagersOneTimeFlag = true; - InitSetPointManagersOneTimeFlag2 = true; - AllSetPtMgr.deallocate(); // Array for all Setpoint Manager data(warnings) - SchSetPtMgr.deallocate(); // Array for Scheduled Setpoint Manager data - DualSchSetPtMgr.deallocate(); // Dual Scheduled Setpoint Manager data - OutAirSetPtMgr.deallocate(); // Array for Outside Air Setpoint Manager data - SingZoneRhSetPtMgr.deallocate(); // Array for SZRH Set Pt Mgr - SingZoneHtSetPtMgr.deallocate(); // Array for SZ Heating Set Pt Mgr - SingZoneClSetPtMgr.deallocate(); // Array for SZ Cooling Set Pt Mgr - SZMinHumSetPtMgr.deallocate(); // Array for SZ Min Hum Set Pt Mgr - SZMaxHumSetPtMgr.deallocate(); // Array for SZ Max Hum Set Pt Mgr - MixedAirSetPtMgr.deallocate(); // Array for Mixed Air Set Pt Mgr - OAPretreatSetPtMgr.deallocate(); // Array for OA Pretreat Set Pt Mgr - WarmestSetPtMgr.deallocate(); // Array for Warmest Set Pt Mgr - ColdestSetPtMgr.deallocate(); // Array for Coldest Set Pt Mgr - WarmestSetPtMgrTempFlow.deallocate(); // Array for Warmest Set Pt Mgr - RABFlowSetPtMgr.deallocate(); // Array for return air bypass - MZAverageCoolingSetPtMgr.deallocate(); // Array for MultiZone - MZAverageHeatingSetPtMgr.deallocate(); // Array for MultiZone - MZAverageMinHumSetPtMgr.deallocate(); // Array for MultiZone - MZAverageMaxHumSetPtMgr.deallocate(); // Array for MultiZone - MZMinHumSetPtMgr.deallocate(); // Multizone min humidity rat Set Pt Mgr - MZMaxHumSetPtMgr.deallocate(); // Multizone max humidity rat Set Pt Mgr - FollowOATempSetPtMgr.deallocate(); // Array for Follow Outdoor Air - FollowSysNodeTempSetPtMgr.deallocate(); // Array for Follow System - GroundTempSetPtMgr.deallocate(); // Array for Ground Temp Setpoint - CondEntSetPtMgr.deallocate(); // Condenser Entering Water Set Pt Mgr - IdealCondEntSetPtMgr.deallocate(); // Ideal Condenser Entering Set Pt Mgr - SZOneStageCoolingSetPtMgr.deallocate(); // single zone 1 stage cool - SZOneStageHeatingSetPtMgr.deallocate(); // single zone 1 stage heat - ReturnWaterResetChWSetPtMgr.deallocate(); // return water reset - ReturnWaterResetHWSetPtMgr.deallocate(); // hot-water return water reset - SchTESSetPtMgr.deallocate(); // TES Scheduled setpoint Managers - - NoSurfaceGroundTempObjWarning = true; - NoShallowGroundTempObjWarning = true; - NoDeepGroundTempObjWarning = true; - NoFCGroundTempObjWarning = true; - InitSetPointManagersMyEnvrnFlag = true; - RunSubOptCondEntTemp = false; - RunFinalOptCondEntTemp = false; - } - void ManageSetPoints(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -496,28 +170,28 @@ namespace SetPointManager { int SetPtMgrNum; // loop index // First time ManageSetPoints is called, get the input for all the setpoint managers - if (GetInputFlag) { + if (state.dataSetPointManager->GetInputFlag) { GetSetPointManagerInputs(state); - GetInputFlag = false; + state.dataSetPointManager->GetInputFlag = false; } InitSetPointManagers(state); - if (ManagerOn) { + if (state.dataSetPointManager->ManagerOn) { SimSetPointManagers(state); UpdateSetPointManagers(state); // The Mixed Air Setpoint Managers (since they depend on other setpoints, they must be calculated // and updated next to last). - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMixedAirSetPtMgrs; ++SetPtMgrNum) { - MixedAirSetPtMgr(SetPtMgrNum).calculate(state); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMixedAirSetPtMgrs; ++SetPtMgrNum) { + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).calculate(state); } - UpdateMixedAirSetPoints(); + UpdateMixedAirSetPoints(state); // The Outside Air Pretreat Setpoint Managers (since they depend on other setpoints, they must be calculated // and updated last). - for (SetPtMgrNum = 1; SetPtMgrNum <= NumOAPretreatSetPtMgrs; ++SetPtMgrNum) { - OAPretreatSetPtMgr(SetPtMgrNum).calculate(state); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumOAPretreatSetPtMgrs; ++SetPtMgrNum) { + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).calculate(state); } - UpdateOAPretreatSetPoints(); + UpdateOAPretreatSetPoints(state); } } @@ -626,186 +300,186 @@ namespace SetPointManager { ZoneNum = 0; cCurrentModuleObject = "SetpointManager:Scheduled"; - NumSchSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:Scheduled' + state.dataSetPointManager->NumSchSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:Scheduled' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = NumNums; MaxNumAlphas = NumAlphas; cCurrentModuleObject = "SetpointManager:Scheduled:DualSetpoint"; - NumDualSchSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:Scheduled:DualSetpoint' + state.dataSetPointManager->NumDualSchSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:Scheduled:DualSetpoint' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:OutdoorAirReset"; - NumOutAirSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:OutdoorAirReset' + state.dataSetPointManager->NumOutAirSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:OutdoorAirReset' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:SingleZone:Reheat"; - NumSZRhSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Reheat' + state.dataSetPointManager->NumSZRhSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Reheat' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:SingleZone:Heating"; - NumSZHtSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Heating' + state.dataSetPointManager->NumSZHtSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Heating' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:SingleZone:Cooling"; - NumSZClSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Cooling' + state.dataSetPointManager->NumSZClSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Cooling' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:SingleZone:Humidity:Minimum"; - NumSZMinHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Humidity:Minimum' + state.dataSetPointManager->NumSZMinHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Humidity:Minimum' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:SingleZone:Humidity:Maximum"; - NumSZMaxHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Humidity:Maximum' + state.dataSetPointManager->NumSZMaxHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:SingleZone:Humidity:Maximum' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:MixedAir"; - NumMixedAirSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MixedAir' + state.dataSetPointManager->NumMixedAirSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MixedAir' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:OutdoorAirPretreat"; - NumOAPretreatSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:OutdoorAirPretreat' + state.dataSetPointManager->NumOAPretreatSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:OutdoorAirPretreat' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:Warmest"; - NumWarmestSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:Warmest' + state.dataSetPointManager->NumWarmestSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:Warmest' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:Coldest"; - NumColdestSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:Coldest' + state.dataSetPointManager->NumColdestSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:Coldest' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:WarmestTemperatureFlow"; - NumWarmestSetPtMgrsTempFlow = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:WarmestTemperatureFlow' + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:WarmestTemperatureFlow' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:ReturnAirBypassFlow"; - NumRABFlowSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:ReturnAirBypassFlow' + state.dataSetPointManager->NumRABFlowSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:ReturnAirBypassFlow' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:MultiZone:Cooling:Average"; - NumMZClgAverageSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:Cooling:Average' + state.dataSetPointManager->NumMZClgAverageSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:Cooling:Average' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:MultiZone:Heating:Average"; - NumMZHtgAverageSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:Heating:Average' + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:Heating:Average' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:MultiZone:MinimumHumidity:Average"; - NumMZAverageMinHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:MinimumHumidity:Average' + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:MinimumHumidity:Average' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:MultiZone:MaximumHumidity:Average"; - NumMZAverageMaxHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:MaximumHumidity:Average' + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:MaximumHumidity:Average' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:MultiZone:Humidity:Minimum"; - NumMZMinHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:Humidity:Minimum' + state.dataSetPointManager->NumMZMinHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:Humidity:Minimum' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:MultiZone:Humidity:Maximum"; - NumMZMaxHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:Humidity:Maximum' + state.dataSetPointManager->NumMZMaxHumSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:MultiZone:Humidity:Maximum' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:FollowOutdoorAirTemperature"; - NumFollowOATempSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:FollowOutdoorAirTemperature' + state.dataSetPointManager->NumFollowOATempSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:FollowOutdoorAirTemperature' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:FollowSystemNodeTemperature"; - NumFollowSysNodeTempSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:FollowSystemNodeTemperature' + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:FollowSystemNodeTemperature' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:FollowGroundTemperature"; - NumGroundTempSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:FollowGroundTemperature' + state.dataSetPointManager->NumGroundTempSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:FollowGroundTemperature' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:CondenserEnteringReset"; - NumCondEntSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:CondenserEnteringReset' + state.dataSetPointManager->NumCondEntSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:CondenserEnteringReset' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:CondenserEnteringReset:Ideal"; - NumIdealCondEntSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:CondenserEnteringReset:Ideal' + state.dataSetPointManager->NumIdealCondEntSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); // 'SetpointManager:CondenserEnteringReset:Ideal' inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:SingleZone:OneStageCooling"; - NumSZOneStageCoolingSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:SingleZone:OneStageHeating"; - NumSZOneStageHeatingSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:ReturnTemperature:ChilledWater"; - NumReturnWaterResetChWSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); cCurrentModuleObject = "SetpointManager:ReturnTemperature:HotWater"; - NumReturnWaterResetHWSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + state.dataSetPointManager->NumReturnWaterResetHWSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, NumParams, NumAlphas, NumNums); MaxNumNumbers = max(MaxNumNumbers, NumNums); MaxNumAlphas = max(MaxNumAlphas, NumAlphas); - NumAllSetPtMgrs = NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + NumSZClSetPtMgrs + - NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + NumWarmestSetPtMgrs + - NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + NumMZClgAverageSetPtMgrs + - NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + NumMZMinHumSetPtMgrs + - NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs + NumFollowSysNodeTempSetPtMgrs + NumGroundTempSetPtMgrs + - NumCondEntSetPtMgrs + NumIdealCondEntSetPtMgrs + NumSZOneStageCoolingSetPtMgrs + NumSZOneStageHeatingSetPtMgrs + - NumReturnWaterResetChWSetPtMgrs + NumReturnWaterResetHWSetPtMgrs; + state.dataSetPointManager->NumAllSetPtMgrs = state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + state.dataSetPointManager->NumSZClSetPtMgrs + + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrs + + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + state.dataSetPointManager->NumMZMinHumSetPtMgrs + + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs + state.dataSetPointManager->NumGroundTempSetPtMgrs + + state.dataSetPointManager->NumCondEntSetPtMgrs + state.dataSetPointManager->NumIdealCondEntSetPtMgrs + state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs + state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs + + state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs + state.dataSetPointManager->NumReturnWaterResetHWSetPtMgrs; cAlphaFieldNames.allocate(MaxNumAlphas); cAlphaArgs.allocate(MaxNumAlphas); @@ -817,17 +491,17 @@ namespace SetPointManager { inputProcessor->getObjectDefMaxArgs(state, "NodeList", NumParams, NumAlphas, NumNums); NodeNums.dimension(NumParams, 0); - if (NumAllSetPtMgrs > 0) AllSetPtMgr.allocate(NumAllSetPtMgrs); // Allocate the entire Setpoint Manager input data array + if (state.dataSetPointManager->NumAllSetPtMgrs > 0) state.dataSetPointManager->AllSetPtMgr.allocate(state.dataSetPointManager->NumAllSetPtMgrs); // Allocate the entire Setpoint Manager input data array // Input the Scheduled Setpoint Managers - if (NumSchSetPtMgrs > 0) SchSetPtMgr.allocate(NumSchSetPtMgrs); // Allocate the Setpoint Manager input data array + if (state.dataSetPointManager->NumSchSetPtMgrs > 0) state.dataSetPointManager->SchSetPtMgr.allocate(state.dataSetPointManager->NumSchSetPtMgrs); // Allocate the Setpoint Manager input data array // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:Scheduled"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSchSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSchSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -842,39 +516,39 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SchSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - SchSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); // setup program flow control integers - if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - } else if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxTemp; - } else if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinTemp; - } else if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "HumidityRatio")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_HumRat; - } else if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumHumidityRatio")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxHumRat; - } else if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumHumidityRatio")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinHumRat; - } else if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MassFlowRate")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MassFlow; - } else if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumMassFlowRate")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxMassFlow; - } else if (UtilityRoutines::SameString(SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumMassFlowRate")) { - SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinMassFlow; + if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxTemp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinTemp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "HumidityRatio")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::HumRat; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumHumidityRatio")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxHumRat; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumHumidityRatio")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinHumRat; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MassFlowRate")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MassFlow; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumMassFlowRate")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxMassFlow; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumMassFlowRate")) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinMassFlow; } else { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); - ShowContinueError(state, "..Valid values are \"Temperature\",\"MaximumTemperature\",\"MinimumTemperature\","); - ShowContinueError(state, " \"HumidityRatio\",\"MaximumHumidityRatio\",\"MinimumHumidityRatio\",\"MassFlowRate\","); - ShowContinueError(state, " \"MaximumMassFlowRate\" or \"MinimumMassFlowRate\""); + ShowContinueError(state, R"(..Valid values are "Temperature","MaximumTemperature","MinimumTemperature",)"); + ShowContinueError(state, R"( "HumidityRatio","MaximumHumidityRatio","MinimumHumidityRatio","MassFlowRate",)"); + ShowContinueError(state, R"( "MaximumMassFlowRate" or "MinimumMassFlowRate")"); ErrorsFound = true; } - SchSetPtMgr(SetPtMgrNum).Sched = cAlphaArgs(3); - SchSetPtMgr(SetPtMgrNum).SchedPtr = GetScheduleIndex(state, cAlphaArgs(3)); - if (SchSetPtMgr(SetPtMgrNum).SchedPtr == 0) { + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).Sched = cAlphaArgs(3); + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr = GetScheduleIndex(state, cAlphaArgs(3)); + if (state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr == 0) { if (lAlphaFieldBlanks(3)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", blank required field."); ShowContinueError(state, "..required field " + cAlphaFieldNames(3)); @@ -884,10 +558,10 @@ namespace SetPointManager { } ErrorsFound = true; } - SchSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(4); + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(4); NodeListError = false; GetNodeNums(state, - SchSetPtMgr(SetPtMgrNum).CtrlNodeListName, + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlNodeListName, NumNodes, NodeNums, NodeListError, @@ -902,12 +576,12 @@ namespace SetPointManager { if (!NodeListError) { NumNodesCtrld = NumNodes; - SchSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - SchSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - SchSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - SchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -919,24 +593,24 @@ namespace SetPointManager { AllSetPtMgrNum = SetPtMgrNum; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = SchSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = SchSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_Scheduled; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = SchSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = SchSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::Scheduled; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Scheduled Setpoint Managers DUAL SETPOINT - if (NumDualSchSetPtMgrs > 0) DualSchSetPtMgr.allocate(NumDualSchSetPtMgrs); // Allocate the Setpoint Manager input data array + if (state.dataSetPointManager->NumDualSchSetPtMgrs > 0) state.dataSetPointManager->DualSchSetPtMgr.allocate(state.dataSetPointManager->NumDualSchSetPtMgrs); // Allocate the Setpoint Manager input data array // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:Scheduled:DualSetpoint"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumDualSchSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumDualSchSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -951,10 +625,10 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - DualSchSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - DualSchSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(DualSchSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -962,9 +636,9 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - DualSchSetPtMgr(SetPtMgrNum).SchedHi = cAlphaArgs(3); - DualSchSetPtMgr(SetPtMgrNum).SchedPtrHi = GetScheduleIndex(state, cAlphaArgs(3)); - if (DualSchSetPtMgr(SetPtMgrNum).SchedPtrHi == 0) { + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SchedHi = cAlphaArgs(3); + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SchedPtrHi = GetScheduleIndex(state, cAlphaArgs(3)); + if (state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SchedPtrHi == 0) { if (lAlphaFieldBlanks(3)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", blank required field."); ShowContinueError(state, "..required field " + cAlphaFieldNames(3)); @@ -974,9 +648,9 @@ namespace SetPointManager { } ErrorsFound = true; } - DualSchSetPtMgr(SetPtMgrNum).SchedLo = cAlphaArgs(4); - DualSchSetPtMgr(SetPtMgrNum).SchedPtrLo = GetScheduleIndex(state, cAlphaArgs(4)); - if (DualSchSetPtMgr(SetPtMgrNum).SchedPtrLo == 0) { + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SchedLo = cAlphaArgs(4); + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SchedPtrLo = GetScheduleIndex(state, cAlphaArgs(4)); + if (state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SchedPtrLo == 0) { if (lAlphaFieldBlanks(4)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", blank required field."); ShowContinueError(state, "..required field " + cAlphaFieldNames(4)); @@ -986,10 +660,10 @@ namespace SetPointManager { } ErrorsFound = true; } - DualSchSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(5); + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(5); NodeListError = false; GetNodeNums(state, - DualSchSetPtMgr(SetPtMgrNum).CtrlNodeListName, + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlNodeListName, NumNodes, NodeNums, NodeListError, @@ -1004,13 +678,13 @@ namespace SetPointManager { if (!NodeListError) { NumNodesCtrld = NumNodes; - DualSchSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - DualSchSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - DualSchSetPtMgr(SetPtMgrNum).SetPtHi = 0.0; - DualSchSetPtMgr(SetPtMgrNum).SetPtLo = 0.0; + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SetPtHi = 0.0; + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SetPtLo = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - DualSchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // check getnodenums/nodelist // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1019,27 +693,27 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = DualSchSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = DualSchSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_ScheduledDual; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = DualSchSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::ScheduledDual; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Outside Air Setpoint Managers - if (NumOutAirSetPtMgrs > 0) OutAirSetPtMgr.allocate(NumOutAirSetPtMgrs); // Allocate the Setpoint Manager input data array + if (state.dataSetPointManager->NumOutAirSetPtMgrs > 0) state.dataSetPointManager->OutAirSetPtMgr.allocate(state.dataSetPointManager->NumOutAirSetPtMgrs); // Allocate the Setpoint Manager input data array // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:OutdoorAirReset"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumOutAirSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumOutAirSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1054,14 +728,14 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - OutAirSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - OutAirSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(OutAirSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - } else if (UtilityRoutines::SameString(OutAirSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { - OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxTemp; - } else if (UtilityRoutines::SameString(OutAirSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { - OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinTemp; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxTemp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinTemp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -1069,49 +743,49 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - OutAirSetPtMgr(SetPtMgrNum).OutLowSetPt1 = rNumericArgs(1); - OutAirSetPtMgr(SetPtMgrNum).OutLow1 = rNumericArgs(2); - OutAirSetPtMgr(SetPtMgrNum).OutHighSetPt1 = rNumericArgs(3); - OutAirSetPtMgr(SetPtMgrNum).OutHigh1 = rNumericArgs(4); - OutAirSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(3); - if (OutAirSetPtMgr(SetPtMgrNum).OutHigh1 < OutAirSetPtMgr(SetPtMgrNum).OutLow1) { + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLowSetPt1 = rNumericArgs(1); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLow1 = rNumericArgs(2); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHighSetPt1 = rNumericArgs(3); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHigh1 = rNumericArgs(4); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(3); + if (state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHigh1 < state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLow1) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid setpoints."); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(4), - OutAirSetPtMgr(SetPtMgrNum).OutHigh1, + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHigh1, cNumericFieldNames(2), - OutAirSetPtMgr(SetPtMgrNum).OutLow1)); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLow1)); } // Get optional input: schedule and 2nd reset rule if (NumAlphas == 4 && NumNums == 8) { - OutAirSetPtMgr(SetPtMgrNum).Sched = cAlphaArgs(4); - OutAirSetPtMgr(SetPtMgrNum).SchedPtr = GetScheduleIndex(state, cAlphaArgs(4)); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).Sched = cAlphaArgs(4); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SchedPtr = GetScheduleIndex(state, cAlphaArgs(4)); // Schedule is optional here, so no check on SchedPtr - OutAirSetPtMgr(SetPtMgrNum).OutLowSetPt2 = rNumericArgs(5); - OutAirSetPtMgr(SetPtMgrNum).OutLow2 = rNumericArgs(6); - OutAirSetPtMgr(SetPtMgrNum).OutHighSetPt2 = rNumericArgs(7); - OutAirSetPtMgr(SetPtMgrNum).OutHigh2 = rNumericArgs(8); - if (OutAirSetPtMgr(SetPtMgrNum).OutHigh2 < OutAirSetPtMgr(SetPtMgrNum).OutLow2) { + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLowSetPt2 = rNumericArgs(5); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLow2 = rNumericArgs(6); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHighSetPt2 = rNumericArgs(7); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHigh2 = rNumericArgs(8); + if (state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHigh2 < state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLow2) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid setpoints."); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(8), - OutAirSetPtMgr(SetPtMgrNum).OutHigh2, + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHigh2, cNumericFieldNames(6), - OutAirSetPtMgr(SetPtMgrNum).OutLow2)); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLow2)); } } else { - OutAirSetPtMgr(SetPtMgrNum).Sched = ""; - OutAirSetPtMgr(SetPtMgrNum).SchedPtr = 0; - OutAirSetPtMgr(SetPtMgrNum).OutLowSetPt2 = 0.0; - OutAirSetPtMgr(SetPtMgrNum).OutLow2 = 0.0; - OutAirSetPtMgr(SetPtMgrNum).OutHighSetPt2 = 0.0; - OutAirSetPtMgr(SetPtMgrNum).OutHigh2 = 0.0; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).Sched = ""; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SchedPtr = 0; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLowSetPt2 = 0.0; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutLow2 = 0.0; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHighSetPt2 = 0.0; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).OutHigh2 = 0.0; } NodeListError = false; GetNodeNums(state, - OutAirSetPtMgr(SetPtMgrNum).CtrlNodeListName, + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlNodeListName, NumNodes, NodeNums, NodeListError, @@ -1125,12 +799,12 @@ namespace SetPointManager { cAlphaFieldNames(3)); if (!NodeListError) { NumNodesCtrld = NumNodes; - OutAirSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - OutAirSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - OutAirSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - OutAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1139,27 +813,27 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = OutAirSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = OutAirSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_OutsideAir; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = OutAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::OutsideAir; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Single Zone Reheat Setpoint Managers - if (NumSZRhSetPtMgrs > 0) SingZoneRhSetPtMgr.allocate(NumSZRhSetPtMgrs); // Allocate the Setpoint Manager input data array + if (state.dataSetPointManager->NumSZRhSetPtMgrs > 0) state.dataSetPointManager->SingZoneRhSetPtMgr.allocate(state.dataSetPointManager->NumSZRhSetPtMgrs); // Allocate the Setpoint Manager input data array // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:SingleZone:Reheat"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZRhSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZRhSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1174,10 +848,10 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SingZoneRhSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - SingZoneRhSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(SingZoneRhSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -1185,21 +859,21 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(3); - SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - if (SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp < SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(3); + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + if (state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).MinSetTemp)); } - SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode(state, + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum = GetOnlySingleNode(state, + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum = GetOnlySingleNode(state, cAlphaArgs(5), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); NodeListError = false; GetNodeNums(state, @@ -1217,12 +891,12 @@ namespace SetPointManager { cAlphaFieldNames(6)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - SingZoneRhSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - SingZoneRhSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1232,35 +906,35 @@ namespace SetPointManager { } // get the actual zone number of the control zone - SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), Zone); - if (SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), Zone); + if (state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(3) + "=\"" + cAlphaArgs(3) + "\"."); ErrorsFound = true; } - SingZoneRhSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).SetPt = 0.0; - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = SingZoneRhSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_SZReheat; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = SingZoneRhSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::SZReheat; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Single Zone Heating Setpoint Managers - if (NumSZHtSetPtMgrs > 0) SingZoneHtSetPtMgr.allocate(NumSZHtSetPtMgrs); // Allocate the Setpoint Manager input data array + if (state.dataSetPointManager->NumSZHtSetPtMgrs > 0) state.dataSetPointManager->SingZoneHtSetPtMgr.allocate(state.dataSetPointManager->NumSZHtSetPtMgrs); // Allocate the Setpoint Manager input data array // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:SingleZone:Heating"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZHtSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZHtSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1275,10 +949,10 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SingZoneHtSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - SingZoneHtSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(SingZoneHtSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -1286,21 +960,21 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(3); - SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - if (SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp < SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(3); + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + if (state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).MinSetTemp)); } - SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode( + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode( state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum = GetOnlySingleNode( + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum = GetOnlySingleNode( state, cAlphaArgs(5), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); NodeListError = false; GetNodeNums(state, @@ -1318,12 +992,12 @@ namespace SetPointManager { cAlphaFieldNames(6)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - SingZoneHtSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - SingZoneHtSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1333,34 +1007,34 @@ namespace SetPointManager { } // get the actual zone number of the control zone - SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), Zone); - if (SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), Zone); + if (state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(3) + "=\"" + cAlphaArgs(3) + "\"."); ErrorsFound = true; } - SingZoneHtSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).SetPt = 0.0; - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = SingZoneHtSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_SZHeating; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = SingZoneHtSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::SZHeating; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Single Zone Cooling Setpoint Managers - if (NumSZClSetPtMgrs > 0) SingZoneClSetPtMgr.allocate(NumSZClSetPtMgrs); // Allocate the Setpoint Manager input data array + if (state.dataSetPointManager->NumSZClSetPtMgrs > 0) state.dataSetPointManager->SingZoneClSetPtMgr.allocate(state.dataSetPointManager->NumSZClSetPtMgrs); // Allocate the Setpoint Manager input data array // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:SingleZone:Cooling"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZClSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1375,10 +1049,10 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SingZoneClSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - SingZoneClSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(SingZoneClSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -1386,21 +1060,21 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(3); - SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - if (SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp < SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(3); + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).MinSetTemp)); } - SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode(state, + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum = GetOnlySingleNode(state, + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum = GetOnlySingleNode(state, cAlphaArgs(5), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); NodeListError = false; GetNodeNums(state, @@ -1418,12 +1092,12 @@ namespace SetPointManager { cAlphaFieldNames(6)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - SingZoneClSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - SingZoneClSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1433,34 +1107,34 @@ namespace SetPointManager { } // get the actual zone number of the control zone - SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), Zone); - if (SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), Zone); + if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(3) + "=\"" + cAlphaArgs(3) + "\"."); ErrorsFound = true; } - SingZoneClSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).SetPt = 0.0; - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = SingZoneClSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_SZCooling; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = SingZoneClSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::SZCooling; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Single Zone Minimum Humidity Setpoint Managers - if (NumSZMinHumSetPtMgrs > 0) SZMinHumSetPtMgr.allocate(NumSZMinHumSetPtMgrs); + if (state.dataSetPointManager->NumSZMinHumSetPtMgrs > 0) state.dataSetPointManager->SZMinHumSetPtMgr.allocate(state.dataSetPointManager->NumSZMinHumSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:SingleZone:Humidity:Minimum"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1475,9 +1149,9 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SZMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - SZMinHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MinimumHumidityRatio"; - SZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinHumRat; + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MinimumHumidityRatio"; + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinHumRat; NodeListError = false; GetNodeNums(state, @@ -1495,12 +1169,12 @@ namespace SetPointManager { cAlphaFieldNames(4)); // nodes whose min humidity ratio will be set if (!NodeListError) { NumNodesCtrld = NumNodes; - SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - SZMinHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1530,7 +1204,7 @@ namespace SetPointManager { ErrorsFound = true; } NumZones = NumNodes; - SZMinHumSetPtMgr(SetPtMgrNum).NumZones = NumZones; + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).NumZones = NumZones; // only allow one control zone for now if (NumNodes > 1) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", entered nodelist."); @@ -1538,37 +1212,37 @@ namespace SetPointManager { ShowContinueError(state, "..only one control zone is allowed."); ErrorsFound = true; } - SZMinHumSetPtMgr(SetPtMgrNum).ZoneNodes.allocate(NumZones); - SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum.allocate(NumZones); - SZMinHumSetPtMgr(SetPtMgrNum).CtrlZoneNum.allocate(NumZones); + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNodes.allocate(NumZones); + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum.allocate(NumZones); + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlZoneNum.allocate(NumZones); for (ZoneNum = 1; ZoneNum <= NumZones; ++ZoneNum) { - SZMinHumSetPtMgr(SetPtMgrNum).ZoneNodes(ZoneNum) = NodeNums(ZoneNum); - SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(ZoneNum) = 0; - SZMinHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(ZoneNum) = 0; + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNodes(ZoneNum) = NodeNums(ZoneNum); + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(ZoneNum) = 0; + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(ZoneNum) = 0; } AllSetPtMgrNum = - SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + NumSZClSetPtMgrs; + SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + state.dataSetPointManager->NumSZClSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = SZMinHumSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_SZMinHum; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = SZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::SZMinHum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Single Zone Maximum Humidity Setpoint Managers - if (NumSZMaxHumSetPtMgrs > 0) SZMaxHumSetPtMgr.allocate(NumSZMaxHumSetPtMgrs); + if (state.dataSetPointManager->NumSZMaxHumSetPtMgrs > 0) state.dataSetPointManager->SZMaxHumSetPtMgr.allocate(state.dataSetPointManager->NumSZMaxHumSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:SingleZone:Humidity:Maximum"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1583,9 +1257,9 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SZMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - SZMaxHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MaximumHumidityRatio"; - SZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxHumRat; + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MaximumHumidityRatio"; + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxHumRat; NodeListError = false; GetNodeNums(state, @@ -1603,12 +1277,12 @@ namespace SetPointManager { cAlphaFieldNames(2)); // nodes whose max humidity ratio will be set if (!NodeListError) { NumNodesCtrld = NumNodes; - SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - SZMaxHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1638,7 +1312,7 @@ namespace SetPointManager { ErrorsFound = true; } NumZones = NumNodes; - SZMaxHumSetPtMgr(SetPtMgrNum).NumZones = NumZones; + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).NumZones = NumZones; // only allow one control zone for now if (NumNodes > 1) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", entered nodelist."); @@ -1646,38 +1320,38 @@ namespace SetPointManager { ShowContinueError(state, "..only one control zone is allowed."); ErrorsFound = true; } - SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNodes.allocate(NumZones); - SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum.allocate(NumZones); - SZMaxHumSetPtMgr(SetPtMgrNum).CtrlZoneNum.allocate(NumZones); + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNodes.allocate(NumZones); + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum.allocate(NumZones); + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlZoneNum.allocate(NumZones); for (ZoneNum = 1; ZoneNum <= NumZones; ++ZoneNum) { - SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNodes(ZoneNum) = NodeNums(ZoneNum); + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNodes(ZoneNum) = NodeNums(ZoneNum); // Actual zone node and controlled zone numbers set in Init subroutine - SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(ZoneNum) = 0; - SZMaxHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(ZoneNum) = 0; + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(ZoneNum) = 0; + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(ZoneNum) = 0; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = SZMaxHumSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_SZMaxHum; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = SZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::SZMaxHum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Mixed Air Setpoint Managers - if (NumMixedAirSetPtMgrs > 0) MixedAirSetPtMgr.allocate(NumMixedAirSetPtMgrs); + if (state.dataSetPointManager->NumMixedAirSetPtMgrs > 0) state.dataSetPointManager->MixedAirSetPtMgr.allocate(state.dataSetPointManager->NumMixedAirSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:MixedAir"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMixedAirSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMixedAirSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1692,10 +1366,10 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - MixedAirSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - MixedAirSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(MixedAirSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -1703,11 +1377,11 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - MixedAirSetPtMgr(SetPtMgrNum).RefNode = GetOnlySingleNode( + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode = GetOnlySingleNode( state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - MixedAirSetPtMgr(SetPtMgrNum).FanInNode = GetOnlySingleNode( + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanInNode = GetOnlySingleNode( state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - MixedAirSetPtMgr(SetPtMgrNum).FanOutNode = GetOnlySingleNode( + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanOutNode = GetOnlySingleNode( state, cAlphaArgs(5), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); NodeListError = false; GetNodeNums(state, @@ -1725,12 +1399,12 @@ namespace SetPointManager { cAlphaFieldNames(6)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - MixedAirSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1740,50 +1414,50 @@ namespace SetPointManager { } Found = FindNumberInList( - MixedAirSetPtMgr(SetPtMgrNum).RefNode, MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes, MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes); + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode, state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes, state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes); if (Found > 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", reference node."); - if (MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes > 1) { + if (state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes > 1) { ShowContinueError(state, "..Reference Node is the same as one of the nodes in SetPoint NodeList"); } else { ShowContinueError(state, "..Reference Node is the same as the SetPoint Node"); } - ShowContinueError(state, "Reference Node Name=\"" + NodeID(MixedAirSetPtMgr(SetPtMgrNum).RefNode) + "\"."); + ShowContinueError(state, "Reference Node Name=\"" + NodeID(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode) + "\"."); ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs; if (NumAlphas > 7) { - MixedAirSetPtMgr(SetPtMgrNum).CoolCoilInNode = GetOnlySingleNode(state, + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CoolCoilInNode = GetOnlySingleNode(state, cAlphaArgs(7), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - MixedAirSetPtMgr(SetPtMgrNum).CoolCoilOutNode = GetOnlySingleNode(state, + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CoolCoilOutNode = GetOnlySingleNode(state, cAlphaArgs(8), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); if (NumNums == 1) { - MixedAirSetPtMgr(SetPtMgrNum).MinCoolCoilOutTemp = rNumericArgs(1); + state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).MinCoolCoilOutTemp = rNumericArgs(1); } } if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = MixedAirSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_MixedAir; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; - AllSetPtMgr(AllSetPtMgrNum).RefNode = MixedAirSetPtMgr(SetPtMgrNum).RefNode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::MixedAir; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).RefNode = state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode; } // Input the Outside Air Pretreat Setpoint Managers - if (NumOAPretreatSetPtMgrs > 0) OAPretreatSetPtMgr.allocate(NumOAPretreatSetPtMgrs); + if (state.dataSetPointManager->NumOAPretreatSetPtMgrs > 0) state.dataSetPointManager->OAPretreatSetPtMgr.allocate(state.dataSetPointManager->NumOAPretreatSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:OutdoorAirPretreat"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumOAPretreatSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumOAPretreatSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1798,72 +1472,72 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - OAPretreatSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - OAPretreatSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); // setup program flow control integers. { - auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(OAPretreatSetPtMgr(SetPtMgrNum).CtrlVarType)); + auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlVarType)); if (SELECT_CASE_var == "TEMPERATURE") { - OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else if (SELECT_CASE_var == "HUMIDITYRATIO") { - OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_HumRat; + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::HumRat; } else if (SELECT_CASE_var == "MAXIMUMHUMIDITYRATIO") { - OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxHumRat; + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxHumRat; } else if (SELECT_CASE_var == "MINIMUMHUMIDITYRATIO") { - OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinHumRat; + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinHumRat; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); - ShowContinueError(state, "..Valid values are \"Temperature\",\"HumidityRatio\",\"MaximumHumidityRatio\" or \"MinimumHumidityRatio\"."); + ShowContinueError(state, R"(..Valid values are "Temperature","HumidityRatio","MaximumHumidityRatio" or "MinimumHumidityRatio".)"); ErrorsFound = true; } } - OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - if (OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp < OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MinSetTemp)); } - OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat = rNumericArgs(3); - OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat = rNumericArgs(4); - if (OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat < OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat) { + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat = rNumericArgs(3); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat = rNumericArgs(4); + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat < state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(4), - OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat, + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat, cNumericFieldNames(3), - OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat)); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat)); } // Because a zero humidity ratio setpoint is a special value indicating "off" or "no load" // must not allow MinSetHumRat or MaxSetHumRat to be <=0.0 - if (OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat <= 0.0) { + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat <= 0.0) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid value."); ShowContinueError(state, "Minimum setpoint humidity ratio <=0.0, resetting to 0.00001"); - OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat = 0.00001; + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MinSetHumRat = 0.00001; } - if (OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat <= 0.0) { + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat <= 0.0) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid value."); ShowContinueError(state, "Maximum setpoint humidity ratio <=0.0, resetting to 0.00001"); - OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat = 0.00001; + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MaxSetHumRat = 0.00001; } - OAPretreatSetPtMgr(SetPtMgrNum).RefNode = GetOnlySingleNode(state, + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode = GetOnlySingleNode(state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode = GetOnlySingleNode(state, + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - OAPretreatSetPtMgr(SetPtMgrNum).OAInNode = GetOnlySingleNode(state, + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).OAInNode = GetOnlySingleNode(state, cAlphaArgs(5), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode = GetOnlySingleNode(state, + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode = GetOnlySingleNode(state, cAlphaArgs(6), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Air, NodeConnectionType_Sensor, 1, ObjectIsNotParent); NodeListError = false; GetNodeNums(state, @@ -1881,12 +1555,12 @@ namespace SetPointManager { cAlphaFieldNames(7)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - OAPretreatSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -1896,39 +1570,39 @@ namespace SetPointManager { } Found = FindNumberInList( - OAPretreatSetPtMgr(SetPtMgrNum).RefNode, OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes, OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes); + state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode, state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes, state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes); if (Found > 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", reference node."); - if (OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes > 1) { + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes > 1) { ShowContinueError(state, "..Reference Node is the same as one of the nodes in SetPoint NodeList"); } else { ShowContinueError(state, "..Reference Node is the same as the SetPoint Node"); } - ShowContinueError(state, "Reference Node Name=\"" + NodeID(OAPretreatSetPtMgr(SetPtMgrNum).RefNode) + "\"."); + ShowContinueError(state, "Reference Node Name=\"" + NodeID(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode) + "\"."); ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = OAPretreatSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_OutsideAirPretreat; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::OutsideAirPretreat; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Warmest Setpoint Managers - if (NumWarmestSetPtMgrs > 0) WarmestSetPtMgr.allocate(NumWarmestSetPtMgrs); + if (state.dataSetPointManager->NumWarmestSetPtMgrs > 0) state.dataSetPointManager->WarmestSetPtMgr.allocate(state.dataSetPointManager->NumWarmestSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:Warmest"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -1943,10 +1617,10 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - WarmestSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - WarmestSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(WarmestSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -1954,24 +1628,24 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - WarmestSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(3); - WarmestSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - WarmestSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - if (WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp < WarmestSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(3); + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + if (state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - WarmestSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).MinSetTemp)); } { auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(cAlphaArgs(4))); if (SELECT_CASE_var == "MAXIMUMTEMPERATURE") { - WarmestSetPtMgr(SetPtMgrNum).Strategy = MaxTemp; + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Strategy = SupplyFlowTempStrategy::MaxTemp; } else { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(4) + "=\"" + cAlphaArgs(4) + "\"."); @@ -1996,12 +1670,12 @@ namespace SetPointManager { cAlphaFieldNames(5)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - WarmestSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - WarmestSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - WarmestSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - WarmestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2010,27 +1684,27 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = WarmestSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = WarmestSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_Warmest; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = WarmestSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::Warmest; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Coldest Setpoint Managers - if (NumColdestSetPtMgrs > 0) ColdestSetPtMgr.allocate(NumColdestSetPtMgrs); + if (state.dataSetPointManager->NumColdestSetPtMgrs > 0) state.dataSetPointManager->ColdestSetPtMgr.allocate(state.dataSetPointManager->NumColdestSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:Coldest"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumColdestSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumColdestSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2045,10 +1719,10 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - ColdestSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - ColdestSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(ColdestSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -2056,24 +1730,24 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - ColdestSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(3); - ColdestSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - ColdestSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - if (ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp < ColdestSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(3); + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + if (state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - ColdestSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).MinSetTemp)); } { auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(cAlphaArgs(4))); if (SELECT_CASE_var == "MINIMUMTEMPERATURE") { - ColdestSetPtMgr(SetPtMgrNum).Strategy = MinTemp; + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Strategy = SupplyFlowTempStrategy::MinTemp; } else { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(4) + "=\"" + cAlphaArgs(4) + "\"."); @@ -2098,12 +1772,12 @@ namespace SetPointManager { cAlphaFieldNames(5)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - ColdestSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - ColdestSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - ColdestSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - ColdestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2112,28 +1786,28 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = ColdestSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = ColdestSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_Coldest; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = ColdestSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::Coldest; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Warmest Temp Flow Setpoint Managers - if (NumWarmestSetPtMgrsTempFlow > 0) WarmestSetPtMgrTempFlow.allocate(NumWarmestSetPtMgrsTempFlow); + if (state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow > 0) state.dataSetPointManager->WarmestSetPtMgrTempFlow.allocate(state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:WarmestTemperatureFlow"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2148,10 +1822,10 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - WarmestSetPtMgrTempFlow(SetPtMgrNum).Name = cAlphaArgs(1); - WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlVarType, "Temperature")) { - WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -2159,36 +1833,36 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName = cAlphaArgs(3); - WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum = 0; - WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - if (WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp < WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName = cAlphaArgs(3); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + if (state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MinSetTemp)); } - WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown = rNumericArgs(3); - if (WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown >= 0.8) { + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown = rNumericArgs(3); + if (state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown >= 0.8) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError( - state, format("...{}=[{:.2R}] is greater than 0.8;", cNumericFieldNames(3), WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown)); + state, format("...{}=[{:.2R}] is greater than 0.8;", cNumericFieldNames(3), state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).MinTurndown)); ShowContinueError(state, "...typical values for " + cNumericFieldNames(3) + " are less than 0.8."); } { auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(cAlphaArgs(4))); if (SELECT_CASE_var == "TEMPERATUREFIRST") { - WarmestSetPtMgrTempFlow(SetPtMgrNum).Strategy = TempFirst; + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Strategy = ControlStrategy::TempFirst; } else if (SELECT_CASE_var == "FLOWFIRST") { - WarmestSetPtMgrTempFlow(SetPtMgrNum).Strategy = FlowFirst; + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Strategy = ControlStrategy::FlowFirst; } else { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(4) + "=\"" + cAlphaArgs(4) + "\"."); - ShowContinueError(state, "..Valid values are \"TemperatureFirst\" or \"FlowFirst\"."); + ShowContinueError(state, R"(..Valid values are "TemperatureFirst" or "FlowFirst".)"); ErrorsFound = true; } } @@ -2209,12 +1883,12 @@ namespace SetPointManager { cAlphaFieldNames(5)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - WarmestSetPtMgrTempFlow(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - WarmestSetPtMgrTempFlow(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2223,28 +1897,28 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = WarmestSetPtMgrTempFlow(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_WarmestTempFlow; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = WarmestSetPtMgrTempFlow(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::WarmestTempFlow; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).NumCtrlNodes; } // Input the Return Air Bypass Flow Setpoint Managers - if (NumRABFlowSetPtMgrs > 0) RABFlowSetPtMgr.allocate(NumRABFlowSetPtMgrs); + if (state.dataSetPointManager->NumRABFlowSetPtMgrs > 0) state.dataSetPointManager->RABFlowSetPtMgr.allocate(state.dataSetPointManager->NumRABFlowSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:ReturnAirBypassFlow"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumRABFlowSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumRABFlowSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2259,13 +1933,13 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - RABFlowSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - RABFlowSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - RABFlowSetPtMgr(SetPtMgrNum).NumCtrlNodes = 1; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).NumCtrlNodes = 1; NumNodesCtrld = 1; - if (UtilityRoutines::SameString(RABFlowSetPtMgr(SetPtMgrNum).CtrlVarType, "Flow")) { - RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MassFlow; + if (UtilityRoutines::SameString(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlVarType, "Flow")) { + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MassFlow; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); @@ -2273,11 +1947,11 @@ namespace SetPointManager { ShowContinueError(state, "..Valid value is \"Temperature\"."); ErrorsFound = true; } - RABFlowSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(3); - RABFlowSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - RABFlowSetPtMgr(SetPtMgrNum).Sched = cAlphaArgs(4); - RABFlowSetPtMgr(SetPtMgrNum).SchedPtr = GetScheduleIndex(state, cAlphaArgs(4)); - if (RABFlowSetPtMgr(SetPtMgrNum).SchedPtr == 0) { + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(3); + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).Sched = cAlphaArgs(4); + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).SchedPtr = GetScheduleIndex(state, cAlphaArgs(4)); + if (state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).SchedPtr == 0) { if (lAlphaFieldBlanks(4)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", blank required field."); ShowContinueError(state, "..required field " + cAlphaFieldNames(4)); @@ -2288,29 +1962,29 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow; - RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex = AllSetPtMgrNum; - RABFlowSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - RABFlowSetPtMgr(SetPtMgrNum).CtrlNodes = 0; - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex = AllSetPtMgrNum; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlNodes = 0; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); // need to reset this to the control node (RABSplitOutNode) in Init, will be 0 here - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = RABFlowSetPtMgr(SetPtMgrNum).CtrlNodes; - AllSetPtMgr(AllSetPtMgrNum).Name = RABFlowSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_RAB; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = RABFlowSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::RAB; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the MultiZone Average Cooling Setpoint Managers - if (NumMZClgAverageSetPtMgrs > 0) MZAverageCoolingSetPtMgr.allocate(NumMZClgAverageSetPtMgrs); + if (state.dataSetPointManager->NumMZClgAverageSetPtMgrs > 0) state.dataSetPointManager->MZAverageCoolingSetPtMgr.allocate(state.dataSetPointManager->NumMZClgAverageSetPtMgrs); // Input the data for each setpoint manager cCurrentModuleObject = "SetpointManager:MultiZone:Cooling:Average"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2325,22 +1999,22 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - MZAverageCoolingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); - MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlVarType = "Temperature"; - MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlVarType = "Temperature"; + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; - if (MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp < MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp) { + if (state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -2359,12 +2033,12 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - MZAverageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - MZAverageCoolingSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2373,27 +2047,27 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = MZAverageCoolingSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_MZCoolingAverage; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = MZAverageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::MZCoolingAverage; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the MultiZone Average Heating Setpoint Managers - if (NumMZHtgAverageSetPtMgrs > 0) MZAverageHeatingSetPtMgr.allocate(NumMZHtgAverageSetPtMgrs); + if (state.dataSetPointManager->NumMZHtgAverageSetPtMgrs > 0) state.dataSetPointManager->MZAverageHeatingSetPtMgr.allocate(state.dataSetPointManager->NumMZHtgAverageSetPtMgrs); // Input the data for each setpoint manager cCurrentModuleObject = "SetpointManager:MultiZone:Heating:Average"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2408,22 +2082,22 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - MZAverageHeatingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); - MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); - MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlVarType = "Temperature"; - MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(1); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlVarType = "Temperature"; + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; - if (MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp < MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp) { + if (state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(1), - MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -2442,12 +2116,12 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - MZAverageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - MZAverageHeatingSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2456,27 +2130,27 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + NumMZClgAverageSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + state.dataSetPointManager->NumMZClgAverageSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = MZAverageHeatingSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_MZHeatingAverage; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = MZAverageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::MZHeatingAverage; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the MultiZone Average Minimum Humidity Setpoint Managers - if (NumMZAverageMinHumSetPtMgrs > 0) MZAverageMinHumSetPtMgr.allocate(NumMZAverageMinHumSetPtMgrs); + if (state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs > 0) state.dataSetPointManager->MZAverageMinHumSetPtMgr.allocate(state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs); // Input the data for each setpoint manager cCurrentModuleObject = "SetpointManager:MultiZone:MinimumHumidity:Average"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2491,22 +2165,22 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - MZAverageMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); - MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum = rNumericArgs(1); - MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum = rNumericArgs(2); - MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MinimumHumidityRatio"; - MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinHumRat; + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum = rNumericArgs(1); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum = rNumericArgs(2); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MinimumHumidityRatio"; + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinHumRat; - if (MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum < MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum) { + if (state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum < state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.3R}] is less than {}=[{:.3R}].", cNumericFieldNames(2), - MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum, + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).MaxSetHum, cNumericFieldNames(1), - MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum)); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).MinSetHum)); } NodeListError = false; @@ -2525,12 +2199,12 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - MZAverageMinHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2539,28 +2213,28 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = MZAverageMinHumSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_MZMinHumAverage; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::MZMinHumAverage; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the MultiZone Average Maximum Humidity SetPoint Managers - if (NumMZAverageMaxHumSetPtMgrs > 0) MZAverageMaxHumSetPtMgr.allocate(NumMZAverageMaxHumSetPtMgrs); + if (state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs > 0) state.dataSetPointManager->MZAverageMaxHumSetPtMgr.allocate(state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs); // Input the data for each setpoint manager cCurrentModuleObject = "SetpointManager:MultiZone:MaximumHumidity:Average"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2575,22 +2249,22 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); - MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum = rNumericArgs(1); - MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum = rNumericArgs(2); - MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MaximumHumidityRatio"; - MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxHumRat; + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum = rNumericArgs(1); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum = rNumericArgs(2); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MaximumHumidityRatio"; + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxHumRat; - if (MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum < MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum) { + if (state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum < state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.3R}] is less than {}=[{:.3R}].", cNumericFieldNames(2), - MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum, + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum, cNumericFieldNames(1), - MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum)); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).MinSetHum)); } NodeListError = false; @@ -2609,12 +2283,12 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - MZAverageMaxHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2623,28 +2297,28 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_MZMaxHumAverage; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::MZMaxHumAverage; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Multizone Minimum Humidity Ratio SetPoint Managers - if (NumMZMinHumSetPtMgrs > 0) MZMinHumSetPtMgr.allocate(NumMZMinHumSetPtMgrs); + if (state.dataSetPointManager->NumMZMinHumSetPtMgrs > 0) state.dataSetPointManager->MZMinHumSetPtMgr.allocate(state.dataSetPointManager->NumMZMinHumSetPtMgrs); // Input the data for each setpoint manager cCurrentModuleObject = "SetpointManager:MultiZone:Humidity:Minimum"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2659,22 +2333,22 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - MZMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); - MZMinHumSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum = rNumericArgs(1); - MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum = rNumericArgs(2); - MZMinHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MinimumHumidityRatio"; - MZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinHumRat; + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum = rNumericArgs(1); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum = rNumericArgs(2); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MinimumHumidityRatio"; + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinHumRat; - if (MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum < MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum) { + if (state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum < state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.3R}] is less than {}=[{:.3R}].", cNumericFieldNames(2), - MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum, + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).MaxSetHum, cNumericFieldNames(1), - MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum)); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).MinSetHum)); } NodeListError = false; @@ -2693,12 +2367,12 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - MZMinHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2707,28 +2381,28 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = MZMinHumSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_MZMinHum; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = MZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::MZMinHum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Multizone Maximum Humidity Ratio SetPoint Managers - if (NumMZMaxHumSetPtMgrs > 0) MZMaxHumSetPtMgr.allocate(NumMZMaxHumSetPtMgrs); + if (state.dataSetPointManager->NumMZMaxHumSetPtMgrs > 0) state.dataSetPointManager->MZMaxHumSetPtMgr.allocate(state.dataSetPointManager->NumMZMaxHumSetPtMgrs); // Input the data for each setpoint manager cCurrentModuleObject = "SetpointManager:MultiZone:Humidity:Maximum"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2743,22 +2417,22 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - MZMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); - MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum = 0; - MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum = rNumericArgs(1); - MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum = rNumericArgs(2); - MZMaxHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MaximumHumidityRatio"; - MZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxHumRat; + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName = cAlphaArgs(2); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum = 0; + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum = rNumericArgs(1); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum = rNumericArgs(2); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlVarType = "MaximumHumidityRatio"; + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxHumRat; - if (MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum < MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum) { + if (state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum < state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.3R}] is less than {}=[{:.3R}].", cNumericFieldNames(2), - MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum, + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).MaxSetHum, cNumericFieldNames(1), - MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum)); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).MinSetHum)); } NodeListError = false; @@ -2777,12 +2451,12 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - MZMaxHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2791,30 +2465,30 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = MZMaxHumSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_MZMaxHum; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = MZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::MZMaxHum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Follow Outdoor Air Temperature Setpoint Managers - if (NumFollowOATempSetPtMgrs > 0) FollowOATempSetPtMgr.allocate(NumFollowOATempSetPtMgrs); + if (state.dataSetPointManager->NumFollowOATempSetPtMgrs > 0) state.dataSetPointManager->FollowOATempSetPtMgr.allocate(state.dataSetPointManager->NumFollowOATempSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:FollowOutdoorAirTemperature"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumFollowOATempSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumFollowOATempSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2829,43 +2503,43 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - FollowOATempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - FollowOATempSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(FollowOATempSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - } else if (UtilityRoutines::SameString(FollowOATempSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { - FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxTemp; - } else if (UtilityRoutines::SameString(FollowOATempSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { - FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinTemp; + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxTemp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinTemp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); - ShowContinueError(state, "..Valid values are \"Temperature\",\"MaximumTemperature\" or \"MinimumTemperature\"."); + ShowContinueError(state, R"(..Valid values are "Temperature","MaximumTemperature" or "MinimumTemperature".)"); ErrorsFound = true; } - FollowOATempSetPtMgr(SetPtMgrNum).RefTempType = cAlphaArgs(3); - if (UtilityRoutines::SameString(FollowOATempSetPtMgr(SetPtMgrNum).RefTempType, "OutdoorAirWetBulb")) { - FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefTempType_WetBulb; - } else if (UtilityRoutines::SameString(FollowOATempSetPtMgr(SetPtMgrNum).RefTempType, "OutdoorAirDryBulb")) { - FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefTempType_DryBulb; + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTempType = cAlphaArgs(3); + if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTempType, "OutdoorAirWetBulb")) { + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::WetBulb; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTempType, "OutdoorAirDryBulb")) { + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::DryBulb; } else { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(3) + "=\"" + cAlphaArgs(3) + "\"."); - ShowContinueError(state, "..Valid values are \"OutdoorAirWetBulb\" or \"OutdoorAirDryBulb\"."); + ShowContinueError(state, R"(..Valid values are "OutdoorAirWetBulb" or "OutdoorAirDryBulb".)"); ErrorsFound = true; } - FollowOATempSetPtMgr(SetPtMgrNum).Offset = rNumericArgs(1); - FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); - if (FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp < FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).Offset = rNumericArgs(1); + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); + if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(3), - FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -2884,12 +2558,12 @@ namespace SetPointManager { cAlphaFieldNames(4)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - FollowOATempSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - FollowOATempSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -2898,30 +2572,30 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = FollowOATempSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_FollowOATemp; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = FollowOATempSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::FollowOATemp; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Follow System Node Temperature Setpoint Managers - if (NumFollowSysNodeTempSetPtMgrs > 0) FollowSysNodeTempSetPtMgr.allocate(NumFollowSysNodeTempSetPtMgrs); + if (state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs > 0) state.dataSetPointManager->FollowSysNodeTempSetPtMgr.allocate(state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:FollowSystemNodeTemperature"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumFollowSysNodeTempSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -2936,46 +2610,46 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - FollowSysNodeTempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - } else if (UtilityRoutines::SameString(FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { - FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxTemp; - } else if (UtilityRoutines::SameString(FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { - FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinTemp; + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxTemp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinTemp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); - ShowContinueError(state, "..Valid values are \"Temperature\",\"MaximumTemperature\" or \"MinimumTemperature\"."); + ShowContinueError(state, R"(..Valid values are "Temperature","MaximumTemperature" or "MinimumTemperature".)"); ErrorsFound = true; } - FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum = GetOnlySingleNode(state, + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum = GetOnlySingleNode(state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Unknown, NodeConnectionType_Sensor, 1, ObjectIsNotParent); - FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType = cAlphaArgs(4); - if (UtilityRoutines::SameString(FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType, "NodeWetBulb")) { - FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefTempType_WetBulb; - } else if (UtilityRoutines::SameString(FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType, "NodeDryBulb")) { - FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefTempType_DryBulb; + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType = cAlphaArgs(4); + if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType, "NodeWetBulb")) { + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::WetBulb; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTempType, "NodeDryBulb")) { + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::DryBulb; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(3) + "=\"" + cAlphaArgs(3) + "\"."); - ShowContinueError(state, "..Valid values are \"NodeWetBulb\" or \"NodeDryBulb\"."); + ShowContinueError(state, R"(..Valid values are "NodeWetBulb" or "NodeDryBulb".)"); ErrorsFound = true; } - FollowSysNodeTempSetPtMgr(SetPtMgrNum).Offset = rNumericArgs(1); - FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); - if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp < FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).Offset = rNumericArgs(1); + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); + if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(3), - FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -2994,12 +2668,12 @@ namespace SetPointManager { cAlphaFieldNames(5)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - FollowSysNodeTempSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - FollowSysNodeTempSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -3008,30 +2682,30 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = FollowSysNodeTempSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_FollowSysNodeTemp; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = FollowSysNodeTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::FollowSysNodeTemp; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Ground Temperature Setpoint Managers - if (NumGroundTempSetPtMgrs > 0) GroundTempSetPtMgr.allocate(NumGroundTempSetPtMgrs); + if (state.dataSetPointManager->NumGroundTempSetPtMgrs > 0) state.dataSetPointManager->GroundTempSetPtMgr.allocate(state.dataSetPointManager->NumGroundTempSetPtMgrs); // Input the data for each Setpoint Manager cCurrentModuleObject = "SetpointManager:FollowGroundTemperature"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumGroundTempSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumGroundTempSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -3046,81 +2720,81 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - GroundTempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - GroundTempSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(GroundTempSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - } else if (UtilityRoutines::SameString(GroundTempSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { - GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxTemp; - } else if (UtilityRoutines::SameString(GroundTempSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { - GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MinTemp; + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlVarType, "MaximumTemperature")) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxTemp; + } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlVarType, "MinimumTemperature")) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MinTemp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); - ShowContinueError(state, "..Valid values are \"Temperature\",\"MaximumTemperature\" or \"MinimumTemperature\"."); + ShowContinueError(state, R"(..Valid values are "Temperature","MaximumTemperature" or "MinimumTemperature".)"); ErrorsFound = true; } - GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType = cAlphaArgs(3); - if (UtilityRoutines::SameString(GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:BuildingSurface")) { - GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefGroundTempObjType_BuildingSurface; - if (NoSurfaceGroundTempObjWarning) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType = cAlphaArgs(3); + if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:BuildingSurface")) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceGroundTempObjectType::BuildingSurface; + if (state.dataSetPointManager->NoSurfaceGroundTempObjWarning) { if (!GroundTempObjInput) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" requires \"Site:GroundTemperature:BuildingSurface\" in the input."); ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp)); } - NoSurfaceGroundTempObjWarning = false; + state.dataSetPointManager->NoSurfaceGroundTempObjWarning = false; } - } else if (UtilityRoutines::SameString(GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:Shallow")) { - GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefGroundTempObjType_Shallow; - if (NoShallowGroundTempObjWarning) { + } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:Shallow")) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceGroundTempObjectType::Shallow; + if (state.dataSetPointManager->NoShallowGroundTempObjWarning) { if (!GroundTemp_SurfaceObjInput) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" requires \"Site:GroundTemperature:Shallow\" in the input."); ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp_Surface)); } - NoShallowGroundTempObjWarning = false; + state.dataSetPointManager->NoShallowGroundTempObjWarning = false; } - } else if (UtilityRoutines::SameString(GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:Deep")) { - GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefGroundTempObjType_Deep; - if (NoDeepGroundTempObjWarning) { + } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:Deep")) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceGroundTempObjectType::Deep; + if (state.dataSetPointManager->NoDeepGroundTempObjWarning) { if (!GroundTemp_DeepObjInput) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" requires \"Site:GroundTemperature:Deep\" in the input."); ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTemp_Deep)); } - NoDeepGroundTempObjWarning = false; + state.dataSetPointManager->NoDeepGroundTempObjWarning = false; } - } else if (UtilityRoutines::SameString(GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:FCfactorMethod")) { - GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefGroundTempObjType_FCfactorMethod; - if (NoFCGroundTempObjWarning) { + } else if (UtilityRoutines::SameString(state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefGroundTempObjType, "Site:GroundTemperature:FCfactorMethod")) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceGroundTempObjectType::FCFactorMethod; + if (state.dataSetPointManager->NoFCGroundTempObjWarning) { if (!FCGroundTemps) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" requires \"Site:GroundTemperature:FCfactorMethod\" in the input."); ShowContinueError(state, format("Defaults, constant throughout the year of ({:.1R}) will be used.", GroundTempFC)); } - NoFCGroundTempObjWarning = false; + state.dataSetPointManager->NoFCGroundTempObjWarning = false; } } else { // should not come here if idd type choice and key list is working ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(3) + "=\"" + cAlphaArgs(3) + "\"."); - ShowContinueError(state, "..Valid values are \"Site:GroundTemperature:BuildingSurface\", \"Site:GroundTemperature:Shallow\","); - ShowContinueError(state, " \"Site:GroundTemperature:Deep\" or \"Site:GroundTemperature:FCfactorMethod\"."); + ShowContinueError(state, R"(..Valid values are "Site:GroundTemperature:BuildingSurface", "Site:GroundTemperature:Shallow",)"); + ShowContinueError(state, R"( "Site:GroundTemperature:Deep" or "Site:GroundTemperature:FCfactorMethod".)"); ErrorsFound = true; } - GroundTempSetPtMgr(SetPtMgrNum).Offset = rNumericArgs(1); - GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); - GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); - if (GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp < GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp) { + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).Offset = rNumericArgs(1); + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp = rNumericArgs(2); + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp = rNumericArgs(3); + if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp < state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp, + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).MaxSetTemp, cNumericFieldNames(3), - GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp)); + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).MinSetTemp)); } NodeListError = false; @@ -3139,12 +2813,12 @@ namespace SetPointManager { cAlphaFieldNames(4)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - GroundTempSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - GroundTempSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowSevereError(state, RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// & @@ -3153,46 +2827,46 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs + NumFollowSysNodeTempSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = GroundTempSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_GroundTemp; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = GroundTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::GroundTemp; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { SetupOutputVariable(state, "Setpoint Manager Warmest Temperature Critical Zone Number", OutputProcessor::Unit::None, - WarmestSetPtMgrTempFlow(SetPtMgrNum).CritZoneNum, + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CritZoneNum, "System", "Average", - WarmestSetPtMgrTempFlow(SetPtMgrNum).Name); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Name); SetupOutputVariable(state, "Setpoint Manager Warmest Temperature Turndown Flow Fraction", OutputProcessor::Unit::None, - WarmestSetPtMgrTempFlow(SetPtMgrNum).Turndown, + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Turndown, "System", "Average", - WarmestSetPtMgrTempFlow(SetPtMgrNum).Name); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Name); } // Input the Condenser Entering Set Point Managers - if (NumCondEntSetPtMgrs > 0) CondEntSetPtMgr.allocate(NumCondEntSetPtMgrs); // Allocate the Set Point Manager input data array + if (state.dataSetPointManager->NumCondEntSetPtMgrs > 0) state.dataSetPointManager->CondEntSetPtMgr.allocate(state.dataSetPointManager->NumCondEntSetPtMgrs); // Allocate the Set Point Manager input data array // Input the data for each Set Point Manager cCurrentModuleObject = "SetpointManager:CondenserEnteringReset"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumCondEntSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumCondEntSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -3207,37 +2881,37 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - CondEntSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - CondEntSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(CondEntSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { // should not come here if idd type choice and key list is working ShowSevereError(state, " found invalid control type of " + cAlphaArgs(2) + " in " + cCurrentModuleObject + " = " + cAlphaArgs(1)); ErrorsFound = true; } - CondEntSetPtMgr(SetPtMgrNum).CondEntTempSched = cAlphaArgs(3); - CondEntSetPtMgr(SetPtMgrNum).CondEntTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(3)); - CondEntSetPtMgr(SetPtMgrNum).MinTwrWbCurve = GetCurveIndex(state, cAlphaArgs(4)); - CondEntSetPtMgr(SetPtMgrNum).MinOaWbCurve = GetCurveIndex(state, cAlphaArgs(5)); - CondEntSetPtMgr(SetPtMgrNum).OptCondEntCurve = GetCurveIndex(state, cAlphaArgs(6)); - CondEntSetPtMgr(SetPtMgrNum).MinimumLiftTD = rNumericArgs(1); - CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp = rNumericArgs(2); - CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb = rNumericArgs(3); - CondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(7); - if (CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp < CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb) { + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CondEntTempSched = cAlphaArgs(3); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CondEntTempSchedPtr = GetScheduleIndex(state, cAlphaArgs(3)); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).MinTwrWbCurve = GetCurveIndex(state, cAlphaArgs(4)); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).MinOaWbCurve = GetCurveIndex(state, cAlphaArgs(5)); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).OptCondEntCurve = GetCurveIndex(state, cAlphaArgs(6)); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).MinimumLiftTD = rNumericArgs(1); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp = rNumericArgs(2); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb = rNumericArgs(3); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(7); + if (state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp < state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp, + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp, cNumericFieldNames(1), - CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb)); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).TowerDsnInletAirWetBulb)); } NodeListError = false; GetNodeNums(state, - CondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName, + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName, NumNodes, NodeNums, NodeListError, @@ -3251,12 +2925,12 @@ namespace SetPointManager { cAlphaFieldNames(7)); if (!NodeListError) { NumNodesCtrld = NumNodes; - CondEntSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - CondEntSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowContinueError(state, 'Invalid '//TRIM(cAlphaFieldNames(3))//' in '//TRIM(cCurrentModuleObject)//' = '// & @@ -3264,33 +2938,33 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs + NumFollowSysNodeTempSetPtMgrs + - NumGroundTempSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs + + state.dataSetPointManager->NumGroundTempSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = CondEntSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = CondEntSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_CondEntReset; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::CondEntReset; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; } // Input the Ideal Condenser Entering Set Point Managers // Allocate the Set Point Manager input data array - if (NumIdealCondEntSetPtMgrs > 0) IdealCondEntSetPtMgr.allocate(NumIdealCondEntSetPtMgrs); + if (state.dataSetPointManager->NumIdealCondEntSetPtMgrs > 0) state.dataSetPointManager->IdealCondEntSetPtMgr.allocate(state.dataSetPointManager->NumIdealCondEntSetPtMgrs); // Input the data for each Set Point Manager cCurrentModuleObject = "SetpointManager:CondenserEnteringReset:Ideal"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -3305,21 +2979,21 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - IdealCondEntSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - IdealCondEntSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); - if (UtilityRoutines::SameString(IdealCondEntSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { - IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlVarType = cAlphaArgs(2); + if (UtilityRoutines::SameString(state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlVarType, "Temperature")) { + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; } else { ShowSevereError(state, " found invalid control type of " + cAlphaArgs(2) + " in " + cCurrentModuleObject + " = " + cAlphaArgs(1)); ErrorsFound = true; } - IdealCondEntSetPtMgr(SetPtMgrNum).MinimumLiftTD = rNumericArgs(1); - IdealCondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp = rNumericArgs(2); - IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(3); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).MinimumLiftTD = rNumericArgs(1); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp = rNumericArgs(2); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName = cAlphaArgs(3); NodeListError = false; GetNodeNums(state, - IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName, + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodeListName, NumNodes, NodeNums, NodeListError, @@ -3333,12 +3007,12 @@ namespace SetPointManager { cAlphaFieldNames(3)); if (!NodeListError) { NumNodesCtrld = NumNodes; - IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - IdealCondEntSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { // CALL ShowContinueError(state, 'Invalid '//TRIM(cAlphaFieldNames(3))//' in '//TRIM(cCurrentModuleObject)//' = '// & @@ -3346,28 +3020,28 @@ namespace SetPointManager { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs + NumFollowSysNodeTempSetPtMgrs + - NumGroundTempSetPtMgrs + NumCondEntSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs + + state.dataSetPointManager->NumGroundTempSetPtMgrs + state.dataSetPointManager->NumCondEntSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = IdealCondEntSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_IdealCondEntReset; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::IdealCondEntReset; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; } - if (NumSZOneStageCoolingSetPtMgrs > 0) SZOneStageCoolingSetPtMgr.allocate(NumSZOneStageCoolingSetPtMgrs); + if (state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs > 0) state.dataSetPointManager->SZOneStageCoolingSetPtMgr.allocate(state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs); cCurrentModuleObject = "SetpointManager:SingleZone:OneStageCooling"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZOneStageCoolingSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -3382,34 +3056,34 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SZOneStageCoolingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlVarType = "Temperature"; - SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp = rNumericArgs(1); - SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp = rNumericArgs(2); + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlVarType = "Temperature"; + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp = rNumericArgs(1); + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp = rNumericArgs(2); - if (SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp < SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp) { + if (state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp < state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp) { // throw warning, off must be warmer than on ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp, + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp, cNumericFieldNames(1), - SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp)); + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOnTemp)); } - SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(2); - SZOneStageCoolingSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetSystemNodeNumberForZone(state, cAlphaArgs(2)); + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(2); + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetSystemNodeNumberForZone(state, cAlphaArgs(2)); // get the actual zone number of the control zone - SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); - if (SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + if (state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); ErrorsFound = true; } else { if (allocated(StageZoneLogic)) { - if (!StageZoneLogic(SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneNum)) { + if (!StageZoneLogic(state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).ControlZoneNum)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); ShowContinueError(state, "Zone thermostat must use ZoneControl:Thermostat:StagedDualSetpoint."); @@ -3434,38 +3108,38 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - SZOneStageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - SZOneStageCoolingSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs + NumFollowSysNodeTempSetPtMgrs + - NumGroundTempSetPtMgrs + NumCondEntSetPtMgrs + NumIdealCondEntSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs + + state.dataSetPointManager->NumGroundTempSetPtMgrs + state.dataSetPointManager->NumCondEntSetPtMgrs + state.dataSetPointManager->NumIdealCondEntSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = SZOneStageCoolingSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_SZOneStageCooling; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = SZOneStageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::SZOneStageCooling; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; } - if (NumSZOneStageHeatingSetPtMgrs > 0) SZOneStageHeatingSetPtMgr.allocate(NumSZOneStageHeatingSetPtMgrs); + if (state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs > 0) state.dataSetPointManager->SZOneStageHeatingSetPtMgr.allocate(state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs); cCurrentModuleObject = "SetpointManager:SingleZone:OneStageHeating"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZOneStageHeatingSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs; ++SetPtMgrNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SetPtMgrNum, @@ -3480,34 +3154,34 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SZOneStageHeatingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); - SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlVarType = "Temperature"; - SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp = rNumericArgs(1); - SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp = rNumericArgs(2); + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlVarType = "Temperature"; + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp = rNumericArgs(1); + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp = rNumericArgs(2); - if (SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp > SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp) { + if (state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp > state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp) { // throw warning, off must be cooler than on ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); ShowContinueError(state, format("...{}=[{:.1R}] is less than {}=[{:.1R}].", cNumericFieldNames(2), - SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp, + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOnTemp, cNumericFieldNames(1), - SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp)); + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp)); } - SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(2); - SZOneStageHeatingSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetSystemNodeNumberForZone(state, cAlphaArgs(2)); + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneName = cAlphaArgs(2); + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ZoneNodeNum = GetSystemNodeNumberForZone(state, cAlphaArgs(2)); // get the actual zone number of the control zone - SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); - if (SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + if (state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneNum == 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); ErrorsFound = true; } else { if (allocated(StageZoneLogic)) { - if (!StageZoneLogic(SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneNum)) { + if (!StageZoneLogic(state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).ControlZoneNum)) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); ShowContinueError(state, "Zone thermostat must use ZoneControl:Thermostat:StagedDualSetpoint."); @@ -3532,38 +3206,38 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes if (!NodeListError) { NumNodesCtrld = NumNodes; - SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - SZOneStageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; - SZOneStageHeatingSetPtMgr(SetPtMgrNum).SetPt = 0.0; + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes = NumNodesCtrld; + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).SetPt = 0.0; for (CtrldNodeNum = 1; CtrldNodeNum <= NumNodesCtrld; ++CtrldNodeNum) { - SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) = NodeNums(CtrldNodeNum); } } else { ErrorsFound = true; } - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs + NumFollowSysNodeTempSetPtMgrs + - NumGroundTempSetPtMgrs + NumCondEntSetPtMgrs + NumIdealCondEntSetPtMgrs + NumSZOneStageCoolingSetPtMgrs; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs + + state.dataSetPointManager->NumGroundTempSetPtMgrs + state.dataSetPointManager->NumCondEntSetPtMgrs + state.dataSetPointManager->NumIdealCondEntSetPtMgrs + state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs; if (!NodeListError) { - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(NumNodesCtrld); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes = state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes; } - AllSetPtMgr(AllSetPtMgrNum).Name = SZOneStageHeatingSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_SZOneStageHeating; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = SZOneStageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::SZOneStageHeating; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; } - if (NumReturnWaterResetChWSetPtMgrs > 0) ReturnWaterResetChWSetPtMgr.allocate(NumReturnWaterResetChWSetPtMgrs); + if (state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs > 0) state.dataSetPointManager->ReturnWaterResetChWSetPtMgr.allocate(state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs); cCurrentModuleObject = "SetpointManager:ReturnTemperature:ChilledWater"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumReturnWaterResetChWSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs; ++SetPtMgrNum) { // get the object inputs inputProcessor->getObjectItem(state, @@ -3580,11 +3254,11 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); // process the sense and actuate nodes bool errFlag = false; - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).supplyNodeIndex = GetOnlySingleNode(state, cAlphaArgs(2), + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).supplyNodeIndex = GetOnlySingleNode(state, cAlphaArgs(2), errFlag, cCurrentModuleObject, cAlphaArgs(1), @@ -3593,7 +3267,7 @@ namespace SetPointManager { 1, ObjectIsNotParent, cAlphaFieldNames(2)); // setpoint nodes - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnNodeIndex = GetOnlySingleNode(state, cAlphaArgs(3), + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnNodeIndex = GetOnlySingleNode(state, cAlphaArgs(3), errFlag, cCurrentModuleObject, cAlphaArgs(1), @@ -3604,22 +3278,22 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes // process the setpoint inputs - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).minimumChilledWaterSetpoint = rNumericArgs(1); - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).maximumChilledWaterSetpoint = rNumericArgs(2); + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).minimumChilledWaterSetpoint = rNumericArgs(1); + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).maximumChilledWaterSetpoint = rNumericArgs(2); // process the return temperature type/value std::string returnType(cAlphaArgs(4)); if (UtilityRoutines::SameString(returnType, "SCHEDULED")) { - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex = GetScheduleIndex(state, cAlphaArgs(5)); - if (ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex == 0) { + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex = GetScheduleIndex(state, cAlphaArgs(5)); + if (state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex == 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(5) + "=\"" + cAlphaArgs(5) + "\"."); ErrorsFound = true; } } else if (UtilityRoutines::SameString(returnType, "CONSTANT")) { - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureConstantTarget = rNumericArgs(3); + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).returnTemperatureConstantTarget = rNumericArgs(3); } else if (UtilityRoutines::SameString(returnType, "RETURNTEMPERATURESETPOINT")) { - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).useReturnTempSetpoint = true; + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).useReturnTempSetpoint = true; } else { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(4) + "=\"" + cAlphaArgs(4) + "\"."); @@ -3627,26 +3301,26 @@ namespace SetPointManager { } // setup the "base" class - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs + NumFollowSysNodeTempSetPtMgrs + - NumGroundTempSetPtMgrs + NumCondEntSetPtMgrs + NumIdealCondEntSetPtMgrs + NumSZOneStageCoolingSetPtMgrs + - NumSZOneStageHeatingSetPtMgrs; - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(1); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes(1) = ReturnWaterResetChWSetPtMgr(SetPtMgrNum).supplyNodeIndex; - AllSetPtMgr(AllSetPtMgrNum).Name = ReturnWaterResetChWSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_ReturnWaterResetChW; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = 1; - } - - if (NumReturnWaterResetHWSetPtMgrs > 0) ReturnWaterResetHWSetPtMgr.allocate(NumReturnWaterResetHWSetPtMgrs); + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs + + state.dataSetPointManager->NumGroundTempSetPtMgrs + state.dataSetPointManager->NumCondEntSetPtMgrs + state.dataSetPointManager->NumIdealCondEntSetPtMgrs + state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs + + state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(1); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes(1) = state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).supplyNodeIndex; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::ReturnWaterResetChW; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = 1; + } + + if (state.dataSetPointManager->NumReturnWaterResetHWSetPtMgrs > 0) state.dataSetPointManager->ReturnWaterResetHWSetPtMgr.allocate(state.dataSetPointManager->NumReturnWaterResetHWSetPtMgrs); cCurrentModuleObject = "SetpointManager:ReturnTemperature:HotWater"; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumReturnWaterResetHWSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumReturnWaterResetHWSetPtMgrs; ++SetPtMgrNum) { // get the object inputs inputProcessor->getObjectItem(state, @@ -3663,11 +3337,11 @@ namespace SetPointManager { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).Name = cAlphaArgs(1); // process the sense and actuate nodes bool errFlag = false; - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).supplyNodeIndex = GetOnlySingleNode(state, cAlphaArgs(2), + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).supplyNodeIndex = GetOnlySingleNode(state, cAlphaArgs(2), errFlag, cCurrentModuleObject, cAlphaArgs(1), @@ -3676,7 +3350,7 @@ namespace SetPointManager { 1, ObjectIsNotParent, cAlphaFieldNames(2)); // setpoint nodes - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnNodeIndex = GetOnlySingleNode(state, cAlphaArgs(3), + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnNodeIndex = GetOnlySingleNode(state, cAlphaArgs(3), errFlag, cCurrentModuleObject, cAlphaArgs(1), @@ -3687,22 +3361,22 @@ namespace SetPointManager { cAlphaFieldNames(3)); // setpoint nodes // process the setpoint inputs - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).minimumHotWaterSetpoint = rNumericArgs(1); - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).maximumHotWaterSetpoint = rNumericArgs(2); + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).minimumHotWaterSetpoint = rNumericArgs(1); + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).maximumHotWaterSetpoint = rNumericArgs(2); // process the return temperature type/value std::string returnType(cAlphaArgs(4)); if (UtilityRoutines::SameString(returnType, "SCHEDULED")) { - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex = GetScheduleIndex(state, cAlphaArgs(5)); - if (ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex == 0) { + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex = GetScheduleIndex(state, cAlphaArgs(5)); + if (state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureScheduleIndex == 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(5) + "=\"" + cAlphaArgs(5) + "\"."); ErrorsFound = true; } } else if (UtilityRoutines::SameString(returnType, "CONSTANT")) { - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureConstantTarget = rNumericArgs(3); + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).returnTemperatureConstantTarget = rNumericArgs(3); } else if (UtilityRoutines::SameString(returnType, "RETURNTEMPERATURESETPOINT")) { - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).useReturnTempSetpoint = true; + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).useReturnTempSetpoint = true; } else { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid field."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(4) + "=\"" + cAlphaArgs(4) + "\"."); @@ -3710,20 +3384,20 @@ namespace SetPointManager { } // setup the "base" class - AllSetPtMgrNum = SetPtMgrNum + NumSchSetPtMgrs + NumDualSchSetPtMgrs + NumOutAirSetPtMgrs + NumSZRhSetPtMgrs + NumSZHtSetPtMgrs + - NumSZClSetPtMgrs + NumSZMinHumSetPtMgrs + NumSZMaxHumSetPtMgrs + NumMixedAirSetPtMgrs + NumOAPretreatSetPtMgrs + - NumWarmestSetPtMgrs + NumColdestSetPtMgrs + NumWarmestSetPtMgrsTempFlow + NumRABFlowSetPtMgrs + - NumMZClgAverageSetPtMgrs + NumMZHtgAverageSetPtMgrs + NumMZAverageMinHumSetPtMgrs + NumMZAverageMaxHumSetPtMgrs + - NumMZMinHumSetPtMgrs + NumMZMaxHumSetPtMgrs + NumFollowOATempSetPtMgrs + NumFollowSysNodeTempSetPtMgrs + - NumGroundTempSetPtMgrs + NumCondEntSetPtMgrs + NumIdealCondEntSetPtMgrs + NumSZOneStageCoolingSetPtMgrs + - NumSZOneStageHeatingSetPtMgrs + NumReturnWaterResetChWSetPtMgrs; - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(1); - AllSetPtMgr(AllSetPtMgrNum).CtrlNodes(1) = ReturnWaterResetHWSetPtMgr(SetPtMgrNum).supplyNodeIndex; - AllSetPtMgr(AllSetPtMgrNum).Name = ReturnWaterResetHWSetPtMgr(SetPtMgrNum).Name; - AllSetPtMgr(AllSetPtMgrNum).SPMType = iSPMType_ReturnWaterResetHW; - AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; - AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = iCtrlVarType_Temp; - AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = 1; + AllSetPtMgrNum = SetPtMgrNum + state.dataSetPointManager->NumSchSetPtMgrs + state.dataSetPointManager->NumDualSchSetPtMgrs + state.dataSetPointManager->NumOutAirSetPtMgrs + state.dataSetPointManager->NumSZRhSetPtMgrs + state.dataSetPointManager->NumSZHtSetPtMgrs + + state.dataSetPointManager->NumSZClSetPtMgrs + state.dataSetPointManager->NumSZMinHumSetPtMgrs + state.dataSetPointManager->NumSZMaxHumSetPtMgrs + state.dataSetPointManager->NumMixedAirSetPtMgrs + state.dataSetPointManager->NumOAPretreatSetPtMgrs + + state.dataSetPointManager->NumWarmestSetPtMgrs + state.dataSetPointManager->NumColdestSetPtMgrs + state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow + state.dataSetPointManager->NumRABFlowSetPtMgrs + + state.dataSetPointManager->NumMZClgAverageSetPtMgrs + state.dataSetPointManager->NumMZHtgAverageSetPtMgrs + state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs + state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs + + state.dataSetPointManager->NumMZMinHumSetPtMgrs + state.dataSetPointManager->NumMZMaxHumSetPtMgrs + state.dataSetPointManager->NumFollowOATempSetPtMgrs + state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs + + state.dataSetPointManager->NumGroundTempSetPtMgrs + state.dataSetPointManager->NumCondEntSetPtMgrs + state.dataSetPointManager->NumIdealCondEntSetPtMgrs + state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs + + state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs + state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes.allocate(1); + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlNodes(1) = state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).supplyNodeIndex; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).Name = state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).Name; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMType = SetPointManagerType::ReturnWaterResetHW; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).SPMIndex = SetPtMgrNum; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).CtrlTypeMode = iCtrlVarType::Temp; + state.dataSetPointManager->AllSetPtMgr(AllSetPtMgrNum).NumCtrlNodes = 1; } cAlphaFieldNames.deallocate(); @@ -3755,7 +3429,7 @@ namespace SetPointManager { // 2) Check for duplicate names in all other setpoint managers // Verify setpoint managers use same control type (e.g. TEMP) and then check for duplicate nodes // SPM 1 - Control nodes A - D, SPM 2 - Control nodes E - H, SPM 3 - Control nodes I - L - // If SPM 1 has same control type as SPM 2 and SPM 3 (e.g. all use SPM%CtrlTypeMode = iCtrlVarType_Temp) then: + // If SPM 1 has same control type as SPM 2 and SPM 3 (e.g. all use SPM%CtrlTypeMode = iCtrlVarType::Temp) then: // Check A with E-H and I-L // Check B with E-H and I-L // Check C with E-H and I-L @@ -3771,57 +3445,55 @@ namespace SetPointManager { int CtrldNodeNum; // index of the items in the controlled node node list int TempCtrldNodeNum; // index of the items in the controlled node node list, used for warning messages - for (SetPtMgrNum = 1; SetPtMgrNum <= NumAllSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumAllSetPtMgrs; ++SetPtMgrNum) { // check for duplicate nodes in each setpoint managers control node list (node lists of size 1 do not need verification) // issue warning only since duplicate node names within a setpoint manager does not cause a conflict (i.e., same // value written to node) but may indicate an error in the node name. - for (CtrldNodeNum = 1; CtrldNodeNum <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes - 1; ++CtrldNodeNum) { - for (TempCtrldNodeNum = CtrldNodeNum + 1; TempCtrldNodeNum <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++TempCtrldNodeNum) { - if (AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) != AllSetPtMgr(SetPtMgrNum).CtrlNodes(TempCtrldNodeNum)) continue; - ShowWarningError(state, cValidSPMTypes(AllSetPtMgr(SetPtMgrNum).SPMType) + "=\"" + AllSetPtMgr(SetPtMgrNum).Name + "\""); - ShowContinueError(state, "...duplicate node specified = " + NodeID(AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum))); - ShowContinueError(state, "...control type variable = " + cValidCtrlTypes(AllSetPtMgr(SetPtMgrNum).CtrlTypeMode)); + for (CtrldNodeNum = 1; CtrldNodeNum <= state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).NumCtrlNodes - 1; ++CtrldNodeNum) { + for (TempCtrldNodeNum = CtrldNodeNum + 1; TempCtrldNodeNum <= state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++TempCtrldNodeNum) { + if (state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) != state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(TempCtrldNodeNum)) continue; + ShowWarningError(state, format("{} =\"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).Name)); + ShowContinueError(state, format("...duplicate node specified = {}", NodeID(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum)))); + ShowContinueError(state, format("...control type variable = {}", controlTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode))); } } // check for node conflicts in all other setpoint managers - for (TempSetPtMgrNum = SetPtMgrNum + 1; TempSetPtMgrNum <= NumAllSetPtMgrs; ++TempSetPtMgrNum) { + for (TempSetPtMgrNum = SetPtMgrNum + 1; TempSetPtMgrNum <= state.dataSetPointManager->NumAllSetPtMgrs; ++TempSetPtMgrNum) { // check the air loop name in addition to the node names for these SP manager types - // IF((AllSetPtMgr(SetPtMgrNum)%SPMType == iSPMType_WarmestTempFlow .AND. & - // AllSetPtMgr(TempSetPtMgrNum)%SPMType == iSPMType_WarmestTempFlow) .OR. & - // (AllSetPtMgr(SetPtMgrNum)%SPMType == iSPMType_RAB .AND. & - // AllSetPtMgr(TempSetPtMgrNum)%SPMType == iSPMType_RAB) .OR. & - // (AllSetPtMgr(SetPtMgrNum)%SPMType == iSPMType_Coldest .AND. & - // AllSetPtMgr(TempSetPtMgrNum)%SPMType == iSPMType_Coldest) .OR. & - // (AllSetPtMgr(SetPtMgrNum)%SPMType == iSPMType_Warmest .AND. & - // AllSetPtMgr(TempSetPtMgrNum)%SPMType == iSPMType_Warmest))THEN - if ((AllSetPtMgr(SetPtMgrNum).SPMType == iSPMType_RAB && AllSetPtMgr(TempSetPtMgrNum).SPMType == iSPMType_RAB)) { + // IF((AllSetPtMgr(SetPtMgrNum)%SPMType == SetPointManagerType::WarmestTempFlow .AND. & + // AllSetPtMgr(TempSetPtMgrNum)%SPMType == SetPointManagerType::WarmestTempFlow) .OR. & + // (AllSetPtMgr(SetPtMgrNum)%SPMType == SetPointManagerType::RAB .AND. & + // AllSetPtMgr(TempSetPtMgrNum)%SPMType == SetPointManagerType::RAB) .OR. & + // (AllSetPtMgr(SetPtMgrNum)%SPMType == SetPointManagerType::Coldest .AND. & + // AllSetPtMgr(TempSetPtMgrNum)%SPMType == SetPointManagerType::Coldest) .OR. & + // (AllSetPtMgr(SetPtMgrNum)%SPMType == SetPointManagerType::Warmest .AND. & + // AllSetPtMgr(TempSetPtMgrNum)%SPMType == SetPointManagerType::Warmest))THEN + if ((state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType == SetPointManagerType::RAB && state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).SPMType == SetPointManagerType::RAB)) { // check the air loop name for duplicates in this SP manager type - if (AllSetPtMgr(SetPtMgrNum).AirLoopNum == AllSetPtMgr(TempSetPtMgrNum).AirLoopNum) { - ShowWarningError(state, cValidSPMTypes(AllSetPtMgr(SetPtMgrNum).SPMType) + "=\"" + AllSetPtMgr(SetPtMgrNum).Name + "\""); + if (state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).AirLoopNum == state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).AirLoopNum) { + ShowWarningError(state, format("{}=\"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).Name)); ShowContinueError(state, "...air loop name conflicts with another setpoint manager."); - ShowContinueError(state, "...conflicting setpoint manager = " + cValidSPMTypes(AllSetPtMgr(TempSetPtMgrNum).SPMType) + " \"" + - AllSetPtMgr(TempSetPtMgrNum).Name + "\""); - ShowContinueError(state, "...conflicting air loop name = " + AllSetPtMgr(SetPtMgrNum).AirLoopName); + ShowContinueError(state, format("...conflicting setpoint manager = {} \"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).Name)); + ShowContinueError(state, "...conflicting air loop name = " + state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).AirLoopName); // ErrorsFound=.TRUE. } // check for duplicate control nodes - if (AllSetPtMgr(SetPtMgrNum).CtrlTypeMode != AllSetPtMgr(TempSetPtMgrNum).CtrlTypeMode) continue; + if (state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode != state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).CtrlTypeMode) continue; - for (CtrldNodeNum = 1; CtrldNodeNum <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrldNodeNum) { - for (TempCtrldNodeNum = 1; TempCtrldNodeNum <= AllSetPtMgr(TempSetPtMgrNum).NumCtrlNodes; ++TempCtrldNodeNum) { - if ((AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) == AllSetPtMgr(TempSetPtMgrNum).CtrlNodes(TempCtrldNodeNum)) && - AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) != 0) { - ShowWarningError(state, cValidSPMTypes(AllSetPtMgr(SetPtMgrNum).SPMType) + "=\"" + AllSetPtMgr(SetPtMgrNum).Name + "\""); + for (CtrldNodeNum = 1; CtrldNodeNum <= state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrldNodeNum) { + for (TempCtrldNodeNum = 1; TempCtrldNodeNum <= state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).NumCtrlNodes; ++TempCtrldNodeNum) { + if ((state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) == state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).CtrlNodes(TempCtrldNodeNum)) && + state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) != 0) { + ShowWarningError(state, format("{}=\"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).Name)); ShowContinueError(state, "...setpoint node conflicts with another setpoint manager."); - ShowContinueError(state, "...conflicting setpoint manager = " + cValidSPMTypes(AllSetPtMgr(TempSetPtMgrNum).SPMType) + - " \"" + AllSetPtMgr(TempSetPtMgrNum).Name + "\""); - ShowContinueError(state, "...conflicting node name = " + NodeID(AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum))); - ShowContinueError(state, "...control type variable = " + cValidCtrlTypes(AllSetPtMgr(SetPtMgrNum).CtrlTypeMode)); + ShowContinueError(state, format("...conflicting setpoint manager = {} \"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).Name)); + ShowContinueError(state, "...conflicting node name = " + NodeID(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum))); + ShowContinueError(state, format("...control type variable = {}", controlTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode))); // ErrorsFound=.TRUE. } } @@ -3830,31 +3502,29 @@ namespace SetPointManager { } else { // not a RAB setpoint manager // check just the control nodes for other types of SP managers - if (AllSetPtMgr(SetPtMgrNum).CtrlTypeMode != AllSetPtMgr(TempSetPtMgrNum).CtrlTypeMode) continue; + if (state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode != state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).CtrlTypeMode) continue; - for (CtrldNodeNum = 1; CtrldNodeNum <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrldNodeNum) { - for (TempCtrldNodeNum = 1; TempCtrldNodeNum <= AllSetPtMgr(TempSetPtMgrNum).NumCtrlNodes; ++TempCtrldNodeNum) { + for (CtrldNodeNum = 1; CtrldNodeNum <= state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrldNodeNum) { + for (TempCtrldNodeNum = 1; TempCtrldNodeNum <= state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).NumCtrlNodes; ++TempCtrldNodeNum) { - if (AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) != AllSetPtMgr(TempSetPtMgrNum).CtrlNodes(TempCtrldNodeNum)) + if (state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) != state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).CtrlNodes(TempCtrldNodeNum)) continue; // only warn if scheduled setpoint manager is setting mass flow rate on the same node used by RAB - if (AllSetPtMgr(SetPtMgrNum).SPMType == iSPMType_RAB || AllSetPtMgr(TempSetPtMgrNum).SPMType == iSPMType_RAB) { - ShowWarningError(state, cValidSPMTypes(AllSetPtMgr(SetPtMgrNum).SPMType) + "=\"" + AllSetPtMgr(SetPtMgrNum).Name + "\""); + if (state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType == SetPointManagerType::RAB || state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).SPMType == SetPointManagerType::RAB) { + ShowWarningError(state, format("{}=\"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).Name)); ShowContinueError(state, "...setpoint node conflicts with another setpoint manager."); - ShowContinueError(state, "...conflicting setpoint manager =" + cValidSPMTypes(AllSetPtMgr(TempSetPtMgrNum).SPMType) + ":\"" + - AllSetPtMgr(TempSetPtMgrNum).Name + "\""); - ShowContinueError(state, "...conflicting node name = " + NodeID(AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum))); - ShowContinueError(state, "...control type variable = " + cValidCtrlTypes(AllSetPtMgr(SetPtMgrNum).CtrlTypeMode)); + ShowContinueError(state, format("...conflicting setpoint manager ={}:\"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).Name)); + ShowContinueError(state, "...conflicting node name = " + NodeID(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum))); + ShowContinueError(state, format("...control type variable = {}", controlTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode))); ShowContinueError(state, "...return air bypass flow setpoint manager will have priority setting mass flow rate on this node."); } else { // severe error for other SP manager types - ShowWarningError(state, cValidSPMTypes(AllSetPtMgr(SetPtMgrNum).SPMType) + "=\"" + AllSetPtMgr(SetPtMgrNum).Name + "\""); + ShowWarningError(state, format("{}=\"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).Name)); ShowContinueError(state, "...setpoint node conflicts with another setpoint manager."); - ShowContinueError(state, "...conflicting setpoint manager = " + cValidSPMTypes(AllSetPtMgr(TempSetPtMgrNum).SPMType) + - ":\"" + AllSetPtMgr(TempSetPtMgrNum).Name + "\""); - ShowContinueError(state, "...conflicting node name = " + NodeID(AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum))); - ShowContinueError(state, "...control type variable = " + cValidCtrlTypes(AllSetPtMgr(SetPtMgrNum).CtrlTypeMode)); + ShowContinueError(state, format("...conflicting setpoint manager = {}:\"{}\"", managerTypeName(state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).SPMType), state.dataSetPointManager->AllSetPtMgr(TempSetPtMgrNum).Name)); + ShowContinueError(state, "...conflicting node name = " + NodeID(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum))); + ShowContinueError(state, format("...control type variable = {}", controlTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode))); // ErrorsFound=.TRUE. } } @@ -3953,19 +3623,19 @@ namespace SetPointManager { static int NumChiller(0); static int TypeOf_Num(0); - ManagerOn = true; + state.dataSetPointManager->ManagerOn = true; // One time initializations if (ZoneEquipInputsFilled && state.dataAirLoop->AirLoopInputsFilled) { // check that the zone equipment and air loop data has been read in - if (InitSetPointManagersOneTimeFlag) { + if (state.dataSetPointManager->InitSetPointManagersOneTimeFlag) { // "SetpointManager:SingleZone:Heating" - cSetPointManagerType = cValidSPMTypes(iSPMType_SZHeating); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZHtSetPtMgrs; ++SetPtMgrNum) { - ZoneInletNode = SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; - ZoneNode = SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum; + cSetPointManagerType = managerTypeName(SetPointManagerType::SZHeating); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZHtSetPtMgrs; ++SetPtMgrNum) { + ZoneInletNode = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; + ZoneNode = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum; // find the index in the ZoneEquipConfig array of the control zone (the one with the main or only thermostat) ConZoneNum = 0; for (ControlledZoneNum = 1; ControlledZoneNum <= state.dataGlobal->NumOfZones; ++ControlledZoneNum) { @@ -3974,19 +3644,19 @@ namespace SetPointManager { } } if (ConZoneNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SingZoneHtSetPtMgr(SetPtMgrNum).Name + "\", Zone Node not found:"); - ShowContinueError(state, "Node=\"" + NodeID(SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum) + "\", not found in any controlled Zone"); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).Name + "\", Zone Node not found:"); + ShowContinueError(state, "Node=\"" + NodeID(state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum) + "\", not found in any controlled Zone"); ErrorsFound = true; } else { bool found = false; for (int zoneInNode = 1; zoneInNode <= ZoneEquipConfig(ConZoneNum).NumInletNodes; ++zoneInNode) { - if (SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum == ZoneEquipConfig(ConZoneNum).InletNode(zoneInNode)) { + if (state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum == ZoneEquipConfig(ConZoneNum).InletNode(zoneInNode)) { found = true; } } if (!found) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SingZoneHtSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + - NodeID(SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + + NodeID(state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); ShowContinueError(state, "is not found in Zone = " + ZoneEquipConfig(ConZoneNum).ZoneName + ". Please check inputs."); ErrorsFound = true; } @@ -3994,10 +3664,10 @@ namespace SetPointManager { } // "SetpointManager:SingleZone:Cooling" - cSetPointManagerType = cValidSPMTypes(iSPMType_SZCooling); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZClSetPtMgrs; ++SetPtMgrNum) { - ZoneInletNode = SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; - ZoneNode = SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum; + cSetPointManagerType = managerTypeName(SetPointManagerType::SZCooling); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { + ZoneInletNode = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; + ZoneNode = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum; // find the index in the ZoneEquipConfig array of the control zone (the one with the main or only thermostat) ConZoneNum = 0; for (ControlledZoneNum = 1; ControlledZoneNum <= state.dataGlobal->NumOfZones; ++ControlledZoneNum) { @@ -4006,19 +3676,19 @@ namespace SetPointManager { } } if (ConZoneNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SingZoneClSetPtMgr(SetPtMgrNum).Name + "\", Zone Node not found:"); - ShowContinueError(state, "Node=\"" + NodeID(SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum) + "\", not found in any controlled Zone"); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).Name + "\", Zone Node not found:"); + ShowContinueError(state, "Node=\"" + NodeID(state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum) + "\", not found in any controlled Zone"); ErrorsFound = true; } else { bool found = false; for (int zoneInNode = 1; zoneInNode <= ZoneEquipConfig(ConZoneNum).NumInletNodes; ++zoneInNode) { - if (SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum == ZoneEquipConfig(ConZoneNum).InletNode(zoneInNode)) { + if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum == ZoneEquipConfig(ConZoneNum).InletNode(zoneInNode)) { found = true; } } if (!found) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SingZoneClSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + - NodeID(SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + + NodeID(state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); ShowContinueError(state, "is not found in Zone = " + ZoneEquipConfig(ConZoneNum).ZoneName + ". Please check inputs."); ErrorsFound = true; } @@ -4026,35 +3696,35 @@ namespace SetPointManager { } // Minimum humidity setpoint managers - cSetPointManagerType = cValidSPMTypes(iSPMType_SZMinHum); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { - for (SetZoneNum = 1; SetZoneNum <= SZMinHumSetPtMgr(SetPtMgrNum).NumZones; ++SetZoneNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::SZMinHum); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (SetZoneNum = 1; SetZoneNum <= state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).NumZones; ++SetZoneNum) { // set the actual and controlled zone numbers for (ControlledZoneNum = 1; ControlledZoneNum <= state.dataGlobal->NumOfZones; ++ControlledZoneNum) { - if (ZoneEquipConfig(ControlledZoneNum).ZoneNode == SZMinHumSetPtMgr(SetPtMgrNum).ZoneNodes(SetZoneNum)) { - SZMinHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(SetZoneNum) = ControlledZoneNum; - SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum) = ZoneEquipConfig(ControlledZoneNum).ActualZoneNum; + if (ZoneEquipConfig(ControlledZoneNum).ZoneNode == state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNodes(SetZoneNum)) { + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(SetZoneNum) = ControlledZoneNum; + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum) = ZoneEquipConfig(ControlledZoneNum).ActualZoneNum; break; } } // still need to validate... - if (SZMinHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(SetZoneNum) == 0) { // didn't find - ShowSevereError(state, cSetPointManagerType + "=\"" + SZMinHumSetPtMgr(SetPtMgrNum).Name + "\", invalid zone"); - ShowContinueError(state, "could not find Controlled Zone=" + Zone(SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)).Name); + if (state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(SetZoneNum) == 0) { // didn't find + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).Name + "\", invalid zone"); + ShowContinueError(state, "could not find Controlled Zone=" + Zone(state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)).Name); ErrorsFound = true; } else { // make sure humidity controlled zone HstatZoneFound = false; for (HStatZoneNum = 1; HStatZoneNum <= NumHumidityControlZones; ++HStatZoneNum) { - if (HumidityControlZone(HStatZoneNum).ActualZoneNum != SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)) continue; + if (HumidityControlZone(HStatZoneNum).ActualZoneNum != state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)) continue; HstatZoneFound = true; break; } if (!HstatZoneFound) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SZMinHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).Name + "\", invalid humidistat specification"); ShowContinueError(state, "could not locate Humidistat in Zone=" + - Zone(SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)).Name); + Zone(state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)).Name); ErrorsFound = true; } } @@ -4062,35 +3732,35 @@ namespace SetPointManager { } // Maximum humidity setpoint managers - cSetPointManagerType = cValidSPMTypes(iSPMType_SZMaxHum); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (SetZoneNum = 1; SetZoneNum <= SZMaxHumSetPtMgr(SetPtMgrNum).NumZones; ++SetZoneNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::SZMaxHum); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (SetZoneNum = 1; SetZoneNum <= state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).NumZones; ++SetZoneNum) { // set the actual and controlled zone numbers for (ControlledZoneNum = 1; ControlledZoneNum <= state.dataGlobal->NumOfZones; ++ControlledZoneNum) { - if (ZoneEquipConfig(ControlledZoneNum).ZoneNode == SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNodes(SetZoneNum)) { - SZMaxHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(SetZoneNum) = ControlledZoneNum; - SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum) = ZoneEquipConfig(ControlledZoneNum).ActualZoneNum; + if (ZoneEquipConfig(ControlledZoneNum).ZoneNode == state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNodes(SetZoneNum)) { + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(SetZoneNum) = ControlledZoneNum; + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum) = ZoneEquipConfig(ControlledZoneNum).ActualZoneNum; break; } } // still need to validate... - if (SZMaxHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(SetZoneNum) == 0) { // didn't find - ShowSevereError(state, cSetPointManagerType + "=\"" + SZMaxHumSetPtMgr(SetPtMgrNum).Name + "\", invalid zone"); - ShowContinueError(state, "could not find Controlled Zone=" + Zone(SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)).Name); + if (state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlZoneNum(SetZoneNum) == 0) { // didn't find + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).Name + "\", invalid zone"); + ShowContinueError(state, "could not find Controlled Zone=" + Zone(state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)).Name); ErrorsFound = true; } else { // make sure humidity controlled zone HstatZoneFound = false; for (HStatZoneNum = 1; HStatZoneNum <= NumHumidityControlZones; ++HStatZoneNum) { - if (HumidityControlZone(HStatZoneNum).ActualZoneNum != SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)) continue; + if (HumidityControlZone(HStatZoneNum).ActualZoneNum != state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)) continue; HstatZoneFound = true; break; } if (!HstatZoneFound) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SZMaxHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).Name + "\", invalid humidistat specification"); ShowContinueError(state, "could not locate Humidistat in Zone=" + - Zone(SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)).Name); + Zone(state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNum(SetZoneNum)).Name); ErrorsFound = true; } } @@ -4098,8 +3768,8 @@ namespace SetPointManager { } // single zone reheat setpoint manager - cSetPointManagerType = cValidSPMTypes(iSPMType_SZReheat); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZRhSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::SZReheat); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZRhSetPtMgrs; ++SetPtMgrNum) { FanNodeIn = 0; FanNodeOut = 0; MixedAirNode = 0; @@ -4107,8 +3777,8 @@ namespace SetPointManager { InletBranchNum = 0; LoopInNode = 0; bool LookForFan = false; - ZoneInletNode = SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; - ZoneNode = SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum; + ZoneInletNode = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; + ZoneNode = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum; // find the index in the ZoneEquipConfig array of the control zone (the one with the main or only thermostat) ConZoneNum = 0; for (ControlledZoneNum = 1; ControlledZoneNum <= state.dataGlobal->NumOfZones; ++ControlledZoneNum) { @@ -4117,25 +3787,25 @@ namespace SetPointManager { } } if (ConZoneNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SingZoneRhSetPtMgr(SetPtMgrNum).Name + "\", Zone Node not found:"); - ShowContinueError(state, "Node=\"" + NodeID(SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum) + "\", not found in any controlled Zone"); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).Name + "\", Zone Node not found:"); + ShowContinueError(state, "Node=\"" + NodeID(state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum) + "\", not found in any controlled Zone"); ErrorsFound = true; } else { bool found = false; for (int zoneInNode = 1; zoneInNode <= ZoneEquipConfig(ConZoneNum).NumInletNodes; ++zoneInNode) { - if (SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum == ZoneEquipConfig(ConZoneNum).InletNode(zoneInNode)) { + if (state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum == ZoneEquipConfig(ConZoneNum).InletNode(zoneInNode)) { found = true; AirLoopNum = ZoneEquipConfig(ConZoneNum).InletNodeAirLoopNum(zoneInNode); } } if (!found) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SingZoneRhSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + - NodeID(SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + + NodeID(state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); ShowContinueError(state, "is not found in Zone = " + ZoneEquipConfig(ConZoneNum).ZoneName + ". Please check inputs."); ErrorsFound = true; } if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + SingZoneRhSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node is not connected to an air loop."); ErrorsFound = true; continue; @@ -4179,96 +3849,95 @@ namespace SetPointManager { } } } - SingZoneRhSetPtMgr(SetPtMgrNum).FanNodeIn = FanNodeIn; - SingZoneRhSetPtMgr(SetPtMgrNum).FanNodeOut = FanNodeOut; - SingZoneRhSetPtMgr(SetPtMgrNum).MixedAirNode = MixedAirNode; - SingZoneRhSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; - SingZoneRhSetPtMgr(SetPtMgrNum).OAInNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).OAMixOAInNodeNum; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).FanNodeIn = FanNodeIn; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).FanNodeOut = FanNodeOut; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).MixedAirNode = MixedAirNode; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).OAInNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).OAMixOAInNodeNum; // this next line assumes that OA system is the first thing on the branch, what if there is a relief fan or heat recovery coil // or other component in there first? does it matter? - SingZoneRhSetPtMgr(SetPtMgrNum).RetNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).OASysInletNodeNum; - - SingZoneRhSetPtMgr(SetPtMgrNum).LoopInNode = LoopInNode; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).RetNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).OASysInletNodeNum; + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).LoopInNode = LoopInNode; } } // Warmest Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_Warmest); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::Warmest); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - WarmestSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + WarmestSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + WarmestSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - WarmestSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; } if (state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesCooled == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + WarmestSetPtMgr(SetPtMgrNum).Name + "\", no zones with cooling found:"); - ShowContinueError(state, "Air Loop provides no cooling, Air Loop=\"" + WarmestSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Name + "\", no zones with cooling found:"); + ShowContinueError(state, "Air Loop provides no cooling, Air Loop=\"" + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + WarmestSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; } } // Coldest Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_Coldest); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumColdestSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::Coldest); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumColdestSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - ColdestSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + ColdestSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + ColdestSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - ColdestSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; } if (state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesHeated == 0) { if (state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesCooled == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + ColdestSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Name + "\", no zones with heating or cooling found:"); - ShowContinueError(state, "Air Loop provides no heating or cooling, Air Loop=\"" + ColdestSetPtMgr(SetPtMgrNum).AirLoopName + + ShowContinueError(state, "Air Loop provides no heating or cooling, Air Loop=\"" + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + ColdestSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; } } // Warmest Temp Flow Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_WarmestTempFlow); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::WarmestTempFlow); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + WarmestSetPtMgrTempFlow(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName + "\"."); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum = AirLoopNum; - WarmestSetPtMgrTempFlow(SetPtMgrNum).SimReady = true; + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).SimReady = true; } if (state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesCooled == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + WarmestSetPtMgrTempFlow(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Name + "\", no zones with cooling found:"); - ShowContinueError(state, "Air Loop provides no cooling, Air Loop=\"" + WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName + "\"."); + ShowContinueError(state, "Air Loop provides no cooling, Air Loop=\"" + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + WarmestSetPtMgrTempFlow(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; @@ -4276,64 +3945,64 @@ namespace SetPointManager { } // return air bypass flow set manager - cSetPointManagerType = cValidSPMTypes(iSPMType_RAB); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumRABFlowSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::RAB); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumRABFlowSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - RABFlowSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); - AllSetPtMgr(RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex).AirLoopNum = AirLoopNum; - AllSetPtMgr(RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex).AirLoopName = RABFlowSetPtMgr(SetPtMgrNum).AirLoopName; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex).AirLoopNum = AirLoopNum; + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex).AirLoopName = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopName; if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + RABFlowSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + RABFlowSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - RABFlowSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).RABExists) { - RABFlowSetPtMgr(SetPtMgrNum).RABMixInNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).RABMixInNode; - RABFlowSetPtMgr(SetPtMgrNum).SupMixInNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).SupMixInNode; - RABFlowSetPtMgr(SetPtMgrNum).MixOutNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).MixOutNode; - RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).RABSplitOutNode; - RABFlowSetPtMgr(SetPtMgrNum).SysOutNode = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).AirLoopSupplyNodeNum(1); - RABFlowSetPtMgr(SetPtMgrNum).CtrlNodes(1) = RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode; - AllSetPtMgr(RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex).CtrlNodes(1) = - RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).RABMixInNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).RABMixInNode; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).SupMixInNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).SupMixInNode; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).MixOutNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).MixOutNode; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).RABSplitOutNode; + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).SysOutNode = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).AirLoopSupplyNodeNum(1); + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlNodes(1) = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode; + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AllSetPtMgrIndex).CtrlNodes(1) = + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode; } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + RABFlowSetPtMgr(SetPtMgrNum).Name + "\", no RAB in air loop found:"); - ShowContinueError(state, "Air Loop=\"" + RABFlowSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).Name + "\", no RAB in air loop found:"); + ShowContinueError(state, "Air Loop=\"" + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + RABFlowSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; } } // MultiZone Average Cooling Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_MZCoolingAverage); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::MZCoolingAverage); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageCoolingSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; } if (state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesCooled == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageCoolingSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).Name + "\", no zones with cooling found:"); - ShowContinueError(state, "Air Loop provides no cooling, Air Loop=\"" + MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName + + ShowContinueError(state, "Air Loop provides no cooling, Air Loop=\"" + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageCoolingSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; @@ -4341,18 +4010,18 @@ namespace SetPointManager { } // MultiZone Average Heating Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_MZHeatingAverage); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::MZHeatingAverage); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageHeatingSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; } // Commented out as we are using %NumZonesCooled instead of %NumZonesHeated for all systems for now // IF (state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum)%NumZonesHeated == 0) THEN @@ -4362,7 +4031,7 @@ namespace SetPointManager { // ErrorsFound = .TRUE. // END IF } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageHeatingSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; @@ -4370,33 +4039,33 @@ namespace SetPointManager { } // MultiZone Average Minimum Humidity Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_MZMinHumAverage); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::MZMinHumAverage); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageMinHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; // make sure humidity controlled zone HstatZoneFound = false; for (HStatZoneNum = 1; HStatZoneNum <= NumHumidityControlZones; ++HStatZoneNum) { for (ZonesCooledIndex = 1; - ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopNum).NumZonesCooled; + ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopNum).NumZonesCooled; ++ZonesCooledIndex) { if (HumidityControlZone(HStatZoneNum).ActualZoneNum != - state.dataAirLoop->AirToZoneNodeInfo(MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex)) + state.dataAirLoop->AirToZoneNodeInfo(state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex)) continue; HstatZoneFound = true; break; } } if (!HstatZoneFound) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageMinHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).Name + "\", invalid humidistat specification"); ShowContinueError(state, "could not locate Humidistat in any of the zones served by the Air loop=" + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name); @@ -4404,7 +4073,7 @@ namespace SetPointManager { } } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageMinHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; @@ -4412,33 +4081,33 @@ namespace SetPointManager { } // MultiZone Average Maximum Humidity Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_MZMaxHumAverage); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::MZMaxHumAverage); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; // make sure humidity controlled zone HstatZoneFound = false; for (HStatZoneNum = 1; HStatZoneNum <= NumHumidityControlZones; ++HStatZoneNum) { for (ZonesCooledIndex = 1; - ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum).NumZonesCooled; + ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum).NumZonesCooled; ++ZonesCooledIndex) { if (HumidityControlZone(HStatZoneNum).ActualZoneNum != - state.dataAirLoop->AirToZoneNodeInfo(MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex)) + state.dataAirLoop->AirToZoneNodeInfo(state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex)) continue; HstatZoneFound = true; break; } } if (!HstatZoneFound) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name + "\", invalid humidistat specification"); ShowContinueError(state, "could not locate Humidistat in any of the zones served by the Air loop=" + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name); @@ -4446,7 +4115,7 @@ namespace SetPointManager { } } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; @@ -4454,32 +4123,32 @@ namespace SetPointManager { } // Multizone Minimum Humidity Ratio Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_MZMinHum); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::MZMinHum); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZMinHumSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - MZMinHumSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; // make sure humidity controlled zone HstatZoneFound = false; for (HStatZoneNum = 1; HStatZoneNum <= NumHumidityControlZones; ++HStatZoneNum) { for (ZonesCooledIndex = 1; - ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(MZMinHumSetPtMgr(SetPtMgrNum).AirLoopNum).NumZonesCooled; + ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopNum).NumZonesCooled; ++ZonesCooledIndex) { if (HumidityControlZone(HStatZoneNum).ActualZoneNum != - state.dataAirLoop->AirToZoneNodeInfo(MZMinHumSetPtMgr(SetPtMgrNum).AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex)) + state.dataAirLoop->AirToZoneNodeInfo(state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex)) continue; HstatZoneFound = true; break; } } if (!HstatZoneFound) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZMinHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).Name + "\", invalid humidistat specification"); ShowContinueError(state, "could not locate Humidistat in any of the zones served by the Air loop=" + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name); @@ -4487,39 +4156,39 @@ namespace SetPointManager { } } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZMinHumSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; } } // Multizone Maximum Humidity Ratio Setpoint Managers - cSetPointManagerType = cValidSPMTypes(iSPMType_MZMaxHum); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::MZMaxHum); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { if (NumPrimaryAirSys > 0) { AirLoopNum = UtilityRoutines::FindItemInList( - MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName, state.dataAirLoop->AirToZoneNodeInfo, &AirLoopZoneEquipConnectData::AirLoopName); if (AirLoopNum == 0) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZMaxHumSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); - ShowContinueError(state, "Air Loop not found =\"" + MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).Name + "\", invalid Air Loop specified:"); + ShowContinueError(state, "Air Loop not found =\"" + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopName + "\"."); ErrorsFound = true; } else { - MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum = AirLoopNum; // make sure humidity controlled zone HstatZoneFound = false; for (HStatZoneNum = 1; HStatZoneNum <= NumHumidityControlZones; ++HStatZoneNum) { for (ZonesCooledIndex = 1; - ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum).NumZonesCooled; + ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum).NumZonesCooled; ++ZonesCooledIndex) { if (HumidityControlZone(HStatZoneNum).ActualZoneNum != - state.dataAirLoop->AirToZoneNodeInfo(MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex)) + state.dataAirLoop->AirToZoneNodeInfo(state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex)) continue; HstatZoneFound = true; break; } } if (!HstatZoneFound) { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZMaxHumSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).Name + "\", invalid humidistat specification"); ShowContinueError(state, "could not locate Humidistat in any of the zones served by the Air loop=" + state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name); @@ -4527,27 +4196,27 @@ namespace SetPointManager { } } } else { - ShowSevereError(state, cSetPointManagerType + "=\"" + MZMaxHumSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).Name + "\", no AirLoopHVAC objects found:"); ShowContinueError(state, "Setpoint Manager needs an AirLoopHVAC to operate."); ErrorsFound = true; } } // condenser entering water temperature reset setpoint manager - cSetPointManagerType = cValidSPMTypes(iSPMType_CondEntReset); - for (SetPtMgrNum = 1; SetPtMgrNum <= NumCondEntSetPtMgrs; ++SetPtMgrNum) { + cSetPointManagerType = managerTypeName(SetPointManagerType::CondEntReset); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumCondEntSetPtMgrs; ++SetPtMgrNum) { // Scan loops and find the loop index that includes the condenser cooling tower node used as setpoint for (LoopNum = 1; LoopNum <= NumCondLoops + NumPlantLoops; ++LoopNum) { // Begin demand side loops ... When condenser is added becomes NumLoops - for (CtrlNodeIndex = 1; CtrlNodeIndex <= CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - if (PlantLoop(LoopNum).TempSetPointNodeNum == CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + if (PlantLoop(LoopNum).TempSetPointNodeNum == state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).TotalComponents; ++CompNum) { // Check if cooling tower is single speed and generate and error TypeOf_Num = PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; if (TypeOf_Num == TypeOf_CoolingTower_SingleSpd) { - ShowSevereError(state, cSetPointManagerType + "=\"" + CondEntSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).Name + "\", invalid tower found"); ShowContinueError(state, "Found SingleSpeed Cooling Tower, Cooling Tower=" + PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Name); @@ -4581,17 +4250,17 @@ namespace SetPointManager { .Branch(BranchNumPlantSide) .Comp(CompNumPlantSide) .TypeOf_Num == TypeNum) { - CondEntSetPtMgr(SetPtMgrNum).LoopIndexPlantSide = LoopNum2; - CondEntSetPtMgr(SetPtMgrNum).ChillerIndexPlantSide = CompNumPlantSide; - CondEntSetPtMgr(SetPtMgrNum).BranchIndexPlantSide = BranchNumPlantSide; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).LoopIndexPlantSide = LoopNum2; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).ChillerIndexPlantSide = CompNumPlantSide; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).BranchIndexPlantSide = BranchNumPlantSide; } } } } - CondEntSetPtMgr(SetPtMgrNum).TypeNum = TypeNum; - CondEntSetPtMgr(SetPtMgrNum).LoopIndexDemandSide = LoopNum; - CondEntSetPtMgr(SetPtMgrNum).ChillerIndexDemandSide = CompNum; - CondEntSetPtMgr(SetPtMgrNum).BranchIndexDemandSide = BranchNum; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).TypeNum = TypeNum; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).LoopIndexDemandSide = LoopNum; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).ChillerIndexDemandSide = CompNum; + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).BranchIndexDemandSide = BranchNum; } } } @@ -4601,35 +4270,35 @@ namespace SetPointManager { } // Ideal condenser entering water temperature reset setpoint manager - cSetPointManagerType = cValidSPMTypes(iSPMType_IdealCondEntReset); + cSetPointManagerType = managerTypeName(SetPointManagerType::IdealCondEntReset); NumChiller = 0; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { // Scan loops and find the loop index that includes the condenser cooling tower node used as setpoint for (LoopNum = 1; LoopNum <= NumCondLoops + NumPlantLoops; ++LoopNum) { // Begin demand side loops ... When condenser is added becomes NumLoops - for (CtrlNodeIndex = 1; CtrlNodeIndex <= IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - if (PlantLoop(LoopNum).TempSetPointNodeNum == IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + if (PlantLoop(LoopNum).TempSetPointNodeNum == state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).TotalComponents; ++CompNum) { // Check if cooling tower is single speed and generate and error TypeOf_Num = PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; if (TypeOf_Num == TypeOf_CoolingTower_SingleSpd) { - ShowSevereError(state, cSetPointManagerType + "=\"" + IdealCondEntSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).Name + "\", invalid cooling tower found"); ShowContinueError(state, "Found Single Speed Cooling Tower, Cooling Tower=" + PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Name); ShowContinueError(state, "SingleSpeed cooling towers cannot be used with this setpoint manager on each loop"); ErrorsFound = true; } else if (TypeOf_Num == TypeOf_CoolingTower_TwoSpd || TypeOf_Num == TypeOf_CoolingTower_VarSpd) { - IdealCondEntSetPtMgr(SetPtMgrNum).CondTowerBranchNum.push_back(BranchNum); - IdealCondEntSetPtMgr(SetPtMgrNum).TowerNum.push_back(CompNum); - IdealCondEntSetPtMgr(SetPtMgrNum).numTowers++; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CondTowerBranchNum.push_back(BranchNum); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).TowerNum.push_back(CompNum); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).numTowers++; } // Scan the pump on the condenser water loop if (TypeOf_Num == TypeOf_PumpVariableSpeed || TypeOf_Num == TypeOf_PumpConstantSpeed) { - IdealCondEntSetPtMgr(SetPtMgrNum).CondPumpNum = CompNum; - IdealCondEntSetPtMgr(SetPtMgrNum).CondPumpBranchNum = BranchNum; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CondPumpNum = CompNum; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CondPumpBranchNum = BranchNum; } } } @@ -4660,9 +4329,9 @@ namespace SetPointManager { .TypeOf_Num; if (TypeOf_Num == TypeNum) { ++NumChiller; - IdealCondEntSetPtMgr(SetPtMgrNum).LoopIndexPlantSide = LoopNum2; - IdealCondEntSetPtMgr(SetPtMgrNum).ChillerIndexPlantSide = CompNumPlantSide; - IdealCondEntSetPtMgr(SetPtMgrNum).BranchIndexPlantSide = BranchNumPlantSide; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).LoopIndexPlantSide = LoopNum2; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ChillerIndexPlantSide = CompNumPlantSide; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).BranchIndexPlantSide = BranchNumPlantSide; // Scan the pump on the chilled water loop for (BranchNum2 = 1; BranchNum2 <= PlantLoop(LoopNum2).LoopSide(SupplySide).TotalBranches; ++BranchNum2) { @@ -4677,8 +4346,8 @@ namespace SetPointManager { .TypeOf_Num; if (TypeOf_Num == TypeOf_PumpVariableSpeed || TypeOf_Num == TypeOf_PumpConstantSpeed) { - IdealCondEntSetPtMgr(SetPtMgrNum).ChilledPumpNum = CompNum2; - IdealCondEntSetPtMgr(SetPtMgrNum).ChilledPumpBranchNum = BranchNum2; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ChilledPumpNum = CompNum2; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ChilledPumpBranchNum = BranchNum2; } } } @@ -4687,15 +4356,15 @@ namespace SetPointManager { } } if (NumChiller > 1) { - ShowSevereError(state, cSetPointManagerType + "=\"" + IdealCondEntSetPtMgr(SetPtMgrNum).Name + + ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).Name + "\", too many chillers found"); ShowContinueError(state, "only one chiller can be used with this setpoint manager on each loop"); ShowContinueError(state, "Found more than one chiller, chiller =" + PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).Name); ErrorsFound = true; } - IdealCondEntSetPtMgr(SetPtMgrNum).TypeNum = TypeNum; - IdealCondEntSetPtMgr(SetPtMgrNum).CondLoopNum = LoopNum; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).TypeNum = TypeNum; + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CondLoopNum = LoopNum; } } } @@ -4708,441 +4377,441 @@ namespace SetPointManager { VerifySetPointManagers(state, ErrorsFound); } - InitSetPointManagersOneTimeFlag = false; + state.dataSetPointManager->InitSetPointManagersOneTimeFlag = false; if (ErrorsFound) { ShowFatalError(state, "InitSetPointManagers: Errors found in getting SetPointManager input."); } } - if ((state.dataGlobal->BeginEnvrnFlag && InitSetPointManagersMyEnvrnFlag) || InitSetPointManagersOneTimeFlag2) { + if ((state.dataGlobal->BeginEnvrnFlag && state.dataSetPointManager->InitSetPointManagersMyEnvrnFlag) || state.dataSetPointManager->InitSetPointManagersOneTimeFlag2) { - ManagerOn = false; + state.dataSetPointManager->ManagerOn = false; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSchSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSchSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number // Initialize scheduled setpoints { - auto const SELECT_CASE_var(SchSetPtMgr(SetPtMgrNum).CtrlTypeMode); - if (SELECT_CASE_var == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); - } else if (SELECT_CASE_var == iCtrlVarType_MaxTemp) { - Node(NodeNum).TempSetPointHi = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); - } else if (SELECT_CASE_var == iCtrlVarType_MinTemp) { - Node(NodeNum).TempSetPointLo = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); - } else if (SELECT_CASE_var == iCtrlVarType_HumRat) { - Node(NodeNum).HumRatSetPoint = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); - } else if (SELECT_CASE_var == iCtrlVarType_MaxHumRat) { - Node(NodeNum).HumRatMax = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); - } else if (SELECT_CASE_var == iCtrlVarType_MinHumRat) { - Node(NodeNum).HumRatMin = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); - } else if (SELECT_CASE_var == iCtrlVarType_MassFlow) { - Node(NodeNum).MassFlowRateSetPoint = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); - } else if (SELECT_CASE_var == iCtrlVarType_MaxMassFlow) { - Node(NodeNum).MassFlowRateMax = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); - } else if (SELECT_CASE_var == iCtrlVarType_MinMassFlow) { - Node(NodeNum).MassFlowRateMin = GetCurrentScheduleValue(state, SchSetPtMgr(SetPtMgrNum).SchedPtr); + auto const SELECT_CASE_var(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode); + if (SELECT_CASE_var == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); + } else if (SELECT_CASE_var == iCtrlVarType::MaxTemp) { + Node(NodeNum).TempSetPointHi = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); + } else if (SELECT_CASE_var == iCtrlVarType::MinTemp) { + Node(NodeNum).TempSetPointLo = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); + } else if (SELECT_CASE_var == iCtrlVarType::HumRat) { + Node(NodeNum).HumRatSetPoint = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); + } else if (SELECT_CASE_var == iCtrlVarType::MaxHumRat) { + Node(NodeNum).HumRatMax = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); + } else if (SELECT_CASE_var == iCtrlVarType::MinHumRat) { + Node(NodeNum).HumRatMin = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); + } else if (SELECT_CASE_var == iCtrlVarType::MassFlow) { + Node(NodeNum).MassFlowRateSetPoint = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); + } else if (SELECT_CASE_var == iCtrlVarType::MaxMassFlow) { + Node(NodeNum).MassFlowRateMax = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); + } else if (SELECT_CASE_var == iCtrlVarType::MinMassFlow) { + Node(NodeNum).MassFlowRateMin = GetCurrentScheduleValue(state, state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SchedPtr); } } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumDualSchSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= DualSchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = DualSchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPointHi = GetCurrentScheduleValue(state, DualSchSetPtMgr(SetPtMgrNum).SchedPtrHi); - Node(NodeNum).TempSetPointLo = GetCurrentScheduleValue(state, DualSchSetPtMgr(SetPtMgrNum).SchedPtrLo); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumDualSchSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPointHi = GetCurrentScheduleValue(state, state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SchedPtrHi); + Node(NodeNum).TempSetPointLo = GetCurrentScheduleValue(state, state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SchedPtrLo); Node(NodeNum).TempSetPoint = (Node(NodeNum).TempSetPointHi + Node(NodeNum).TempSetPointLo) / 2.0; } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumOutAirSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= OutAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - OutAirSetPtMgr(SetPtMgrNum).calculate(state); - NodeNum = OutAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = OutAirSetPtMgr(SetPtMgrNum).SetPt; - } else if (OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { - Node(NodeNum).TempSetPointHi = OutAirSetPtMgr(SetPtMgrNum).SetPt; - } else if (OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { - Node(NodeNum).TempSetPointLo = OutAirSetPtMgr(SetPtMgrNum).SetPt; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumOutAirSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).calculate(state); + NodeNum = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SetPt; + } else if (state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { + Node(NodeNum).TempSetPointHi = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SetPt; + } else if (state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { + Node(NodeNum).TempSetPointLo = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SetPt; } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { // Minimum humidity setpoint managers - for (ZoneIndex = 1; ZoneIndex <= SZMinHumSetPtMgr(SetPtMgrNum).NumZones; ++ZoneIndex) { - ZoneNode = SZMinHumSetPtMgr(SetPtMgrNum).ZoneNodes(ZoneIndex); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { // Minimum humidity setpoint managers + for (ZoneIndex = 1; ZoneIndex <= state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).NumZones; ++ZoneIndex) { + ZoneNode = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).ZoneNodes(ZoneIndex); Node(ZoneNode).MassFlowRate = 0.0; } - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number Node(NodeNum).HumRatMin = 0.007; // Set the setpoint } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { // Maximum humidity setpoint managers - for (ZoneIndex = 1; ZoneIndex <= SZMaxHumSetPtMgr(SetPtMgrNum).NumZones; ++ZoneIndex) { - ZoneNode = SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNodes(ZoneIndex); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { // Maximum humidity setpoint managers + for (ZoneIndex = 1; ZoneIndex <= state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).NumZones; ++ZoneIndex) { + ZoneNode = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).ZoneNodes(ZoneIndex); Node(ZoneNode).MassFlowRate = 0.0; } - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number Node(NodeNum).HumRatMax = 0.011; // Set the setpoint } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZRhSetPtMgrs; ++SetPtMgrNum) { // single zone reheat setpoint managers - ZoneInletNode = SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; - ZoneNode = SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZRhSetPtMgrs; ++SetPtMgrNum) { // single zone reheat setpoint managers + ZoneInletNode = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; + ZoneNode = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).ZoneNodeNum; Node(ZoneInletNode).MassFlowRate = 0.0; Node(ZoneNode).MassFlowRate = 0.0; - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SingZoneRhSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZHtSetPtMgrs; ++SetPtMgrNum) { // single zone heating setpoint managers - ZoneInletNode = SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; - ZoneNode = SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZHtSetPtMgrs; ++SetPtMgrNum) { // single zone heating setpoint managers + ZoneInletNode = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; + ZoneNode = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).ZoneNodeNum; Node(ZoneInletNode).MassFlowRate = 0.0; Node(ZoneNode).MassFlowRate = 0.0; - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SingZoneHtSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZClSetPtMgrs; ++SetPtMgrNum) { // single zone cooling setpoint managers - ZoneInletNode = SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; - ZoneNode = SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { // single zone cooling setpoint managers + ZoneInletNode = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum; + ZoneNode = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).ZoneNodeNum; Node(ZoneInletNode).MassFlowRate = 0.0; Node(ZoneNode).MassFlowRate = 0.0; - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SingZoneClSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMixedAirSetPtMgrs; ++SetPtMgrNum) { // mixed air setpoint managers - - Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).MassFlowRate = 0.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).MassFlowRate = 0.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).MassFlowRate = 0.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).Temp = 20.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Temp = 20.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Temp = 20.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).HumRat = OutHumRat; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).HumRat = OutHumRat; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).HumRat = OutHumRat; - Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).Quality = 1.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Quality = 1.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Quality = 1.0; - Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).Press = OutBaroPress; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Press = OutBaroPress; - Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Press = OutBaroPress; - Node(MixedAirSetPtMgr(SetPtMgrNum).RefNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); - Node(MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); - Node(MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMixedAirSetPtMgrs; ++SetPtMgrNum) { // mixed air setpoint managers + + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode).MassFlowRate = 0.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanInNode).MassFlowRate = 0.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).MassFlowRate = 0.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode).Temp = 20.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Temp = 20.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Temp = 20.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode).HumRat = OutHumRat; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanInNode).HumRat = OutHumRat; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).HumRat = OutHumRat; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode).Quality = 1.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Quality = 1.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Quality = 1.0; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode).Press = OutBaroPress; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Press = OutBaroPress; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Press = OutBaroPress; + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).RefNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).FanOutNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumOAPretreatSetPtMgrs; ++SetPtMgrNum) { // Outside Air Pretreat setpoint managers - - Node(OAPretreatSetPtMgr(SetPtMgrNum).RefNode).MassFlowRate = 0.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).MassFlowRate = 0.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).MassFlowRate = 0.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).MassFlowRate = 0.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Temp = 20.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Temp = 20.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Temp = 20.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Temp = 20.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).RefNode).HumRat = OutHumRat; - Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).HumRat = OutHumRat; - Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).HumRat = OutHumRat; - Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).HumRat = OutHumRat; - Node(OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Quality = 1.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Quality = 1.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Quality = 1.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Quality = 1.0; - Node(OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Press = OutBaroPress; - Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Press = OutBaroPress; - Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Press = OutBaroPress; - Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Press = OutBaroPress; - Node(OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); - Node(OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); - Node(OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); - Node(OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); - for (CtrlNodeIndex = 1; CtrlNodeIndex <= OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumOAPretreatSetPtMgrs; ++SetPtMgrNum) { // Outside Air Pretreat setpoint managers + + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode).MassFlowRate = 0.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).MassFlowRate = 0.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).MassFlowRate = 0.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).MassFlowRate = 0.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Temp = 20.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Temp = 20.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Temp = 20.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Temp = 20.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode).HumRat = OutHumRat; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).HumRat = OutHumRat; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).HumRat = OutHumRat; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).HumRat = OutHumRat; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Quality = 1.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Quality = 1.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Quality = 1.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Quality = 1.0; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Press = OutBaroPress; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Press = OutBaroPress; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Press = OutBaroPress; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Press = OutBaroPress; + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).RefNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).MixedOutNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).OAInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + Node(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).ReturnInNode).Enthalpy = PsyHFnTdbW(DataPrecisionGlobals::constant_twenty, OutHumRat); + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } - if (OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxHumRat) { + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxHumRat) { Node(NodeNum).HumRatMax = OutHumRat; // Set the setpoint } - if (OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinHumRat) { + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinHumRat) { Node(NodeNum).HumRatMin = OutHumRat; // Set the setpoint } - if (OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_HumRat) { + if (state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::HumRat) { Node(NodeNum).HumRatSetPoint = OutHumRat; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= WarmestSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = WarmestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumColdestSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= ColdestSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = ColdestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumColdestSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= WarmestSetPtMgrTempFlow(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the temperature setpoint - if (WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum != 0) { - state.dataAirLoop->AirLoopFlow(WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum).ReqSupplyFrac = 1.0; // PH 10/09/04 Set the flow - state.dataAirLoop->AirLoopControlInfo(WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum).LoopFlowRateSet = true; // PH 10/09/04 Set the flag + if (state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum != 0) { + state.dataAirLoop->AirLoopFlow(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum).ReqSupplyFrac = 1.0; // PH 10/09/04 Set the flow + state.dataAirLoop->AirLoopControlInfo(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum).LoopFlowRateSet = true; // PH 10/09/04 Set the flag } } } } if (ZoneEquipInputsFilled && state.dataAirLoop->AirLoopInputsFilled) { - for (SetPtMgrNum = 1; SetPtMgrNum <= NumRABFlowSetPtMgrs; ++SetPtMgrNum) { - NodeNum = RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode; - if (RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MassFlow) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumRABFlowSetPtMgrs; ++SetPtMgrNum) { + NodeNum = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode; + if (state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MassFlow) { Node(NodeNum).MassFlowRateSetPoint = 0.0; } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number Node(NodeNum).HumRatMin = 0.007; // Set the setpoint } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number Node(NodeNum).HumRatMax = 0.011; // Set the setpoint } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number Node(NodeNum).HumRatMin = 0.007; // Set the setpoint } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number Node(NodeNum).HumRatMax = 0.011; // Set the setpoint } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumFollowOATempSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= FollowOATempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefTempType_WetBulb) { - if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumFollowOATempSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceTempType::WetBulb) { + if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = OutWetBulbTemp; // Set the setpoint - } else if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = OutWetBulbTemp; // Set the setpoint - } else if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = OutWetBulbTemp; // Set the setpoint } - } else if (FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefTempType_DryBulb) { - if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + } else if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceTempType::DryBulb) { + if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = OutDryBulbTemp; // Set the setpoint - } else if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = OutDryBulbTemp; // Set the setpoint - } else if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = OutDryBulbTemp; // Set the setpoint } } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumFollowSysNodeTempSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= FollowSysNodeTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (CheckOutAirNodeNumber(state, FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum)) { - if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefTempType_WetBulb) { - Node(FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum).SPMNodeWetBulbRepReq = true; - if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (CheckOutAirNodeNumber(state, state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum)) { + if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceTempType::WetBulb) { + Node(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum).SPMNodeWetBulbRepReq = true; + if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = OutWetBulbTemp; // Set the setpoint - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = OutWetBulbTemp; // Set the setpoint - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = OutWetBulbTemp; // Set the setpoint } - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefTempType_DryBulb) { - if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceTempType::DryBulb) { + if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = OutDryBulbTemp; // Set the setpoint - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = OutDryBulbTemp; // Set the setpoint - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = OutDryBulbTemp; // Set the setpoint } } } else { // If reference node is a water node, then set RefTypeMode to NodeDryBulb - if (Node(FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum).FluidType == NodeType_Water) { - FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode = iRefTempType_DryBulb; - } else if (Node(FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum).FluidType == NodeType_Air) { - if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefTempType_WetBulb) { - Node(FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum).SPMNodeWetBulbRepReq = true; + if (Node(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum).FluidType == NodeType_Water) { + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode = ReferenceTempType::DryBulb; + } else if (Node(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum).FluidType == NodeType_Air) { + if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceTempType::WetBulb) { + Node(state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).RefNodeNum).SPMNodeWetBulbRepReq = true; } } - if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = 20.0; // Set the setpoint - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = 20.0; // Set the setpoint - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = 20.0; // Set the setpoint } } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumGroundTempSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= GroundTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefGroundTempObjType_BuildingSurface) { - if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumGroundTempSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceGroundTempObjectType::BuildingSurface) { + if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = GroundTemp; // Set the setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = GroundTemp; // Set the setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = GroundTemp; // Set the setpoint } - } else if (GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefGroundTempObjType_Shallow) { - if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceGroundTempObjectType::Shallow) { + if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = GroundTemp_Surface; // Set the setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = GroundTemp_Surface; // Set the setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = GroundTemp_Surface; // Set the setpoint } - } else if (GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefGroundTempObjType_Deep) { - if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceGroundTempObjectType::Deep) { + if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = GroundTemp_Deep; // Set the setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = GroundTemp_Deep; // Set the setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = GroundTemp_Deep; // Set the setpoint } - } else if (GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode == iRefGroundTempObjType_FCfactorMethod) { - if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).RefTypeMode == ReferenceGroundTempObjectType::FCFactorMethod) { + if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { Node(NodeNum).TempSetPoint = GroundTempFC; // Set the setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { Node(NodeNum).TempSetPointHi = GroundTempFC; // Set the setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { Node(NodeNum).TempSetPointLo = GroundTempFC; // Set the setpoint } } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumCondEntSetPtMgrs; ++SetPtMgrNum) { // Condenser entering water Set point managers - for (CtrlNodeIndex = 1; CtrlNodeIndex <= CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = GetCurrentScheduleValue(state, CondEntSetPtMgr(SetPtMgrNum).CondEntTempSchedPtr); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumCondEntSetPtMgrs; ++SetPtMgrNum) { // Condenser entering water Set point managers + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = GetCurrentScheduleValue(state, state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CondEntTempSchedPtr); } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { // Ideal Condenser entering water Set point managers - for (CtrlNodeIndex = 1; CtrlNodeIndex <= IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = IdealCondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { // Ideal Condenser entering water Set point managers + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).MaxCondEntTemp; } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZOneStageCoolingSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZOneStageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CoolingOffTemp; } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZOneStageHeatingSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZOneStageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).HeatingOffTemp; } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumReturnWaterResetChWSetPtMgrs; ++SetPtMgrNum) { - Node(ReturnWaterResetChWSetPtMgr(SetPtMgrNum).supplyNodeIndex).TempSetPoint = - ReturnWaterResetChWSetPtMgr(SetPtMgrNum).minimumChilledWaterSetpoint; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs; ++SetPtMgrNum) { + Node(state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).supplyNodeIndex).TempSetPoint = + state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum).minimumChilledWaterSetpoint; } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumReturnWaterResetHWSetPtMgrs; ++SetPtMgrNum) { - Node(ReturnWaterResetHWSetPtMgr(SetPtMgrNum).supplyNodeIndex).TempSetPoint = - ReturnWaterResetHWSetPtMgr(SetPtMgrNum).maximumHotWaterSetpoint; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumReturnWaterResetHWSetPtMgrs; ++SetPtMgrNum) { + Node(state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).supplyNodeIndex).TempSetPoint = + state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum).maximumHotWaterSetpoint; } - InitSetPointManagersMyEnvrnFlag = false; - if (!InitSetPointManagersOneTimeFlag) InitSetPointManagersOneTimeFlag2 = false; + state.dataSetPointManager->InitSetPointManagersMyEnvrnFlag = false; + if (!state.dataSetPointManager->InitSetPointManagersOneTimeFlag) state.dataSetPointManager->InitSetPointManagersOneTimeFlag2 = false; if (ErrorsFound) { ShowFatalError(state, "InitSetPointManagers: Errors found. Program Terminates."); @@ -5150,7 +4819,7 @@ namespace SetPointManager { } // end begin environment inits if (!state.dataGlobal->BeginEnvrnFlag) { - InitSetPointManagersMyEnvrnFlag = true; + state.dataSetPointManager->InitSetPointManagersMyEnvrnFlag = true; } } @@ -5209,184 +4878,184 @@ namespace SetPointManager { // The Scheduled Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSchSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSchSetPtMgrs; ++SetPtMgrNum) { - SchSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).calculate(state); } // The Scheduled TES Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSchTESSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSchTESSetPtMgrs; ++SetPtMgrNum) { - SchTESSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->SchTESSetPtMgr(SetPtMgrNum).calculate(state); } // The Scheduled Dual Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumDualSchSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumDualSchSetPtMgrs; ++SetPtMgrNum) { - DualSchSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).calculate(state); } // The Outside Air Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumOutAirSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumOutAirSetPtMgrs; ++SetPtMgrNum) { - OutAirSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).calculate(state); } // The Single Zone Reheat Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZRhSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZRhSetPtMgrs; ++SetPtMgrNum) { - SingZoneRhSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).calculate(state); } // The Single Zone Heating Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZHtSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZHtSetPtMgrs; ++SetPtMgrNum) { - SingZoneHtSetPtMgr(SetPtMgrNum).calculate(); + state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).calculate(); } // The Single Zone Cooling Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZClSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { - SingZoneClSetPtMgr(SetPtMgrNum).calculate(); + state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).calculate(); } // The Single Zone Minimum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { - SZMinHumSetPtMgr(SetPtMgrNum).calculate(); + state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).calculate(); } // The Single Zone Maximum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { - SZMaxHumSetPtMgr(SetPtMgrNum).calculate(); + state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).calculate(); } // The Warmest Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrs; ++SetPtMgrNum) { - WarmestSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).calculate(state); } // The Coldest Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumColdestSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumColdestSetPtMgrs; ++SetPtMgrNum) { - ColdestSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).calculate(state); } // The Warmest Temp Flow Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { - WarmestSetPtMgrTempFlow(SetPtMgrNum).calculate(state); + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).calculate(state); } // The RAB Temp Flow Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumRABFlowSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumRABFlowSetPtMgrs; ++SetPtMgrNum) { - RABFlowSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).calculate(state); } // The Multizone Average Cooling Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { - MZAverageCoolingSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).calculate(state); } // The Multizone Average Heating Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { - MZAverageHeatingSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).calculate(state); } // The Multizone Average Minimum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { - MZAverageMinHumSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).calculate(state); } // The Multizone Average Maximum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { - MZAverageMaxHumSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).calculate(state); } // The Multizone Minimum Humidity Ratio Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { - MZMinHumSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).calculate(state); } // The Multizone Maximum Humidity Ratio Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { - MZMaxHumSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).calculate(state); } // The Follow Outdoor Air Temperature Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumFollowOATempSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumFollowOATempSetPtMgrs; ++SetPtMgrNum) { - FollowOATempSetPtMgr(SetPtMgrNum).calculate(); + state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).calculate(); } // The Follow System Node Temp Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumFollowSysNodeTempSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs; ++SetPtMgrNum) { - FollowSysNodeTempSetPtMgr(SetPtMgrNum).calculate(); + state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).calculate(); } // The Ground Temp Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumGroundTempSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumGroundTempSetPtMgrs; ++SetPtMgrNum) { - GroundTempSetPtMgr(SetPtMgrNum).calculate(); + state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).calculate(); } // The Condenser Entering Water Temperature Set Point Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumCondEntSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumCondEntSetPtMgrs; ++SetPtMgrNum) { - CondEntSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).calculate(state); } // The Ideal Condenser Entering Water Temperature Set Point Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { - IdealCondEntSetPtMgr(SetPtMgrNum).calculate(state); + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).calculate(state); } // the single zone cooling on/off staged control setpoint managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZOneStageCoolingSetPtMgrs; ++SetPtMgrNum) { - SZOneStageCoolingSetPtMgr(SetPtMgrNum).calculate(); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs; ++SetPtMgrNum) { + state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).calculate(); } // the single zone heating on/off staged control setpoint managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZOneStageHeatingSetPtMgrs; ++SetPtMgrNum) { - SZOneStageHeatingSetPtMgr(SetPtMgrNum).calculate(); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs; ++SetPtMgrNum) { + state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).calculate(); } // return water reset - for (SetPtMgrNum = 1; SetPtMgrNum <= NumReturnWaterResetChWSetPtMgrs; ++SetPtMgrNum) { - auto &returnWaterSPM(ReturnWaterResetChWSetPtMgr(SetPtMgrNum)); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs; ++SetPtMgrNum) { + auto &returnWaterSPM(state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum)); returnWaterSPM.calculate(state, Node(returnWaterSPM.returnNodeIndex), Node(returnWaterSPM.supplyNodeIndex)); } // hot-water return water reset - for (SetPtMgrNum = 1; SetPtMgrNum <= NumReturnWaterResetHWSetPtMgrs; ++SetPtMgrNum) { - auto &returnWaterSPM(ReturnWaterResetHWSetPtMgr(SetPtMgrNum)); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumReturnWaterResetHWSetPtMgrs; ++SetPtMgrNum) { + auto &returnWaterSPM(state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum)); returnWaterSPM.calculate(state, Node(returnWaterSPM.returnNodeIndex), Node(returnWaterSPM.supplyNodeIndex)); } } @@ -6147,24 +5816,24 @@ namespace SetPointManager { { auto const SELECT_CASE_var(this->CtrlTypeMode); - if (SELECT_CASE_var == iCtrlVarType_Temp) { // 'Temperature' + if (SELECT_CASE_var == iCtrlVarType::Temp) { // 'Temperature' RefNodeSetPoint = Node(RefNode).TempSetPoint; ReturnInValue = Node(ReturnInNode).Temp; MinSetPoint = this->MinSetTemp; MaxSetPoint = this->MaxSetTemp; - } else if (SELECT_CASE_var == iCtrlVarType_MaxHumRat) { // 'HUMRATMAX' + } else if (SELECT_CASE_var == iCtrlVarType::MaxHumRat) { // 'HUMRATMAX' RefNodeSetPoint = Node(RefNode).HumRatMax; ReturnInValue = Node(ReturnInNode).HumRat; MinSetPoint = this->MinSetHumRat; MaxSetPoint = this->MaxSetHumRat; HumiditySetPoint = true; - } else if (SELECT_CASE_var == iCtrlVarType_MinHumRat) { // 'HUMRATMIN' + } else if (SELECT_CASE_var == iCtrlVarType::MinHumRat) { // 'HUMRATMIN' RefNodeSetPoint = Node(RefNode).HumRatMin; ReturnInValue = Node(ReturnInNode).HumRat; MinSetPoint = this->MinSetHumRat; MaxSetPoint = this->MaxSetHumRat; HumiditySetPoint = true; - } else if (SELECT_CASE_var == iCtrlVarType_HumRat) { // 'HumidityRatio' + } else if (SELECT_CASE_var == iCtrlVarType::HumRat) { // 'HumidityRatio' RefNodeSetPoint = Node(RefNode).HumRatSetPoint; ReturnInValue = Node(ReturnInNode).HumRat; MinSetPoint = this->MinSetHumRat; @@ -6185,13 +5854,13 @@ namespace SetPointManager { bool LocalSetPointCheckFailed = false; { auto const SELECT_CASE_var(this->CtrlTypeMode); - if (SELECT_CASE_var == iCtrlVarType_Temp) { // 'Temperature' + if (SELECT_CASE_var == iCtrlVarType::Temp) { // 'Temperature' CheckIfNodeSetPointManagedByEMS(state, RefNode, iTemperatureSetPoint, LocalSetPointCheckFailed); - } else if (SELECT_CASE_var == iCtrlVarType_MaxHumRat) { // 'HUMRATMAX' + } else if (SELECT_CASE_var == iCtrlVarType::MaxHumRat) { // 'HUMRATMAX' CheckIfNodeSetPointManagedByEMS(state, RefNode, iHumidityRatioMaxSetPoint, LocalSetPointCheckFailed); - } else if (SELECT_CASE_var == iCtrlVarType_MinHumRat) { // 'HUMRATMIN' + } else if (SELECT_CASE_var == iCtrlVarType::MinHumRat) { // 'HUMRATMIN' CheckIfNodeSetPointManagedByEMS(state, RefNode, iHumidityRatioMinSetPoint, LocalSetPointCheckFailed); - } else if (SELECT_CASE_var == iCtrlVarType_HumRat) { // 'HumidityRatio' + } else if (SELECT_CASE_var == iCtrlVarType::HumRat) { // 'HumidityRatio' CheckIfNodeSetPointManagedByEMS(state, RefNode, iHumidityRatioSetPoint, LocalSetPointCheckFailed); } } @@ -6461,7 +6130,6 @@ namespace SetPointManager { Real64 MinSetPointTemp; int CritZoneNumTemp; int CritZoneNumFlow; - int ControlStrategy; if (!this->SimReady) return; AirLoopNum = this->AirLoopNum; @@ -6473,7 +6141,6 @@ namespace SetPointManager { FracFlow = MinFracFlow; CritZoneNumTemp = 0; CritZoneNumFlow = 0; - ControlStrategy = this->Strategy; for (ZonesCooledIndex = 1; ZonesCooledIndex <= state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++ZonesCooledIndex) { CtrlZoneNum = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).CoolCtrlZoneNums(ZonesCooledIndex); @@ -6489,7 +6156,7 @@ namespace SetPointManager { TotCoolLoad += std::abs(ZoneLoad); CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { - if (ControlStrategy == TempFirst) { + if (this->Strategy == ControlStrategy::TempFirst) { // First find supply air temperature required to meet the load at minimum flow. If this is // below the minimum supply air temperature, calculate the fractional flow rate required to meet the // load at the minimum supply air temperature. @@ -6531,7 +6198,7 @@ namespace SetPointManager { this->SetPt = SetPointTemp; this->Turndown = FracFlow; - if (ControlStrategy == TempFirst) { + if (this->Strategy == ControlStrategy::TempFirst) { if (CritZoneNumFlow != 0) { this->CritZoneNum = CritZoneNumFlow; } else { @@ -7167,9 +6834,9 @@ namespace SetPointManager { { auto const SELECT_CASE_var(this->RefTypeMode); - if (SELECT_CASE_var == iRefTempType_WetBulb) { + if (SELECT_CASE_var == ReferenceTempType::WetBulb) { this->SetPt = OutWetBulbTemp + this->Offset; - } else if (SELECT_CASE_var == iRefTempType_DryBulb) { + } else if (SELECT_CASE_var == ReferenceTempType::DryBulb) { this->SetPt = OutDryBulbTemp + this->Offset; } } @@ -7234,11 +6901,11 @@ namespace SetPointManager { { auto const SELECT_CASE_var(this->RefTypeMode); - if (SELECT_CASE_var == iRefTempType_WetBulb) { + if (SELECT_CASE_var == ReferenceTempType::WetBulb) { if (allocated(MoreNodeInfo)) { RefNodeTemp = MoreNodeInfo(RefNode).WetBulbTemp; } - } else if (SELECT_CASE_var == iRefTempType_DryBulb) { + } else if (SELECT_CASE_var == ReferenceTempType::DryBulb) { RefNodeTemp = Node(RefNode).Temp; } } @@ -7297,13 +6964,13 @@ namespace SetPointManager { { auto const SELECT_CASE_var(this->RefTypeMode); - if (SELECT_CASE_var == iRefGroundTempObjType_BuildingSurface) { + if (SELECT_CASE_var == ReferenceGroundTempObjectType::BuildingSurface) { this->SetPt = GroundTemp + this->Offset; - } else if (SELECT_CASE_var == iRefGroundTempObjType_Shallow) { + } else if (SELECT_CASE_var == ReferenceGroundTempObjectType::Shallow) { this->SetPt = GroundTemp_Surface + this->Offset; - } else if (SELECT_CASE_var == iRefGroundTempObjType_Deep) { + } else if (SELECT_CASE_var == ReferenceGroundTempObjectType::Deep) { this->SetPt = GroundTemp_Deep + this->Offset; - } else if (SELECT_CASE_var == iRefGroundTempObjType_FCfactorMethod) { + } else if (SELECT_CASE_var == ReferenceGroundTempObjectType::FCFactorMethod) { this->SetPt = GroundTempFC + this->Offset; } } @@ -7413,16 +7080,16 @@ namespace SetPointManager { TypeNum == TypeOf_Chiller_ElectricReformEIR || TypeNum == TypeOf_Chiller_EngineDriven) { TempDesCondIn = PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesCondIn; - DCESPMCondInletTemp = + state.dataSetPointManager->DCESPMCondInletTemp = Node(PlantLoop(LoopIndexDemandSide).LoopSide(DemandSide).Branch(BranchIndexDemandSide).Comp(ChillerIndexDemandSide).NodeNumIn) .Temp; - DCESPMEvapOutletTemp = + state.dataSetPointManager->DCESPMEvapOutletTemp = Node(PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).NodeNumOut).Temp; TempEvapOutDesign = PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesEvapOut; - DCESPMDesignClgCapacity_Watts = + state.dataSetPointManager->DCESPMDesignClgCapacity_Watts = PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).MaxLoad; - DCESPMCurrentLoad_Watts = PlantLoop(LoopIndexPlantSide).CoolingDemand; + state.dataSetPointManager->DCESPMCurrentLoad_Watts = PlantLoop(LoopIndexPlantSide).CoolingDemand; } else if (TypeNum == TypeOf_Chiller_Indirect_Absorption || TypeNum == TypeOf_Chiller_DFAbsorption) { TempDesCondIn = PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesCondIn; @@ -7433,31 +7100,31 @@ namespace SetPointManager { } // for attached chillers (that are running this timestep) find their Dsn_MinCondSetpt and Dsn_EntCondTemp - DCESPMDsn_MinCondSetpt = 999.0; - DCESPMDsn_EntCondTemp = 0.0; + state.dataSetPointManager->DCESPMDsn_MinCondSetpt = 999.0; + state.dataSetPointManager->DCESPMDsn_EntCondTemp = 0.0; // Design Minimum Condenser Entering as a function of the minimum lift and TEvapLvg // for chillers operating on current cond loop this timestep Dsn_CondMinThisChiller = TempEvapOutDesign + (this->MinimumLiftTD); - DCESPMDsn_MinCondSetpt = min(DCESPMDsn_MinCondSetpt, Dsn_CondMinThisChiller); + state.dataSetPointManager->DCESPMDsn_MinCondSetpt = min(state.dataSetPointManager->DCESPMDsn_MinCondSetpt, Dsn_CondMinThisChiller); // Design entering condenser water temperature for chillers operating // on current cond loop this timestep - DCESPMDsn_EntCondTemp = max(DCESPMDsn_EntCondTemp, TempDesCondIn); + state.dataSetPointManager->DCESPMDsn_EntCondTemp = max(state.dataSetPointManager->DCESPMDsn_EntCondTemp, TempDesCondIn); // Load this array with the design capacity and actual load of each chiller this timestep - Des_Load = DCESPMDesignClgCapacity_Watts; - Act_Load = DCESPMCurrentLoad_Watts; + Des_Load = state.dataSetPointManager->DCESPMDesignClgCapacity_Watts; + Act_Load = state.dataSetPointManager->DCESPMCurrentLoad_Watts; // ***** Load Calculations ***** // In this section the sum of the actual load (watts) and design load (watts) // of the chillers that are on is calculated. - DCESPMActual_Load_Sum += Act_Load; - DCESPMDesign_Load_Sum += Des_Load; + state.dataSetPointManager->DCESPMActual_Load_Sum += Act_Load; + state.dataSetPointManager->DCESPMDesign_Load_Sum += Des_Load; // Exit if the chillers are all off this hour - if (DCESPMActual_Load_Sum <= 0) { - CondWaterSetPoint = DCESPMDsn_EntCondTemp; + if (state.dataSetPointManager->DCESPMActual_Load_Sum <= 0) { + CondWaterSetPoint = state.dataSetPointManager->DCESPMDsn_EntCondTemp; return; } @@ -7465,48 +7132,48 @@ namespace SetPointManager { // This section first calculates the actual (ALW) and design (DLW) individual // weights. Then the weighted actual and design loads are computed. Finally // the Weighted Ratio is found. - if (DCESPMActual_Load_Sum != 0 && DCESPMDesign_Load_Sum != 0) { - ALW = ((Act_Load / DCESPMActual_Load_Sum) * Act_Load); - DLW = ((Des_Load / DCESPMDesign_Load_Sum) * Des_Load); + if (state.dataSetPointManager->DCESPMActual_Load_Sum != 0 && state.dataSetPointManager->DCESPMDesign_Load_Sum != 0) { + ALW = ((Act_Load / state.dataSetPointManager->DCESPMActual_Load_Sum) * Act_Load); + DLW = ((Des_Load / state.dataSetPointManager->DCESPMDesign_Load_Sum) * Des_Load); } else { ALW = 0.0; DLW = 0.0; } - DCESPMWeighted_Actual_Load_Sum += ALW; - DCESPMWeighted_Design_Load_Sum += DLW; - DCESPMWeighted_Ratio = DCESPMWeighted_Actual_Load_Sum / DCESPMWeighted_Design_Load_Sum; + state.dataSetPointManager->DCESPMWeighted_Actual_Load_Sum += ALW; + state.dataSetPointManager->DCESPMWeighted_Design_Load_Sum += DLW; + state.dataSetPointManager->DCESPMWeighted_Ratio = state.dataSetPointManager->DCESPMWeighted_Actual_Load_Sum / state.dataSetPointManager->DCESPMWeighted_Design_Load_Sum; // ***** Optimal Temperature Calculation ***** // In this section the optimal temperature is computed along with the minimum // design wet bulb temp and the minimum actual wet bulb temp. // Min_DesignWB = ACoef1 + ACoef2*OaWb + ACoef3*WPLR + ACoef4*TwrDsnWB + ACoef5*NF - DCESPMMin_DesignWB = CurveValue(state, this->MinTwrWbCurve, OutWetBulbTemp, DCESPMWeighted_Ratio, Twr_DesignWB, NormDsnCondFlow); + state.dataSetPointManager->DCESPMMin_DesignWB = CurveValue(state, this->MinTwrWbCurve, OutWetBulbTemp, state.dataSetPointManager->DCESPMWeighted_Ratio, Twr_DesignWB, NormDsnCondFlow); // Min_ActualWb = BCoef1 + BCoef2*MinDsnWB + BCoef3*WPLR + BCoef4*TwrDsnWB + BCoef5*NF - DCESPMMin_ActualWb = CurveValue(state, this->MinOaWbCurve, DCESPMMin_DesignWB, DCESPMWeighted_Ratio, Twr_DesignWB, NormDsnCondFlow); + state.dataSetPointManager->DCESPMMin_ActualWb = CurveValue(state, this->MinOaWbCurve, state.dataSetPointManager->DCESPMMin_DesignWB, state.dataSetPointManager->DCESPMWeighted_Ratio, Twr_DesignWB, NormDsnCondFlow); // Opt_CondEntTemp = CCoef1 + CCoef2*OaWb + CCoef3*WPLR + CCoef4*TwrDsnWB + CCoef5*NF - DCESPMOpt_CondEntTemp = CurveValue(state, this->OptCondEntCurve, OutWetBulbTemp, DCESPMWeighted_Ratio, Twr_DesignWB, NormDsnCondFlow); + state.dataSetPointManager->DCESPMOpt_CondEntTemp = CurveValue(state, this->OptCondEntCurve, OutWetBulbTemp, state.dataSetPointManager->DCESPMWeighted_Ratio, Twr_DesignWB, NormDsnCondFlow); // ***** Calculate (Cond ent - Evap lvg) Section ***** // In this section we find the worst case of (Cond ent - Evap lvg) for the // chillers that are running. - DCESPMCur_MinLiftTD = 9999.0; + state.dataSetPointManager->DCESPMCur_MinLiftTD = 9999.0; // temp_MinLiftTD = 20.0 / 1.8; - temp_MinLiftTD = DCESPMCondInletTemp - DCESPMEvapOutletTemp; - DCESPMCur_MinLiftTD = min(DCESPMCur_MinLiftTD, temp_MinLiftTD); + temp_MinLiftTD = state.dataSetPointManager->DCESPMCondInletTemp - state.dataSetPointManager->DCESPMEvapOutletTemp; + state.dataSetPointManager->DCESPMCur_MinLiftTD = min(state.dataSetPointManager->DCESPMCur_MinLiftTD, temp_MinLiftTD); } // ***** Limit conditions Section ***** // Check for limit conditions and control to the proper value. - if ((DCESPMWeighted_Ratio >= 0.90) && (DCESPMOpt_CondEntTemp >= (DCESPMDsn_EntCondTemp + 1.0))) { + if ((state.dataSetPointManager->DCESPMWeighted_Ratio >= 0.90) && (state.dataSetPointManager->DCESPMOpt_CondEntTemp >= (state.dataSetPointManager->DCESPMDsn_EntCondTemp + 1.0))) { // Optimized value exceeds the design condenser entering condition or chillers // near full load condition; reset condenser entering setpoint to its design value - SetPoint = DCESPMDsn_EntCondTemp + 1.0; + SetPoint = state.dataSetPointManager->DCESPMDsn_EntCondTemp + 1.0; } else { - if ((OutWetBulbTemp >= DCESPMMin_ActualWb) && (Twr_DesignWB >= DCESPMMin_DesignWB) && (DCESPMCur_MinLiftTD > this->MinimumLiftTD)) { + if ((OutWetBulbTemp >= state.dataSetPointManager->DCESPMMin_ActualWb) && (Twr_DesignWB >= state.dataSetPointManager->DCESPMMin_DesignWB) && (state.dataSetPointManager->DCESPMCur_MinLiftTD > this->MinimumLiftTD)) { // Boundaries are satified; use optimized condenser entering water temp - SetPoint = DCESPMOpt_CondEntTemp; + SetPoint = state.dataSetPointManager->DCESPMOpt_CondEntTemp; } else { // Boundaries violated; Reset to scheduled value of condenser water entering setpoint SetPoint = CondWaterSetPoint; @@ -7514,7 +7181,7 @@ namespace SetPointManager { } // Do not allow new setpoint to be less than the design condenser minimum entering condition, // i.e., TCondWaterEnt not allowed to be less than DsnEvapWaterLvg + MinimumLiftTD - CondWaterSetPoint = max(SetPoint, DCESPMDsn_MinCondSetpt); + CondWaterSetPoint = max(SetPoint, state.dataSetPointManager->DCESPMDsn_MinCondSetpt); this->SetPt = CondWaterSetPoint; } @@ -7586,18 +7253,18 @@ namespace SetPointManager { TotEnergy = this->calculateCurrentEnergyUsage(state); this->setupSetPointAndFlags( - TotEnergy, TotEnergyPre, CondWaterSetPoint, CondTempLimit, state.dataGlobal->RunOptCondEntTemp, RunSubOptCondEntTemp, RunFinalOptCondEntTemp); + TotEnergy, TotEnergyPre, CondWaterSetPoint, CondTempLimit, state.dataGlobal->RunOptCondEntTemp, state.dataSetPointManager->RunSubOptCondEntTemp, state.dataSetPointManager->RunFinalOptCondEntTemp); } else { CondWaterSetPoint = this->MaxCondEntTemp; TotEnergyPre = 0.0; state.dataGlobal->RunOptCondEntTemp = false; - RunSubOptCondEntTemp = false; + state.dataSetPointManager->RunSubOptCondEntTemp = false; } } else { CondWaterSetPoint = this->MaxCondEntTemp; state.dataGlobal->RunOptCondEntTemp = false; - RunSubOptCondEntTemp = false; + state.dataSetPointManager->RunSubOptCondEntTemp = false; } this->SetPt = CondWaterSetPoint; @@ -7609,7 +7276,7 @@ namespace SetPointManager { Real64 &CondTempLimit, bool &RunOptCondEntTemp, bool &RunSubOptCondEntTemp, - bool &RunFinalOptCondEntTemp) + bool &RunFinalOptCondEntTemp) const { Real64 DeltaTotEnergy; if (TotEnergyPre != 0.0) { @@ -8086,33 +7753,33 @@ namespace SetPointManager { // Loop over all the Scheduled Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSchSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSchSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = SchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number { - auto const SELECT_CASE_var(SchSetPtMgr(SetPtMgrNum).CtrlTypeMode); + auto const SELECT_CASE_var(state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode); // set the setpoint depending on the type of variable being controlled - if (SELECT_CASE_var == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = SchSetPtMgr(SetPtMgrNum).SetPt; - } else if (SELECT_CASE_var == iCtrlVarType_MaxTemp) { - Node(NodeNum).TempSetPointHi = SchSetPtMgr(SetPtMgrNum).SetPt; - } else if (SELECT_CASE_var == iCtrlVarType_MinTemp) { - Node(NodeNum).TempSetPointLo = SchSetPtMgr(SetPtMgrNum).SetPt; - } else if (SELECT_CASE_var == iCtrlVarType_HumRat) { - Node(NodeNum).HumRatSetPoint = SchSetPtMgr(SetPtMgrNum).SetPt; - } else if (SELECT_CASE_var == iCtrlVarType_MaxHumRat) { - Node(NodeNum).HumRatMax = SchSetPtMgr(SetPtMgrNum).SetPt; - } else if (SELECT_CASE_var == iCtrlVarType_MinHumRat) { - Node(NodeNum).HumRatMin = SchSetPtMgr(SetPtMgrNum).SetPt; - } else if (SELECT_CASE_var == iCtrlVarType_MassFlow) { - Node(NodeNum).MassFlowRateSetPoint = SchSetPtMgr(SetPtMgrNum).SetPt; - } else if (SELECT_CASE_var == iCtrlVarType_MaxMassFlow) { - Node(NodeNum).MassFlowRateMax = SchSetPtMgr(SetPtMgrNum).SetPt; - } else if (SELECT_CASE_var == iCtrlVarType_MinMassFlow) { - Node(NodeNum).MassFlowRateMin = SchSetPtMgr(SetPtMgrNum).SetPt; + if (SELECT_CASE_var == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; + } else if (SELECT_CASE_var == iCtrlVarType::MaxTemp) { + Node(NodeNum).TempSetPointHi = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; + } else if (SELECT_CASE_var == iCtrlVarType::MinTemp) { + Node(NodeNum).TempSetPointLo = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; + } else if (SELECT_CASE_var == iCtrlVarType::HumRat) { + Node(NodeNum).HumRatSetPoint = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; + } else if (SELECT_CASE_var == iCtrlVarType::MaxHumRat) { + Node(NodeNum).HumRatMax = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; + } else if (SELECT_CASE_var == iCtrlVarType::MinHumRat) { + Node(NodeNum).HumRatMin = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; + } else if (SELECT_CASE_var == iCtrlVarType::MassFlow) { + Node(NodeNum).MassFlowRateSetPoint = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; + } else if (SELECT_CASE_var == iCtrlVarType::MaxMassFlow) { + Node(NodeNum).MassFlowRateMax = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; + } else if (SELECT_CASE_var == iCtrlVarType::MinMassFlow) { + Node(NodeNum).MassFlowRateMin = state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).SetPt; } } @@ -8122,26 +7789,26 @@ namespace SetPointManager { // Loop over all the Scheduled TES Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSchTESSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSchTESSetPtMgrs; ++SetPtMgrNum) { // only one setpoint for each scheduled TES setpoint manager and its a temperature setpoint - NodeNum = SchTESSetPtMgr(SetPtMgrNum).CtrlNodeNum; // Get the node number - Node(NodeNum).TempSetPoint = SchTESSetPtMgr(SetPtMgrNum).SetPt; + NodeNum = state.dataSetPointManager->SchTESSetPtMgr(SetPtMgrNum).CtrlNodeNum; // Get the node number + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SchTESSetPtMgr(SetPtMgrNum).SetPt; } // setpoint manger:scheduledTES // Loop over all the Scheduled Dual Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumDualSchSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumDualSchSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= DualSchSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = DualSchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPointHi = DualSchSetPtMgr(SetPtMgrNum).SetPtHi; // Set the setpoint High - Node(NodeNum).TempSetPointLo = DualSchSetPtMgr(SetPtMgrNum).SetPtLo; // Set the setpoint Low + if (state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPointHi = state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SetPtHi; // Set the setpoint High + Node(NodeNum).TempSetPointLo = state.dataSetPointManager->DualSchSetPtMgr(SetPtMgrNum).SetPtLo; // Set the setpoint Low Node(NodeNum).TempSetPoint = (Node(NodeNum).TempSetPointHi + Node(NodeNum).TempSetPointLo) / 2.0; // average of the high and low } } @@ -8149,323 +7816,323 @@ namespace SetPointManager { // Loop over all the Outside Air Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumOutAirSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumOutAirSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= OutAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = OutAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = OutAirSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint - } else if (OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { - Node(NodeNum).TempSetPointHi = OutAirSetPtMgr(SetPtMgrNum).SetPt; // Set the high temperature setpoint - } else if (OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { - Node(NodeNum).TempSetPointLo = OutAirSetPtMgr(SetPtMgrNum).SetPt; // Set the low temperature setpoint + NodeNum = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + } else if (state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { + Node(NodeNum).TempSetPointHi = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SetPt; // Set the high temperature setpoint + } else if (state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { + Node(NodeNum).TempSetPointLo = state.dataSetPointManager->OutAirSetPtMgr(SetPtMgrNum).SetPt; // Set the low temperature setpoint } } } // Loop over all the Single Zone Reheat Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZRhSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZRhSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SingZoneRhSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = SingZoneRhSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + if (state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SingZoneRhSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } } // Loop over all the Single Zone Heating Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZHtSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZHtSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SingZoneHtSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = SingZoneHtSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + if (state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SingZoneHtSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } } // Loop over all the Single Zone Cooling Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZClSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZClSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SingZoneClSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = SingZoneClSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + if (state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SingZoneClSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } } // Loop over all the Single Zone Minimum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - Node(NodeNum).HumRatMin = SZMinHumSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + Node(NodeNum).HumRatMin = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } // Loop over all the Single Zone Maximum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - Node(NodeNum).HumRatMax = SZMaxHumSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + Node(NodeNum).HumRatMax = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } // Loop over all the Warmest Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= WarmestSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = WarmestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = WarmestSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + if (state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->WarmestSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } } // Loop over all the Coldest Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumColdestSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumColdestSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= ColdestSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = ColdestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = ColdestSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + if (state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->ColdestSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } } // Loop over all the Warmest Temp Flow Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumWarmestSetPtMgrsTempFlow; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= WarmestSetPtMgrTempFlow(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = WarmestSetPtMgrTempFlow(SetPtMgrNum).SetPt; // Set the supply air temperature setpoint - state.dataAirLoop->AirLoopFlow(WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum).ReqSupplyFrac = - WarmestSetPtMgrTempFlow(SetPtMgrNum).Turndown; // Set the supply air flow rate - state.dataAirLoop->AirLoopControlInfo(WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum).LoopFlowRateSet = true; // PH 8/17/07 + if (state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).SetPt; // Set the supply air temperature setpoint + state.dataAirLoop->AirLoopFlow(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum).ReqSupplyFrac = + state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).Turndown; // Set the supply air flow rate + state.dataAirLoop->AirLoopControlInfo(state.dataSetPointManager->WarmestSetPtMgrTempFlow(SetPtMgrNum).AirLoopNum).LoopFlowRateSet = true; // PH 8/17/07 } } } - for (SetPtMgrNum = 1; SetPtMgrNum <= NumRABFlowSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumRABFlowSetPtMgrs; ++SetPtMgrNum) { - NodeNum = RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode; // Get the node number + NodeNum = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).RABSplitOutNode; // Get the node number - if (RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MassFlow) { - Node(NodeNum).MassFlowRateSetPoint = RABFlowSetPtMgr(SetPtMgrNum).FlowSetPt; // Set the flow setpoint + if (state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MassFlow) { + Node(NodeNum).MassFlowRateSetPoint = state.dataSetPointManager->RABFlowSetPtMgr(SetPtMgrNum).FlowSetPt; // Set the flow setpoint } } // Loop over all the MultiZone Average Cooling Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZClgAverageSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = MZAverageCoolingSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->MZAverageCoolingSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // Loop over all the MultiZone Average Heating Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZHtgAverageSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = MZAverageHeatingSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->MZAverageHeatingSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // Loop over all the MultiZone Average Minimum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinHumRat) { - Node(NodeNum).HumRatMin = MZAverageMinHumSetPtMgr(SetPtMgrNum).SetPt; // Set the humidity ratio setpoint + NodeNum = state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinHumRat) { + Node(NodeNum).HumRatMin = state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).SetPt; // Set the humidity ratio setpoint } } } // Loop over all the MultiZone Average Maxiumum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxHumRat) { - Node(NodeNum).HumRatMax = MZAverageMaxHumSetPtMgr(SetPtMgrNum).SetPt; // Set the humidity ratio setpoint + NodeNum = state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxHumRat) { + Node(NodeNum).HumRatMax = state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).SetPt; // Set the humidity ratio setpoint } } } // Loop over all the Multizone Minimum Humidity Ratio Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinHumRat) { - Node(NodeNum).HumRatMin = MZMinHumSetPtMgr(SetPtMgrNum).SetPt; // Set the humidity ratio setpoint + NodeNum = state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinHumRat) { + Node(NodeNum).HumRatMin = state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).SetPt; // Set the humidity ratio setpoint } } } // Loop over all the Multizone Maximum Humidity Ratio Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxHumRat) { - Node(NodeNum).HumRatMax = MZMaxHumSetPtMgr(SetPtMgrNum).SetPt; // Set the humidity ratio setpoint + NodeNum = state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxHumRat) { + Node(NodeNum).HumRatMax = state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).SetPt; // Set the humidity ratio setpoint } } } // Loop over all the Follow Outdoor Air Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumFollowOATempSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= FollowOATempSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumFollowOATempSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = FollowOATempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint - } else if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { - Node(NodeNum).TempSetPointHi = FollowOATempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint - } else if (FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { - Node(NodeNum).TempSetPointLo = FollowOATempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + } else if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { + Node(NodeNum).TempSetPointHi = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + } else if (state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { + Node(NodeNum).TempSetPointLo = state.dataSetPointManager->FollowOATempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // Loop over all the Follow System Node Temperature Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumFollowSysNodeTempSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= FollowSysNodeTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumFollowSysNodeTempSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = FollowSysNodeTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { - Node(NodeNum).TempSetPointHi = FollowSysNodeTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint - } else if (FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { - Node(NodeNum).TempSetPointLo = FollowSysNodeTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { + Node(NodeNum).TempSetPointHi = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + } else if (state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { + Node(NodeNum).TempSetPointLo = state.dataSetPointManager->FollowSysNodeTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // Loop over all the Ground Tempearture Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumGroundTempSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= GroundTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumGroundTempSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = GroundTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxTemp) { - Node(NodeNum).TempSetPointHi = GroundTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint - } else if (GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MinTemp) { - Node(NodeNum).TempSetPointLo = GroundTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxTemp) { + Node(NodeNum).TempSetPointHi = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + } else if (state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MinTemp) { + Node(NodeNum).TempSetPointLo = state.dataSetPointManager->GroundTempSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // Loop over all Condenser Entering Set Point Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumCondEntSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumCondEntSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // set points from this set point manager - NodeNum = CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = CondEntSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // Loop over all Ideal Condenser Entering Set Point Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumIdealCondEntSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // set points from this set point manager - NodeNum = IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = IdealCondEntSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // loop over all single zone on/off cooling setpoint managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZOneStageCoolingSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZOneStageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZOneStageCoolingSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // set points from this set point manager - NodeNum = SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = SZOneStageCoolingSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SZOneStageCoolingSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // loop over all single zone on/off heating setpoint managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZOneStageHeatingSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZOneStageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZOneStageHeatingSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // set points from this set point manager - NodeNum = SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = SZOneStageHeatingSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint + NodeNum = state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + if (state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SZOneStageHeatingSetPtMgr(SetPtMgrNum).SetPt; // Set the temperature setpoint } } } // return water temperature reset setpoint managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumReturnWaterResetChWSetPtMgrs; ++SetPtMgrNum) { - auto &returnWaterSPM(ReturnWaterResetChWSetPtMgr(SetPtMgrNum)); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumReturnWaterResetChWSetPtMgrs; ++SetPtMgrNum) { + auto &returnWaterSPM(state.dataSetPointManager->ReturnWaterResetChWSetPtMgr(SetPtMgrNum)); if (returnWaterSPM.plantSetpointNodeIndex > 0) { Node(returnWaterSPM.plantSetpointNodeIndex).TempSetPoint = returnWaterSPM.currentSupplySetPt; } else { @@ -8474,8 +8141,8 @@ namespace SetPointManager { } // hot-water return water temperature reset setpoint managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumReturnWaterResetHWSetPtMgrs; ++SetPtMgrNum) { - auto &returnWaterSPM(ReturnWaterResetHWSetPtMgr(SetPtMgrNum)); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumReturnWaterResetHWSetPtMgrs; ++SetPtMgrNum) { + auto &returnWaterSPM(state.dataSetPointManager->ReturnWaterResetHWSetPtMgr(SetPtMgrNum)); if (returnWaterSPM.plantSetpointNodeIndex > 0) { Node(returnWaterSPM.plantSetpointNodeIndex).TempSetPoint = returnWaterSPM.currentSupplySetPt; } else { @@ -8484,7 +8151,7 @@ namespace SetPointManager { } } - void UpdateMixedAirSetPoints() + void UpdateMixedAirSetPoints(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -8521,21 +8188,21 @@ namespace SetPointManager { // Loop over all the Mixed Air Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMixedAirSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMixedAirSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number - if (MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_Temp) { - Node(NodeNum).TempSetPoint = MixedAirSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + if (state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::Temp) { + Node(NodeNum).TempSetPoint = state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } } } - void UpdateOAPretreatSetPoints() + void UpdateOAPretreatSetPoints(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -8573,56 +8240,56 @@ namespace SetPointManager { // Loop over all the Mixed Air Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumOAPretreatSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumOAPretreatSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes; + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { // Loop over the list of nodes wanting // setpoints from this setpoint manager - NodeNum = OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number + NodeNum = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); // Get the node number { - auto const SELECT_CASE_var(OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode); - if (SELECT_CASE_var == iCtrlVarType_Temp) { // 'Temperature' - Node(NodeNum).TempSetPoint = OAPretreatSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint - } else if (SELECT_CASE_var == iCtrlVarType_MaxHumRat) { // 'MaximumHumidityRatio' - Node(NodeNum).HumRatMax = OAPretreatSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint - } else if (SELECT_CASE_var == iCtrlVarType_MinHumRat) { // 'MinimumHumidityRatio' - Node(NodeNum).HumRatMin = OAPretreatSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint - } else if (SELECT_CASE_var == iCtrlVarType_HumRat) { // 'HumidityRatio' - Node(NodeNum).HumRatSetPoint = OAPretreatSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + auto const SELECT_CASE_var(state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).CtrlTypeMode); + if (SELECT_CASE_var == iCtrlVarType::Temp) { // 'Temperature' + Node(NodeNum).TempSetPoint = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + } else if (SELECT_CASE_var == iCtrlVarType::MaxHumRat) { // 'MaximumHumidityRatio' + Node(NodeNum).HumRatMax = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + } else if (SELECT_CASE_var == iCtrlVarType::MinHumRat) { // 'MinimumHumidityRatio' + Node(NodeNum).HumRatMin = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint + } else if (SELECT_CASE_var == iCtrlVarType::HumRat) { // 'HumidityRatio' + Node(NodeNum).HumRatSetPoint = state.dataSetPointManager->OAPretreatSetPtMgr(SetPtMgrNum).SetPt; // Set the setpoint } } } } } - int getSPMBasedOnNode(EnergyPlusData &state, int const NodeNum, int const SetPtType, int const SPMType, CtrlNodeType ctrlOrRefNode) + int getSPMBasedOnNode(EnergyPlusData &state, int const NodeNum, iCtrlVarType const SetPtType, SetPointManagerType const SPMType, CtrlNodeType ctrlOrRefNode) { - if (GetInputFlag) { + if (state.dataSetPointManager->GetInputFlag) { GetSetPointManagerInputs(state); - GetInputFlag = false; + state.dataSetPointManager->GetInputFlag = false; } int getSPMBasedOnNode = 0; - for (int SetPtMgrNum = 1; SetPtMgrNum <= NumAllSetPtMgrs; ++SetPtMgrNum) { - if (SetPtType == AllSetPtMgr(SetPtMgrNum).CtrlTypeMode) { // SetPtType is e.g., iCtrlVarType_Temp, iCtrlVarType_HumRat, etc. + for (int SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumAllSetPtMgrs; ++SetPtMgrNum) { + if (SetPtType == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode) { // SetPtType is e.g., iCtrlVarType::Temp, iCtrlVarType::HumRat, etc. switch (ctrlOrRefNode) { // ctrlOrRefNode is enum type of node to look for, either control node or reference node case CtrlNodeType::control: { - for (int NumNode = 1; NumNode <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { - // SPMType is type of set point manager, e.g., iSPMType_Scheduled, iSPMType_MixedAir, etc. - if (NodeNum == AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode) && SPMType == AllSetPtMgr(SetPtMgrNum).SPMType) { - getSPMBasedOnNode = AllSetPtMgr(SetPtMgrNum).SPMIndex; // SPMIndex is index to specific type of SPM + for (int NumNode = 1; NumNode <= state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { + // SPMType is type of set point manager, e.g., SetPointManagerType::Scheduled, SetPointManagerType::MixedAir, etc. + if (NodeNum == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode) && SPMType == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType) { + getSPMBasedOnNode = state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMIndex; // SPMIndex is index to specific type of SPM break; } } break; } case CtrlNodeType::reference: { - // SPMType is type of set point manager, e.g., iSPMType_Scheduled, iSPMType_MixedAir, etc. - if (NodeNum == AllSetPtMgr(SetPtMgrNum).RefNode && SPMType == AllSetPtMgr(SetPtMgrNum).SPMType) { - getSPMBasedOnNode = AllSetPtMgr(SetPtMgrNum).SPMIndex; // SPMIndex is index to specific type of SPM + // SPMType is type of set point manager, e.g., SetPointManagerType::Scheduled, SetPointManagerType::MixedAir, etc. + if (NodeNum == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).RefNode && SPMType == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMType) { + getSPMBasedOnNode = state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).SPMIndex; // SPMIndex is index to specific type of SPM } break; } @@ -8634,7 +8301,7 @@ namespace SetPointManager { return getSPMBasedOnNode; } - bool IsNodeOnSetPtManager(EnergyPlusData &state, int const NodeNum, int const SetPtType) + bool IsNodeOnSetPtManager(EnergyPlusData &state, int const NodeNum, iCtrlVarType const SetPtType) { // FUNCTION INFORMATION: @@ -8663,17 +8330,17 @@ namespace SetPointManager { int NumNode; // First time called, get the input for all the setpoint managers - if (GetInputFlag) { + if (state.dataSetPointManager->GetInputFlag) { GetSetPointManagerInputs(state); - GetInputFlag = false; + state.dataSetPointManager->GetInputFlag = false; } IsNodeOnSetPtManager = false; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumAllSetPtMgrs; ++SetPtMgrNum) { - if (SetPtType == AllSetPtMgr(SetPtMgrNum).CtrlTypeMode) { - for (NumNode = 1; NumNode <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { - if (NodeNum == AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode)) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumAllSetPtMgrs; ++SetPtMgrNum) { + if (SetPtType == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode) { + for (NumNode = 1; NumNode <= state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { + if (NodeNum == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode)) { IsNodeOnSetPtManager = true; break; } @@ -8684,7 +8351,7 @@ namespace SetPointManager { return IsNodeOnSetPtManager; } - bool NodeHasSPMCtrlVarType(EnergyPlusData &state, int const NodeNum, int const iCtrlVarType) + bool NodeHasSPMCtrlVarType(EnergyPlusData &state, int const NodeNum, iCtrlVarType const iCtrlVarType) { // FUNCTION INFORMATION: @@ -8727,18 +8394,18 @@ namespace SetPointManager { // FLOW: // First time called, get the input for all the setpoint managers - if (GetInputFlag) { + if (state.dataSetPointManager->GetInputFlag) { GetSetPointManagerInputs(state); - GetInputFlag = false; + state.dataSetPointManager->GetInputFlag = false; } // Initialize to false that node is not controlled by set point manager NodeHasSPMCtrlVarType = false; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumAllSetPtMgrs; ++SetPtMgrNum) { - for (NumNode = 1; NumNode <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { - if (NodeNum == AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode)) { - if (AllSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumAllSetPtMgrs; ++SetPtMgrNum) { + for (NumNode = 1; NumNode <= state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { + if (NodeNum == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode)) { + if (state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType) { // If specific control type is found, it doesn't matter if there are other of same type. NodeHasSPMCtrlVarType = true; goto SPMLoop_exit; @@ -8795,18 +8462,18 @@ namespace SetPointManager { bool ResetCntrlVarType; // if true reset Hum Rat control var type to maxhumidity ratio // First time called, get the input for all the setpoint managers - if (GetInputFlag) { + if (state.dataSetPointManager->GetInputFlag) { GetSetPointManagerInputs(state); - GetInputFlag = false; + state.dataSetPointManager->GetInputFlag = false; } ResetCntrlVarType = false; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumAllSetPtMgrs; ++SetPtMgrNum) { - for (NumNode = 1; NumNode <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { - if (NodeNum == AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode)) { - if (AllSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_HumRat) { - AllSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType_MaxHumRat; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumAllSetPtMgrs; ++SetPtMgrNum) { + for (NumNode = 1; NumNode <= state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { + if (NodeNum == state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode)) { + if (state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::HumRat) { + state.dataSetPointManager->AllSetPtMgr(SetPtMgrNum).CtrlTypeMode = iCtrlVarType::MaxHumRat; SetPtMgrNumPtr = SetPtMgrNum; ResetCntrlVarType = true; goto SPMLoop_exit; @@ -8818,10 +8485,10 @@ namespace SetPointManager { SPMLoop_exit:; if (ResetCntrlVarType) { - ShowWarningError(state, RoutineName + cValidSPMTypes(AllSetPtMgr(SetPtMgrNumPtr).SPMType) + "=\"" + AllSetPtMgr(SetPtMgrNumPtr).Name + "\". "); - ShowContinueError(state, " ..Humidity ratio control variable type specified is = " + cValidCtrlTypes(iCtrlVarType_HumRat)); - ShowContinueError(state, " ..Humidity ratio control variable type allowed with water coils is = " + cValidCtrlTypes(iCtrlVarType_MaxHumRat)); - ShowContinueError(state, " ..Setpointmanager control variable type is reset to = " + cValidCtrlTypes(iCtrlVarType_MaxHumRat)); + ShowWarningError(state, RoutineName + managerTypeName(state.dataSetPointManager->AllSetPtMgr(SetPtMgrNumPtr).SPMType) + "=\"" + state.dataSetPointManager->AllSetPtMgr(SetPtMgrNumPtr).Name + "\". "); + ShowContinueError(state, format(" ..Humidity ratio control variable type specified is = {}", controlTypeName(iCtrlVarType::HumRat))); + ShowContinueError(state, format(" ..Humidity ratio control variable type allowed with water coils is = {}", controlTypeName(iCtrlVarType::MaxHumRat))); + ShowContinueError(state, format(" ..Setpointmanager control variable type is reset to = {}", controlTypeName(iCtrlVarType::MaxHumRat))); ShowContinueError(state, " ..Simulation continues. "); } } @@ -8841,16 +8508,16 @@ namespace SetPointManager { std::string cCurrentModuleObject; cCurrentModuleObject = "SetpointManager:CondenserEnteringReset:Ideal"; - NumIdealCondEntSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + state.dataSetPointManager->NumIdealCondEntSetPtMgrs = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - if (NumIdealCondEntSetPtMgrs > 0) { + if (state.dataSetPointManager->NumIdealCondEntSetPtMgrs > 0) { state.dataGlobal->AnyIdealCondEntSetPointInModel = true; } else { state.dataGlobal->AnyIdealCondEntSetPointInModel = false; } } - int GetHumidityRatioVariableType(EnergyPlusData &state, int const CntrlNodeNum) + iCtrlVarType GetHumidityRatioVariableType(EnergyPlusData &state, int const CntrlNodeNum) { // SUBROUTINE INFORMATION: @@ -8871,7 +8538,7 @@ namespace SetPointManager { // USE STATEMENTS: // Return value - int HumRatCntrlType; + iCtrlVarType HumRatCntrlType; // Locals // SUBROUTINE PARAMETER DEFINITIONS: @@ -8887,81 +8554,81 @@ namespace SetPointManager { int CtrlNodeIndex; int NodeNum; - if (GetInputFlag) { + if (state.dataSetPointManager->GetInputFlag) { GetSetPointManagerInputs(state); - GetInputFlag = false; + state.dataSetPointManager->GetInputFlag = false; } - HumRatCntrlType = iCtrlVarType_HumRat; + HumRatCntrlType = iCtrlVarType::HumRat; // Loop over the single zone maximum humidity setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); if (CntrlNodeNum == NodeNum) { - HumRatCntrlType = iCtrlVarType_MaxHumRat; + HumRatCntrlType = iCtrlVarType::MaxHumRat; return HumRatCntrlType; } } } // Loop over the MultiZone maximum humidity setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); if (CntrlNodeNum == NodeNum) { - HumRatCntrlType = iCtrlVarType_MaxHumRat; + HumRatCntrlType = iCtrlVarType::MaxHumRat; return HumRatCntrlType; } } } // Loop over the MultiZone Average Maxiumum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMaxHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZAverageMaxHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); if (CntrlNodeNum == NodeNum) { - HumRatCntrlType = iCtrlVarType_MaxHumRat; + HumRatCntrlType = iCtrlVarType::MaxHumRat; return HumRatCntrlType; } } } // Loop over the single zone minimum humidity setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->SZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); if (CntrlNodeNum == NodeNum) { - HumRatCntrlType = iCtrlVarType_MinHumRat; + HumRatCntrlType = iCtrlVarType::MinHumRat; return HumRatCntrlType; } } } // Loop over the MultiZone minimum humidity setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZMinHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); if (CntrlNodeNum == NodeNum) { - HumRatCntrlType = iCtrlVarType_MinHumRat; + HumRatCntrlType = iCtrlVarType::MinHumRat; return HumRatCntrlType; } } } // Loop over the MultiZone Average Minimum Humidity Setpoint Managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - NodeNum = MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMZAverageMinHumSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + NodeNum = state.dataSetPointManager->MZAverageMinHumSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex); if (CntrlNodeNum == NodeNum) { - HumRatCntrlType = iCtrlVarType_MinHumRat; + HumRatCntrlType = iCtrlVarType::MinHumRat; return HumRatCntrlType; } } } // Loop over the schedule setpoint managers - for (SetPtMgrNum = 1; SetPtMgrNum <= NumSchSetPtMgrs; ++SetPtMgrNum) { - for (CtrlNodeIndex = 1; CtrlNodeIndex <= SchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - if (CntrlNodeNum == SchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { - if (SchSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_HumRat) { - return iCtrlVarType_HumRat; - } else if (SchSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType_MaxHumRat) { - return iCtrlVarType_MaxHumRat; + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumSchSetPtMgrs; ++SetPtMgrNum) { + for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { + if (CntrlNodeNum == state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { + if (state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::HumRat) { + return iCtrlVarType::HumRat; + } else if (state.dataSetPointManager->SchSetPtMgr(SetPtMgrNum).CtrlTypeMode == iCtrlVarType::MaxHumRat) { + return iCtrlVarType::MaxHumRat; } } } @@ -9005,33 +8672,33 @@ namespace SetPointManager { bool ErrorsFoundinTESSchSetup(false); int NodeNum; - NumSchTESSetPtMgrs += 1; - NumAllSetPtMgrs += 1; + state.dataSetPointManager->NumSchTESSetPtMgrs += 1; + state.dataSetPointManager->NumAllSetPtMgrs += 1; // allocate/redimension structures for new item - if (NumSchTESSetPtMgrs == 1) { // first time through--main structure not allocated yet - SchTESSetPtMgr.allocate(1); - } else if (NumSchTESSetPtMgrs > 1) { // no longer first time through--redimension to new size - SchTESSetPtMgr.redimension(NumSchTESSetPtMgrs); + if (state.dataSetPointManager->NumSchTESSetPtMgrs == 1) { // first time through--main structure not allocated yet + state.dataSetPointManager->SchTESSetPtMgr.allocate(1); + } else if (state.dataSetPointManager->NumSchTESSetPtMgrs > 1) { // no longer first time through--redimension to new size + state.dataSetPointManager->SchTESSetPtMgr.redimension(state.dataSetPointManager->NumSchTESSetPtMgrs); } - AllSetPtMgr.redimension(NumAllSetPtMgrs); + state.dataSetPointManager->AllSetPtMgr.redimension(state.dataSetPointManager->NumAllSetPtMgrs); // Set up the scheduled TES setpoint manager information - SchTESSetPtMgr(NumSchTESSetPtMgrs).SchedPtr = SchedPtr; - SchTESSetPtMgr(NumSchTESSetPtMgrs).SchedPtrCharge = SchedPtrCharge; - SchTESSetPtMgr(NumSchTESSetPtMgrs).NonChargeCHWTemp = NonChargeCHWTemp; - SchTESSetPtMgr(NumSchTESSetPtMgrs).ChargeCHWTemp = ChargeCHWTemp; - SchTESSetPtMgr(NumSchTESSetPtMgrs).CompOpType = CompOpType; - SchTESSetPtMgr(NumSchTESSetPtMgrs).CtrlNodeNum = ControlNodeNum; + state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).SchedPtr = SchedPtr; + state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).SchedPtrCharge = SchedPtrCharge; + state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).NonChargeCHWTemp = NonChargeCHWTemp; + state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).ChargeCHWTemp = ChargeCHWTemp; + state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).CompOpType = CompOpType; + state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).CtrlNodeNum = ControlNodeNum; // Set up the all setpoint manager information for "verification" that no other setpoint manager controls the node that this new ones does - AllSetPtMgr(NumAllSetPtMgrs).CtrlNodes.allocate(1); - AllSetPtMgr(NumAllSetPtMgrs).CtrlNodes(1) = SchTESSetPtMgr(NumSchTESSetPtMgrs).CtrlNodeNum; + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->NumAllSetPtMgrs).CtrlNodes.allocate(1); + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->NumAllSetPtMgrs).CtrlNodes(1) = state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).CtrlNodeNum; // Give it a Name just in case it's used for error reporting - AllSetPtMgr(NumAllSetPtMgrs).Name = format("Auto generated TES SPM {}", NumSchTESSetPtMgrs); - AllSetPtMgr(NumAllSetPtMgrs).SPMType = iSPMType_TESScheduled; - AllSetPtMgr(NumAllSetPtMgrs).CtrlTypeMode = iCtrlVarType_Temp; - AllSetPtMgr(NumAllSetPtMgrs).NumCtrlNodes = 1; + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->NumAllSetPtMgrs).Name = format("Auto generated TES SPM {}", state.dataSetPointManager->NumSchTESSetPtMgrs); + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->NumAllSetPtMgrs).SPMType = SetPointManagerType::TESScheduled; + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->NumAllSetPtMgrs).CtrlTypeMode = iCtrlVarType::Temp; + state.dataSetPointManager->AllSetPtMgr(state.dataSetPointManager->NumAllSetPtMgrs).NumCtrlNodes = 1; // Now verify that there is no overlap (no other SPM uses the node of the new setpoint manager) ErrorsFoundinTESSchSetup = false; @@ -9043,12 +8710,12 @@ namespace SetPointManager { // we must now also initialize, simulate, and update the current SchTESStPtMgr that was just added. But the init and simulate // steps are the same so we can call the simulate first. - SchTESSetPtMgr(NumSchTESSetPtMgrs).calculate(state); + state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).calculate(state); // Now update reusing code from Update routine specialized to only doing the current (new) setpoint manager and then we are done - NodeNum = SchTESSetPtMgr(NumSchTESSetPtMgrs).CtrlNodeNum; // Get the node number - Node(NodeNum).TempSetPoint = SchTESSetPtMgr(NumSchTESSetPtMgrs).SetPt; + NodeNum = state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).CtrlNodeNum; // Get the node number + Node(NodeNum).TempSetPoint = state.dataSetPointManager->SchTESSetPtMgr(state.dataSetPointManager->NumSchTESSetPtMgrs).SetPt; } // end of SetUpNewScheduledTESSetPtMgr @@ -9086,15 +8753,15 @@ namespace SetPointManager { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CtrldNodeNum; - if (GetInputFlag) { + if (state.dataSetPointManager->GetInputFlag) { GetSetPointManagerInputs(state); - GetInputFlag = false; + state.dataSetPointManager->GetInputFlag = false; } FeezigCheckFlag = false; - for (CtrldNodeNum = 1; CtrldNodeNum <= MixedAirSetPtMgr(MixedAirSPMNum).NumCtrlNodes; ++CtrldNodeNum) { - if (MixedAirSetPtMgr(MixedAirSPMNum).FreezeCheckEnable) { + for (CtrldNodeNum = 1; CtrldNodeNum <= state.dataSetPointManager->MixedAirSetPtMgr(MixedAirSPMNum).NumCtrlNodes; ++CtrldNodeNum) { + if (state.dataSetPointManager->MixedAirSetPtMgr(MixedAirSPMNum).FreezeCheckEnable) { FeezigCheckFlag = true; break; } @@ -9138,18 +8805,18 @@ namespace SetPointManager { int SetPtMgrNum; int CtrldNodeNum; - if (GetInputFlag) { + if (state.dataSetPointManager->GetInputFlag) { GetSetPointManagerInputs(state); - GetInputFlag = false; + state.dataSetPointManager->GetInputFlag = false; } MixedAirSPMNum = 0; - for (SetPtMgrNum = 1; SetPtMgrNum <= NumMixedAirSetPtMgrs; ++SetPtMgrNum) { + for (SetPtMgrNum = 1; SetPtMgrNum <= state.dataSetPointManager->NumMixedAirSetPtMgrs; ++SetPtMgrNum) { - for (CtrldNodeNum = 1; CtrldNodeNum <= MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrldNodeNum) { - if (MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) == MixedAirNode) { - if (MixedAirSetPtMgr(SetPtMgrNum).CoolCoilInNode > 0 && MixedAirSetPtMgr(SetPtMgrNum).CoolCoilOutNode > 0) { + for (CtrldNodeNum = 1; CtrldNodeNum <= state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrldNodeNum) { + if (state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CtrlNodes(CtrldNodeNum) == MixedAirNode) { + if (state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CoolCoilInNode > 0 && state.dataSetPointManager->MixedAirSetPtMgr(SetPtMgrNum).CoolCoilOutNode > 0) { MixedAirSPMNum = CtrldNodeNum; break; } @@ -9160,6 +8827,4 @@ namespace SetPointManager { return MixedAirSPMNum; } // End of GetMixedAirNumWithCoilFreezingCheck( -} // namespace SetPointManager - } // namespace EnergyPlus diff --git a/src/EnergyPlus/SetPointManager.hh b/src/EnergyPlus/SetPointManager.hh index db43ad9a7ff..7f19e084152 100644 --- a/src/EnergyPlus/SetPointManager.hh +++ b/src/EnergyPlus/SetPointManager.hh @@ -48,6 +48,8 @@ #ifndef SetPointManager_hh_INCLUDED #define SetPointManager_hh_INCLUDED +#include + // ObjexxFCL Headers #include #include @@ -69,128 +71,172 @@ namespace SetPointManager { reference }; - // Data - // MODULE PARAMETER DEFINITIONS: - extern int const MaxTemp; - extern int const MinTemp; - extern int const TempFirst; - extern int const FlowFirst; - extern int const iRefTempType_WetBulb; - extern int const iRefTempType_DryBulb; - extern int const iRefGroundTempObjType_BuildingSurface; - extern int const iRefGroundTempObjType_Shallow; - extern int const iRefGroundTempObjType_Deep; - extern int const iRefGroundTempObjType_FCfactorMethod; - - // following are used to reduce string comparisons related to CtrlVarType - extern int const iCtrlVarType_Temp; // control type 'Temperature' - extern int const iCtrlVarType_MaxTemp; // control type 'MaximumTemperature' - extern int const iCtrlVarType_MinTemp; // control type 'MinimumTemperature' - extern int const iCtrlVarType_HumRat; // control Type 'HumidityRatio' - extern int const iCtrlVarType_MaxHumRat; // control Type 'MaximumHumidityRatio' - extern int const iCtrlVarType_MinHumRat; // control Type 'MinimumHumidityRatio' - extern int const iCtrlVarType_MassFlow; // control type 'MassFlowRate' - extern int const iCtrlVarType_MaxMassFlow; // control Type 'MaximumMassFlowRate' - extern int const iCtrlVarType_MinMassFlow; // control Type 'MinimumMassFlowRate' - - extern int const NumValidCtrlTypes; - extern Array1D_string const cValidCtrlTypes; - - // following are used to reduce string comparisons related to CtrlVarType - extern int const iSPMType_Scheduled; - extern int const iSPMType_ScheduledDual; - extern int const iSPMType_OutsideAir; - extern int const iSPMType_SZReheat; - extern int const iSPMType_SZHeating; - extern int const iSPMType_SZCooling; - extern int const iSPMType_SZMinHum; - extern int const iSPMType_SZMaxHum; - extern int const iSPMType_MixedAir; - extern int const iSPMType_OutsideAirPretreat; - extern int const iSPMType_Warmest; - extern int const iSPMType_Coldest; - extern int const iSPMType_WarmestTempFlow; - extern int const iSPMType_RAB; - extern int const iSPMType_MZCoolingAverage; - extern int const iSPMType_MZHeatingAverage; - extern int const iSPMType_MZMinHumAverage; - extern int const iSPMType_MZMaxHumAverage; - extern int const iSPMType_MZMinHum; - extern int const iSPMType_MZMaxHum; - extern int const iSPMType_FollowOATemp; - extern int const iSPMType_FollowSysNodeTemp; - extern int const iSPMType_GroundTemp; - extern int const iSPMType_CondEntReset; - extern int const iSPMType_IdealCondEntReset; - extern int const iSPMType_SZOneStageCooling; - extern int const iSPMType_SZOneStageHeating; - extern int const iSPMType_ReturnWaterResetChW; - extern int const iSPMType_ReturnWaterResetHW; - - extern int const NumValidSPMTypes; - extern Array1D_string const cValidSPMTypes; - - // Type declarations in SetPointManager module - - // This one is used for conflicting node checks and is DEALLOCATED at the end of VerifySetPointManagers + enum class SupplyFlowTempStrategy { + MaxTemp, MinTemp, Unknown + }; + enum class ControlStrategy { + TempFirst, FlowFirst, Unknown + }; + enum class ReferenceTempType { + WetBulb, DryBulb, Unknown + }; + enum class ReferenceGroundTempObjectType { + BuildingSurface, Shallow, Deep, FCFactorMethod, Unknown + }; - // MODULE VARIABLE DECLARATIONS: - extern int NumAllSetPtMgrs; // Number of all Setpoint Managers found in input - extern int NumSchSetPtMgrs; // Number of Scheduled Setpoint Managers found in input - extern int NumDualSchSetPtMgrs; // Number of Scheduled Dual Setpoint Managers found in input - extern int NumOutAirSetPtMgrs; // Number of Outside Air Setpoint Managers found in input - extern int NumSZRhSetPtMgrs; // number of single zone reheat setpoint managers - extern int NumSZHtSetPtMgrs; // number of single zone heating setpoint managers - extern int NumSZClSetPtMgrs; // number of single zone cooling setpoint managers - extern int NumSZMinHumSetPtMgrs; // number of Single Zone Minimum Humidity Setpoint Managers - extern int NumSZMaxHumSetPtMgrs; // number of Single Zone Maximum Humidity Setpoint Managers - extern int NumMixedAirSetPtMgrs; // number of mixed air setpoint managers - extern int NumOAPretreatSetPtMgrs; // number of outside air pretreat setpoint managers - extern int NumWarmestSetPtMgrs; // number of Warmest setpoint managers - extern int NumColdestSetPtMgrs; // number of Coldest setpoint managers - extern int NumWarmestSetPtMgrsTempFlow; // number of Warmest Temp Flow setpoint managers - extern int NumRABFlowSetPtMgrs; // number of return air bypass temperature-based flow setpoint manager - extern int NumMZClgAverageSetPtMgrs; // number of Multizone:Cooling:Average setpoint managers - extern int NumMZHtgAverageSetPtMgrs; // number of Multizone:Heating:Average setpoint managers - extern int NumMZAverageMinHumSetPtMgrs; // number of MultiZone:MinimumHumidity:Average setpoint managers - extern int NumMZAverageMaxHumSetPtMgrs; // number of MultiZone:MaximumHumidity:Average setpoint managers - extern int NumMZMinHumSetPtMgrs; // number of MultiZone:Humidity:Minimum setpoint managers - extern int NumMZMaxHumSetPtMgrs; // number of MultiZone:Humidity:Maximum setpoint managers - extern int NumFollowOATempSetPtMgrs; // number of SetpointManager:FollowOutdoorAirTemperature setpoint managers - extern int NumFollowSysNodeTempSetPtMgrs; // number of SetpointManager:FollowSystemNodeTemperature setpoint managers - extern int NumGroundTempSetPtMgrs; // number of SetpointManager:FollowGroundTemperature setpoint managers - extern int NumCondEntSetPtMgrs; // number of Condenser Entering Reset setpoint managers - extern int NumIdealCondEntSetPtMgrs; // number of Ideal Condenser Entering Temperature setpoint managers - extern int NumSZOneStageCoolingSetPtMgrs; // number of single zone one stage cooling setpoint managers - extern int NumSZOneStageHeatingSetPtMgrs; // number of singel zone one stage heating setpoint managers - extern int NumReturnWaterResetChWSetPtMgrs; // number of chilled-water return water reset setpoint managers - extern int NumReturnWaterResetHWSetPtMgrs; // number of hot-water return water reset setpoint managers - extern int NumSchTESSetPtMgrs; // Number of TES Scheduled Setpoint Managers found in input - - extern bool ManagerOn; - extern bool GetInputFlag; // First time, input is "gotten" - - // temperature-based flow control manager - // Average Cooling Set Pt Mgr - // Average Heating Set Pt Mgr - // Average Minimum humidity ratio Set Pt Mgr - // Average Maximum humidity ratio Set Pt Mgr - - // Temperature Setpoint Manager data - // Node Temp Setpoint Manager data - // Manager data - - // SUBROUTINE SPECIFICATIONS FOR MODULE SetPointManager - - // Types - - struct DataSetPointManager // Derived type for all Setpoint Managers + enum class iCtrlVarType { + Unknown, + Temp, + MaxTemp, + MinTemp, + HumRat, + MaxHumRat, + MinHumRat, + MassFlow, + MaxMassFlow, + MinMassFlow + }; + int constexpr NumValidCtrlTypes = 9; + inline const char* controlTypeName(iCtrlVarType cvt) { + switch(cvt) { + case iCtrlVarType::Temp: + return "Temperature"; + case iCtrlVarType::MaxTemp: + return "MaximumTemperature"; + case iCtrlVarType::MinTemp: + return "MinimumTemperature"; + case iCtrlVarType::HumRat: + return "HumidityRatio"; + case iCtrlVarType::MaxHumRat: + return "MaximumHumidityRatio"; + case iCtrlVarType::MinHumRat: + return "MinimumHumidityRatio"; + case iCtrlVarType::MassFlow: + return "MassFlowRate"; + case iCtrlVarType::MaxMassFlow: + return "MaximumMassFlowRate"; + case iCtrlVarType::MinMassFlow: + return "MinimumMassFlowRate"; + case iCtrlVarType::Unknown: + return "*UNKNOWN*"; + } + return "*UNKNOWN*"; // not sure how we would get here, the switch block cases are exhaustive + } + + enum class SetPointManagerType { + Scheduled, + ScheduledDual, + OutsideAir, + SZReheat, + SZHeating, + SZCooling, + SZMinHum, + SZMaxHum, + MixedAir, + OutsideAirPretreat, + Warmest, + Coldest, + WarmestTempFlow, + RAB, + MZCoolingAverage, + MZHeatingAverage, + MZMinHumAverage, + MZMaxHumAverage, + MZMinHum, + MZMaxHum, + FollowOATemp, + FollowSysNodeTemp, + GroundTemp, + CondEntReset, + IdealCondEntReset, + SZOneStageCooling, + SZOneStageHeating, + ReturnWaterResetChW, + ReturnWaterResetHW, + TESScheduled, + Unknown + }; + int constexpr NumValidSPMTypes = 30; + inline const char* managerTypeName(SetPointManagerType t) { + switch(t) { + case SetPointManagerType::Scheduled: + return "SetpointManager:Scheduled"; + case SetPointManagerType::ScheduledDual: + return "SetpointManager:Scheduled:DualSetpoint"; + case SetPointManagerType::OutsideAir: + return "SetpointManager:OutdoorAirReset"; + case SetPointManagerType::SZReheat: + return "SetpointManager:SingleZone:Reheat"; + case SetPointManagerType::SZHeating: + return "SetpointManager:SingleZone:Heating"; + case SetPointManagerType::SZCooling: + return "SetpointManager:SingleZone:Cooling"; + case SetPointManagerType::SZMinHum: + return "SetpointManager:SingleZone:Humidity:Minimum"; + case SetPointManagerType::SZMaxHum: + return "SetpointManager:SingleZone:Humidity:Maximum"; + case SetPointManagerType::MixedAir: + return "SetpointManager:MixedAir"; + case SetPointManagerType::OutsideAirPretreat: + return "SetpointManager:OutdoorAirPretreat"; + case SetPointManagerType::Warmest: + return "SetpointManager:Warmest"; + case SetPointManagerType::Coldest: + return "SetpointManager:Coldest"; + case SetPointManagerType::WarmestTempFlow: + return "SetpointManager:WarmestTemperatureFlow"; + case SetPointManagerType::RAB: + return "SetpointManager:ReturnAirBypassFlow"; + case SetPointManagerType::MZCoolingAverage: + return "SetpointManager:MultiZone:Cooling:Average"; + case SetPointManagerType::MZHeatingAverage: + return "SetpointManager:MultiZone:Heating:Average"; + case SetPointManagerType::MZMinHumAverage: + return "SetpointManager:MultiZone:MinimumHumidity:Average"; + case SetPointManagerType::MZMaxHumAverage: + return "SetpointManager:MultiZone:MaximumHumidity:Average"; + case SetPointManagerType::MZMinHum: + return "SetpointManager:MultiZone:Humidity:Minimum"; + case SetPointManagerType::MZMaxHum: + return "SetpointManager:MultiZone:Humidity:Maximum"; + case SetPointManagerType::FollowOATemp: + return "SetpointManager:FollowOutdoorAirTemperature"; + case SetPointManagerType::FollowSysNodeTemp: + return "SetpointManager:FollowSystemNodeTemperature"; + case SetPointManagerType::GroundTemp: + return "SetpointManager:FollowGroundTemperature"; + case SetPointManagerType::CondEntReset: + return "SetpointManager:CondenserEnteringReset"; + case SetPointManagerType::IdealCondEntReset: + return "SetpointManager:CondenserEnteringReset:Ideal"; + case SetPointManagerType::SZOneStageCooling: + return "SetpointManager:SingleZone:OneStageCooling"; + case SetPointManagerType::SZOneStageHeating: + return "SetpointManager:SingleZone:OneStageHeating"; + case SetPointManagerType::ReturnWaterResetChW: + return "SetpointManager:ReturnTemperature:ChilledWater"; + case SetPointManagerType::ReturnWaterResetHW: + return "SetpointManager:ReturnTemperature:HotWater"; + case SetPointManagerType::TESScheduled: + return "SetpointManager:ScheduledTES"; + case SetPointManagerType::Unknown: + return "*UNKNOWN*"; + } + return "*UNKNOWN*"; // not sure how we would get here, the switch block cases are exhaustive + } + + struct SPBase { + std::string Name; + iCtrlVarType CtrlTypeMode; // set to iCtrlVarType::* + std::string CtrlVarType; + SPBase() : CtrlTypeMode(iCtrlVarType::Unknown) {} + }; + + struct DataSetPointManager : SPBase // Derived type for all Setpoint Managers { // Members - std::string Name; // name of setpoint manager - int SPMType; // integer representing type of setpoint manager + SetPointManagerType SPMType; // integer representing type of setpoint manager int SPMIndex; // index to specific set point manager - int CtrlTypeMode; // set to iCtrlVarType_xxxx int NumCtrlNodes; // number of control nodes Array1D_int CtrlNodes; // index to control node int AirLoopNum; // index to air loop @@ -198,17 +244,14 @@ namespace SetPointManager { int RefNode; // index to reference node // Default Constructor - DataSetPointManager() : SPMType(0), SPMIndex(0), CtrlTypeMode(0), NumCtrlNodes(0), AirLoopNum(0), RefNode(0) + DataSetPointManager() : SPMType(SetPointManagerType::Unknown), SPMIndex(0), NumCtrlNodes(0), AirLoopNum(0), RefNode(0) { } }; - struct DefineScheduledSetPointManager // Derived type for Scheduled Setpoint Manager data + struct DefineScheduledSetPointManager : SPBase // Derived type for Scheduled Setpoint Manager data { // Members - std::string Name; - std::string CtrlVarType; - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string Sched; int SchedPtr; int NumCtrlNodes; @@ -217,19 +260,16 @@ namespace SetPointManager { Real64 SetPt; // Default Constructor - DefineScheduledSetPointManager() : CtrlTypeMode(0), SchedPtr(0), NumCtrlNodes(0), SetPt(0.0) + DefineScheduledSetPointManager() : SchedPtr(0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefineSchedDualSetPointManager // Derived type for Scheduled Dual Setpoint Manager + struct DefineSchedDualSetPointManager : SPBase // Derived type for Scheduled Dual Setpoint Manager { // Members - std::string Name; - std::string CtrlVarType; - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string SchedHi; std::string SchedLo; int SchedPtrHi; @@ -241,19 +281,16 @@ namespace SetPointManager { Real64 SetPtLo; // Default Constructor - DefineSchedDualSetPointManager() : CtrlTypeMode(0), SchedPtrHi(0), SchedPtrLo(0), NumCtrlNodes(0), SetPtHi(0.0), SetPtLo(0.0) + DefineSchedDualSetPointManager() : SchedPtrHi(0), SchedPtrLo(0), NumCtrlNodes(0), SetPtHi(0.0), SetPtLo(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefineOutsideAirSetPointManager // Derived type for Outside Air Setpoint Manager Data + struct DefineOutsideAirSetPointManager : SPBase // Derived type for Outside Air Setpoint Manager Data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx Real64 OutLowSetPt1; // 1st setpoint at outside low Real64 OutLow1; // 1st Outside low Real64 OutHighSetPt1; // 1st setpoint at outside high @@ -271,7 +308,7 @@ namespace SetPointManager { // Default Constructor DefineOutsideAirSetPointManager() - : CtrlTypeMode(0), OutLowSetPt1(0.0), OutLow1(0.0), OutHighSetPt1(0.0), OutHigh1(0.0), SchedPtr(0), OutLowSetPt2(0.0), OutLow2(0.0), + : OutLowSetPt1(0.0), OutLow1(0.0), OutHighSetPt1(0.0), OutHigh1(0.0), SchedPtr(0), OutLowSetPt2(0.0), OutLow2(0.0), OutHighSetPt2(0.0), OutHigh2(0.0), NumCtrlNodes(0), SetPt(0.0) { @@ -282,12 +319,9 @@ namespace SetPointManager { Real64 CalcSetPoint(Real64 OutLowTemp, Real64 OutHighTemp, Real64 OutDryBulbTemp, Real64 SetTempAtOutLow, Real64 SetTempAtOutHigh); }; - struct DefineSZReheatSetPointManager // Derived type for the Single Zone Reheat Setpoint Manager data + struct DefineSZReheatSetPointManager : SPBase // Derived type for the Single Zone Reheat Setpoint Manager data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string ControlZoneName; // name of the control zone (zone with main thermostat) int ControlZoneNum; // number (index into Zone array) of control zone int ZoneNodeNum; // zone node number @@ -307,7 +341,7 @@ namespace SetPointManager { // Default Constructor DefineSZReheatSetPointManager() - : CtrlTypeMode(0), ControlZoneNum(0), ZoneNodeNum(0), ZoneInletNodeNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), MixedAirNode(0), + : ControlZoneNum(0), ZoneNodeNum(0), ZoneInletNodeNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), MixedAirNode(0), FanNodeIn(0), FanNodeOut(0), AirLoopNum(0), OAInNode(0), RetNode(0), LoopInNode(0), NumCtrlNodes(0), SetPt(0.0) { } @@ -315,12 +349,9 @@ namespace SetPointManager { void calculate(EnergyPlusData &state); }; - struct DefineSZHeatingSetPointManager // Derived type for the Single Zone Heating Setpoint Manager data + struct DefineSZHeatingSetPointManager : SPBase // Derived type for the Single Zone Heating Setpoint Manager data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string ControlZoneName; // name of the control zone (zone with main thermostat) int ControlZoneNum; // number (index into Zone array) of control zone int ZoneNodeNum; // zone node number @@ -333,19 +364,16 @@ namespace SetPointManager { // Default Constructor DefineSZHeatingSetPointManager() - : CtrlTypeMode(0), ControlZoneNum(0), ZoneNodeNum(0), ZoneInletNodeNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + : ControlZoneNum(0), ZoneNodeNum(0), ZoneInletNodeNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineSZCoolingSetPointManager // Derived type for the Single Zone Cooling Setpoint Manager data + struct DefineSZCoolingSetPointManager : SPBase // Derived type for the Single Zone Cooling Setpoint Manager data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string ControlZoneName; // name of the control zone (zone with main thermostat) int ControlZoneNum; // number (index into Zone array) of control zone int ZoneNodeNum; // zone node number @@ -358,19 +386,16 @@ namespace SetPointManager { // Default Constructor DefineSZCoolingSetPointManager() - : CtrlTypeMode(0), ControlZoneNum(0), ZoneNodeNum(0), ZoneInletNodeNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + : ControlZoneNum(0), ZoneNodeNum(0), ZoneInletNodeNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineSZMinHumSetPointManager // Derived Type for Single Zone Minimum Humidity Setpoint Manager data + struct DefineSZMinHumSetPointManager : SPBase // Derived Type for Single Zone Minimum Humidity Setpoint Manager data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx int NumZones; // number of zones whose humidity is being controlled int NumCtrlNodes; // number of nodes whose humidity ratio is being set Array1D_int ZoneNodes; // zone node numbers of zones being controlled @@ -380,19 +405,16 @@ namespace SetPointManager { Real64 SetPt; // the setpoint // Default Constructor - DefineSZMinHumSetPointManager() : CtrlTypeMode(0), NumZones(0), NumCtrlNodes(0), SetPt(0.0) + DefineSZMinHumSetPointManager() : NumZones(0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineSZMaxHumSetPointManager // Derived Type for Single Zone Maximum Humidity Setpoint Manager data + struct DefineSZMaxHumSetPointManager : SPBase // Derived Type for Single Zone Maximum Humidity Setpoint Manager data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx int NumZones; // number of zones whose humidity is being controlled int NumCtrlNodes; // number of nodes whose humidity ratio is being set Array1D_int ZoneNodes; // zone node numbers of zones being controlled @@ -402,19 +424,16 @@ namespace SetPointManager { Real64 SetPt; // the setpoint // Default Constructor - DefineSZMaxHumSetPointManager() : CtrlTypeMode(0), NumZones(0), NumCtrlNodes(0), SetPt(0.0) + DefineSZMaxHumSetPointManager() : NumZones(0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineMixedAirSetPointManager + struct DefineMixedAirSetPointManager : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx int RefNode; // reference node number int FanInNode; // supply fan inlet node number int FanOutNode; // Supplt fan outlet node number @@ -429,7 +448,7 @@ namespace SetPointManager { // Default Constructor DefineMixedAirSetPointManager() - : CtrlTypeMode(0), RefNode(0), FanInNode(0), FanOutNode(0), NumCtrlNodes(0), SetPt(0.0), MySetPointCheckFlag(true), + : RefNode(0), FanInNode(0), FanOutNode(0), NumCtrlNodes(0), SetPt(0.0), MySetPointCheckFlag(true), FreezeCheckEnable(false), CoolCoilInNode(0), CoolCoilOutNode(0), MinCoolCoilOutTemp(7.2) { @@ -438,12 +457,9 @@ namespace SetPointManager { void calculate(EnergyPlusData &state); }; - struct DefineOAPretreatSetPointManager + struct DefineOAPretreatSetPointManager : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx int RefNode; // reference node number int MixedOutNode; // mixed air outlet node number int OAInNode; // outside air inlet node number @@ -459,7 +475,7 @@ namespace SetPointManager { // Default Constructor DefineOAPretreatSetPointManager() - : CtrlTypeMode(0), RefNode(0), MixedOutNode(0), OAInNode(0), ReturnInNode(0), MinSetTemp(0.0), MaxSetTemp(0.0), MinSetHumRat(0.0), + : RefNode(0), MixedOutNode(0), OAInNode(0), ReturnInNode(0), MinSetTemp(0.0), MaxSetTemp(0.0), MinSetHumRat(0.0), MaxSetHumRat(0.0), NumCtrlNodes(0), SetPt(0.0), MySetPointCheckFlag(true) { } @@ -467,65 +483,56 @@ namespace SetPointManager { void calculate(EnergyPlusData &state); }; - struct DefineWarmestSetPointManager + struct DefineWarmestSetPointManager : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop that will use "warmest zone" strategy int AirLoopNum; // index of named air loop Real64 MinSetTemp; // minimum supply air setpoint temperature Real64 MaxSetTemp; // maximum supply air setpoint temperature - int Strategy; // supply flow and temperature set strategy + SupplyFlowTempStrategy Strategy; // supply flow and temperature set strategy // 1 = MaxTemp int NumCtrlNodes; // number of nodes whose temperature is being set Array1D_int CtrlNodes; // nodes where temperature is being set Real64 SetPt; // the setpoint // Default Constructor - DefineWarmestSetPointManager() : CtrlTypeMode(0), AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), Strategy(0), NumCtrlNodes(0), SetPt(0.0) + DefineWarmestSetPointManager() : AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), Strategy(SupplyFlowTempStrategy::Unknown), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefineColdestSetPointManager + struct DefineColdestSetPointManager : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop that will use "coldest zone" strategy int AirLoopNum; // index of named air loop Real64 MinSetTemp; // minimum supply air setpoint temperature Real64 MaxSetTemp; // maximum supply air setpoint temperature - int Strategy; // supply flow and temperature set strategy + SupplyFlowTempStrategy Strategy; // supply flow and temperature set strategy // 2 = MinTemp int NumCtrlNodes; // number of nodes whose temperature is being set Array1D_int CtrlNodes; // nodes where temperature is being set Real64 SetPt; // the setpoint // Default Constructor - DefineColdestSetPointManager() : CtrlTypeMode(0), AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), Strategy(0), NumCtrlNodes(0), SetPt(0.0) + DefineColdestSetPointManager() : AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), Strategy(SupplyFlowTempStrategy::Unknown), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefWarmestSetPtManagerTempFlow + struct DefWarmestSetPtManagerTempFlow : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop that will use "warmest zone" strategy int AirLoopNum; // index of named air loop Real64 MinSetTemp; // minimum supply air setpoint temperature Real64 MaxSetTemp; // maximum supply air setpoint temperature - int Strategy; // supply flow and temperature set strategy + ControlStrategy Strategy; // supply flow and temperature set strategy // 1 = TempFirst, 2 = FlowFirst int NumCtrlNodes; // number of nodes whose temperature is being set Array1D_int CtrlNodes; // nodes where temperature is being set @@ -537,7 +544,7 @@ namespace SetPointManager { // Default Constructor DefWarmestSetPtManagerTempFlow() - : CtrlTypeMode(0), AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), Strategy(0), NumCtrlNodes(0), SetPt(0.0), MinTurndown(0.0), + : AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), Strategy(ControlStrategy::Unknown), NumCtrlNodes(0), SetPt(0.0), MinTurndown(0.0), Turndown(0.0), CritZoneNum(0), SimReady(false) { } @@ -545,12 +552,9 @@ namespace SetPointManager { void calculate(EnergyPlusData &state); }; - struct DefRABFlowSetPointManager + struct DefRABFlowSetPointManager : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx int NumCtrlNodes; // number of nodes whose temperature is being set Array1D_int CtrlNodes; // nodes where temperature is being set std::string AirLoopName; // name of air loop that will use "warmest zone" strategy @@ -567,7 +571,7 @@ namespace SetPointManager { // Default Constructor DefRABFlowSetPointManager() - : CtrlTypeMode(0), NumCtrlNodes(0), AirLoopNum(0), SchedPtr(0), FlowSetPt(0.0), RABMixInNode(0), SupMixInNode(0), MixOutNode(0), + : NumCtrlNodes(0), AirLoopNum(0), SchedPtr(0), FlowSetPt(0.0), RABMixInNode(0), SupMixInNode(0), MixOutNode(0), RABSplitOutNode(0), SysOutNode(0), AllSetPtMgrIndex(0) { } @@ -575,12 +579,9 @@ namespace SetPointManager { void calculate(EnergyPlusData &state); }; - struct DefMultiZoneAverageCoolingSetPointManager // derived type for SetpointManager:Multizone:Cooling:Average data + struct DefMultiZoneAverageCoolingSetPointManager : SPBase // derived type for SetpointManager:Multizone:Cooling:Average data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop that will use "MultiZone:Cooling:Average" strategy int AirLoopNum; // index of named air loop Real64 MinSetTemp; // minimum supply air setpoint temperature [C] @@ -590,19 +591,16 @@ namespace SetPointManager { Real64 SetPt; // the temperature setpoint [C] // Default Constructor - DefMultiZoneAverageCoolingSetPointManager() : CtrlTypeMode(0), AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + DefMultiZoneAverageCoolingSetPointManager() : AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefMultiZoneAverageHeatingSetPointManager // derived type for SetpointManager:Multizone:Heating:Average data + struct DefMultiZoneAverageHeatingSetPointManager : SPBase // derived type for SetpointManager:Multizone:Heating:Average data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop that will use "MultiZone:Heating:Average" strategy int AirLoopNum; // index of named air loop Real64 MinSetTemp; // minimum supply air setpoint temperature [C] @@ -612,19 +610,16 @@ namespace SetPointManager { Real64 SetPt; // the temperature setpoint [C] // Default Constructor - DefMultiZoneAverageHeatingSetPointManager() : CtrlTypeMode(0), AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + DefMultiZoneAverageHeatingSetPointManager() : AirLoopNum(0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefMultiZoneAverageMinHumSetPointManager // derived type for SetpointManager:MultiZone:MinimumHumidity:Average data + struct DefMultiZoneAverageMinHumSetPointManager : SPBase // derived type for SetpointManager:MultiZone:MinimumHumidity:Average data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop using MultiZone:MinimumHumidity:Average strategy int AirLoopNum; // index of named air loop Real64 MinSetHum; // minimum supply air humidity ratio [kg/kg] @@ -634,19 +629,16 @@ namespace SetPointManager { Real64 SetPt; // the humidity ratio setpoint [kg/kg] // Default Constructor - DefMultiZoneAverageMinHumSetPointManager() : CtrlTypeMode(0), AirLoopNum(0), MinSetHum(0.0), MaxSetHum(0.0), NumCtrlNodes(0), SetPt(0.0) + DefMultiZoneAverageMinHumSetPointManager() : AirLoopNum(0), MinSetHum(0.0), MaxSetHum(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefMultiZoneAverageMaxHumSetPointManager // derived type for SetpointManager:MultiZone:MaximumHumidity:Average data + struct DefMultiZoneAverageMaxHumSetPointManager : SPBase // derived type for SetpointManager:MultiZone:MaximumHumidity:Average data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop using MultiZone:MaximumHumidity:Average strategy int AirLoopNum; // index of named air loop Real64 MinSetHum; // minimum supply air humidity ratio [kg/kg] @@ -656,19 +648,16 @@ namespace SetPointManager { Real64 SetPt; // the humidity ratio setpoint [kg/kg] // Default Constructor - DefMultiZoneAverageMaxHumSetPointManager() : CtrlTypeMode(0), AirLoopNum(0), MinSetHum(0.0), MaxSetHum(0.0), NumCtrlNodes(0), SetPt(0.0) + DefMultiZoneAverageMaxHumSetPointManager() : AirLoopNum(0), MinSetHum(0.0), MaxSetHum(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefMultiZoneMinHumSetPointManager // derived type for SetpointManager:MultiZone:Humidity:Minimum data + struct DefMultiZoneMinHumSetPointManager : SPBase // derived type for SetpointManager:MultiZone:Humidity:Minimum data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop using SetpointManager:MultiZone:Humidity:Minimum int AirLoopNum; // index of named air loop Real64 MinSetHum; // minimum supply air humidity ratio [kg/kg] @@ -678,19 +667,16 @@ namespace SetPointManager { Real64 SetPt; // the humidity ratio setpoint [kg/kg] // Default Constructor - DefMultiZoneMinHumSetPointManager() : CtrlTypeMode(0), AirLoopNum(0), MinSetHum(0.0), MaxSetHum(0.0), NumCtrlNodes(0), SetPt(0.0) + DefMultiZoneMinHumSetPointManager() : AirLoopNum(0), MinSetHum(0.0), MaxSetHum(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefMultiZoneMaxHumSetPointManager // derived type for SetpointManager:MultiZone:Humidity:Maximum data + struct DefMultiZoneMaxHumSetPointManager : SPBase // derived type for SetpointManager:MultiZone:Humidity:Maximum data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string AirLoopName; // name of air loop using SetpointManager:MultiZone:Humidity:Maximum int AirLoopNum; // index of named air loop Real64 MinSetHum; // minimum supply air humidity ratio [kg/kg] @@ -700,21 +686,18 @@ namespace SetPointManager { Real64 SetPt; // the humidity ratio setpoint [kg/kg] // Default Constructor - DefMultiZoneMaxHumSetPointManager() : CtrlTypeMode(0), AirLoopNum(0), MinSetHum(0.0), MaxSetHum(0.0), NumCtrlNodes(0), SetPt(0.0) + DefMultiZoneMaxHumSetPointManager() : AirLoopNum(0), MinSetHum(0.0), MaxSetHum(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(EnergyPlusData &state); }; - struct DefineFollowOATempSetPointManager + struct DefineFollowOATempSetPointManager : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string RefTempType; // Reference Temperature type (choice OutdoorAirWetBulb/OutdoorAirDryBulb) - int RefTypeMode; // set to iRefTempType_WetBulb or iRefTempType_DryBulb + ReferenceTempType RefTypeMode; // set to iRefTempType_WetBulb or iRefTempType_DryBulb Real64 Offset; // Offset temperature difference Real64 MinSetTemp; // Minimum supply air setpoint temperature Real64 MaxSetTemp; // Maximum supply air setpoint temperature @@ -724,22 +707,19 @@ namespace SetPointManager { // Default Constructor DefineFollowOATempSetPointManager() - : CtrlTypeMode(0), RefTypeMode(0), Offset(0.0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + : RefTypeMode(ReferenceTempType::Unknown), Offset(0.0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineFollowSysNodeTempSetPointManager + struct DefineFollowSysNodeTempSetPointManager : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx int RefNodeNum; // reference node number std::string RefTempType; // Reference Temperature type (choice OutdoorAirWetBulb/OutdoorAirDryBulb) - int RefTypeMode; // set to iRefTempType_WetBulb or iRefTempType_DryBulb + ReferenceTempType RefTypeMode; // set to iRefTempType_WetBulb or iRefTempType_DryBulb Real64 Offset; // Offset temperature difference Real64 MinSetTemp; // Minimum supply air setpoint temperature Real64 MaxSetTemp; // Maximum supply air setpoint temperature @@ -749,25 +729,22 @@ namespace SetPointManager { // Default Constructor DefineFollowSysNodeTempSetPointManager() - : CtrlTypeMode(0), RefNodeNum(0), RefTypeMode(0), Offset(0.0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + : RefNodeNum(0), RefTypeMode(ReferenceTempType::Unknown), Offset(0.0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineGroundTempSetPointManager + struct DefineGroundTempSetPointManager : SPBase { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string RefGroundTempObjType; // Reference Temperature type (Available choices are listed below) // Site:GroundTemperature:BuildingSurface // Site:GroundTemperature:Shallow // Site:GroundTemperature:Deep // Site:GroundTemperature:FCfactorMethod - int RefTypeMode; // set to iRefGroundTempObjType_xxxx based on RefGroundTempObjType + ReferenceGroundTempObjectType RefTypeMode; // set to iRefGroundTempObjType_xxxx based on RefGroundTempObjType Real64 Offset; // Offset temperature difference Real64 MinSetTemp; // Minimum supply air setpoint temperature Real64 MaxSetTemp; // Maximum supply air setpoint temperature @@ -777,19 +754,16 @@ namespace SetPointManager { // Default Constructor DefineGroundTempSetPointManager() - : CtrlTypeMode(0), RefTypeMode(0), Offset(0.0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + : RefTypeMode(ReferenceGroundTempObjectType::Unknown), Offset(0.0), MinSetTemp(0.0), MaxSetTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineCondEntSetPointManager // derived type for SetpointManager:CondenserEnteringReset data + struct DefineCondEntSetPointManager : SPBase // derived type for SetpointManager:CondenserEnteringReset data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string CondEntTempSched; // Optional schedule int CondEntTempSchedPtr; // default condenser entering water temperature schedule Index Real64 TowerDsnInletAirWetBulb; // cooling tower design inlet air wetbulb temperature @@ -812,7 +786,7 @@ namespace SetPointManager { // Default Constructor DefineCondEntSetPointManager() - : CtrlTypeMode(0), CondEntTempSchedPtr(0), TowerDsnInletAirWetBulb(0.0), MinTwrWbCurve(0), MinOaWbCurve(0), OptCondEntCurve(0), + : CondEntTempSchedPtr(0), TowerDsnInletAirWetBulb(0.0), MinTwrWbCurve(0), MinOaWbCurve(0), OptCondEntCurve(0), MinimumLiftTD(0.0), MaxCondEntTemp(0.0), NumCtrlNodes(0), SetPt(0.0), ChillerIndexPlantSide(0), ChillerIndexDemandSide(0), BranchIndexPlantSide(0), BranchIndexDemandSide(0), LoopIndexPlantSide(0), LoopIndexDemandSide(0), TypeNum(0) { @@ -821,12 +795,10 @@ namespace SetPointManager { void calculate(EnergyPlusData &state); }; - struct DefineIdealCondEntSetPointManager // derived type for SetpointManager:CondenserEnteringReset:Ideal data + struct DefineIdealCondEntSetPointManager : SPBase // derived type for SetpointManager:CondenserEnteringReset:Ideal data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx + // type of variable to be set Real64 MinimumLiftTD; // minimum lift Real64 MaxCondEntTemp; // maximum condenser entering water temp int NumCtrlNodes; // number of nodes whose temperature is being set @@ -857,7 +829,7 @@ namespace SetPointManager { // Default Constructor DefineIdealCondEntSetPointManager() - : CtrlTypeMode(0), MinimumLiftTD(0.0), MaxCondEntTemp(0.0), NumCtrlNodes(0), SetPt(0.0), ChillerIndexPlantSide(0), + : MinimumLiftTD(0.0), MaxCondEntTemp(0.0), NumCtrlNodes(0), SetPt(0.0), ChillerIndexPlantSide(0), BranchIndexPlantSide(0), LoopIndexPlantSide(0), ChllrVarType(0), ChllrVarIndex(0), ChlPumpVarType(0), ChlPumpVarIndex(0), CndPumpVarType(0), CndPumpVarIndex(0), TypeNum(0), CondLoopNum(0), numTowers(0), CondPumpNum(0), CondPumpBranchNum(0), ChilledPumpNum(0), ChilledPumpBranchNum(0), SetupIdealCondEntSetPtVars(true) @@ -876,15 +848,12 @@ namespace SetPointManager { Real64 &CondTempLimit, bool &RunOptCondEntTemp, bool &RunSubOptCondEntTemp, - bool &RunFinalOptCondEntTemp); + bool &RunFinalOptCondEntTemp) const; }; - struct DefineSZOneStageCoolinggSetPointManager // Derived type for the Single Zone One Stage Cooling Setpoint Manager data + struct DefineSZOneStageCoolinggSetPointManager : SPBase // Derived type for the Single Zone One Stage Cooling Setpoint Manager data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string ControlZoneName; // name of the control zone (zone with main thermostat) int ControlZoneNum; // number (index into Zone array) of control zone int ZoneNodeNum; // zone node number @@ -896,19 +865,16 @@ namespace SetPointManager { // Default Constructor DefineSZOneStageCoolinggSetPointManager() - : CtrlTypeMode(0), ControlZoneNum(0), ZoneNodeNum(0), CoolingOnTemp(0.0), CoolingOffTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + : ControlZoneNum(0), ZoneNodeNum(0), CoolingOnTemp(0.0), CoolingOffTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineSZOneStageHeatingSetPointManager // Derived type for the Single Zone One Stage Heating Setpoint Manager data + struct DefineSZOneStageHeatingSetPointManager : SPBase // Derived type for the Single Zone One Stage Heating Setpoint Manager data { // Members - std::string Name; - std::string CtrlVarType; // type of variable to be set - int CtrlTypeMode; // set to iCtrlVarType_xxxx std::string ControlZoneName; // name of the control zone (zone with main thermostat) int ControlZoneNum; // number (index into Zone array) of control zone int ZoneNodeNum; // zone node number @@ -920,17 +886,16 @@ namespace SetPointManager { // Default Constructor DefineSZOneStageHeatingSetPointManager() - : CtrlTypeMode(0), ControlZoneNum(0), ZoneNodeNum(0), HeatingOnTemp(0.0), HeatingOffTemp(0.0), NumCtrlNodes(0), SetPt(0.0) + : ControlZoneNum(0), ZoneNodeNum(0), HeatingOnTemp(0.0), HeatingOffTemp(0.0), NumCtrlNodes(0), SetPt(0.0) { } void calculate(); }; - struct DefineReturnWaterChWSetPointManager // derived type for SetpointManager:SupplyResetForReturnTemperature:ChilledWater data + struct DefineReturnWaterChWSetPointManager : SPBase // derived type for SetpointManager:SupplyResetForReturnTemperature:ChilledWater data { // Members - std::string Name; int returnNodeIndex; // node ID for the plant supply-side return node int supplyNodeIndex; // node ID for the plant supply-side supply node Real64 minimumChilledWaterSetpoint; // the minimum reset temperature for the chilled water setpoint @@ -944,7 +909,7 @@ namespace SetPointManager { // Default Constructor DefineReturnWaterChWSetPointManager() - : Name(""), returnNodeIndex(0), supplyNodeIndex(0), minimumChilledWaterSetpoint(0.0), maximumChilledWaterSetpoint(0.0), + : returnNodeIndex(0), supplyNodeIndex(0), minimumChilledWaterSetpoint(0.0), maximumChilledWaterSetpoint(0.0), returnTemperatureScheduleIndex(0), returnTemperatureConstantTarget(0.0), currentSupplySetPt(0.0), plantLoopIndex(0), plantSetpointNodeIndex(0), useReturnTempSetpoint(false) { @@ -954,10 +919,9 @@ namespace SetPointManager { void calculate(EnergyPlusData &state, DataLoopNode::NodeData &returnNode, DataLoopNode::NodeData &supplyNode); }; - struct DefineReturnWaterHWSetPointManager // derived type for SetpointManager:SupplyResetForReturnTemperature:HotWater data + struct DefineReturnWaterHWSetPointManager : SPBase // derived type for SetpointManager:SupplyResetForReturnTemperature:HotWater data { // Members - std::string Name; int returnNodeIndex; // node ID for the plant supply-side return node int supplyNodeIndex; // node ID for the plant supply-side supply node Real64 maximumHotWaterSetpoint; // the maximum reset temperature for the hot water setpoint @@ -971,7 +935,7 @@ namespace SetPointManager { // Default Constructor DefineReturnWaterHWSetPointManager() - : Name(""), returnNodeIndex(0), supplyNodeIndex(0), maximumHotWaterSetpoint(0.0), minimumHotWaterSetpoint(0.0), + : returnNodeIndex(0), supplyNodeIndex(0), maximumHotWaterSetpoint(0.0), minimumHotWaterSetpoint(0.0), returnTemperatureScheduleIndex(0), returnTemperatureConstantTarget(0.0), currentSupplySetPt(0.0), plantLoopIndex(0), plantSetpointNodeIndex(0), useReturnTempSetpoint(false) { @@ -981,7 +945,7 @@ namespace SetPointManager { void calculate(EnergyPlusData &state, DataLoopNode::NodeData &returnNode, DataLoopNode::NodeData &supplyNode); }; - struct DefineScheduledTESSetPointManager // Derived type for Scheduled TES Setpoint Manager data + struct DefineScheduledTESSetPointManager : SPBase // Derived type for Scheduled TES Setpoint Manager data { // Members int SchedPtr; @@ -1002,41 +966,6 @@ namespace SetPointManager { void calculate(EnergyPlusData &state); }; - // Object Data - extern Array1D AllSetPtMgr; // Array for all Setpoint Manager data(warnings) - extern Array1D SchSetPtMgr; // Array for Scheduled Setpoint Manager data - extern Array1D DualSchSetPtMgr; // Dual Scheduled Setpoint Manager data - extern Array1D OutAirSetPtMgr; // Array for Outside Air Setpoint Manager data - extern Array1D SingZoneRhSetPtMgr; // Array for SZRH Set Pt Mgr - extern Array1D SingZoneHtSetPtMgr; // Array for SZ Heating Set Pt Mgr - extern Array1D SingZoneClSetPtMgr; // Array for SZ Cooling Set Pt Mgr - extern Array1D SZMinHumSetPtMgr; // Array for SZ Min Hum Set Pt Mgr - extern Array1D SZMaxHumSetPtMgr; // Array for SZ Max Hum Set Pt Mgr - extern Array1D MixedAirSetPtMgr; // Array for Mixed Air Set Pt Mgr - extern Array1D OAPretreatSetPtMgr; // Array for OA Pretreat Set Pt Mgr - extern Array1D WarmestSetPtMgr; // Array for Warmest Set Pt Mgr - extern Array1D ColdestSetPtMgr; // Array for Coldest Set Pt Mgr - extern Array1D WarmestSetPtMgrTempFlow; // Array for Warmest Set Pt Mgr - extern Array1D RABFlowSetPtMgr; // Array for return air bypass - extern Array1D MZAverageCoolingSetPtMgr; // Array for MultiZone - extern Array1D MZAverageHeatingSetPtMgr; // Array for MultiZone - extern Array1D MZAverageMinHumSetPtMgr; // Array for MultiZone - extern Array1D MZAverageMaxHumSetPtMgr; // Array for MultiZone - extern Array1D MZMinHumSetPtMgr; // Multizone min humidity rat Set Pt Mgr - extern Array1D MZMaxHumSetPtMgr; // Multizone max humidity rat Set Pt Mgr - extern Array1D FollowOATempSetPtMgr; // Array for Follow Outdoor Air - extern Array1D FollowSysNodeTempSetPtMgr; // Array for Follow System - extern Array1D GroundTempSetPtMgr; // Array for Ground Temp Setpoint - extern Array1D CondEntSetPtMgr; // Condenser Entering Water Set Pt Mgr - extern Array1D IdealCondEntSetPtMgr; // Ideal Condenser Entering Set Pt Mgr - extern Array1D SZOneStageCoolingSetPtMgr; // single zone 1 stage cool - extern Array1D SZOneStageHeatingSetPtMgr; // single zone 1 stage heat - extern Array1D ReturnWaterResetChWSetPtMgr; // return water reset - extern Array1D ReturnWaterResetHWSetPtMgr; // hot-water return reset - extern Array1D SchTESSetPtMgr; // Array for Scheduled Setpoint Manager data - - // Functions - void clear_state(); void ManageSetPoints(EnergyPlusData &state); @@ -1053,31 +982,229 @@ namespace SetPointManager { void UpdateSetPointManagers(EnergyPlusData &state); - void UpdateMixedAirSetPoints(); + void UpdateMixedAirSetPoints(EnergyPlusData &state); - void UpdateOAPretreatSetPoints(); + void UpdateOAPretreatSetPoints(EnergyPlusData &state); - int getSPMBasedOnNode(EnergyPlusData &state, int const NodeNum, int const SetPtType, int const SMPType, CtrlNodeType ctrlOrRefNode); + int getSPMBasedOnNode(EnergyPlusData &state, int NodeNum, iCtrlVarType SetPtType, SetPointManagerType SMPType, CtrlNodeType ctrlOrRefNode); - bool IsNodeOnSetPtManager(EnergyPlusData &state, int const NodeNum, int const SetPtType); + bool IsNodeOnSetPtManager(EnergyPlusData &state, int NodeNum, iCtrlVarType SetPtType); - bool NodeHasSPMCtrlVarType(EnergyPlusData &state, int const NodeNum, int const iCtrlVarType); + bool NodeHasSPMCtrlVarType(EnergyPlusData &state, int NodeNum, iCtrlVarType iCtrlVarType); - void ResetHumidityRatioCtrlVarType(EnergyPlusData &state, int const NodeNum); + void ResetHumidityRatioCtrlVarType(EnergyPlusData &state, int NodeNum); void CheckIfAnyIdealCondEntSetPoint(EnergyPlusData &state); - int GetHumidityRatioVariableType(EnergyPlusData &state, int const CntrlNodeNum); + iCtrlVarType GetHumidityRatioVariableType(EnergyPlusData &state, int CntrlNodeNum); void SetUpNewScheduledTESSetPtMgr(EnergyPlusData &state, - int const SchedPtr, int const SchedPtrCharge, Real64 NonChargeCHWTemp, Real64 ChargeCHWTemp, int const CompOpType, int const ControlNodeNum); + int SchedPtr, int SchedPtrCharge, Real64 NonChargeCHWTemp, Real64 ChargeCHWTemp, int CompOpType, int ControlNodeNum); - bool GetCoilFreezingCheckFlag(EnergyPlusData &state, int const MixedAirSPMNum); + bool GetCoilFreezingCheckFlag(EnergyPlusData &state, int MixedAirSPMNum); - int GetMixedAirNumWithCoilFreezingCheck(EnergyPlusData &state, int const MixedAirNode); + int GetMixedAirNumWithCoilFreezingCheck(EnergyPlusData &state, int MixedAirNode); } // namespace SetPointManager +struct SetPointManagerData : BaseGlobalStruct { + // MODULE VARIABLE DECLARATIONS: + int NumAllSetPtMgrs = 0; // Number of all Setpoint Managers found in input + int NumSchSetPtMgrs = 0; // Number of Scheduled Setpoint Managers found in input + int NumDualSchSetPtMgrs = 0; // Number of Scheduled Dual Setpoint Managers found in input + int NumOutAirSetPtMgrs = 0; // Number of Outside Air Setpoint Managers found in input + int NumSZRhSetPtMgrs = 0; // number of single zone reheat setpoint managers + int NumSZHtSetPtMgrs = 0; // number of single zone heating setpoint managers + int NumSZClSetPtMgrs = 0; // number of single zone cooling setpoint managers + int NumSZMinHumSetPtMgrs = 0; // number of Single Zone Minimum Humidity Setpoint Managers + int NumSZMaxHumSetPtMgrs = 0; // number of Single Zone Maximum Humidity Setpoint Managers + int NumMixedAirSetPtMgrs = 0; // number of mixed air setpoint managers + int NumOAPretreatSetPtMgrs = 0; // number of outside air pretreat setpoint managers + int NumWarmestSetPtMgrs = 0; // number of Warmest setpoint managers + int NumColdestSetPtMgrs = 0; // number of Coldest setpoint managers + int NumWarmestSetPtMgrsTempFlow = 0; // number of Warmest Temp Flow setpoint managers + int NumRABFlowSetPtMgrs = 0; // number of return air bypass temperature-based flow setpoint manager + int NumMZClgAverageSetPtMgrs = 0; // number of Multizone:Cooling:Average setpoint managers + int NumMZHtgAverageSetPtMgrs = 0; // number of Multizone:Heating:Average setpoint managers + int NumMZAverageMinHumSetPtMgrs = 0; // number of MultiZone:MinimumHumidity:Average setpoint managers + int NumMZAverageMaxHumSetPtMgrs = 0; // number of MultiZone:MaximumHumidity:Average setpoint managers + int NumMZMinHumSetPtMgrs = 0; // number of MultiZone:Humidity:Minimum setpoint managers + int NumMZMaxHumSetPtMgrs = 0; // number of MultiZone:Humidity:Maximum setpoint managers + int NumFollowOATempSetPtMgrs = 0; // number of SetpointManager:FollowOutdoorAirTemperature setpoint managers + int NumFollowSysNodeTempSetPtMgrs = 0; // number of SetpointManager:FollowSystemNodeTemperature setpoint managers + int NumGroundTempSetPtMgrs = 0; // number of SetpointManager:FollowGroundTemperature setpoint managers + int NumCondEntSetPtMgrs = 0; // number of Condenser Entering Reset setpoint managers + int NumIdealCondEntSetPtMgrs = 0; // number of Ideal Condenser Entering Temperature setpoint managers + int NumSZOneStageCoolingSetPtMgrs = 0; // number of single zone one stage cooling setpoint managers + int NumSZOneStageHeatingSetPtMgrs = 0; // number of singel zone one stage heating setpoint managers + int NumReturnWaterResetChWSetPtMgrs = 0; // number of return water reset setpoint managers + int NumReturnWaterResetHWSetPtMgrs = 0; // number of hot-water return water reset setpoint managers + int NumSchTESSetPtMgrs = 0; // number of TES scheduled setpoint managers (created internally, not by user input) + + bool ManagerOn = false; + bool GetInputFlag = true; // First time, input is "gotten" + + bool InitSetPointManagersOneTimeFlag = true; + bool InitSetPointManagersOneTimeFlag2 = true; + Real64 DCESPMDsn_EntCondTemp = 0.0; + Real64 DCESPMDsn_MinCondSetpt = 0.0; + Real64 DCESPMCur_MinLiftTD = 0.0; + Real64 DCESPMDesign_Load_Sum = 0.0; + Real64 DCESPMActual_Load_Sum = 0.0; + Real64 DCESPMWeighted_Actual_Load_Sum = 0.0; + Real64 DCESPMWeighted_Design_Load_Sum = 0.0; + Real64 DCESPMWeighted_Ratio = 0.0; + Real64 DCESPMMin_DesignWB = 0.0; + Real64 DCESPMMin_ActualWb = 0.0; + Real64 DCESPMOpt_CondEntTemp = 0.0; + Real64 DCESPMDesignClgCapacity_Watts = 0.0; + Real64 DCESPMCurrentLoad_Watts = 0.0; + Real64 DCESPMCondInletTemp = 0.0; + Real64 DCESPMEvapOutletTemp = 0.0; + bool NoSurfaceGroundTempObjWarning = true; // This will cause a warning to be issued if no "surface" ground + // temperature object was input. + bool NoShallowGroundTempObjWarning = true; // This will cause a warning to be issued if no "shallow" ground + // temperature object was input. + bool NoDeepGroundTempObjWarning = true; // This will cause a warning to be issued if no "deep" ground + // temperature object was input. + bool NoFCGroundTempObjWarning = true; // This will cause a warning to be issued if no ground + // temperature object was input for FC Factor method + bool InitSetPointManagersMyEnvrnFlag = true; // flag for init once at start of environment + bool RunSubOptCondEntTemp = false; + bool RunFinalOptCondEntTemp = false; + + // Object Data + Array1D AllSetPtMgr; // Array for all Setpoint Manager data(warnings) + Array1D SchSetPtMgr; // Array for Scheduled Setpoint Manager data + Array1D DualSchSetPtMgr; // Dual Scheduled Setpoint Manager data + Array1D OutAirSetPtMgr; // Array for Outside Air Setpoint Manager data + Array1D SingZoneRhSetPtMgr; // Array for SZRH Set Pt Mgr + Array1D SingZoneHtSetPtMgr; // Array for SZ Heating Set Pt Mgr + Array1D SingZoneClSetPtMgr; // Array for SZ Cooling Set Pt Mgr + Array1D SZMinHumSetPtMgr; // Array for SZ Min Hum Set Pt Mgr + Array1D SZMaxHumSetPtMgr; // Array for SZ Max Hum Set Pt Mgr + Array1D MixedAirSetPtMgr; // Array for Mixed Air Set Pt Mgr + Array1D OAPretreatSetPtMgr; // Array for OA Pretreat Set Pt Mgr + Array1D WarmestSetPtMgr; // Array for Warmest Set Pt Mgr + Array1D ColdestSetPtMgr; // Array for Coldest Set Pt Mgr + Array1D WarmestSetPtMgrTempFlow; // Array for Warmest Set Pt Mgr + Array1D RABFlowSetPtMgr; // Array for return air bypass + Array1D MZAverageCoolingSetPtMgr; // Array for MultiZone + Array1D MZAverageHeatingSetPtMgr; // Array for MultiZone + Array1D MZAverageMinHumSetPtMgr; // Array for MultiZone + Array1D MZAverageMaxHumSetPtMgr; // Array for MultiZone + Array1D MZMinHumSetPtMgr; // Multizone min humidity rat Set Pt Mgr + Array1D MZMaxHumSetPtMgr; // Multizone max humidity rat Set Pt Mgr + Array1D FollowOATempSetPtMgr; // Array for Follow Outdoor Air + Array1D FollowSysNodeTempSetPtMgr; // Array for Follow System + Array1D GroundTempSetPtMgr; // Array for Ground Temp Setpoint + Array1D CondEntSetPtMgr; // Condenser Entering Water Set Pt Mgr + Array1D IdealCondEntSetPtMgr; // Ideal Condenser Entering Set Pt Mgr + Array1D SZOneStageCoolingSetPtMgr; // single zone 1 stage cool + Array1D SZOneStageHeatingSetPtMgr; // single zone 1 stage heat + Array1D ReturnWaterResetChWSetPtMgr; // return water reset + Array1D ReturnWaterResetHWSetPtMgr; // hot-water return water reset + Array1D SchTESSetPtMgr; // Array for TES Scheduled Setpoint Manager data + + void clear_state() override + { + + NumAllSetPtMgrs = 0; // Number of all Setpoint Managers found in input + NumSchSetPtMgrs = 0; // Number of Scheduled Setpoint Managers found in input + NumDualSchSetPtMgrs = 0; // Number of Scheduled Dual Setpoint Managers found in input + NumOutAirSetPtMgrs = 0; // Number of Outside Air Setpoint Managers found in input + NumSZRhSetPtMgrs = 0; // number of single zone reheat setpoint managers + NumSZHtSetPtMgrs = 0; // number of single zone heating setpoint managers + NumSZClSetPtMgrs = 0; // number of single zone cooling setpoint managers + NumSZMinHumSetPtMgrs = 0; // number of Single Zone Minimum Humidity Setpoint Managers + NumSZMaxHumSetPtMgrs = 0; // number of Single Zone Maximum Humidity Setpoint Managers + NumMixedAirSetPtMgrs = 0; // number of mixed air setpoint managers + NumOAPretreatSetPtMgrs = 0; // number of outside air pretreat setpoint managers + NumWarmestSetPtMgrs = 0; // number of Warmest setpoint managers + NumColdestSetPtMgrs = 0; // number of Coldest setpoint managers + NumWarmestSetPtMgrsTempFlow = 0; // number of Warmest Temp Flow setpoint managers + NumRABFlowSetPtMgrs = 0; // number of return air bypass temperature-based flow setpoint manager + NumMZClgAverageSetPtMgrs = 0; // number of Multizone:Cooling:Average setpoint managers + NumMZHtgAverageSetPtMgrs = 0; // number of Multizone:Heating:Average setpoint managers + NumMZAverageMinHumSetPtMgrs = 0; // number of MultiZone:MinimumHumidity:Average setpoint managers + NumMZAverageMaxHumSetPtMgrs = 0; // number of MultiZone:MaximumHumidity:Average setpoint managers + NumMZMinHumSetPtMgrs = 0; // number of MultiZone:Humidity:Minimum setpoint managers + NumMZMaxHumSetPtMgrs = 0; // number of MultiZone:Humidity:Maximum setpoint managers + NumFollowOATempSetPtMgrs = 0; // number of SetpointManager:FollowOutdoorAirTemperature setpoint managers + NumFollowSysNodeTempSetPtMgrs = 0; // number of SetpointManager:FollowSystemNodeTemperature setpoint managers + NumGroundTempSetPtMgrs = 0; // number of SetpointManager:FollowGroundTemperature setpoint managers + NumCondEntSetPtMgrs = 0; // number of Condenser Entering Reset setpoint managers + NumIdealCondEntSetPtMgrs = 0; // number of Ideal Condenser Entering Temperature setpoint managers + NumSZOneStageCoolingSetPtMgrs = 0; // number of single zone one stage cooling setpoint managers + NumSZOneStageHeatingSetPtMgrs = 0; // number of singel zone one stage heating setpoint managers + NumReturnWaterResetChWSetPtMgrs = 0; // number of return water reset setpoint managers + NumReturnWaterResetHWSetPtMgrs = 0; // number of hot-water return water reset setpoint managers + NumSchTESSetPtMgrs = 0; // number of TES Scheduled setpoint Managers + + DCESPMDsn_EntCondTemp = 0.0; + DCESPMDsn_MinCondSetpt = 0.0; + DCESPMCur_MinLiftTD = 0.0; + DCESPMDesign_Load_Sum = 0.0; + DCESPMActual_Load_Sum = 0.0; + DCESPMWeighted_Actual_Load_Sum = 0.0; + DCESPMWeighted_Design_Load_Sum = 0.0; + DCESPMWeighted_Ratio = 0.0; + DCESPMMin_DesignWB = 0.0; + DCESPMMin_ActualWb = 0.0; + DCESPMOpt_CondEntTemp = 0.0; + DCESPMDesignClgCapacity_Watts = 0.0; + DCESPMCurrentLoad_Watts = 0.0; + DCESPMCondInletTemp = 0.0; + DCESPMEvapOutletTemp = 0.0; + + ManagerOn = false; + GetInputFlag = true; // First time, input is "gotten" + // Object Data + InitSetPointManagersOneTimeFlag = true; + InitSetPointManagersOneTimeFlag2 = true; + AllSetPtMgr.deallocate(); // Array for all Setpoint Manager data(warnings) + SchSetPtMgr.deallocate(); // Array for Scheduled Setpoint Manager data + DualSchSetPtMgr.deallocate(); // Dual Scheduled Setpoint Manager data + OutAirSetPtMgr.deallocate(); // Array for Outside Air Setpoint Manager data + SingZoneRhSetPtMgr.deallocate(); // Array for SZRH Set Pt Mgr + SingZoneHtSetPtMgr.deallocate(); // Array for SZ Heating Set Pt Mgr + SingZoneClSetPtMgr.deallocate(); // Array for SZ Cooling Set Pt Mgr + SZMinHumSetPtMgr.deallocate(); // Array for SZ Min Hum Set Pt Mgr + SZMaxHumSetPtMgr.deallocate(); // Array for SZ Max Hum Set Pt Mgr + MixedAirSetPtMgr.deallocate(); // Array for Mixed Air Set Pt Mgr + OAPretreatSetPtMgr.deallocate(); // Array for OA Pretreat Set Pt Mgr + WarmestSetPtMgr.deallocate(); // Array for Warmest Set Pt Mgr + ColdestSetPtMgr.deallocate(); // Array for Coldest Set Pt Mgr + WarmestSetPtMgrTempFlow.deallocate(); // Array for Warmest Set Pt Mgr + RABFlowSetPtMgr.deallocate(); // Array for return air bypass + MZAverageCoolingSetPtMgr.deallocate(); // Array for MultiZone + MZAverageHeatingSetPtMgr.deallocate(); // Array for MultiZone + MZAverageMinHumSetPtMgr.deallocate(); // Array for MultiZone + MZAverageMaxHumSetPtMgr.deallocate(); // Array for MultiZone + MZMinHumSetPtMgr.deallocate(); // Multizone min humidity rat Set Pt Mgr + MZMaxHumSetPtMgr.deallocate(); // Multizone max humidity rat Set Pt Mgr + FollowOATempSetPtMgr.deallocate(); // Array for Follow Outdoor Air + FollowSysNodeTempSetPtMgr.deallocate(); // Array for Follow System + GroundTempSetPtMgr.deallocate(); // Array for Ground Temp Setpoint + CondEntSetPtMgr.deallocate(); // Condenser Entering Water Set Pt Mgr + IdealCondEntSetPtMgr.deallocate(); // Ideal Condenser Entering Set Pt Mgr + SZOneStageCoolingSetPtMgr.deallocate(); // single zone 1 stage cool + SZOneStageHeatingSetPtMgr.deallocate(); // single zone 1 stage heat + ReturnWaterResetChWSetPtMgr.deallocate(); // return water reset + ReturnWaterResetHWSetPtMgr.deallocate(); // hot-water return water reset + SchTESSetPtMgr.deallocate(); // TES Scheduled setpoint Managers + + NoSurfaceGroundTempObjWarning = true; + NoShallowGroundTempObjWarning = true; + NoDeepGroundTempObjWarning = true; + NoFCGroundTempObjWarning = true; + InitSetPointManagersMyEnvrnFlag = true; + RunSubOptCondEntTemp = false; + RunFinalOptCondEntTemp = false; + } + +}; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/SimAirServingZones.hh b/src/EnergyPlus/SimAirServingZones.hh index 806e9586595..4ae701ab3b9 100644 --- a/src/EnergyPlus/SimAirServingZones.hh +++ b/src/EnergyPlus/SimAirServingZones.hh @@ -100,123 +100,81 @@ namespace SimAirServingZones { extern int const Fan_ComponentModel; // cpw22Aug2010 (new) extern int const DXHeatPumpSystem; extern int const CoilUserDefined; - extern int const Fan_System_Object; extern int const UnitarySystemModel; extern int const ZoneVRFasAirLoopEquip; - // DERIVED TYPE DEFINITIONS: - // na - - // MODULE VARIABLE DECLARATIONS: - extern bool GetAirLoopInputFlag; // Flag set to make sure you get input once extern int NumOfTimeStepInDay; // number of zone time steps in a day - // Subroutine Specifications for the Module - // Driver/Manager Routines - - // Get Input routines for module - - // Initialization routines for module - - // Simulation subroutines for the module - - // Functions void clear_state(); - void ManageAirLoops(EnergyPlusData &state, bool const FirstHVACIteration, // TRUE if first full HVAC iteration in an HVAC timestep + void ManageAirLoops(EnergyPlusData &state, bool FirstHVACIteration, // TRUE if first full HVAC iteration in an HVAC timestep bool &SimAir, // TRUE means air loops must be (re)simulated bool &SimZoneEquipment // TRUE means zone equipment must be (re) simulated ); - // Get Input Section of the Module - //****************************************************************************** - void GetAirPathData(EnergyPlusData &state); - // End of Get Input subroutines for the Module - //****************************************************************************** - - // Beginning Initialization Section of the Module - //****************************************************************************** - - void InitAirLoops(EnergyPlusData &state, bool const FirstHVACIteration); // TRUE if first full HVAC iteration in an HVAC timestep + void InitAirLoops(EnergyPlusData &state, bool FirstHVACIteration); // TRUE if first full HVAC iteration in an HVAC timestep void ConnectReturnNodes(EnergyPlusData &state); - // Begin Algorithm Section of the Module - //****************************************************************************** - - void SimAirLoops(EnergyPlusData &state, bool const FirstHVACIteration, bool &SimZoneEquipment); + void SimAirLoops(EnergyPlusData &state, bool FirstHVACIteration, bool &SimZoneEquipment); void SimAirLoop(EnergyPlusData &state, - bool const FirstHVACIteration, int const AirLoopNum, int const AirLoopPass, int &AirLoopIterMax, int &AirLoopIterTot, int &AirLoopNumCalls); + bool FirstHVACIteration, int AirLoopNum, int AirLoopPass, int &AirLoopIterMax, int &AirLoopIterTot, int &AirLoopNumCalls); void SolveAirLoopControllers(EnergyPlusData &state, - bool const FirstHVACIteration, int const AirLoopNum, bool &AirLoopConvergedFlag, int &IterMax, int &IterTot, int &NumCalls); + bool FirstHVACIteration, int AirLoopNum, bool &AirLoopConvergedFlag, int &IterMax, int &IterTot, int &NumCalls); - void SolveWaterCoilController(EnergyPlusData &state, bool const FirstHVACIteration, - int const AirLoopNum, + void SolveWaterCoilController(EnergyPlusData &state, bool FirstHVACIteration, + int AirLoopNum, std::string const &CompName, int &CompIndex, std::string const &ControllerName, int ControllerIndex, - bool const HXAssistedWaterCoil); + bool HXAssistedWaterCoil); void ReSolveAirLoopControllers(EnergyPlusData &state, - bool const FirstHVACIteration, int const AirLoopNum, bool &AirLoopConvergedFlag, int &IterMax, int &IterTot, int &NumCalls); + bool FirstHVACIteration, int AirLoopNum, bool &AirLoopConvergedFlag, int &IterMax, int &IterTot, int &NumCalls); - void SimAirLoopComponents(EnergyPlusData &state, int const AirLoopNum, // Index of the air loop being currently simulated - bool const FirstHVACIteration // TRUE if first full HVAC iteration in an HVAC timestep + void SimAirLoopComponents(EnergyPlusData &state, int AirLoopNum, // Index of the air loop being currently simulated + bool FirstHVACIteration // TRUE if first full HVAC iteration in an HVAC timestep ); void SimAirLoopComponent(EnergyPlusData &state, std::string const &CompName, // the component Name - int const CompType_Num, // numeric equivalent for component type - bool const FirstHVACIteration, // TRUE if first full HVAC iteration in an HVAC timestep - int const AirLoopNum, // Primary air loop number + int CompType_Num, // numeric equivalent for component type + bool FirstHVACIteration, // TRUE if first full HVAC iteration in an HVAC timestep + int AirLoopNum, // Primary air loop number int &CompIndex, // numeric pointer for CompType/CompName -- passed back from other routines HVACSystemData *CompPointer); void UpdateBranchConnections(EnergyPlusData &state, - int const AirLoopNum, // primary air system number - int const BranchNum, // branch reference number - int const Update // 1=BeforeBranchSim; 2=AfterBranchSim + int AirLoopNum, // primary air system number + int BranchNum, // branch reference number + int Update // 1=BeforeBranchSim; 2=AfterBranchSim ); void ResolveSysFlow(EnergyPlusData &state, - int const SysNum, // the primary air system number - bool &SysReSim // Set to TRUE if mass balance fails and resimulation is needed + int SysNum, // the primary air system number + bool &SysReSim // Set to TRUE if mass balance fails and re-simulation is needed ); void SizeAirLoops(EnergyPlusData &state); - void SizeAirLoopBranches(EnergyPlusData &state, int const AirLoopNum, int const BranchNum); + void SizeAirLoopBranches(EnergyPlusData &state, int AirLoopNum, int BranchNum); void SetUpSysSizingArrays(EnergyPlusData &state); void SizeSysOutdoorAir(EnergyPlusData &state); - void UpdateSysSizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator const CallIndicator); + void UpdateSysSizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator CallIndicator); - void UpdateSysSizingForScalableInputs(EnergyPlusData &state, int const AirLoopNum); + void UpdateSysSizingForScalableInputs(EnergyPlusData &state, int AirLoopNum); - Real64 GetHeatingSATempForSizing(EnergyPlusData &state, int const IndexAirLoop // air loop index - ); - - Real64 GetHeatingSATempHumRatForSizing(EnergyPlusData &state, int const IndexAirLoop // air loop index - ); + Real64 GetHeatingSATempForSizing(EnergyPlusData &state, int IndexAirLoop); - // End Algorithm Section of the Module - // ***************************************************************************** - - // Beginning of Reporting subroutines for the SimAir Module - // ***************************************************************************** - - // End of Reporting subroutines for the SimAir Module - // ***************************************************************************** - - // Utility Subroutines for the SimAir Module - // ***************************************************************************** + Real64 GetHeatingSATempHumRatForSizing(EnergyPlusData &state, int IndexAirLoop); void LimitZoneVentEff(Real64 Xs, // ratio of uncorrected system outdoor air flow rate to the design system supply flow rate Real64 Voz, // corrected (divided by distribution efficiency) zone outside air flow rate [m3/s] @@ -224,16 +182,13 @@ namespace SimAirServingZones { Real64 &SystemCoolingEv // system ventilation efficiency ); - void CheckWaterCoilIsOnAirLoop(EnergyPlusData &state, int const CoilTypeNum, std::string const CompType, std::string const CompName, bool &WaterCoilOnAirLoop); - - bool CheckWaterCoilOnPrimaryAirLoopBranch(EnergyPlusData &state, int const CoilTypeNum, std::string const CompName); + void CheckWaterCoilIsOnAirLoop(EnergyPlusData &state, int CoilTypeNum, std::string CompType, std::string CompName, bool &WaterCoilOnAirLoop); - bool CheckWaterCoilOnOASystem(EnergyPlusData &state, int const CoilTypeNum, std::string const CompName); + bool CheckWaterCoilOnPrimaryAirLoopBranch(EnergyPlusData &state, int CoilTypeNum, std::string CompName); - bool CheckWaterCoilSystemOnAirLoopOrOASystem(EnergyPlusData &state, int const CoilTypeNum, std::string const CompName); + bool CheckWaterCoilOnOASystem(EnergyPlusData &state, int CoilTypeNum, std::string CompName); - // End of Utility subroutines for the SimAir Module - // ***************************************************************************** + bool CheckWaterCoilSystemOnAirLoopOrOASystem(EnergyPlusData &state, int CoilTypeNum, std::string CompName); } // namespace SimAirServingZones diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 7c991edadad..3793e210d80 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -173,29 +173,6 @@ namespace SimulationManager { // MODULE PARAMETER DEFINITIONS: static std::string const BlankString; - // MODULE VARIABLE DECLARATIONS: - bool RunPeriodsInInput(false); - bool RunControlInInput(false); - - namespace { - // These were static variables within different functions. They were pulled out into the namespace - // to facilitate easier unit testing of those functions. - // These are purposefully not in the header file as an extern variable. No one outside of SimulationManager should - // use these. They are cleared by clear_state() for use by unit tests, but normal simulations should be unaffected. - // This is purposefully in an anonymous namespace so nothing outside this implementation file can use it. - bool PreP_Fatal(false); - bool WarningOut(true); - } // namespace - - // Functions - void clear_state() - { - RunPeriodsInInput = false; - RunControlInInput = false; - PreP_Fatal = false; - WarningOut = true; - } - void ManageSimulation(EnergyPlusData &state) { @@ -318,7 +295,7 @@ namespace SimulationManager { state.dataGlobal->DoOutputReporting = false; DisplayPerfSimulationFlag = false; DoWeatherInitReporting = false; - RunPeriodsInInput = + state.dataSimulationManager->RunPeriodsInInput = (inputProcessor->getNumObjectsFound(state, "RunPeriod") > 0 || inputProcessor->getNumObjectsFound(state, "RunPeriod:CustomRange") > 0 || FullAnnualRun); AskForConnectionsReport = false; // set to false until sizing is finished @@ -366,7 +343,7 @@ namespace SimulationManager { } state.dataGlobal->DoingSizing = false; - if ((state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing) && !(state.dataGlobal->DoDesDaySim || (state.dataGlobal->DoWeathSim && RunPeriodsInInput))) { + if ((state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing) && !(state.dataGlobal->DoDesDaySim || (state.dataGlobal->DoWeathSim && state.dataSimulationManager->RunPeriodsInInput))) { ShowWarningError(state, "ManageSimulation: Input file has requested Sizing Calculations but no Simulations are requested (in SimulationControl " "object). Succeeding warnings/errors may be confusing."); } @@ -657,7 +634,7 @@ namespace SimulationManager { } if (!SimsDone && state.dataGlobal->DoWeathSim) { - if (!RunPeriodsInInput) { // if no run period requested, and sims not done + if (!state.dataSimulationManager->RunPeriodsInInput) { // if no run period requested, and sims not done ShowWarningError(state, "ManageSimulation: Weather Simulation was requested in SimulationControl but no RunPeriods in input."); } } @@ -1182,7 +1159,7 @@ namespace SimulationManager { CurrentModuleObject = "SimulationControl"; NumRunControl = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); if (NumRunControl > 0) { - RunControlInInput = true; + state.dataSimulationManager->RunControlInInput = true; inputProcessor->getObjectItem(state, CurrentModuleObject, 1, @@ -1564,7 +1541,7 @@ namespace SimulationManager { WeatherFileAttached = FileSystem::fileExists(state.files.inputWeatherFileName.fileName); - if (RunControlInInput) { + if (state.dataSimulationManager->RunControlInInput) { if (state.dataGlobal->DoZoneSizing) { if (NumZoneSizing > 0 && NumSizingDays == 0) { ErrorsFound = true; @@ -1615,11 +1592,11 @@ namespace SimulationManager { ShowSevereError(state, "CheckEnvironmentSpecifications: SimulationControl specified doing design day simulations; weather file design " "environments specified; but no weather file specified."); } - if (state.dataGlobal->DoWeathSim && !RunPeriodsInInput) { + if (state.dataGlobal->DoWeathSim && !state.dataSimulationManager->RunPeriodsInInput) { ShowWarningError(state, "CheckEnvironmentSpecifications: SimulationControl specified doing weather simulations, but no run periods for " "weather file specified. No annual results produced."); } - if (state.dataGlobal->DoWeathSim && RunPeriodsInInput && !WeatherFileAttached) { + if (state.dataGlobal->DoWeathSim && state.dataSimulationManager->RunPeriodsInInput && !WeatherFileAttached) { ShowWarningError(state, "CheckEnvironmentSpecifications: SimulationControl specified doing weather simulations; run periods for weather " "file specified; but no weather file specified."); } @@ -2366,10 +2343,10 @@ namespace SimulationManager { if (state.dataBranchNodeConnections->CompSets(Count).ParentCType == "UNDEFINED" || state.dataBranchNodeConnections->CompSets(Count).InletNodeName == "UNDEFINED" || state.dataBranchNodeConnections->CompSets(Count).OutletNodeName == "UNDEFINED") { - if (AbortProcessing && WarningOut) { + if (AbortProcessing && state.dataSimulationManager->WarningOut) { ShowWarningError(state, "Node Connection errors shown during \"fatal error\" processing may be false because not all inputs may have " "been retrieved."); - WarningOut = false; + state.dataSimulationManager->WarningOut = false; } ShowWarningError(state, "Node Connection Error for object " + state.dataBranchNodeConnections->CompSets(Count).CType + ", name=" + state.dataBranchNodeConnections->CompSets(Count).CName); ShowContinueError(state, " " + state.dataBranchNodeConnections->CompSets(Count).Description + " not on any Branch or Parent Object"); @@ -2381,10 +2358,10 @@ namespace SimulationManager { } } if (state.dataBranchNodeConnections->CompSets(Count).Description == "UNDEFINED") { - if (AbortProcessing && WarningOut) { + if (AbortProcessing && state.dataSimulationManager->WarningOut) { ShowWarningError(state, "Node Connection errors shown during \"fatal error\" processing may be false because not all inputs may have " "been retrieved."); - WarningOut = false; + state.dataSimulationManager->WarningOut = false; } ShowWarningError(state, "Potential Node Connection Error for object " + state.dataBranchNodeConnections->CompSets(Count).CType + ", name=" + state.dataBranchNodeConnections->CompSets(Count).CName); ShowContinueError(state, " Node Types are still UNDEFINED -- See Branch/Node Details file for further information"); @@ -2400,10 +2377,10 @@ namespace SimulationManager { if (state.dataBranchNodeConnections->CompSets(Count).CName != state.dataBranchNodeConnections->CompSets(Count1).CName) continue; if (state.dataBranchNodeConnections->CompSets(Count).InletNodeName != state.dataBranchNodeConnections->CompSets(Count1).InletNodeName) continue; if (state.dataBranchNodeConnections->CompSets(Count).OutletNodeName != state.dataBranchNodeConnections->CompSets(Count1).OutletNodeName) continue; - if (AbortProcessing && WarningOut) { + if (AbortProcessing && state.dataSimulationManager->WarningOut) { ShowWarningError(state, "Node Connection errors shown during \"fatal error\" processing may be false because not all inputs may have " "been retrieved."); - WarningOut = false; + state.dataSimulationManager->WarningOut = false; } ShowWarningError(state, "Component plus inlet/outlet node pair used more than once:"); ShowContinueError(state, " Component : " + state.dataBranchNodeConnections->CompSets(Count).CType + ", name=" + state.dataBranchNodeConnections->CompSets(Count).CName); @@ -3052,9 +3029,9 @@ namespace SimulationManager { state.dataGlobal->DoingInputProcessing = false; - inputProcessor->preProcessorCheck(state, PreP_Fatal); // Check Preprocessor objects for warning, severe, etc errors. + inputProcessor->preProcessorCheck(state, state.dataSimulationManager->PreP_Fatal); // Check Preprocessor objects for warning, severe, etc errors. - if (PreP_Fatal) { + if (state.dataSimulationManager->PreP_Fatal) { ShowFatalError(state, "Preprocessor condition(s) cause termination."); } diff --git a/src/EnergyPlus/SimulationManager.hh b/src/EnergyPlus/SimulationManager.hh index 9ec1a67bf09..47b429c965b 100644 --- a/src/EnergyPlus/SimulationManager.hh +++ b/src/EnergyPlus/SimulationManager.hh @@ -50,6 +50,7 @@ // EnergyPlus Headers #include +#include namespace EnergyPlus { @@ -58,25 +59,6 @@ struct EnergyPlusData; namespace SimulationManager { - // Data - // MODULE PARAMETER DEFINITIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // MODULE VARIABLE DECLARATIONS: - extern bool RunPeriodsInInput; - extern bool RunControlInInput; - - // SUBROUTINE SPECIFICATIONS FOR MODULE SimulationManager - - // Functions - void clear_state(); - void ManageSimulation(EnergyPlusData &state); void GetProjectData(EnergyPlusData &state); @@ -109,12 +91,21 @@ namespace SimulationManager { void PostIPProcessing(EnergyPlusData &state); - // void - // CheckCachedIPErrors(); - } // namespace SimulationManager -// EXTERNAL SUBROUTINES: +struct SimulationManagerData : BaseGlobalStruct { + bool RunPeriodsInInput = false; + bool RunControlInInput = false; + bool PreP_Fatal = false; + bool WarningOut = true; + void clear_state() override { + this->RunPeriodsInInput = false; + this->RunControlInInput = false; + this->PreP_Fatal = false; + this->WarningOut = true; + } +}; + void Resimulate(EnergyPlusData &state, bool &ResimExt, // Flag to resimulate the exterior energy use simulation diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index ee296130c5e..2376b8d2951 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -93,9 +92,8 @@ #include #include -namespace EnergyPlus { +namespace EnergyPlus::SingleDuct { -namespace SingleDuct { // Module containing the Single Duct Systems as a single component/ or really a single driver // MODULE INFORMATION: @@ -131,97 +129,10 @@ namespace SingleDuct { using namespace ScheduleManager; using namespace SteamCoils; - // Data - // MODULE PARAMETER DEFINITIONS - int const Normal(1); - int const ReverseAction(2); - int const ReverseActionWithLimits(3); - int const HeatingActionNotUsed(0); - // SysTypes represented here - int const SingleDuctVAVReheat(3); - int const SingleDuctVAVNoReheat(4); - int const SingleDuctConstVolReheat(5); - int const SingleDuctConstVolNoReheat(6); - int const SingleDuctVAVReheatVSFan(7); - int const SingleDuctCBVAVReheat(10); - int const SingleDuctCBVAVNoReheat(11); - // Reheat Coil Types used here - int const HCoilType_None(0); - int const HCoilType_Gas(1); - int const HCoilType_Electric(2); - int const HCoilType_SimpleHeating(3); - int const HCoilType_SteamAirHeating(4); - - // Minimum Flow Fraction Input Method - int const ConstantMinFrac(1); - int const ScheduledMinFrac(2); - int const FixedMin(3); - int const MinFracNotUsed(0); - int NumATMixers(0); - static std::string const fluidNameSteam("STEAM"); static std::string const fluidNameWater("WATER"); static std::string const BlankString; - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: - bool GetInputFlag(true); // Flag set to make sure you get input once - bool GetATMixerFlag(true); // Flag set to make sure you get input once - int NumConstVolSys(0); - Array1D_bool CheckEquipName; - - // INTERFACE BLOCK SPECIFICATIONS - - int NumSDAirTerminal(0); // The Number of Systems found in the Input - - // Subroutine Specifications for the Module - // Driver/Manager Routines - - // Get Input routines for module - - // Initialization routines for module - - // Algorithms for the module - - // Update routine to check convergence and update nodes - - // Reporting routines for module - - // Object Data - Array1D sd_airterminal; - std::unordered_map SysUniqueNames; - Array1D SysATMixer; - // Array1D< AirTerminalSingleDuctConstantVolumeNoReheat > SingleDuctConstantVolumeNoReheat; - - namespace { - // These were static variables within different functions. They were pulled out into the namespace - // to facilitate easier unit testing of those functions. - // These are purposefully not in the header file as an extern variable. No one outside of this should - // use these. They are cleared by clear_state() for use by unit tests, but normal simulations should be unaffected. - // This is purposefully in an anonymous namespace so nothing outside this implementation file can use it. - bool InitSysFlag(true); // Flag set to make sure you do begin simulation initializaztions once - bool InitATMixerFlag(true); // Flag set to make sure you do begin simulation initializaztions once for mixer - bool ZoneEquipmentListChecked(false); // True after the Zone Equipment List has been checked for items - } // namespace - - // MODULE SUBROUTINES: - //************************************************************************* - - // Functions - - void clear_state() - { - GetInputFlag = true; - GetATMixerFlag = true; - InitSysFlag = true; - SysUniqueNames.clear(); - SysATMixer.deallocate(); - sd_airterminal.deallocate(); - InitATMixerFlag = true; - ZoneEquipmentListChecked = false; - } - void SimulateSingleDuct( EnergyPlusData &state, std::string const &CompName, bool const FirstHVACIteration, int const ZoneNum, int const ZoneNodeNum, int &CompIndex) { @@ -245,40 +156,40 @@ namespace SingleDuct { // FLOW: // Obtains and Allocates Sys related parameters from input file - if (GetInputFlag) { // First time subroutine has been entered + if (state.dataSingleDuct->GetInputFlag) { // First time subroutine has been entered GetSysInput(state); - GetInputFlag = false; + state.dataSingleDuct->GetInputFlag = false; } // Find the correct SysNumber with the Component Name if (CompIndex == 0) { - SysNum = UtilityRoutines::FindItemInList(CompName, sd_airterminal, &SingleDuctAirTerminal::SysName); + SysNum = UtilityRoutines::FindItemInList(CompName, state.dataSingleDuct->sd_airterminal, &SingleDuctAirTerminal::SysName); if (SysNum == 0) { ShowFatalError(state, "SimulateSingleDuct: System not found=" + CompName); } CompIndex = SysNum; } else { SysNum = CompIndex; - if (SysNum > NumSDAirTerminal || SysNum < 1) { + if (SysNum > state.dataSingleDuct->NumSDAirTerminal || SysNum < 1) { ShowFatalError(state, format("SimulateSingleDuct: Invalid CompIndex passed={}, Number of Systems={}, System name={}", CompIndex, - NumSDAirTerminal, + state.dataSingleDuct->NumSDAirTerminal, CompName)); } - if (CheckEquipName(SysNum)) { - if (CompName != sd_airterminal(SysNum).SysName) { + if (state.dataSingleDuct->CheckEquipName(SysNum)) { + if (CompName != state.dataSingleDuct->sd_airterminal(SysNum).SysName) { ShowFatalError(state, format("SimulateSingleDuct: Invalid CompIndex passed={}, System name={}, stored System Name for that index={}", CompIndex, CompName, - sd_airterminal(SysNum).SysName)); + state.dataSingleDuct->sd_airterminal(SysNum).SysName)); } - CheckEquipName(SysNum) = false; + state.dataSingleDuct->CheckEquipName(SysNum) = false; } } - auto &thisATU(sd_airterminal(SysNum)); + auto &thisATU(state.dataSingleDuct->sd_airterminal(SysNum)); TermUnitSingDuct = true; DataSizing::CurTermUnitSizingNum = DataDefineEquip::AirDistUnit(thisATU.ADUNum).TermUnitSizingNum; @@ -287,29 +198,28 @@ namespace SingleDuct { thisATU.InitSys(state, FirstHVACIteration); // Initialize all Sys related parameters // Calculate the Correct Sys Model with the current SysNum + switch (thisATU.SysType_Num) { - auto const SELECT_CASE_var(thisATU.SysType_Num); - - if (SELECT_CASE_var == SingleDuctConstVolReheat) { // AirTerminal:SingleDuct:ConstantVolume:Reheat + case SysType::SingleDuctConstVolReheat: // AirTerminal:SingleDuct:ConstantVolume:Reheat thisATU.SimConstVol(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - - } else if (SELECT_CASE_var == SingleDuctConstVolNoReheat) { // AirTerminal:SingleDuct:ConstantVolume:NoReheat + break; + case SysType::SingleDuctConstVolNoReheat: // AirTerminal:SingleDuct:ConstantVolume:NoReheat thisATU.SimConstVolNoReheat(); - } else if (SELECT_CASE_var == SingleDuctVAVReheat) { // SINGLE DUCT:VAV:REHEAT - thisATU.SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - - } else if (SELECT_CASE_var == SingleDuctVAVNoReheat) { // SINGLE DUCT:VAV:NOREHEAT + break; + case SysType::SingleDuctVAVReheat: // SINGLE DUCT:VAV:REHEAT + case SysType::SingleDuctVAVNoReheat: // SINGLE DUCT:VAV:NOREHEAT thisATU.SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - - } else if (SELECT_CASE_var == SingleDuctVAVReheatVSFan) { // SINGLE DUCT:VAV:REHEAT:VS FAN + break; + case SysType::SingleDuctVAVReheatVSFan: // SINGLE DUCT:VAV:REHEAT:VS FAN thisATU.SimVAVVS(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - - } else if (SELECT_CASE_var == SingleDuctCBVAVReheat) { // SINGLE DUCT:VAVHEATANDCOOL:REHEAT - thisATU.SimCBVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - - } else if (SELECT_CASE_var == SingleDuctCBVAVNoReheat) { // SINGLE DUCT:VAVHEATANDCOOL:NOREHEAT + break; + case SysType::SingleDuctCBVAVReheat: // SINGLE DUCT:VAVHEATANDCOOL:REHEAT + case SysType::SingleDuctCBVAVNoReheat: // SINGLE DUCT:VAVHEATANDCOOL:NOREHEAT thisATU.SimCBVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - } + break; + default: + // assert(false); + break; } // Report the current Sys @@ -395,16 +305,16 @@ namespace SingleDuct { // Flow NumVAVSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:Reheat"); NumNoRHVAVSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:NoReheat"); - NumConstVolSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:ConstantVolume:Reheat"); + state.dataSingleDuct->NumConstVolSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:ConstantVolume:Reheat"); NumCVNoReheatSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:ConstantVolume:NoReheat"); NumVAVVS = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan"); NumCBVAVSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat"); NumNoRHCBVAVSys = inputProcessor->getNumObjectsFound(state, "AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat"); - NumSDAirTerminal = NumVAVSys + NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys + NumVAVVS + NumCBVAVSys + NumNoRHCBVAVSys; + state.dataSingleDuct->NumSDAirTerminal = NumVAVSys + state.dataSingleDuct->NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys + NumVAVVS + NumCBVAVSys + NumNoRHCBVAVSys; - sd_airterminal.allocate(NumSDAirTerminal); - SysUniqueNames.reserve(static_cast(NumSDAirTerminal)); - CheckEquipName.dimension(NumSDAirTerminal, true); + state.dataSingleDuct->sd_airterminal.allocate(state.dataSingleDuct->NumSDAirTerminal); + state.dataSingleDuct->SysUniqueNames.reserve(static_cast(state.dataSingleDuct->NumSDAirTerminal)); + state.dataSingleDuct->CheckEquipName.dimension(state.dataSingleDuct->NumSDAirTerminal, true); inputProcessor->getObjectDefMaxArgs(state, "AirTerminal:SingleDuct:VAV:Reheat", TotalArgs, NumAlphas, NumNums); MaxNums = max(MaxNums, NumNums); @@ -454,194 +364,194 @@ namespace SingleDuct { cNumericFields); SysNum = SysIndex; - sd_airterminal(SysNum).SysNum = SysNum; - GlobalNames::VerifyUniqueInterObjectName(state, SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - sd_airterminal(SysNum).SysName = Alphas(1); - sd_airterminal(SysNum).SysType = CurrentModuleObject; - sd_airterminal(SysNum).SysType_Num = SingleDuctVAVReheat; - sd_airterminal(SysNum).ReheatComp = Alphas(7); - if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_Gas; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_Electric; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_SimpleHeating; - sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_SteamAirHeating; - sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; - } else if (sd_airterminal(SysNum).ReheatComp != "") { - ShowSevereError(state, "Illegal " + cAlphaFields(8) + " = " + sd_airterminal(SysNum).ReheatComp + '.'); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); + state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctVAVReheat; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = Alphas(7); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Gas; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Electric; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SimpleHeating; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SteamAirHeating; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + } else if (!state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp.empty()) { + ShowSevereError(state, "Illegal " + cAlphaFields(8) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ReheatName = Alphas(8); - ValidateComponent(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK, sd_airterminal(SysNum).SysType); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = Alphas(8); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); } else { - sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } // For node connections, this object is both a parent and a non-parent, because the // VAV damper is not called out as a separate component, its nodes must be connected // as ObjectIsNotParent. But for the reheat coil, the nodes are connected as ObjectIsParent - sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent, cAlphaFields(3)); - sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent, cAlphaFields(4)); - sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); if (UtilityRoutines::SameString(Alphas(5), "Constant")) { - sd_airterminal(SysNum).ZoneMinAirFracMethod = ConstantMinFrac; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Constant; } else if (UtilityRoutines::SameString(Alphas(5), "FixedFlowRate")) { - sd_airterminal(SysNum).ZoneMinAirFracMethod = FixedMin; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Fixed; } else if (UtilityRoutines::SameString(Alphas(5), "Scheduled")) { - sd_airterminal(SysNum).ZoneMinAirFracMethod = ScheduledMinFrac; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Scheduled; } else { ShowSevereError(state, cAlphaFields(5) + " = " + Alphas(5) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); if (lNumericBlanks(2)) { - sd_airterminal(SysNum).ConstantMinAirFracSetByUser = false; - sd_airterminal(SysNum).DesignMinAirFrac = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ConstantMinAirFracSetByUser = false; + state.dataSingleDuct->sd_airterminal(SysNum).DesignMinAirFrac = 0.0; } else { - sd_airterminal(SysNum).ConstantMinAirFracSetByUser = true; - sd_airterminal(SysNum).DesignMinAirFrac = Numbers(2); - if (sd_airterminal(SysNum).ZoneMinAirFracMethod == FixedMin) { + state.dataSingleDuct->sd_airterminal(SysNum).ConstantMinAirFracSetByUser = true; + state.dataSingleDuct->sd_airterminal(SysNum).DesignMinAirFrac = Numbers(2); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Fixed) { ShowWarningError(state, "Since " + cAlphaFields(5) + " = " + Alphas(5) + ", input for " + cNumericFields(2) + " will be ignored."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); - sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; } } - sd_airterminal(SysNum).ZoneFixedMinAir = Numbers(3); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFixedMinAir = Numbers(3); if (lNumericBlanks(3)) { - sd_airterminal(SysNum).FixedMinAirSetByUser = false; - sd_airterminal(SysNum).DesignMinAirFrac = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).FixedMinAirSetByUser = false; + state.dataSingleDuct->sd_airterminal(SysNum).DesignMinAirFrac = 0.0; } else { - sd_airterminal(SysNum).FixedMinAirSetByUser = true; - sd_airterminal(SysNum).DesignMinAirFrac = Numbers(3); - if (sd_airterminal(SysNum).ZoneMinAirFracMethod == ConstantMinFrac) { + state.dataSingleDuct->sd_airterminal(SysNum).FixedMinAirSetByUser = true; + state.dataSingleDuct->sd_airterminal(SysNum).DesignMinAirFrac = Numbers(3); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Constant) { ShowWarningError(state, "Since " + cAlphaFields(5) + " = " + Alphas(5) + ", input for " + cNumericFields(3) + " will be ignored."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); - sd_airterminal(SysNum).ZoneFixedMinAir = 0.0; + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFixedMinAir = 0.0; } } - sd_airterminal(SysNum).ZoneMinAirFracSchPtr = GetScheduleIndex(state, Alphas(6)); - if ((sd_airterminal(SysNum).ZoneMinAirFracSchPtr == 0) && (sd_airterminal(SysNum).ZoneMinAirFracMethod == ScheduledMinFrac)) { + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr = GetScheduleIndex(state, Alphas(6)); + if ((state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr == 0) && (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { ShowSevereError(state, cAlphaFields(6) + " = " + Alphas(6) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "A valid schedule is required"); ErrorsFound = true; - } else if ((sd_airterminal(SysNum).ZoneMinAirFracSchPtr > 0) && (sd_airterminal(SysNum).ZoneMinAirFracMethod == ScheduledMinFrac)) { + } else if ((state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr > 0) && (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { // check range of values in schedule - if (!CheckScheduleValueMinMax(state, sd_airterminal(SysNum).ZoneMinAirFracSchPtr, ">=", 0.0, "<=", 1.0)) { + if (!CheckScheduleValueMinMax(state, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr, ">=", 0.0, "<=", 1.0)) { ShowSevereError(state, "Error found in " + cAlphaFields(6) + " = " + Alphas(6)); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Schedule values must be (>=0., <=1.)"); } } // The reheat coil control node is necessary for hot water and steam reheat, but not necessary for // electric or gas reheat. - if (sd_airterminal(SysNum).ReheatComp_Num != HCoilType_Gas && sd_airterminal(SysNum).ReheatComp_Num != HCoilType_Electric) { - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_SteamAirHeating) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num != HeatingCoilType::Gas && state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num != HeatingCoilType::Electric) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { IsNotOK = false; - sd_airterminal(SysNum).ReheatControlNode = - GetCoilSteamInletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = + GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } else { IsNotOK = false; - sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } } - sd_airterminal(SysNum).ReheatAirOutletNode = GetOnlySingleNode(state, Alphas(9), + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = GetOnlySingleNode(state, Alphas(9), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsParent, cAlphaFields(9)); - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_SteamAirHeating) { - sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(4); - sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(5); + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(5); } else { - sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(4); - sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(5); + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(5); } - sd_airterminal(SysNum).ControllerOffset = Numbers(6); + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = Numbers(6); // Set default convergence tolerance - if (sd_airterminal(SysNum).ControllerOffset <= 0.0) { - sd_airterminal(SysNum).ControllerOffset = 0.001; + if (state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset <= 0.0) { + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.001; } if (UtilityRoutines::SameString(Alphas(10), "Reverse")) { - sd_airterminal(SysNum).DamperHeatingAction = ReverseAction; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::ReverseAction; } else if (UtilityRoutines::SameString(Alphas(10), "Normal")) { - sd_airterminal(SysNum).DamperHeatingAction = Normal; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::Normal; } else if (UtilityRoutines::SameString(Alphas(10), "ReverseWithLimits")) { - sd_airterminal(SysNum).DamperHeatingAction = ReverseActionWithLimits; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::ReverseActionWithLimits; } else { ShowSevereError(state, cAlphaFields(10) + " = " + Alphas(10) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } // Register component set data - TestCompSet(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, - NodeID(sd_airterminal(SysNum).InletNodeNum), - NodeID(sd_airterminal(SysNum).ReheatAirOutletNode), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode), "Air Nodes"); for (ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == AirDistUnit(ADUNum).OutletNodeNum) { - AirDistUnit(ADUNum).InletNodeNum = sd_airterminal(SysNum).InletNodeNum; - sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == AirDistUnit(ADUNum).OutletNodeNum) { + AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + sd_airterminal(SysNum).SysType + ',' + - sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + NodeID(sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -649,107 +559,107 @@ namespace SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, NodeID(sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowContinueError(state, NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = sd_airterminal(SysNum).InletNodeNum; - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = sd_airterminal(SysNum).ReheatAirOutletNode; - AirDistUnit(sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - AirDistUnit(sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; } - sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; - sd_airterminal(SysNum).ZoneFloorArea = Zone(sd_airterminal(SysNum).ActualZoneNum).FloorArea * - Zone(sd_airterminal(SysNum).ActualZoneNum).Multiplier * - Zone(sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; } } } } if (Numbers(7) == DataGlobalConstants::AutoCalculate()) { - sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat = Numbers(7); + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat = Numbers(7); } else { - sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat = Numbers(7) * sd_airterminal(SysNum).ZoneFloorArea; + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat = Numbers(7) * state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea; } - sd_airterminal(SysNum).MaxAirVolFractionDuringReheat = Numbers(8); + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFractionDuringReheat = Numbers(8); - if (sd_airterminal(SysNum).DamperHeatingAction != ReverseActionWithLimits) { - if (sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat > 0.0) { + if (state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction != Action::ReverseActionWithLimits) { + if (state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRateDuringReheat > 0.0) { ShowWarningError(state, "Since " + cAlphaFields(10) + " = " + Alphas(10) + ", input for " + cNumericFields(7) + " will be ignored."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); } - if (sd_airterminal(SysNum).MaxAirVolFractionDuringReheat > 0.0) { + if (state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFractionDuringReheat > 0.0) { ShowWarningError(state, "Since " + cAlphaFields(10) + " = " + Alphas(10) + ", input for " + cNumericFields(8) + " will be ignored."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); } } // Maximum reheat air temperature, i.e. the maximum supply air temperature leaving the reheat coil if (!lNumericBlanks(9)) { - sd_airterminal(SysNum).MaxReheatTemp = Numbers(9); - sd_airterminal(SysNum).MaxReheatTempSetByUser = true; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTemp = Numbers(9); + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = true; } else { // user does not specify maximum supply air temperature - // sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C - sd_airterminal(SysNum).MaxReheatTempSetByUser = false; + // state.dataSingleDuct->sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = false; } if (!lAlphaBlanks(11)) { - sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(11), OARequirements); - if (sd_airterminal(SysNum).OARequirementsPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(11), OARequirements); + if (state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr == 0) { ShowSevereError(state, cAlphaFields(11) + " = " + Alphas(11) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } else { - sd_airterminal(SysNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->sd_airterminal(SysNum).NoOAFlowInputFromUser = false; } } if (lAlphaBlanks(12)) { - sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; } else { - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(12)); - if (sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(12)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(12) + " = " + Alphas(12) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; } - ValidateComponent(state, Alphas(7), Alphas(8), IsNotOK, sd_airterminal(SysNum).SysType); + ValidateComponent(state, Alphas(7), Alphas(8), IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } // Add reheat coil to component sets array - SetUpCompSets(state, sd_airterminal(SysNum).SysType, sd_airterminal(SysNum).SysName, Alphas(7), Alphas(8), Alphas(3), Alphas(9)); + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, state.dataSingleDuct->sd_airterminal(SysNum).SysName, Alphas(7), Alphas(8), Alphas(3), Alphas(9)); // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, "System", "Average", - sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysName); SetupOutputVariable(state, "Zone Air Terminal Minimum Air Flow Fraction", OutputProcessor::Unit::None, - sd_airterminal(SysNum).ZoneMinAirFracReport, + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracReport, "System", "Average", - sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysName); } // end Number of Sys Loop @@ -771,106 +681,106 @@ namespace SingleDuct { cNumericFields); SysNum = SysIndex + NumVAVSys; - sd_airterminal(SysNum).SysNum = SysNum; - GlobalNames::VerifyUniqueInterObjectName(state, SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - sd_airterminal(SysNum).SysName = Alphas(1); - sd_airterminal(SysNum).SysType = CurrentModuleObject; - sd_airterminal(SysNum).SysType_Num = SingleDuctCBVAVReheat; - sd_airterminal(SysNum).ReheatComp = Alphas(5); - if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_Gas; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_Electric; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_SimpleHeating; - sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_SteamAirHeating; - sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; - } else if (sd_airterminal(SysNum).ReheatComp != "") { - ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + sd_airterminal(SysNum).ReheatComp + '.'); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); + state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctCBVAVReheat; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = Alphas(5); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Gas; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Electric; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SimpleHeating; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SteamAirHeating; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + } else if (!state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp.empty()) { + ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ReheatName = Alphas(6); - ValidateComponent(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK, sd_airterminal(SysNum).SysType); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = Alphas(6); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); } else { - sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } // For node connections, this object is both a parent and a non-parent, because the // VAV damper is not called out as a separate component, its nodes must be connected // as ObjectIsNotParent. But for the reheat coil, the nodes are connected as ObjectIsParent - sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent, cAlphaFields(3)); - sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent, cAlphaFields(4)); - sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); - if (sd_airterminal(SysNum).ZoneMinAirFracDes < 0.0) { - ShowWarningError(state, sd_airterminal(SysNum).SysType + " \"" + sd_airterminal(SysNum).SysName + "\""); + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes < 0.0) { + ShowWarningError(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType + " \"" + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "\""); ShowContinueError(state, cNumericFields(2) + " must be greater than or equal to 0. Resetting to 0 and the simulation continues."); - sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; } - if (sd_airterminal(SysNum).ZoneMinAirFracDes > 1.0) { - ShowWarningError(state, sd_airterminal(SysNum).SysType + " \"" + sd_airterminal(SysNum).SysName + "\""); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes > 1.0) { + ShowWarningError(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType + " \"" + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "\""); ShowContinueError(state, cNumericFields(2) + " must be less than or equal to 1. Resetting to 1 and the simulation continues."); - sd_airterminal(SysNum).ZoneMinAirFracDes = 1.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 1.0; } // The reheat coil control node is necessary for hot water and steam reheat, but not necessary for // electric or gas reheat. - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_Gas || sd_airterminal(SysNum).ReheatComp_Num == HCoilType_Electric) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Electric) { // IF(.NOT. lAlphaBlanks(5)) THEN - // CALL ShowWarningError(state, 'In '//TRIM(sd_airterminal(SysNum)%SysType)//' = ' //TRIM(sd_airterminal(SysNum)%SysName) & + // CALL ShowWarningError(state, 'In '//TRIM(state.dataSingleDuct->sd_airterminal(SysNum)%SysType)//' = ' //TRIM(state.dataSingleDuct->sd_airterminal(SysNum)%SysName) & // // ' the '//TRIM(cAlphaFields(5))//' is not needed and will be ignored.') // CALL ShowContinueError(state, ' It is used for hot water and steam reheat coils only.') // END IF } else { // IF(lAlphaBlanks(5)) THEN - // CALL ShowSevereError(state, 'In '//TRIM(sd_airterminal(SysNum)%SysType)//' = ' //TRIM(sd_airterminal(SysNum)%SysName) & + // CALL ShowSevereError(state, 'In '//TRIM(state.dataSingleDuct->sd_airterminal(SysNum)%SysType)//' = ' //TRIM(state.dataSingleDuct->sd_airterminal(SysNum)%SysName) & // // ' the '//TRIM(cAlphaFields(5))//' is undefined.') // ErrorsFound=.TRUE. // ELSE - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_SteamAirHeating) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { IsNotOK = false; - sd_airterminal(SysNum).ReheatControlNode = - GetCoilSteamInletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = + GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } // GetOnlySingleNode(state, Alphas(5),ErrorsFound,sd_airterminal(SysNum)%SysType,Alphas(1), & // NodeType_Steam,NodeConnectionType_Actuator,1,ObjectIsParent) } else { IsNotOK = false; - sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } // GetOnlySingleNode(state, Alphas(5),ErrorsFound,Sys(SysNum)%SysType,Alphas(1), & @@ -878,49 +788,49 @@ namespace SingleDuct { } // END IF } - sd_airterminal(SysNum).ReheatAirOutletNode = GetOnlySingleNode(state, Alphas(7), + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = GetOnlySingleNode(state, Alphas(7), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsParent, cAlphaFields(7)); - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_SteamAirHeating) { - sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(3); - sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(4); + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(3); + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(4); } else { - sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(3); - sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(3); + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(4); } - sd_airterminal(SysNum).ControllerOffset = Numbers(5); + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = Numbers(5); // Set default convergence tolerance - if (sd_airterminal(SysNum).ControllerOffset <= 0.0) { - sd_airterminal(SysNum).ControllerOffset = 0.001; + if (state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset <= 0.0) { + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.001; } - sd_airterminal(SysNum).DamperHeatingAction = ReverseAction; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::ReverseAction; // Register component set data - TestCompSet(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, - NodeID(sd_airterminal(SysNum).InletNodeNum), - NodeID(sd_airterminal(SysNum).ReheatAirOutletNode), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode), "Air Nodes"); for (ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == AirDistUnit(ADUNum).OutletNodeNum) { - AirDistUnit(ADUNum).InletNodeNum = sd_airterminal(SysNum).InletNodeNum; - sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == AirDistUnit(ADUNum).OutletNodeNum) { + AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + sd_airterminal(SysNum).SysType + ',' + - sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + NodeID(sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -928,75 +838,75 @@ namespace SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, NodeID(sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowContinueError(state, NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = sd_airterminal(SysNum).InletNodeNum; - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = sd_airterminal(SysNum).ReheatAirOutletNode; - AirDistUnit(sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - AirDistUnit(sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; } - sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; - sd_airterminal(SysNum).ZoneFloorArea = Zone(sd_airterminal(SysNum).ActualZoneNum).FloorArea * - Zone(sd_airterminal(SysNum).ActualZoneNum).Multiplier * - Zone(sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; } } } } if (!lNumericBlanks(6)) { - sd_airterminal(SysNum).MaxReheatTemp = Numbers(6); - sd_airterminal(SysNum).MaxReheatTempSetByUser = true; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTemp = Numbers(6); + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = true; } else { // user does not specify maximum supply air temperature - // sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C - sd_airterminal(SysNum).MaxReheatTempSetByUser = false; + // state.dataSingleDuct->sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = false; } - ValidateComponent(state, Alphas(5), Alphas(6), IsNotOK, sd_airterminal(SysNum).SysType); + ValidateComponent(state, Alphas(5), Alphas(6), IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } if (lAlphaBlanks(8)) { - sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; } else { - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(8)); - if (sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(8)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(8) + " = " + Alphas(8) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; } // Add reheat coil to component sets array - SetUpCompSets(state, sd_airterminal(SysNum).SysType, sd_airterminal(SysNum).SysName, Alphas(5), Alphas(6), Alphas(3), Alphas(7)); + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, state.dataSingleDuct->sd_airterminal(SysNum).SysName, Alphas(5), Alphas(6), Alphas(3), Alphas(7)); // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, "System", "Average", - sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysName); } // end Number of VAVHeatandCool Sys Loop CurrentModuleObject = "AirTerminal:SingleDuct:ConstantVolume:Reheat"; - for (SysIndex = 1; SysIndex <= NumConstVolSys; ++SysIndex) { + for (SysIndex = 1; SysIndex <= state.dataSingleDuct->NumConstVolSys; ++SysIndex) { inputProcessor->getObjectItem(state, CurrentModuleObject, @@ -1012,56 +922,56 @@ namespace SingleDuct { cNumericFields); SysNum = SysIndex + NumVAVSys + NumCBVAVSys; - sd_airterminal(SysNum).SysNum = SysNum; - GlobalNames::VerifyUniqueInterObjectName(state, SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - sd_airterminal(SysNum).SysName = Alphas(1); - sd_airterminal(SysNum).SysType = CurrentModuleObject; - sd_airterminal(SysNum).SysType_Num = SingleDuctConstVolReheat; - sd_airterminal(SysNum).ReheatComp = Alphas(5); - if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_Gas; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_Electric; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_SimpleHeating; - sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_SteamAirHeating; - sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); + state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctConstVolReheat; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = Alphas(5); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Gas; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Electric; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SimpleHeating; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SteamAirHeating; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; } else { - ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + sd_airterminal(SysNum).ReheatComp + '.'); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ReheatName = Alphas(6); - ValidateComponent(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK, sd_airterminal(SysNum).SysType); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = Alphas(6); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); } else { - sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } - sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsParent, cAlphaFields(3)); - sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Inlet, @@ -1070,7 +980,7 @@ namespace SingleDuct { cAlphaFields(4)); // The reheat coil control node is necessary for hot water reheat, but not necessary for // electric or gas reheat. - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_Gas || sd_airterminal(SysNum).ReheatComp_Num == HCoilType_Electric) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Electric) { // IF(.NOT. lAlphaBlanks(5)) THEN // CALL ShowWarningError(state, 'In '//TRIM(Sys(SysNum)%SysType)//' = ' // TRIM(Sys(SysNum)%SysName) & // // ' the '//TRIM(cAlphaFields(5))//' is not needed and will be ignored.') @@ -1082,73 +992,73 @@ namespace SingleDuct { // // ' the '//TRIM(cAlphaFields(5))//' is undefined.') // ErrorsFound=.TRUE. // END IF - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_SteamAirHeating) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { IsNotOK = false; - sd_airterminal(SysNum).ReheatControlNode = - GetCoilSteamInletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = + GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } // GetOnlySingleNode(state, Alphas(5),ErrorsFound,sd_airterminal(SysNum)%SysType,Alphas(1), & // NodeType_Steam,NodeConnectionType_Actuator,1,ObjectIsParent) } else { IsNotOK = false; - sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } // GetOnlySingleNode(state, Alphas(5),ErrorsFound,sd_airterminal(SysNum)%SysType,Alphas(1), & // NodeType_Water,NodeConnectionType_Actuator,1,ObjectIsParent) } } - sd_airterminal(SysNum).ReheatAirOutletNode = sd_airterminal(SysNum).OutletNodeNum; - sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; - sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFracNotUsed; - sd_airterminal(SysNum).DamperHeatingAction = HeatingActionNotUsed; - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_SteamAirHeating) { - sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(2); - sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(3); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::MinFracNotUsed; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(2); + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(3); } else { - sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(2); - sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(3); + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(2); + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(3); } - sd_airterminal(SysNum).ControllerOffset = Numbers(4); + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = Numbers(4); // Set default convergence tolerance - if (sd_airterminal(SysNum).ControllerOffset <= 0.0) { - sd_airterminal(SysNum).ControllerOffset = 0.001; + if (state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset <= 0.0) { + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.001; } // Maximum reheat air temperature, i.e. the maximum supply air temperature leaving the reheat coil if (!lNumericBlanks(5)) { - sd_airterminal(SysNum).MaxReheatTemp = Numbers(5); - sd_airterminal(SysNum).MaxReheatTempSetByUser = true; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTemp = Numbers(5); + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = true; } else { // user does not specify maximum supply air temperature - // sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C - sd_airterminal(SysNum).MaxReheatTempSetByUser = false; + // state.dataSingleDuct->sd_airterminal(SysNum)%MaxReheatTemp = 35.0D0 !C + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatTempSetByUser = false; } // Register component set data - TestCompSet(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, - NodeID(sd_airterminal(SysNum).InletNodeNum), - NodeID(sd_airterminal(SysNum).OutletNodeNum), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), "Air Nodes"); for (ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == AirDistUnit(ADUNum).OutletNodeNum) { - AirDistUnit(ADUNum).InletNodeNum = sd_airterminal(SysNum).InletNodeNum; - sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == AirDistUnit(ADUNum).OutletNodeNum) { + AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + sd_airterminal(SysNum).SysType + ',' + - sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + NodeID(sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -1156,40 +1066,40 @@ namespace SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (sd_airterminal(SysNum).OutletNodeNum == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, NodeID(sd_airterminal(SysNum).OutletNodeNum) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowContinueError(state, NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = sd_airterminal(SysNum).InletNodeNum; - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = sd_airterminal(SysNum).OutletNodeNum; - AirDistUnit(sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - AirDistUnit(sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; } - sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; - sd_airterminal(SysNum).ZoneFloorArea = Zone(sd_airterminal(SysNum).ActualZoneNum).FloorArea * - Zone(sd_airterminal(SysNum).ActualZoneNum).Multiplier * - Zone(sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; } } } } - ValidateComponent(state, Alphas(5), Alphas(6), IsNotOK, sd_airterminal(SysNum).SysType); + ValidateComponent(state, Alphas(5), Alphas(6), IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } // Add reheat coil to component sets array - SetUpCompSets(state, sd_airterminal(SysNum).SysType, sd_airterminal(SysNum).SysName, Alphas(5), Alphas(6), Alphas(4), Alphas(3)); + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, state.dataSingleDuct->sd_airterminal(SysNum).SysName, Alphas(5), Alphas(6), Alphas(4), Alphas(3)); // Setup the Average damper Position output variable // BG removed 9-10-2009 during work on CR 7770, constant volume has no damper @@ -1215,36 +1125,36 @@ namespace SingleDuct { cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys + NumConstVolSys; - sd_airterminal(SysNum).SysNum = SysNum; - GlobalNames::VerifyUniqueInterObjectName(state, SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - sd_airterminal(SysNum).SysName = Alphas(1); - sd_airterminal(SysNum).SysType = CurrentModuleObject; - sd_airterminal(SysNum).SysType_Num = SingleDuctConstVolNoReheat; + SysNum = SysIndex + NumVAVSys + NumCBVAVSys + state.dataSingleDuct->NumConstVolSys; + state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); + state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctConstVolNoReheat; - sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); } else { - sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } - sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent, cAlphaFields(3)); - sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, @@ -1252,38 +1162,38 @@ namespace SingleDuct { ObjectIsNotParent, cAlphaFields(4)); - sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; - sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFracNotUsed; - sd_airterminal(SysNum).DamperHeatingAction = HeatingActionNotUsed; + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::MinFracNotUsed; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; - sd_airterminal(SysNum).ReheatControlNode = 0; - sd_airterminal(SysNum).ReheatAirOutletNode = sd_airterminal(SysNum).OutletNodeNum; - sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; - sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; - sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; - sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; - sd_airterminal(SysNum).ControllerOffset = 0.000001; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = 0; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.000001; // Register component set data - TestCompSet(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, - NodeID(sd_airterminal(SysNum).InletNodeNum), - NodeID(sd_airterminal(SysNum).OutletNodeNum), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), "Air Nodes"); for (ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { - if (sd_airterminal(SysNum).OutletNodeNum == AirDistUnit(ADUNum).OutletNodeNum) { - AirDistUnit(ADUNum).InletNodeNum = sd_airterminal(SysNum).InletNodeNum; - sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == AirDistUnit(ADUNum).OutletNodeNum) { + AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + sd_airterminal(SysNum).SysType + ',' + - sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + NodeID(sd_airterminal(SysNum).OutletNodeNum)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum)); ErrorsFound = true; } else { @@ -1291,54 +1201,54 @@ namespace SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (sd_airterminal(SysNum).OutletNodeNum == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, NodeID(sd_airterminal(SysNum).OutletNodeNum) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowContinueError(state, NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = sd_airterminal(SysNum).InletNodeNum; - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = sd_airterminal(SysNum).OutletNodeNum; - AirDistUnit(sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - AirDistUnit(sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; } - sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; - sd_airterminal(SysNum).ZoneFloorArea = Zone(sd_airterminal(SysNum).ActualZoneNum).FloorArea * - Zone(sd_airterminal(SysNum).ActualZoneNum).Multiplier * - Zone(sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; } } } } if (lAlphaBlanks(5)) { - sd_airterminal(SysNum).NoOAFlowInputFromUser = true; + state.dataSingleDuct->sd_airterminal(SysNum).NoOAFlowInputFromUser = true; } else { - sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(5), DataSizing::OARequirements); - if (sd_airterminal(SysNum).OARequirementsPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(5), DataSizing::OARequirements); + if (state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr == 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", invalid data."); ShowContinueError(state, "..invalid " + cAlphaFields(5) + "=\"" + Alphas(5) + "\"."); ErrorsFound = true; } else { - sd_airterminal(SysNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->sd_airterminal(SysNum).NoOAFlowInputFromUser = false; } } if (lAlphaBlanks(6)) { - sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; } else { if (Alphas(6) == "CURRENTOCCUPANCY") { - sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; } else if (Alphas(6) == "DESIGNOCCUPANCY") { - sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonByDesignLevel; + state.dataSingleDuct->sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonByDesignLevel; } else { - sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->sd_airterminal(SysNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", invalid data."); ShowContinueError(state, "..invalid " + cAlphaFields(6) + "=\"" + Alphas(6) + "\". The default input of CurrentOccupancy is assigned"); } @@ -1347,16 +1257,16 @@ namespace SingleDuct { if (state.dataGlobal->AnyEnergyManagementSystemInModel) { // model results related actuators SetupEMSActuator("AirTerminal:SingleDuct:ConstantVolume:NoReheat", - sd_airterminal(SysNum).SysName, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, "Mass Flow Rate", "[kg/s]", - sd_airterminal(SysNum).EMSOverrideAirFlow, - sd_airterminal(SysNum).EMSMassFlowRateValue); + state.dataSingleDuct->sd_airterminal(SysNum).EMSOverrideAirFlow, + state.dataSingleDuct->sd_airterminal(SysNum).EMSMassFlowRateValue); // model input related internal variables SetupEMSInternalVariable(state, "AirTerminal:SingleDuct:ConstantVolume:NoReheat Maximum Mass Flow Rate", - sd_airterminal(SysNum).SysName, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, "[kg/s]", - sd_airterminal(SysNum).AirMassFlowRateMax); + state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax); } } // End Number of Sys Loop @@ -1378,127 +1288,127 @@ namespace SingleDuct { cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys + NumConstVolSys + NumCVNoReheatSys; - sd_airterminal(SysNum).SysNum = SysNum; - GlobalNames::VerifyUniqueInterObjectName(state, SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - sd_airterminal(SysNum).SysName = Alphas(1); - sd_airterminal(SysNum).SysType = CurrentModuleObject; - sd_airterminal(SysNum).SysType_Num = SingleDuctVAVNoReheat; - sd_airterminal(SysNum).ReheatComp = ""; - sd_airterminal(SysNum).ReheatName = ""; - sd_airterminal(SysNum).Schedule = Alphas(2); + SysNum = SysIndex + NumVAVSys + NumCBVAVSys + state.dataSingleDuct->NumConstVolSys + NumCVNoReheatSys; + state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); + state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctVAVNoReheat; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = ""; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = ""; + state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); } else { - sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } - sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent, cAlphaFields(3)); - sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent, cAlphaFields(4)); - sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); if (UtilityRoutines::SameString(Alphas(5), "Constant")) { - sd_airterminal(SysNum).ZoneMinAirFracMethod = ConstantMinFrac; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Constant; } else if (UtilityRoutines::SameString(Alphas(5), "FixedFlowRate")) { - sd_airterminal(SysNum).ZoneMinAirFracMethod = FixedMin; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Fixed; } else if (UtilityRoutines::SameString(Alphas(5), "Scheduled")) { - sd_airterminal(SysNum).ZoneMinAirFracMethod = ScheduledMinFrac; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod = MinFlowFraction::Scheduled; } else { ShowSevereError(state, cAlphaFields(5) + " = " + Alphas(5) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); if (lNumericBlanks(2)) { - sd_airterminal(SysNum).ConstantMinAirFracSetByUser = false; - sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ConstantMinAirFracSetByUser = false; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; } else { - sd_airterminal(SysNum).ConstantMinAirFracSetByUser = true; - sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); - if (sd_airterminal(SysNum).ZoneMinAirFracMethod == FixedMin) { + state.dataSingleDuct->sd_airterminal(SysNum).ConstantMinAirFracSetByUser = true; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Fixed) { ShowWarningError(state, "Since " + cAlphaFields(5) + " = " + Alphas(5) + ", input for " + cNumericFields(2) + " will be ignored."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); - sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; } } - sd_airterminal(SysNum).ZoneFixedMinAir = Numbers(3); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFixedMinAir = Numbers(3); if (lNumericBlanks(3)) { - sd_airterminal(SysNum).FixedMinAirSetByUser = false; - sd_airterminal(SysNum).DesignFixedMinAir = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).FixedMinAirSetByUser = false; + state.dataSingleDuct->sd_airterminal(SysNum).DesignFixedMinAir = 0.0; } else { - sd_airterminal(SysNum).FixedMinAirSetByUser = true; - sd_airterminal(SysNum).DesignFixedMinAir = Numbers(3); - if (sd_airterminal(SysNum).ZoneMinAirFracMethod == ConstantMinFrac) { + state.dataSingleDuct->sd_airterminal(SysNum).FixedMinAirSetByUser = true; + state.dataSingleDuct->sd_airterminal(SysNum).DesignFixedMinAir = Numbers(3); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Constant) { ShowWarningError(state, "Since " + cAlphaFields(5) + " = " + Alphas(5) + ", input for " + cNumericFields(3) + " will be ignored."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); - sd_airterminal(SysNum).ZoneFixedMinAir = 0.0; + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFixedMinAir = 0.0; } } - sd_airterminal(SysNum).ZoneMinAirFracSchPtr = GetScheduleIndex(state, Alphas(6)); - if ((sd_airterminal(SysNum).ZoneMinAirFracSchPtr == 0) && (sd_airterminal(SysNum).ZoneMinAirFracMethod == ScheduledMinFrac)) { + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr = GetScheduleIndex(state, Alphas(6)); + if ((state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr == 0) && (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { ShowSevereError(state, cAlphaFields(6) + " = " + Alphas(6) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "A valid schedule is required"); ErrorsFound = true; - } else if ((sd_airterminal(SysNum).ZoneMinAirFracSchPtr > 0) && (sd_airterminal(SysNum).ZoneMinAirFracMethod == ScheduledMinFrac)) { + } else if ((state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr > 0) && (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracMethod == MinFlowFraction::Scheduled)) { // check range of values in schedule - if (!CheckScheduleValueMinMax(state, sd_airterminal(SysNum).ZoneMinAirFracSchPtr, ">=", 0.0, "<=", 1.0)) { + if (!CheckScheduleValueMinMax(state, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracSchPtr, ">=", 0.0, "<=", 1.0)) { ShowSevereError(state, "Error found in " + cAlphaFields(6) + " = " + Alphas(6)); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Schedule values must be (>=0., <=1.)"); } } - sd_airterminal(SysNum).ReheatControlNode = 0; - sd_airterminal(SysNum).ReheatAirOutletNode = sd_airterminal(SysNum).OutletNodeNum; - sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; - sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; - sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; - sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; - sd_airterminal(SysNum).ControllerOffset = 0.000001; - sd_airterminal(SysNum).DamperHeatingAction = HeatingActionNotUsed; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = 0; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.000001; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; // Register component set data - TestCompSet(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, - NodeID(sd_airterminal(SysNum).InletNodeNum), - NodeID(sd_airterminal(SysNum).OutletNodeNum), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), "Air Nodes"); for (ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { - if (sd_airterminal(SysNum).OutletNodeNum == AirDistUnit(ADUNum).OutletNodeNum) { - AirDistUnit(ADUNum).InletNodeNum = sd_airterminal(SysNum).InletNodeNum; - sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == AirDistUnit(ADUNum).OutletNodeNum) { + AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + sd_airterminal(SysNum).SysType + ',' + - sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + NodeID(sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -1506,69 +1416,69 @@ namespace SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, NodeID(sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowContinueError(state, NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = sd_airterminal(SysNum).InletNodeNum; - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = sd_airterminal(SysNum).ReheatAirOutletNode; - AirDistUnit(sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - AirDistUnit(sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; } - sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; - sd_airterminal(SysNum).ZoneFloorArea = Zone(sd_airterminal(SysNum).ActualZoneNum).FloorArea * - Zone(sd_airterminal(SysNum).ActualZoneNum).Multiplier * - Zone(sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; } } } } if (!lAlphaBlanks(7)) { - sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(7), OARequirements); - if (sd_airterminal(SysNum).OARequirementsPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(7), OARequirements); + if (state.dataSingleDuct->sd_airterminal(SysNum).OARequirementsPtr == 0) { ShowSevereError(state, cAlphaFields(7) + " = " + Alphas(7) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } else { - sd_airterminal(SysNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->sd_airterminal(SysNum).NoOAFlowInputFromUser = false; } } if (lAlphaBlanks(8)) { - sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; } else { - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(8)); - if (sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(8)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(8) + " = " + Alphas(8) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; } // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, "System", "Average", - sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysName); SetupOutputVariable(state, "Zone Air Terminal Minimum Air Flow Fraction", OutputProcessor::Unit::None, - sd_airterminal(SysNum).ZoneMinAirFracReport, + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracReport, "System", "Average", - sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysName); } // end Number of Sys Loop @@ -1589,84 +1499,84 @@ namespace SingleDuct { cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys + NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys; - sd_airterminal(SysNum).SysNum = SysNum; - GlobalNames::VerifyUniqueInterObjectName(state, SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - sd_airterminal(SysNum).SysName = Alphas(1); - sd_airterminal(SysNum).SysType = CurrentModuleObject; - sd_airterminal(SysNum).SysType_Num = SingleDuctCBVAVNoReheat; - sd_airterminal(SysNum).ReheatComp = ""; - sd_airterminal(SysNum).ReheatName = ""; - sd_airterminal(SysNum).Schedule = Alphas(2); + SysNum = SysIndex + NumVAVSys + NumCBVAVSys + state.dataSingleDuct->NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys; + state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); + state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctCBVAVNoReheat; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = ""; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = ""; + state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); } else { - sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } - sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), + state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = GetOnlySingleNode(state, Alphas(3), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent, cAlphaFields(3)); - sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), + state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetOnlySingleNode(state, Alphas(4), ErrorsFound, - sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysType, Alphas(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent, cAlphaFields(4)); - sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); - if (sd_airterminal(SysNum).ZoneMinAirFracDes < 0.0) { - ShowWarningError(state, sd_airterminal(SysNum).SysType + " = \"" + sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(2); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes < 0.0) { + ShowWarningError(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = \"" + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, cNumericFields(2) + " must be greater than or equal to 0. Resetting to 0 and the simulation continues."); - sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 0.0; } - if (sd_airterminal(SysNum).ZoneMinAirFracDes > 1.0) { - ShowWarningError(state, sd_airterminal(SysNum).SysType + " = \"" + sd_airterminal(SysNum).SysName); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes > 1.0) { + ShowWarningError(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = \"" + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, cNumericFields(2) + " must be less than or equal to 1. Resetting to 1 and the simulation continues."); - sd_airterminal(SysNum).ZoneMinAirFracDes = 1.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = 1.0; } - sd_airterminal(SysNum).ReheatControlNode = 0; - sd_airterminal(SysNum).ReheatAirOutletNode = sd_airterminal(SysNum).OutletNodeNum; - sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; - sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; - sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; - sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; - sd_airterminal(SysNum).ControllerOffset = 0.000001; - sd_airterminal(SysNum).DamperHeatingAction = HeatingActionNotUsed; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = 0; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = 0.0; + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.000001; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; // Register component set data - TestCompSet(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, - NodeID(sd_airterminal(SysNum).InletNodeNum), - NodeID(sd_airterminal(SysNum).OutletNodeNum), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), "Air Nodes"); for (ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { - if (sd_airterminal(SysNum).OutletNodeNum == AirDistUnit(ADUNum).OutletNodeNum) { - AirDistUnit(ADUNum).InletNodeNum = sd_airterminal(SysNum).InletNodeNum; - sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum == AirDistUnit(ADUNum).OutletNodeNum) { + AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + sd_airterminal(SysNum).SysType + ',' + - sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + NodeID(sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -1674,52 +1584,52 @@ namespace SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { if (ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, NodeID(sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowContinueError(state, NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = sd_airterminal(SysNum).InletNodeNum; - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = sd_airterminal(SysNum).ReheatAirOutletNode; - AirDistUnit(sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - AirDistUnit(sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; } - sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; - sd_airterminal(SysNum).ZoneFloorArea = Zone(sd_airterminal(SysNum).ActualZoneNum).FloorArea * - Zone(sd_airterminal(SysNum).ActualZoneNum).Multiplier * - Zone(sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; } } } } if (lAlphaBlanks(5)) { - sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; } else { - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(5)); - if (sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(5)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(5) + " = " + Alphas(5) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; } // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, "System", "Average", - sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysName); } // end Number of VAVHeatandCool:NoReheat Sys Loop @@ -1741,130 +1651,130 @@ namespace SingleDuct { cAlphaFields, cNumericFields); - SysNum = SysIndex + NumVAVSys + NumCBVAVSys + NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys + NumNoRHCBVAVSys; - sd_airterminal(SysNum).SysNum = SysNum; - GlobalNames::VerifyUniqueInterObjectName(state, SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); - sd_airterminal(SysNum).SysName = Alphas(1); - sd_airterminal(SysNum).SysType = CurrentModuleObject; - sd_airterminal(SysNum).SysType_Num = SingleDuctVAVReheatVSFan; - sd_airterminal(SysNum).ReheatComp = Alphas(7); - sd_airterminal(SysNum).ReheatName = Alphas(8); + SysNum = SysIndex + NumVAVSys + NumCBVAVSys + state.dataSingleDuct->NumConstVolSys + NumCVNoReheatSys + NumNoRHVAVSys + NumNoRHCBVAVSys; + state.dataSingleDuct->sd_airterminal(SysNum).SysNum = SysNum; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataSingleDuct->SysUniqueNames, Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound); + state.dataSingleDuct->sd_airterminal(SysNum).SysName = Alphas(1); + state.dataSingleDuct->sd_airterminal(SysNum).SysType = CurrentModuleObject; + state.dataSingleDuct->sd_airterminal(SysNum).SysType_Num = SysType::SingleDuctVAVReheatVSFan; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp = Alphas(7); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatName = Alphas(8); IsNotOK = false; - if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_Gas; - sd_airterminal(SysNum).ReheatAirOutletNode = - GetHeatingCoilOutletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); - sd_airterminal(SysNum).ReheatCoilMaxCapacity = - GetHeatingCoilCapacity(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); - if (IsNotOK) ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_Electric; - sd_airterminal(SysNum).ReheatAirOutletNode = - GetHeatingCoilOutletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); - sd_airterminal(SysNum).ReheatCoilMaxCapacity = - GetHeatingCoilCapacity(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); - if (IsNotOK) ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_SimpleHeating; - sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { - sd_airterminal(SysNum).ReheatComp_Num = HCoilType_SteamAirHeating; - sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; - } else if (sd_airterminal(SysNum).ReheatComp != "") { - ShowSevereError(state, "Illegal " + cAlphaFields(7) + " = " + sd_airterminal(SysNum).ReheatComp + '.'); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Fuel")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Gas; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = + GetHeatingCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatCoilMaxCapacity = + GetHeatingCoilCapacity(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + if (IsNotOK) ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Electric")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::Electric; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = + GetHeatingCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatCoilMaxCapacity = + GetHeatingCoilCapacity(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); + if (IsNotOK) ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Water")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SimpleHeating; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilWaterSimpleHeating; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, "Coil:Heating:Steam")) { + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num = HeatingCoilType::SteamAirHeating; + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_PlantType = TypeOf_CoilSteamAirHeating; + } else if (!state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp.empty()) { + ShowSevereError(state, "Illegal " + cAlphaFields(7) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - ValidateComponent(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK, sd_airterminal(SysNum).SysType); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).FanType = Alphas(5); - if (UtilityRoutines::SameString(sd_airterminal(SysNum).FanType, "Fan:VariableVolume")) { - sd_airterminal(SysNum).Fan_Num = DataHVACGlobals::FanType_SimpleVAV; - } else if (UtilityRoutines::SameString(sd_airterminal(SysNum).FanType, "Fan:SystemModel")) { - sd_airterminal(SysNum).Fan_Num = DataHVACGlobals::FanType_SystemModelObject; - } else if (sd_airterminal(SysNum).FanType != "") { - ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + sd_airterminal(SysNum).FanType + '.'); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).FanType = Alphas(5); + if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).FanType, "Fan:VariableVolume")) { + state.dataSingleDuct->sd_airterminal(SysNum).Fan_Num = DataHVACGlobals::FanType_SimpleVAV; + } else if (UtilityRoutines::SameString(state.dataSingleDuct->sd_airterminal(SysNum).FanType, "Fan:SystemModel")) { + state.dataSingleDuct->sd_airterminal(SysNum).Fan_Num = DataHVACGlobals::FanType_SystemModelObject; + } else if (!state.dataSingleDuct->sd_airterminal(SysNum).FanType.empty()) { + ShowSevereError(state, "Illegal " + cAlphaFields(5) + " = " + state.dataSingleDuct->sd_airterminal(SysNum).FanType + '.'); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).FanName = Alphas(6); - ValidateComponent(state, sd_airterminal(SysNum).FanType, sd_airterminal(SysNum).FanName, IsNotOK, sd_airterminal(SysNum).SysType); + state.dataSingleDuct->sd_airterminal(SysNum).FanName = Alphas(6); + ValidateComponent(state, state.dataSingleDuct->sd_airterminal(SysNum).FanType, state.dataSingleDuct->sd_airterminal(SysNum).FanName, IsNotOK, state.dataSingleDuct->sd_airterminal(SysNum).SysType); if (IsNotOK) { - ShowContinueError(state, "In " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "In " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - if (sd_airterminal(SysNum).Fan_Num == DataHVACGlobals::FanType_SystemModelObject) { + if (state.dataSingleDuct->sd_airterminal(SysNum).Fan_Num == DataHVACGlobals::FanType_SystemModelObject) { HVACFan::fanObjs.emplace_back(new HVACFan::FanSystem( - state, sd_airterminal(SysNum).FanName)); // call constructor, safe here because get input is not using DataIPShortCuts. - sd_airterminal(SysNum).Fan_Index = HVACFan::getFanObjectVectorIndex(state, sd_airterminal(SysNum).FanName); - sd_airterminal(SysNum).OutletNodeNum = HVACFan::fanObjs[sd_airterminal(SysNum).Fan_Index]->outletNodeNum; - sd_airterminal(SysNum).InletNodeNum = HVACFan::fanObjs[sd_airterminal(SysNum).Fan_Index]->inletNodeNum; - HVACFan::fanObjs[sd_airterminal(SysNum).Fan_Index]->fanIsSecondaryDriver = true; - } else if (sd_airterminal(SysNum).Fan_Num == DataHVACGlobals::FanType_SimpleVAV) { + state, state.dataSingleDuct->sd_airterminal(SysNum).FanName)); // call constructor, safe here because get input is not using DataIPShortCuts. + state.dataSingleDuct->sd_airterminal(SysNum).Fan_Index = HVACFan::getFanObjectVectorIndex(state, state.dataSingleDuct->sd_airterminal(SysNum).FanName); + state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(SysNum).Fan_Index]->outletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(SysNum).Fan_Index]->inletNodeNum; + HVACFan::fanObjs[state.dataSingleDuct->sd_airterminal(SysNum).Fan_Index]->fanIsSecondaryDriver = true; + } else if (state.dataSingleDuct->sd_airterminal(SysNum).Fan_Num == DataHVACGlobals::FanType_SimpleVAV) { IsNotOK = false; - sd_airterminal(SysNum).OutletNodeNum = - GetFanOutletNode(state, sd_airterminal(SysNum).FanType, sd_airterminal(SysNum).FanName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum = + GetFanOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).FanType, state.dataSingleDuct->sd_airterminal(SysNum).FanName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } IsNotOK = false; - sd_airterminal(SysNum).InletNodeNum = GetFanInletNode(state, sd_airterminal(SysNum).FanType, sd_airterminal(SysNum).FanName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum = GetFanInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).FanType, state.dataSingleDuct->sd_airterminal(SysNum).FanName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } - sd_airterminal(SysNum).Schedule = Alphas(2); + state.dataSingleDuct->sd_airterminal(SysNum).Schedule = Alphas(2); if (lAlphaBlanks(2)) { - sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = DataGlobalConstants::ScheduleAlwaysOn(); } else { - sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); - if (sd_airterminal(SysNum).SchedPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = GetScheduleIndex(state, Alphas(2)); + if (state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr == 0) { ShowSevereError(state, cAlphaFields(2) + " = " + Alphas(2) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } - AirTermSysInletNodeName = NodeID(sd_airterminal(SysNum).InletNodeNum); + AirTermSysInletNodeName = NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum); if (!UtilityRoutines::SameString(Alphas(3), AirTermSysInletNodeName)) { - ShowWarningError(state, RoutineName + "Invalid air terminal object air inlet node name in " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowWarningError(state, RoutineName + "Invalid air terminal object air inlet node name in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, " Specified air inlet node name is = " + Alphas(3) + "."); ShowContinueError(state, " Expected air inlet node name is = " + AirTermSysInletNodeName + "."); // ErrorsFound = true; } - sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); - sd_airterminal(SysNum).MaxHeatAirVolFlowRate = Numbers(2); - sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(3); + state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate = Numbers(1); + state.dataSingleDuct->sd_airterminal(SysNum).MaxHeatAirVolFlowRate = Numbers(2); + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = Numbers(3); // The reheat coil control node is necessary for hot water reheat, but not necessary for // electric or gas reheat. - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_Gas || sd_airterminal(SysNum).ReheatComp_Num == HCoilType_Electric) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Gas || state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::Electric) { // IF(.NOT. lAlphaBlanks(6)) THEN - // CALL ShowWarningError(state, 'In '//TRIM(sd_airterminal(SysNum)%SysType)//' = ' // TRIM(sd_airterminal(SysNum)%SysName) & + // CALL ShowWarningError(state, 'In '//TRIM(state.dataSingleDuct->sd_airterminal(SysNum)%SysType)//' = ' // TRIM(state.dataSingleDuct->sd_airterminal(SysNum)%SysName) & // // ' the '//TRIM(cAlphaFields(6))//' is not needed and will be ignored.') // CALL ShowContinueError(state, ' It is used for hot water reheat coils only.') // END IF } else { // IF(lAlphaBlanks(6)) THEN - // CALL ShowSevereError(state, 'In '//TRIM(sd_airterminal(SysNum)%SysType)//' = ' // TRIM(sd_airterminal(SysNum)%SysName) & + // CALL ShowSevereError(state, 'In '//TRIM(state.dataSingleDuct->sd_airterminal(SysNum)%SysType)//' = ' // TRIM(state.dataSingleDuct->sd_airterminal(SysNum)%SysName) & // // ' the '//TRIM(cAlphaFields(6))//' is undefined') // ErrorsFound=.TRUE. // END IF - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_SteamAirHeating) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { IsNotOK = false; - sd_airterminal(SysNum).ReheatControlNode = - GetCoilSteamInletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = + GetCoilSteamInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } else { // A4, \field Unit supply air outlet node @@ -1872,10 +1782,10 @@ namespace SingleDuct { // \note same as zone inlet node // \type alpha IsNotOK = false; - sd_airterminal(SysNum).ReheatAirOutletNode = - GetCoilAirOutletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = + GetCoilAirOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } @@ -1883,9 +1793,9 @@ namespace SingleDuct { // NodeType_Steam,NodeConnectionType_Actuator,1,ObjectIsParent) } else { IsNotOK = false; - sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatControlNode = GetCoilWaterInletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } else { // A4, \field Unit supply air outlet node @@ -1893,10 +1803,10 @@ namespace SingleDuct { // \note same as zone inlet node // \type alpha IsNotOK = false; - sd_airterminal(SysNum).ReheatAirOutletNode = - GetCoilOutletNode(state, sd_airterminal(SysNum).ReheatComp, sd_airterminal(SysNum).ReheatName, IsNotOK); + state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode = + GetCoilOutletNode(state, state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp, state.dataSingleDuct->sd_airterminal(SysNum).ReheatName, IsNotOK); if (IsNotOK) { - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } } @@ -1908,51 +1818,51 @@ namespace SingleDuct { // \note same as heating coil air outlet node // \note same as zone inlet node // \type alpha - // sd_airterminal(SysNum)%ReheatAirOutletNode = & + // state.dataSingleDuct->sd_airterminal(SysNum)%ReheatAirOutletNode = & // GetOnlySingleNode(state, Alphas(4),ErrorsFound,sd_airterminal(SysNum)%SysType,Alphas(1), & // NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent) - AirTermSysOutletNodeName = NodeID(sd_airterminal(SysNum).ReheatAirOutletNode); + AirTermSysOutletNodeName = NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode); if (!UtilityRoutines::SameString(Alphas(4), AirTermSysOutletNodeName)) { - ShowWarningError(state, RoutineName + "Invalid air terminal object air outlet node name in " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowWarningError(state, RoutineName + "Invalid air terminal object air outlet node name in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, " Specified air outlet node name is = " + Alphas(4) + "."); ShowContinueError(state, " Expected air outlet node name is = " + AirTermSysOutletNodeName + "."); // ErrorsFound = true; } - if (sd_airterminal(SysNum).ReheatComp_Num == HCoilType_SteamAirHeating) { - sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(4); - sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(5); + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatSteamVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatSteamVolFlow = Numbers(5); } else { - sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(4); - sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(5); + state.dataSingleDuct->sd_airterminal(SysNum).MaxReheatWaterVolFlow = Numbers(4); + state.dataSingleDuct->sd_airterminal(SysNum).MinReheatWaterVolFlow = Numbers(5); } - sd_airterminal(SysNum).ControllerOffset = Numbers(6); + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = Numbers(6); // Set default convergence tolerance - if (sd_airterminal(SysNum).ControllerOffset <= 0.0) { - sd_airterminal(SysNum).ControllerOffset = 0.001; + if (state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset <= 0.0) { + state.dataSingleDuct->sd_airterminal(SysNum).ControllerOffset = 0.001; } - sd_airterminal(SysNum).DamperHeatingAction = HeatingActionNotUsed; + state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction = Action::HeatingActionNotUsed; // Register component set data - TestCompSet(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, - NodeID(sd_airterminal(SysNum).InletNodeNum), - NodeID(sd_airterminal(SysNum).ReheatAirOutletNode), + TestCompSet(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode), "Air Nodes"); for (ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == AirDistUnit(ADUNum).OutletNodeNum) { - AirDistUnit(ADUNum).InletNodeNum = sd_airterminal(SysNum).InletNodeNum; - sd_airterminal(SysNum).ADUNum = ADUNum; + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == AirDistUnit(ADUNum).OutletNodeNum) { + AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + state.dataSingleDuct->sd_airterminal(SysNum).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (sd_airterminal(SysNum).ADUNum == 0) { - ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + sd_airterminal(SysNum).SysType + ',' + - sd_airterminal(SysNum).SysName + "]."); - ShowContinueError(state, "...should have outlet node = " + NodeID(sd_airterminal(SysNum).ReheatAirOutletNode)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ADUNum == 0) { + ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + state.dataSingleDuct->sd_airterminal(SysNum).SysType + ',' + + state.dataSingleDuct->sd_airterminal(SysNum).SysName + "]."); + ShowContinueError(state, "...should have outlet node = " + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); ErrorsFound = true; } else { @@ -1962,82 +1872,82 @@ namespace SingleDuct { for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (SupAirIn = 1; SupAirIn <= ZoneEquipConfig(CtrlZone).NumInletNodes; ++SupAirIn) { - if (sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { + if (state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode == ZoneEquipConfig(CtrlZone).InletNode(SupAirIn)) { IsNotOK = false; if (ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode > 0) { ShowSevereError(state, "Error in connecting a terminal unit to a zone"); - ShowContinueError(state, NodeID(sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); - ShowContinueError(state, "Occurs for terminal unit " + sd_airterminal(SysNum).SysType + " = " + - sd_airterminal(SysNum).SysName); + ShowContinueError(state, NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode) + " already connects to another zone"); + ShowContinueError(state, "Occurs for terminal unit " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ShowContinueError(state, "Check terminal unit node names for errors"); ErrorsFound = true; } else { - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = sd_airterminal(SysNum).InletNodeNum; - ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = sd_airterminal(SysNum).ReheatAirOutletNode; - AirDistUnit(sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).InNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).OutNode = state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).TermUnitSizingNum = ZoneEquipConfig(CtrlZone).AirDistUnitCool(SupAirIn).TermUnitSizingIndex; - AirDistUnit(sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysNum).ADUNum).ZoneEqNum = CtrlZone; } - sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; - sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; - sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; - sd_airterminal(SysNum).ZoneFloorArea = Zone(sd_airterminal(SysNum).ActualZoneNum).FloorArea * - Zone(sd_airterminal(SysNum).ActualZoneNum).Multiplier * - Zone(sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneNum = CtrlZone; + state.dataSingleDuct->sd_airterminal(SysNum).CtrlZoneInNodeIndex = SupAirIn; + state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneFloorArea = Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).FloorArea * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).Multiplier * + Zone(state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum).ListMultiplier; } } } } if (IsNotOK) { ShowWarningError(state, "Did not Match Supply Air Outlet Node to any Zone Node"); - ShowContinueError(state, "..Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "..Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); } if (lAlphaBlanks(9)) { - sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac = 1.0; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = false; } else { - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(9)); - if (sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = GetScheduleIndex(state, Alphas(9)); + if (state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr == 0) { ShowSevereError(state, cAlphaFields(9) + " = " + Alphas(9) + " not found."); - ShowContinueError(state, "Occurs in " + sd_airterminal(SysNum).SysType + " = " + sd_airterminal(SysNum).SysName); + ShowContinueError(state, "Occurs in " + state.dataSingleDuct->sd_airterminal(SysNum).SysType + " = " + state.dataSingleDuct->sd_airterminal(SysNum).SysName); ErrorsFound = true; } - sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist = true; } // Add reheat coil to component sets array - SetUpCompSets(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, Alphas(7), Alphas(8), - NodeID(sd_airterminal(SysNum).OutletNodeNum), - NodeID(sd_airterminal(SysNum).ReheatAirOutletNode)); + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).ReheatAirOutletNode)); // Add fan to component sets array - SetUpCompSets(state, sd_airterminal(SysNum).SysType, - sd_airterminal(SysNum).SysName, + SetUpCompSets(state, state.dataSingleDuct->sd_airterminal(SysNum).SysType, + state.dataSingleDuct->sd_airterminal(SysNum).SysName, Alphas(5), Alphas(6), - NodeID(sd_airterminal(SysNum).InletNodeNum), - NodeID(sd_airterminal(SysNum).OutletNodeNum)); + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum), + NodeID(state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum)); // Setup the Average damper Position output variable SetupOutputVariable(state, "Zone Air Terminal VAV Damper Position", OutputProcessor::Unit::None, - sd_airterminal(SysNum).DamperPosition, + state.dataSingleDuct->sd_airterminal(SysNum).DamperPosition, "System", "Average", - sd_airterminal(SysNum).SysName); + state.dataSingleDuct->sd_airterminal(SysNum).SysName); } // common report variable for all single duct air terminals - for (int sdIndex = 1; sdIndex <= NumSDAirTerminal; ++sdIndex) { + for (int sdIndex = 1; sdIndex <= state.dataSingleDuct->NumSDAirTerminal; ++sdIndex) { SetupOutputVariable(state, "Zone Air Terminal Outdoor Air Volume Flow Rate", OutputProcessor::Unit::m3_s, - sd_airterminal(sdIndex).OutdoorAirFlowRate, + state.dataSingleDuct->sd_airterminal(sdIndex).OutdoorAirFlowRate, "System", "Average", - sd_airterminal(sdIndex).SysName); + state.dataSingleDuct->sd_airterminal(sdIndex).SysName); } // Error check to see if a single duct air terminal is assigned to zone that has zone secondary recirculation @@ -2045,13 +1955,13 @@ namespace SingleDuct { NumZoneSiz = inputProcessor->getNumObjectsFound(state, "Sizing:Zone"); if (NumZoneSiz > 0) { - for (SysIndex = 1; SysIndex <= NumSDAirTerminal; ++SysIndex) { + for (SysIndex = 1; SysIndex <= state.dataSingleDuct->NumSDAirTerminal; ++SysIndex) { for (ZoneSizIndex = 1; ZoneSizIndex <= NumZoneSiz; ++ZoneSizIndex) { if (state.dataGlobal->DoZoneSizing) { - if (FinalZoneSizing(ZoneSizIndex).ActualZoneNum == sd_airterminal(SysIndex).ActualZoneNum) { + if (FinalZoneSizing(ZoneSizIndex).ActualZoneNum == state.dataSingleDuct->sd_airterminal(SysIndex).ActualZoneNum) { if (FinalZoneSizing(ZoneSizIndex).ZoneSecondaryRecirculation > 0.0) { ShowWarningError(state, RoutineName + "A zone secondary recirculation fraction is specified for zone served by "); - ShowContinueError(state, "...terminal unit \"" + sd_airterminal(SysIndex).SysName + + ShowContinueError(state, "...terminal unit \"" + state.dataSingleDuct->sd_airterminal(SysIndex).SysName + "\" , that indicates a single path system"); ShowContinueError(state, "...The zone secondary recirculation for that zone was set to 0.0"); FinalZoneSizing(ZoneSizIndex).ZoneSecondaryRecirculation = 0.0; @@ -2130,7 +2040,7 @@ namespace SingleDuct { // FLOW: // Do the Begin Simulation initializations - if (InitSysFlag) { + if (state.dataSingleDuct->InitSysFlag) { // MyEnvrnFlag.allocate(NumSDAirTerminal); // MySizeFlag.allocate(NumSDAirTerminal); @@ -2140,7 +2050,7 @@ namespace SingleDuct { // MySizeFlag = true; // PlantLoopScanFlag = true; // GetGasElecHeatCoilCap = true; - InitSysFlag = false; + state.dataSingleDuct->InitSysFlag = false; } if (this->PlantLoopScanFlag && allocated(PlantLoop)) { @@ -2177,15 +2087,15 @@ namespace SingleDuct { this->PlantLoopScanFlag = false; } - if (!ZoneEquipmentListChecked && ZoneEquipInputsFilled) { - ZoneEquipmentListChecked = true; + if (!state.dataSingleDuct->ZoneEquipmentListChecked && ZoneEquipInputsFilled) { + state.dataSingleDuct->ZoneEquipmentListChecked = true; // Check to see if there is a Air Distribution Unit on the Zone Equipment List - for (SysIndex = 1; SysIndex <= NumSDAirTerminal; ++SysIndex) { - if (sd_airterminal(SysIndex).ADUNum == 0) continue; - if (CheckZoneEquipmentList(state, "ZoneHVAC:AirDistributionUnit", AirDistUnit(sd_airterminal(SysIndex).ADUNum).Name)) continue; - ShowSevereError(state, "InitSingleDuctSystems: ADU=[Air Distribution Unit," + AirDistUnit(sd_airterminal(SysIndex).ADUNum).Name + + for (SysIndex = 1; SysIndex <= state.dataSingleDuct->NumSDAirTerminal; ++SysIndex) { + if (state.dataSingleDuct->sd_airterminal(SysIndex).ADUNum == 0) continue; + if (CheckZoneEquipmentList(state, "ZoneHVAC:AirDistributionUnit", AirDistUnit(state.dataSingleDuct->sd_airterminal(SysIndex).ADUNum).Name)) continue; + ShowSevereError(state, "InitSingleDuctSystems: ADU=[Air Distribution Unit," + AirDistUnit(state.dataSingleDuct->sd_airterminal(SysIndex).ADUNum).Name + "] is not on any ZoneHVAC:EquipmentList."); - ShowContinueError(state, "...System=[" + sd_airterminal(SysIndex).SysType + ',' + sd_airterminal(SysIndex).SysName + + ShowContinueError(state, "...System=[" + state.dataSingleDuct->sd_airterminal(SysIndex).SysType + ',' + state.dataSingleDuct->sd_airterminal(SysIndex).SysName + "] will not be simulated."); } } @@ -2205,7 +2115,7 @@ namespace SingleDuct { } if (this->GetGasElecHeatCoilCap) { - if (this->ReheatComp_Num == HCoilType_Electric || this->ReheatComp_Num == HCoilType_Gas) { + if (this->ReheatComp_Num == HeatingCoilType::Electric || this->ReheatComp_Num == HeatingCoilType::Gas) { if (this->ReheatCoilMaxCapacity == AutoSize) { errFlag = false; this->ReheatCoilMaxCapacity = GetHeatingCoilCapacity(state, this->ReheatComp, this->ReheatName, errFlag); @@ -2231,7 +2141,7 @@ namespace SingleDuct { Node(InletNode).MassFlowRateMax = this->MaxAirVolFlowRate * StdRhoAir; this->MassFlowDiff = 1.0e-10 * this->AirMassFlowRateMax; - if (this->HWLoopNum > 0 && this->ReheatComp_Num != HCoilType_SteamAirHeating) { // protect early calls before plant is setup + if (this->HWLoopNum > 0 && this->ReheatComp_Num != HeatingCoilType::SteamAirHeating) { // protect early calls before plant is setup rho = GetDensityGlycol( state, PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp(), PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else { @@ -2245,7 +2155,7 @@ namespace SingleDuct { // set the upstream leakage flowrate - remove from here - done in ZoneAirLoopEquipmentManager::SimZoneAirLoopEquipment - if (this->ReheatComp_Num == HCoilType_SteamAirHeating) { + if (this->ReheatComp_Num == HeatingCoilType::SteamAirHeating) { SteamTemp = 100.0; SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, SteamTemp, 1.0, this->FluidIndex, RoutineNameFull); this->MaxReheatSteamFlow = SteamDensity * this->MaxReheatSteamVolFlow; @@ -2257,10 +2167,10 @@ namespace SingleDuct { if (this->ZoneTurndownMinAirFracSchExist) { CurrentEnvZoneTurndownMinAirFrac = ScheduleManager::GetScheduleMinValue(state, this->ZoneTurndownMinAirFracSchPtr); } - if ((this->SysType_Num == SingleDuctVAVReheat || this->SysType_Num == SingleDuctCBVAVReheat) || - (this->SysType_Num == SingleDuctCBVAVNoReheat)) { + if ((this->SysType_Num == SysType::SingleDuctVAVReheat || this->SysType_Num == SysType::SingleDuctCBVAVReheat) || + (this->SysType_Num == SysType::SingleDuctCBVAVNoReheat)) { // need the lowest schedule value - if (this->ZoneMinAirFracMethod == ScheduledMinFrac) { + if (this->ZoneMinAirFracMethod == MinFlowFraction::Scheduled) { this->ZoneMinAirFracDes = GetScheduleMinValue(state, this->ZoneMinAirFracSchPtr); } Node(OutletNode).MassFlowRateMin = Node(OutletNode).MassFlowRateMax * this->ZoneMinAirFracDes * CurrentEnvZoneTurndownMinAirFrac; @@ -2270,7 +2180,7 @@ namespace SingleDuct { Node(InletNode).MassFlowRateMin = 0.0; } if ((this->ReheatControlNode > 0) && !this->PlantLoopScanFlag) { - if (this->ReheatComp_Num == HCoilType_SteamAirHeating) { + if (this->ReheatComp_Num == HeatingCoilType::SteamAirHeating) { InitComponentNodes(this->MinReheatSteamFlow, this->MaxReheatSteamFlow, this->ReheatControlNode, @@ -2309,7 +2219,7 @@ namespace SingleDuct { Real64 mDotFromOARequirement(0.0); - if (this->SysType_Num == SingleDuctConstVolNoReheat) { + if (this->SysType_Num == SysType::SingleDuctConstVolNoReheat) { /*Real64 mDotFromOARequirement( 0.0 );*/ if (!this->NoOAFlowInputFromUser) { mDotFromOARequirement = this->AirMassFlowRateMax; @@ -2332,7 +2242,7 @@ namespace SingleDuct { } } - if (this->ZoneMinAirFracMethod == ScheduledMinFrac) { + if (this->ZoneMinAirFracMethod == MinFlowFraction::Scheduled) { this->ZoneMinAirFracDes = GetCurrentScheduleValue(state, this->ZoneMinAirFracSchPtr); // now reset inlet node min avail Node(InletNode).MassFlowRateMinAvail = this->AirMassFlowRateMax * this->ZoneMinAirFracDes * this->ZoneTurndownMinAirFrac; @@ -2351,7 +2261,7 @@ namespace SingleDuct { if ((Node(InletNode).MassFlowRateMaxAvail > 0.0) && (GetCurrentScheduleValue(state, this->SchedPtr) > 0.0)) { if (!(AirflowNetwork::SimulateAirflowNetwork > AirflowNetwork::AirflowNetworkControlMultizone && AirflowNetwork::AirflowNetworkFanActivated)) { - if (this->SysType_Num == SingleDuctConstVolNoReheat) { + if (this->SysType_Num == SysType::SingleDuctConstVolNoReheat) { if (this->NoOAFlowInputFromUser) { Node(InletNode).MassFlowRate = this->AirMassFlowRateMax; Node(InletNode).MassFlowRateMaxAvail = this->AirMassFlowRateMax; @@ -2386,7 +2296,7 @@ namespace SingleDuct { this->MassFlow3 = 0.0; } else { - if (this->SysType_Num == SingleDuctConstVolNoReheat) { + if (this->SysType_Num == SysType::SingleDuctConstVolNoReheat) { if (!this->EMSOverrideAirFlow) { if ((Node(InletNode).MassFlowRateMaxAvail > 0.0) && (GetCurrentScheduleValue(state, this->SchedPtr) > 0.0)) { if (this->NoOAFlowInputFromUser) { @@ -2652,7 +2562,7 @@ namespace SingleDuct { if (this->ZoneMinAirFracDes == AutoSize) { IsAutoSize = true; } - if (this->ZoneMinAirFracMethod == ConstantMinFrac) { + if (this->ZoneMinAirFracMethod == MinFlowFraction::Constant) { if (ZoneSizingRunDone) { if (CurTermUnitSizingNum > 0) { // use the combined defaults or other user inputs stored in DesCoolVolFlowMin @@ -2713,7 +2623,7 @@ namespace SingleDuct { if (this->ZoneFixedMinAir == AutoSize) { IsAutoSize = true; } - if (this->ZoneMinAirFracMethod == FixedMin) { + if (this->ZoneMinAirFracMethod == MinFlowFraction::Fixed) { if (ZoneSizingRunDone) { if (CurTermUnitSizingNum > 0) { // use the combined defaults or other user inputs stored in DesCoolVolFlowMin @@ -2770,7 +2680,7 @@ namespace SingleDuct { } } - if (this->ZoneMinAirFracMethod == ScheduledMinFrac) { + if (this->ZoneMinAirFracMethod == MinFlowFraction::Scheduled) { // need a value for sizing. if (this->ConstantMinAirFracSetByUser) { this->ZoneMinAirFracDes = this->DesignMinAirFrac; @@ -2787,12 +2697,12 @@ namespace SingleDuct { } } - if (this->ZoneMinAirFracMethod == FixedMin) { + if (this->ZoneMinAirFracMethod == MinFlowFraction::Fixed) { // need a value for sizing. this->ZoneMinAirFracDes = min(1.0, SafeDivide(this->ZoneFixedMinAir, this->MaxAirVolFlowRate)); } - if (this->DamperHeatingAction == ReverseActionWithLimits) { + if (this->DamperHeatingAction == Action::ReverseActionWithLimits) { if (ZoneSizingRunDone) { if (CurTermUnitSizingNum > 0) { // if zone sizing run done, set the design max reheat air flow to the value from the design calcs @@ -2890,7 +2800,7 @@ namespace SingleDuct { } } } else { - // both fields have user input. Report both out, use the larger of the 2 values. Note that only sd_airterminal( SysNum + // both fields have user input. Report both out, use the larger of the 2 values. Note that only state.dataSingleDuct->sd_airterminal( SysNum // ).MaxAirVolFlowRateDuringReheat is used subsequently. Check both inputs for optional caution message that user input value is not // within 10% of the design value. MaxAirVolFlowRateDuringReheatUser = this->MaxAirVolFlowRateDuringReheat; @@ -2944,7 +2854,7 @@ namespace SingleDuct { // check that MaxAirVolFlowRateDuringReheat is greater than the min and less than the max this->MaxAirVolFlowRateDuringReheat = min(MaxAirVolFlowRateDuringReheatDes, this->MaxAirVolFlowRate); this->MaxAirVolFlowRateDuringReheat = max(MaxAirVolFlowRateDuringReheatDes, (this->MaxAirVolFlowRate * this->ZoneMinAirFracDes)); - } else if (this->DamperHeatingAction == Normal) { + } else if (this->DamperHeatingAction == Action::Normal) { // for Normal action, max reheat flow is equal to the minimum. Report it. if (this->ZoneFloorArea > 0.0) { BaseSizer::reportSizerOutput(state, this->SysType, @@ -2956,7 +2866,7 @@ namespace SingleDuct { // zero the ReverseActioWithLimits inputs this->MaxAirVolFlowRateDuringReheat = max(this->MaxAirVolFlowRateDuringReheat, 0.0); this->MaxAirVolFractionDuringReheat = max(this->MaxAirVolFractionDuringReheat, 0.0); - } else if (this->DamperHeatingAction == ReverseAction) { + } else if (this->DamperHeatingAction == Action::ReverseAction) { // for ReverseAction, max reheat flow is equal to the maximum. Report it. if (this->ZoneFloorArea > 0.0) { BaseSizer::reportSizerOutput(state, this->SysType, @@ -2974,7 +2884,7 @@ namespace SingleDuct { TermUnitSizing(CurTermUnitSizingNum).ReheatAirFlowMult = 1.0; TermUnitSizing(CurTermUnitSizingNum).ReheatLoadMult = 1.0; if (ZoneSizingRunDone) { - if (this->SysType_Num == SingleDuctVAVReheatVSFan) { + if (this->SysType_Num == SysType::SingleDuctVAVReheatVSFan) { TermUnitSizing(CurTermUnitSizingNum).AirVolFlow = max(UserInputMaxHeatAirVolFlowRate, TermUnitFinalZoneSizing(CurTermUnitSizingNum).NonAirSysDesHeatVolFlow, @@ -2985,15 +2895,15 @@ namespace SingleDuct { this->MaxAirVolFlowRate * this->ZoneMinAirFracDes * this->ZoneTurndownMinAirFrac); } } else { - if (this->SysType_Num == SingleDuctVAVReheatVSFan) { + if (this->SysType_Num == SysType::SingleDuctVAVReheatVSFan) { TermUnitSizing(CurTermUnitSizingNum).AirVolFlow = max(this->MaxHeatAirVolFlowRate, this->MaxAirVolFlowRate * this->ZoneMinAirFracDes * this->ZoneTurndownMinAirFrac); - } else if (this->SysType_Num == SingleDuctConstVolReheat || this->SysType_Num == SingleDuctConstVolNoReheat) { + } else if (this->SysType_Num == SysType::SingleDuctConstVolReheat || this->SysType_Num == SysType::SingleDuctConstVolNoReheat) { TermUnitSizing(CurTermUnitSizingNum).AirVolFlow = this->MaxAirVolFlowRate; } else { - if (this->DamperHeatingAction == ReverseAction) { + if (this->DamperHeatingAction == Action::ReverseAction) { TermUnitSizing(CurTermUnitSizingNum).AirVolFlow = this->MaxAirVolFlowRate; - } else if (this->DamperHeatingAction == ReverseActionWithLimits) { + } else if (this->DamperHeatingAction == Action::ReverseActionWithLimits) { TermUnitSizing(CurTermUnitSizingNum).AirVolFlow = max( this->MaxAirVolFlowRateDuringReheat, (this->MaxAirVolFlowRate * this->ZoneMinAirFracDes * this->ZoneTurndownMinAirFrac)); } else { @@ -3004,20 +2914,20 @@ namespace SingleDuct { } if (TermUnitSizing(CurTermUnitSizingNum).AirVolFlow > SmallAirVolFlow) { - if (this->DamperHeatingAction == ReverseActionWithLimits) { + if (this->DamperHeatingAction == Action::ReverseActionWithLimits) { TermUnitSizing(CurTermUnitSizingNum).ReheatAirFlowMult = min(this->MaxAirVolFlowRateDuringReheat, this->MaxAirVolFlowRate) / TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; TermUnitSizing(CurTermUnitSizingNum).ReheatLoadMult = TermUnitSizing(CurTermUnitSizingNum).ReheatAirFlowMult; - } else if (this->DamperHeatingAction == ReverseAction) { + } else if (this->DamperHeatingAction == Action::ReverseAction) { TermUnitSizing(CurTermUnitSizingNum).ReheatAirFlowMult = this->MaxAirVolFlowRate / TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; TermUnitSizing(CurTermUnitSizingNum).ReheatLoadMult = TermUnitSizing(CurTermUnitSizingNum).ReheatAirFlowMult; - } else if (this->DamperHeatingAction == Normal && this->MaxAirVolFlowRateDuringReheat > 0.0) { + } else if (this->DamperHeatingAction == Action::Normal && this->MaxAirVolFlowRateDuringReheat > 0.0) { TermUnitSizing(CurTermUnitSizingNum).ReheatAirFlowMult = min(this->MaxAirVolFlowRateDuringReheat, (this->MaxAirVolFlowRate * this->ZoneMinAirFracDes * this->ZoneTurndownMinAirFrac)) / TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; TermUnitSizing(CurTermUnitSizingNum).ReheatLoadMult = 1.0; - } else if (this->DamperHeatingAction == Normal && this->MaxAirVolFlowRateDuringReheat == 0.0) { + } else if (this->DamperHeatingAction == Action::Normal && this->MaxAirVolFlowRateDuringReheat == 0.0) { TermUnitSizing(CurTermUnitSizingNum).ReheatAirFlowMult = (this->MaxAirVolFlowRate * this->ZoneMinAirFracDes * this->ZoneTurndownMinAirFrac) / TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; @@ -3228,8 +3138,8 @@ namespace SingleDuct { TermUnitSizing(CurTermUnitSizingNum).MaxHWVolFlow = this->MaxReheatWaterVolFlow; TermUnitSizing(CurTermUnitSizingNum).MaxSTVolFlow = this->MaxReheatSteamVolFlow; TermUnitSizing(CurTermUnitSizingNum).DesHeatingLoad = DesCoilLoad; // Coil Summary report - if (this->ReheatComp_Num == HCoilType_SimpleHeating) { - if (this->DamperHeatingAction == Normal) { + if (this->ReheatComp_Num == HeatingCoilType::SimpleHeating) { + if (this->DamperHeatingAction == Action::Normal) { SetCoilDesFlow(state, this->ReheatComp, this->ReheatName, this->ZoneMinAirFracDes * this->MaxAirVolFlowRate, ErrorsFound); } else { @@ -3350,9 +3260,9 @@ namespace SingleDuct { // The SINGLE DUCT:VAV:REHEAT terminal unit originally contained 2 components: a damper // and a reheat coil. The damper has become a virtual component - it consists only of // an air inlet node and an air outlet node. The damper is upstream of the heating coil. - // sd_airterminal(SysNum)%InletNodeNum is the inlet node to the terminal unit and the damper - // sd_airterminal(SysNum)%OutletNodeNum is the outlet node of the damper and the inlet node of the heating coil - // sd_airterminal(SysNum)%ReheatAirOutletNode is the outlet node of the terminal unit and the heating coil + // state.dataSingleDuct->sd_airterminal(SysNum)%InletNodeNum is the inlet node to the terminal unit and the damper + // state.dataSingleDuct->sd_airterminal(SysNum)%OutletNodeNum is the outlet node of the damper and the inlet node of the heating coil + // state.dataSingleDuct->sd_airterminal(SysNum)%ReheatAirOutletNode is the outlet node of the terminal unit and the heating coil // The calculated load from the Heat Balance LeakLoadMult = AirDistUnit(this->ADUNum).LeakLoadMult; @@ -3412,7 +3322,7 @@ namespace SingleDuct { } else if ((this->sd_airterminalInlet.AirMassFlowRateMaxAvail > 0.0) && (QTotLoad >= 0.0 || TempControlType(ZoneNum) == SingleHeatingSetPoint) && (GetCurrentScheduleValue(state, this->SchedPtr) > 0.0)) { - // IF (sd_airterminal(SysNum)%DamperHeatingAction .EQ. ReverseAction .AND. this->sd_airterminalInlet%AirMassFlowRateMinAvail <= + // IF (state.dataSingleDuct->sd_airterminal(SysNum)%DamperHeatingAction .EQ. ReverseAction .AND. this->sd_airterminalInlet%AirMassFlowRateMinAvail <= // SmallMassFlow) THEN // special case for heating: reverse action and damper allowed to close - set the minimum flow rate to a small but nonzero value // MassFlow = 0.01d0*this->sd_airterminalInlet%AirMassFlowRateMaxAvail @@ -3469,14 +3379,14 @@ namespace SingleDuct { // ! Calculate the Damper Position when there is a Max air flow specified. // If (MassFlow == 0.0D0) THEN - // sd_airterminal(SysNum)%DamperPosition = 0.0D0 + // state.dataSingleDuct->sd_airterminal(SysNum)%DamperPosition = 0.0D0 // ELSE IF (this->sd_airterminalInlet%AirMassFlowRateMaxAvail > this->sd_airterminalInlet%AirMassFlowRateMinAvail) THEN - // sd_airterminal(SysNum)%DamperPosition = ((MassFlow-this->sd_airterminalInlet%AirMassFlowRateMinAvail) / & + // state.dataSingleDuct->sd_airterminal(SysNum)%DamperPosition = ((MassFlow-this->sd_airterminalInlet%AirMassFlowRateMinAvail) / & // (this->sd_airterminalInlet%AirMassFlowRateMaxAvail-this->sd_airterminalInlet%AirMassFlowRateMinAvail)) * // & // (1.0d0-MinFlowFrac) + MinFlowFrac // ELSE - // sd_airterminal(SysNum)%DamperPosition = 1.0D0 + // state.dataSingleDuct->sd_airterminal(SysNum)%DamperPosition = 1.0D0 // END IF if (MassFlow == 0.0) { @@ -3512,11 +3422,11 @@ namespace SingleDuct { QZoneMax2 = QToHeatSetPt; // fill dual-max reheat flow limit, if any - if (this->DamperHeatingAction == ReverseAction) { + if (this->DamperHeatingAction == Action::ReverseAction) { MaxDeviceAirMassFlowReheat = this->AirMassFlowRateMax; - } else if (this->DamperHeatingAction == ReverseActionWithLimits) { + } else if (this->DamperHeatingAction == Action::ReverseActionWithLimits) { MaxDeviceAirMassFlowReheat = this->AirMassFlowDuringReheatMax; - } else if (this->DamperHeatingAction == Normal) { + } else if (this->DamperHeatingAction == Action::Normal) { MaxDeviceAirMassFlowReheat = this->ZoneMinAirFrac * this->AirMassFlowRateMax; } else { // used for AIRTERMINAL_SINGLEDUCT_VAV_NOREHEAT or SingleDuctVAVNoReheat @@ -3564,7 +3474,7 @@ namespace SingleDuct { auto const SELECT_CASE_var(this->ReheatComp_Num); // Reverse damper option is working only for water coils for now. // hot water heating coil - if (SELECT_CASE_var == HCoilType_SimpleHeating) { // COIL:WATER:SIMPLEHEATING + if (SELECT_CASE_var == HeatingCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING // Determine the load required to pass to the Component controller // Although this equation looks strange (using temp instead of deltaT), it is corrected later in ControlCompOutput // and is working as-is, temperature setpoints are maintained as expected. @@ -3611,7 +3521,7 @@ namespace SingleDuct { // If reverse action damper and the hot water flow is at maximum, simulate the // hot water coil with fixed (maximum) hot water flow but allow the air flow to // vary up to the maximum (air damper opens to try to meet zone load) - if (this->DamperHeatingAction == ReverseAction || this->DamperHeatingAction == ReverseActionWithLimits) { + if (this->DamperHeatingAction == Action::ReverseAction || this->DamperHeatingAction == Action::ReverseActionWithLimits) { if (Node(this->ReheatControlNode).MassFlowRate == MaxFlowWater) { // fill limits for air flow for controller MinAirMassFlowRevAct = this->AirMassFlowRateMax * this->ZoneMinAirFrac; @@ -3680,8 +3590,8 @@ namespace SingleDuct { this->sd_airterminalOutlet.AirMassFlowRate = MassFlow; // reset OA report variable this->UpdateSys(); - } // IF (Node(sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate .EQ. MaxFlowWater) THEN - } // IF (sd_airterminal(SysNum)%DamperHeatingAction .EQ. ReverseAction) THEN + } // IF (Node(state.dataSingleDuct->sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate .EQ. MaxFlowWater) THEN + } // IF (state.dataSingleDuct->sd_airterminal(SysNum)%DamperHeatingAction .EQ. ReverseAction) THEN // Recalculate the Damper Position. if (MassFlow == 0.0) { @@ -3695,28 +3605,28 @@ namespace SingleDuct { this->ZoneMinAirFracReport = this->ZoneMinAirFrac; } - } else if (SELECT_CASE_var == HCoilType_SteamAirHeating) { // ! COIL:STEAM:AIRHEATING + } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // ! COIL:STEAM:AIRHEATING // Determine the load required to pass to the Component controller QZnReq = QZoneMax2 - MassFlow * CpAirAvg * (this->sd_airterminalInlet.AirTemp - ZoneTemp); // Simulate reheat coil for the VAV system SimulateSteamCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index, QZnReq); - } else if (SELECT_CASE_var == HCoilType_Electric) { // COIL:ELECTRIC:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING // Determine the load required to pass to the Component controller QZnReq = QZoneMax2 - MassFlow * CpAirAvg * (this->sd_airterminalInlet.AirTemp - ZoneTemp); // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, QZnReq, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_Gas) { // COIL:GAS:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING // Determine the load required to pass to the Component controller QZnReq = QZoneMax2 - MassFlow * CpAirAvg * (this->sd_airterminalInlet.AirTemp - ZoneTemp); // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, QZnReq, this->ReheatComp_Index, QHeatingDelivered); - } else if (SELECT_CASE_var == HCoilType_None) { // blank + } else if (SELECT_CASE_var == HeatingCoilType::None) { // blank // I no reheat is defined then assume that the damper is the only component. // If something else is there that is not a reheat coil or a blank then give the error message @@ -3730,26 +3640,26 @@ namespace SingleDuct { { auto const SELECT_CASE_var(this->ReheatComp_Num); - if (SELECT_CASE_var == HCoilType_SimpleHeating) { // COIL:WATER:SIMPLEHEATING + if (SELECT_CASE_var == HeatingCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING // Simulate reheat coil for the Const Volume system - // Node(sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 !DSU + // Node(state.dataSingleDuct->sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 !DSU DummyMdot = 0.0; SetActuatedBranchFlowRate(state, DummyMdot, this->ReheatControlNode, this->HWLoopNum, this->HWLoopSide, this->HWBranchIndex, true); // call the reheat coil with the NO FLOW condition to make sure that the Node values // are passed through to the coil outlet correctly SimulateWaterCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_SteamAirHeating) { // COIL:STEAM:AIRHEATING + } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // COIL:STEAM:AIRHEATING // Simulate reheat coil for the VAV system SimulateSteamCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index, 0.0); - } else if (SELECT_CASE_var == HCoilType_Electric) { // COIL:ELECTRIC:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, 0.0, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_Gas) { // COIL:GAS:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, 0.0, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_None) { // blank + } else if (SELECT_CASE_var == HeatingCoilType::None) { // blank // If no reheat is defined then assume that the damper is the only component. // If something else is that is not a reheat coil or a blank then give the error message @@ -3768,7 +3678,7 @@ namespace SingleDuct { void SingleDuctAirTerminal::CalcOAMassFlow(EnergyPlusData &state, Real64 &SAMassFlow, // outside air based on optional user input Real64 &AirLoopOAFrac // outside air based on optional user input - ) + ) const { // FUNCTION INFORMATION: @@ -3901,9 +3811,9 @@ namespace SingleDuct { static Real64 QZoneMax2(0.0); // temporary variable static Real64 QZoneMax3(0.0); // temporary variable - // sd_airterminal(SysNum)%InletNodeNum is the inlet node to the terminal unit and the damper - // sd_airterminal(SysNum)%OutletNodeNum is the outlet node of the damper and the inlet node of the heating coil - // sd_airterminal(SysNum)%ReheatAirOutletNode is the outlet node of the terminal unit and the heating coil + // state.dataSingleDuct->sd_airterminal(SysNum)%InletNodeNum is the inlet node to the terminal unit and the damper + // state.dataSingleDuct->sd_airterminal(SysNum)%OutletNodeNum is the outlet node of the damper and the inlet node of the heating coil + // state.dataSingleDuct->sd_airterminal(SysNum)%ReheatAirOutletNode is the outlet node of the terminal unit and the heating coil // The calculated load from the Heat Balance LeakLoadMult = AirDistUnit(this->ADUNum).LeakLoadMult; @@ -4014,7 +3924,7 @@ namespace SingleDuct { MassFlow = MassFlowActual; - } // IF (sd_airterminal(SysNum)%MaxReheatTempSetByUser) THEN + } // IF (state.dataSingleDuct->sd_airterminal(SysNum)%MaxReheatTempSetByUser) THEN this->sd_airterminalOutlet.AirMassFlowRate = MassFlow; @@ -4024,7 +3934,7 @@ namespace SingleDuct { auto const SELECT_CASE_var(this->ReheatComp_Num); // hot water heating coil - if (SELECT_CASE_var == HCoilType_SimpleHeating) { // COIL:WATER:SIMPLEHEATING + if (SELECT_CASE_var == HeatingCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING // Determine the load required to pass to the Component controller // Although this equation looks strange (using temp instead of deltaT), it is corrected later in ControlCompOutput // and is working as-is, temperature setpoints are maintained as expected. @@ -4032,7 +3942,7 @@ namespace SingleDuct { if (QZnReq < SmallLoad) QZnReq = 0.0; // Initialize hot water flow rate to zero. - // Node(sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 + // Node(state.dataSingleDuct->sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 DummyMdot = 0.0; SetActuatedBranchFlowRate(state, DummyMdot, this->ReheatControlNode, this->HWLoopNum, this->HWLoopSide, this->HWBranchIndex, true); // On the first HVAC iteration the system values are given to the controller, but after that @@ -4072,7 +3982,7 @@ namespace SingleDuct { // If reverse action damper and the hot water flow is at maximum, simulate the // hot water coil with fixed (maximum) hot water flow but allow the air flow to // vary up to the maximum (air damper opens to try to meet zone load). - if (this->DamperHeatingAction == ReverseAction) { + if (this->DamperHeatingAction == Action::ReverseAction) { if (Node(this->ReheatControlNode).MassFlowRate == this->MaxReheatWaterFlow) { ControlCompOutput(state, this->ReheatName, @@ -4131,7 +4041,7 @@ namespace SingleDuct { this->DamperPosition = MassFlow / this->AirMassFlowRateMax; } } - } else if (SELECT_CASE_var == HCoilType_SteamAirHeating) { // ! COIL:STEAM:AIRHEATING + } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // ! COIL:STEAM:AIRHEATING // Determine the load required to pass to the Component controller QZnReq = QZoneMax2 - MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - ZoneTemp); if (QZnReq < SmallLoad) QZnReq = 0.0; @@ -4139,7 +4049,7 @@ namespace SingleDuct { // Simulate reheat coil for the VAV system SimulateSteamCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index, QZnReq); - } else if (SELECT_CASE_var == HCoilType_Electric) { // COIL:ELECTRIC:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING // Determine the load required to pass to the Component controller QSupplyAir = MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - ZoneTemp); QZnReq = QZoneMax2 - QSupplyAir; @@ -4148,14 +4058,14 @@ namespace SingleDuct { // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, QZnReq, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_Gas) { // COIL:GAS:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING // Determine the load required to pass to the Component controller QZnReq = QZoneMax2 - MassFlow * CpAirZn * (this->sd_airterminalInlet.AirTemp - ZoneTemp); if (QZnReq < SmallLoad) QZnReq = 0.0; // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, QZnReq, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_None) { // blank + } else if (SELECT_CASE_var == HeatingCoilType::None) { // blank // If no reheat is defined then assume that the damper is the only component. // If something else is there that is not a reheat coil then give the error message below. @@ -4169,9 +4079,9 @@ namespace SingleDuct { { auto const SELECT_CASE_var(this->ReheatComp_Num); - if (SELECT_CASE_var == HCoilType_SimpleHeating) { // COIL:WATER:SIMPLEHEATING + if (SELECT_CASE_var == HeatingCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING // Simulate reheat coil for the Const Volume system - // Node(sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 + // Node(state.dataSingleDuct->sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 // Initialize hot water flow rate to zero. DummyMdot = 0.0; SetActuatedBranchFlowRate(state, DummyMdot, this->ReheatControlNode, this->HWLoopNum, this->HWLoopSide, this->HWBranchIndex, true); @@ -4179,18 +4089,18 @@ namespace SingleDuct { // call the reheat coil with the NO FLOW condition to make sure that the Node values // are passed through to the coil outlet correctly SimulateWaterCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_SteamAirHeating) { // COIL:STEAM:AIRHEATING + } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // COIL:STEAM:AIRHEATING // Simulate reheat coil for the VAV system SimulateSteamCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index, 0.0); - } else if (SELECT_CASE_var == HCoilType_Electric) { // COIL:ELECTRIC:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, 0.0, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_Gas) { // COIL:GAS:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, 0.0, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_None) { // blank + } else if (SELECT_CASE_var == HeatingCoilType::None) { // blank // If no reheat is defined then assume that the damper is the only component. // If something else is there that is not a reheat coil then give the error message @@ -4267,7 +4177,7 @@ namespace SingleDuct { Real64 QHeatFanOnMin; // min heating - fan at min flow, hot water at max flow [W] Real64 QHeatFanOffMax; // max heating - fan off, hot water flow at max [W] Real64 QNoHeatFanOff; // min heating - fan off, hot water at min flow [W] - int HCType; // heating coil type (as a number) + HeatingCoilType HCType; // heating coil type int FanType; // fan type (as a number) Real64 HCLoad; // load passed to a gas or electric heating coil [W] int FanOp; // 1 if fan is on; 0 if off. @@ -4299,11 +4209,11 @@ namespace SingleDuct { if (this->sd_airterminalInlet.AirMassFlowRateMaxAvail <= 0.0 || CurDeadBandOrSetback(ZoneNum)) { MassFlow = 0.0; FanOp = 0; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, 0.0, 0.0, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, 0.0, 0.0, FanType, MassFlow, FanOp, QDelivered); return; } - if (HCType == HCoilType_SimpleHeating) { + if (HCType == HeatingCoilType::SimpleHeating) { WaterControlNode = this->ReheatControlNode; HCLoad = 0.0; if (FirstHVACIteration) { @@ -4321,7 +4231,7 @@ namespace SingleDuct { MinFlowWater = 0.0; } - if (HCType == HCoilType_SteamAirHeating) { + if (HCType == HeatingCoilType::SteamAirHeating) { SteamControlNode = this->ReheatControlNode; HCLoad = 0.0; if (FirstHVACIteration) { @@ -4341,27 +4251,27 @@ namespace SingleDuct { // define 3 load regions and assign the current load to the correct region. // region 1: active cooling with fan on FanOp = 1; - if (HCType == HCoilType_SteamAirHeating) { - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowSteam, 0.0, FanType, MaxCoolMassFlow, FanOp, QCoolFanOnMax); - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowSteam, 0.0, FanType, MinMassFlow, FanOp, QCoolFanOnMin); + if (HCType == HeatingCoilType::SteamAirHeating) { + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowSteam, 0.0, FanType, MaxCoolMassFlow, FanOp, QCoolFanOnMax); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowSteam, 0.0, FanType, MinMassFlow, FanOp, QCoolFanOnMin); // region 2: active heating with fan on - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowSteam, BigLoad, FanType, MaxHeatMassFlow, FanOp, QHeatFanOnMax); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowSteam, BigLoad, FanType, MaxHeatMassFlow, FanOp, QHeatFanOnMax); MaxSteamCap = GetCoilCapacity(state, this->ReheatComp, this->ReheatName, ErrorsFound); - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowSteam, 0.0, FanType, MinMassFlow, FanOp, QHeatFanOnMin); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowSteam, 0.0, FanType, MinMassFlow, FanOp, QHeatFanOnMin); // region 3: active heating with fan off FanOp = 0; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowSteam, BigLoad, FanType, MinMassFlow, FanOp, QHeatFanOffMax); - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowSteam, 0.0, FanType, MinMassFlow, FanOp, QNoHeatFanOff); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowSteam, BigLoad, FanType, MinMassFlow, FanOp, QHeatFanOffMax); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowSteam, 0.0, FanType, MinMassFlow, FanOp, QNoHeatFanOff); } else { - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowWater, 0.0, FanType, MaxCoolMassFlow, FanOp, QCoolFanOnMax); - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowWater, 0.0, FanType, MinMassFlow, FanOp, QCoolFanOnMin); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowWater, 0.0, FanType, MaxCoolMassFlow, FanOp, QCoolFanOnMax); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowWater, 0.0, FanType, MinMassFlow, FanOp, QCoolFanOnMin); // region 2: active heating with fan on - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowWater, BigLoad, FanType, MaxHeatMassFlow, FanOp, QHeatFanOnMax); - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowWater, 0.0, FanType, MinMassFlow, FanOp, QHeatFanOnMin); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowWater, BigLoad, FanType, MaxHeatMassFlow, FanOp, QHeatFanOnMax); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowWater, 0.0, FanType, MinMassFlow, FanOp, QHeatFanOnMin); // region 3: active heating with fan off FanOp = 0; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowWater, BigLoad, FanType, MinMassFlow, FanOp, QHeatFanOffMax); - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowWater, 0.0, FanType, MinMassFlow, FanOp, QNoHeatFanOff); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowWater, BigLoad, FanType, MinMassFlow, FanOp, QHeatFanOffMax); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowWater, 0.0, FanType, MinMassFlow, FanOp, QNoHeatFanOff); } // Active cooling with fix for issue #5592 @@ -4378,7 +4288,7 @@ namespace SingleDuct { } Par(3) = double(ZoneNodeNum); Par(4) = double(HCType); - if (HCType == HCoilType_SteamAirHeating) { + if (HCType == HeatingCoilType::SteamAirHeating) { Par(5) = MinFlowSteam; } else { Par(5) = MinFlowWater; @@ -4386,7 +4296,7 @@ namespace SingleDuct { Par(6) = double(FanType); Par(7) = double(FanOp); Par(8) = QTotLoad; - SolveRoot(state, UnitFlowToler, 50, SolFlag, MassFlow, this->VAVVSCoolingResidual, MinMassFlow, MaxCoolMassFlow, Par); + SolveRoot(state, UnitFlowToler, 50, SolFlag, MassFlow, EnergyPlus::SingleDuct::SingleDuctAirTerminal::VAVVSCoolingResidual, MinMassFlow, MaxCoolMassFlow, Par); if (SolFlag == -1) { if (this->IterationLimit == 0) { ShowWarningError(state, "Supply air flow control failed in VS VAV terminal unit " + this->SysName); @@ -4406,10 +4316,10 @@ namespace SingleDuct { MassFlow = MaxCoolMassFlow; - if (HCType == HCoilType_SteamAirHeating) { - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowSteam, 0.0, FanType, MassFlow, FanOp, QDelivered); + if (HCType == HeatingCoilType::SteamAirHeating) { + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowSteam, 0.0, FanType, MassFlow, FanOp, QDelivered); } else { - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowWater, 0.0, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowWater, 0.0, FanType, MassFlow, FanOp, QDelivered); } } @@ -4419,17 +4329,17 @@ namespace SingleDuct { (this->sd_airterminalInlet.AirMassFlowRateMaxAvail > 0.0 && CurDeadBandOrSetback(ZoneNum))) { MassFlow = MinMassFlow; FanOp = 0; - if (HCType == HCoilType_SteamAirHeating) { - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowSteam, QTotLoad, FanType, MassFlow, FanOp, QNoHeatFanOff); + if (HCType == HeatingCoilType::SteamAirHeating) { + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowSteam, QTotLoad, FanType, MassFlow, FanOp, QNoHeatFanOff); } else { - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MinFlowWater, 0.0, FanType, MassFlow, FanOp, QNoHeatFanOff); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MinFlowWater, 0.0, FanType, MassFlow, FanOp, QNoHeatFanOff); } // active heating } else if (QTotLoad > QNoHeatFanOff + SmallLoad && this->sd_airterminalInlet.AirMassFlowRateMaxAvail > 0.0 && !CurDeadBandOrSetback(ZoneNum)) { // hot water coil - if (HCType == HCoilType_SimpleHeating) { + if (HCType == HeatingCoilType::SimpleHeating) { if (QTotLoad < QHeatFanOffMax - SmallLoad) { // vary HW flow, leave air flow at minimum MassFlow = MinMassFlow; @@ -4441,17 +4351,17 @@ namespace SingleDuct { Par(2) = 0.0; } Par(3) = double(ZoneNodeNum); - Par(4) = double(HCType); + Par(4) = double(static_cast(HCType)); Par(5) = MassFlow; Par(6) = double(FanType); Par(7) = double(FanOp); Par(8) = QTotLoad; ErrTolerance = this->ControllerOffset; - SolveRoot(state, ErrTolerance, 500, SolFlag, HWFlow, this->VAVVSHWNoFanResidual, MinFlowWater, MaxFlowWater, Par); + SolveRoot(state, ErrTolerance, 500, SolFlag, HWFlow, EnergyPlus::SingleDuct::SingleDuctAirTerminal::VAVVSHWNoFanResidual, MinFlowWater, MaxFlowWater, Par); if (SolFlag == -1) { ShowRecurringWarningErrorAtEnd(state, "Hot Water flow control failed in VS VAV terminal unit " + this->SysName, this->ErrCount1); ShowRecurringContinueErrorAtEnd(state, "...Iteration limit (500) exceeded in calculating the hot water flow rate", this->ErrCount1c); - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, HWFlow, 0.0, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HWFlow, 0.0, FanType, MassFlow, FanOp, QDelivered); } else if (SolFlag == -2) { ShowRecurringWarningErrorAtEnd(state, "Hot Water flow control failed (bad air flow limits) in VS VAV terminal unit " + this->SysName, this->ErrCount2); @@ -4459,7 +4369,7 @@ namespace SingleDuct { } else if (QTotLoad >= QHeatFanOffMax - SmallLoad && QTotLoad <= QHeatFanOnMin + SmallLoad) { MassFlow = MinMassFlow; FanOp = 0; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowWater, 0.0, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowWater, 0.0, FanType, MassFlow, FanOp, QDelivered); } else if (QTotLoad > QHeatFanOnMin + SmallLoad && QTotLoad < QHeatFanOnMax - SmallLoad) { // set hot water flow to max and vary the supply air flow rate FanOp = 1; @@ -4475,7 +4385,7 @@ namespace SingleDuct { Par(6) = double(FanType); Par(7) = double(FanOp); Par(8) = QTotLoad; - SolveRoot(state, UnitFlowToler, 50, SolFlag, MassFlow, this->VAVVSHWFanOnResidual, MinMassFlow, MaxHeatMassFlow, Par); + SolveRoot(state, UnitFlowToler, 50, SolFlag, MassFlow, EnergyPlus::SingleDuct::SingleDuctAirTerminal::VAVVSHWFanOnResidual, MinMassFlow, MaxHeatMassFlow, Par); if (SolFlag == -1) { if (this->IterationLimit == 0) { ShowWarningError(state, "Supply air flow control failed in VS VAV terminal unit " + this->SysName); @@ -4494,9 +4404,9 @@ namespace SingleDuct { } else { MassFlow = MaxHeatMassFlow; FanOp = 1; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowWater, 0.0, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowWater, 0.0, FanType, MassFlow, FanOp, QDelivered); } - } else if (HCType == HCoilType_SteamAirHeating) { + } else if (HCType == HeatingCoilType::SteamAirHeating) { // IF (QTotLoad > QNoHeatFanOff + SmallLoad .AND. QTotLoad < QHeatFanOffMax - SmallLoad) THEN if (QTotLoad < QHeatFanOffMax - SmallLoad) { // vary steam flow, leave air flow at minimum @@ -4509,7 +4419,7 @@ namespace SingleDuct { Par(2) = 0.0; } Par(3) = double(ZoneNodeNum); - Par(4) = double(HCType); + Par(4) = double(static_cast(HCType)); Par(5) = MassFlow; Par(6) = double(FanType); Par(7) = double(FanOp); @@ -4518,11 +4428,11 @@ namespace SingleDuct { Par(10) = MaxFlowSteam; Par(11) = MaxSteamCap; ErrTolerance = this->ControllerOffset; - SolveRoot(state, ErrTolerance, 500, SolFlag, HWFlow, this->VAVVSHWNoFanResidual, MinFlowSteam, MaxFlowSteam, Par); + SolveRoot(state, ErrTolerance, 500, SolFlag, HWFlow, EnergyPlus::SingleDuct::SingleDuctAirTerminal::VAVVSHWNoFanResidual, MinFlowSteam, MaxFlowSteam, Par); if (SolFlag == -1) { ShowRecurringWarningErrorAtEnd(state, "Steam flow control failed in VS VAV terminal unit " + this->SysName, this->ErrCount1); ShowRecurringContinueErrorAtEnd(state, "...Iteration limit (500) exceeded in calculating the hot water flow rate", this->ErrCount1c); - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, HWFlow, 0.0, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HWFlow, 0.0, FanType, MassFlow, FanOp, QDelivered); } else if (SolFlag == -2) { ShowRecurringWarningErrorAtEnd(state, "Steam flow control failed (bad air flow limits) in VS VAV terminal unit " + this->SysName, this->ErrCount2); @@ -4530,7 +4440,7 @@ namespace SingleDuct { } else if (QTotLoad >= QHeatFanOffMax - SmallLoad && QTotLoad <= QHeatFanOnMin + SmallLoad) { MassFlow = MinMassFlow; FanOp = 0; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, MaxFlowWater, 0.0, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, MaxFlowWater, 0.0, FanType, MassFlow, FanOp, QDelivered); } else if (QTotLoad > QHeatFanOnMin + SmallLoad && QTotLoad < QHeatFanOnMax - SmallLoad) { FanOp = 1; Par(1) = double(this->SysNum); @@ -4545,7 +4455,7 @@ namespace SingleDuct { Par(6) = double(FanType); Par(7) = double(FanOp); Par(8) = QTotLoad; - SolveRoot(state, UnitFlowToler, 50, SolFlag, MassFlow, this->VAVVSHWFanOnResidual, MinMassFlow, MaxHeatMassFlow, Par); + SolveRoot(state, UnitFlowToler, 50, SolFlag, MassFlow, EnergyPlus::SingleDuct::SingleDuctAirTerminal::VAVVSHWFanOnResidual, MinMassFlow, MaxHeatMassFlow, Par); if (SolFlag == -1) { if (this->IterationLimit == 0) { ShowWarningError(state, "Steam heating coil control failed in VS VAV terminal unit " + this->SysName); @@ -4564,14 +4474,14 @@ namespace SingleDuct { } else { MassFlow = MaxHeatMassFlow; FanOp = 1; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, QTotLoad, QTotLoad, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, QTotLoad, QTotLoad, FanType, MassFlow, FanOp, QDelivered); } - } else if (HCType == HCoilType_Gas || HCType == HCoilType_Electric) { + } else if (HCType == HeatingCoilType::Gas || HCType == HeatingCoilType::Electric) { if (QTotLoad <= QHeatFanOnMin + SmallLoad) { // vary heating coil power, leave mass flow at minimum MassFlow = MinMassFlow; FanOp = 0; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, 0.0, QTotLoad, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, 0.0, QTotLoad, FanType, MassFlow, FanOp, QDelivered); } else if (QTotLoad > QHeatFanOnMin + SmallLoad && QTotLoad < QHeatFanOnMax - SmallLoad) { FanOp = 1; Par(1) = double(this->SysNum); @@ -4586,7 +4496,7 @@ namespace SingleDuct { Par(6) = double(FanType); Par(7) = double(FanOp); Par(8) = QTotLoad; - SolveRoot(state, UnitFlowToler, 50, SolFlag, FracDelivered, this->VAVVSHCFanOnResidual, 0.0, 1.0, Par); + SolveRoot(state, UnitFlowToler, 50, SolFlag, FracDelivered, EnergyPlus::SingleDuct::SingleDuctAirTerminal::VAVVSHCFanOnResidual, 0.0, 1.0, Par); MassFlow = Node(SysInletNode).MassFlowRate; if (SolFlag == -1) { if (this->IterationLimit == 0) { @@ -4605,7 +4515,7 @@ namespace SingleDuct { } else { MassFlow = MaxHeatMassFlow; FanOp = 1; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, 0.0, QTotLoad, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, 0.0, QTotLoad, FanType, MassFlow, FanOp, QDelivered); } } else { ShowFatalError(state, "Invalid Reheat Component=" + this->ReheatComp); @@ -4615,7 +4525,7 @@ namespace SingleDuct { MassFlow = 0.0; FanOp = 0; - this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, HCType, 0.0, 0.0, FanType, MassFlow, FanOp, QDelivered); + this->CalcVAVVS(state, FirstHVACIteration, ZoneNodeNum, 0.0, 0.0, FanType, MassFlow, FanOp, QDelivered); } // Move mass flow rates to the damper outlet node @@ -4723,13 +4633,13 @@ namespace SingleDuct { { auto const SELECT_CASE_var(this->ReheatComp_Num); - if (SELECT_CASE_var == HCoilType_SimpleHeating) { // COIL:WATER:SIMPLEHEATING + if (SELECT_CASE_var == HeatingCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING // Determine the load required to pass to the Component controller QZnReq = QMax2 + MassFlow * CpAir * ZoneTemp; // Before Iterating through the Reheat Coil and Controller set the flags for the // Do Loop to initialized conditions. - // Node(sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 + // Node(state.dataSingleDuct->sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 // Initialize hot water flow rate to zero. DummyMdot = 0.0; SetActuatedBranchFlowRate(state, DummyMdot, this->ReheatControlNode, this->HWLoopNum, this->HWLoopSide, this->HWBranchIndex, true); @@ -4768,20 +4678,20 @@ namespace SingleDuct { this->HWLoopSide, this->HWBranchIndex); - } else if (SELECT_CASE_var == HCoilType_SteamAirHeating) { // COIL:STEAM:STEAMAIRHEATING + } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // COIL:STEAM:STEAMAIRHEATING // Determine the load required to pass to the Component controller QZnReq = QMax2 - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - ZoneTemp); // Simulate reheat coil for the VAV system SimulateSteamCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index, QZnReq); - } else if (SELECT_CASE_var == HCoilType_Electric) { // COIL:ELECTRIC:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING // Determine the load required to pass to the Component controller QZnReq = QMax2 - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - ZoneTemp); // Simulate reheat coil for the VAV system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, QZnReq, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_Gas) { // COIL:GAS:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING // Determine the load required to pass to the Component controller QZnReq = QMax2 - MassFlow * CpAir * (this->sd_airterminalInlet.AirTemp - ZoneTemp); @@ -4797,9 +4707,9 @@ namespace SingleDuct { { auto const SELECT_CASE_var(this->ReheatComp_Num); - if (SELECT_CASE_var == HCoilType_SimpleHeating) { // COIL:WATER:SIMPLEHEATING + if (SELECT_CASE_var == HeatingCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING // Simulate reheat coil for the Const Volume system - // Node(sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 + // Node(state.dataSingleDuct->sd_airterminal(SysNum)%ReheatControlNode)%MassFlowRate = 0.0D0 // Initialize hot water flow rate to zero. DummyMdot = 0.0; SetActuatedBranchFlowRate(state, DummyMdot, this->ReheatControlNode, this->HWLoopNum, this->HWLoopSide, this->HWBranchIndex, true); @@ -4807,15 +4717,15 @@ namespace SingleDuct { // call the reheat coil with the NO FLOW condition to make sure that the Node values // are passed through to the coil outlet correctly SimulateWaterCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_SteamAirHeating) { // COIL:STEAM:AIRHEATING + } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // COIL:STEAM:AIRHEATING // Simulate reheat coil for the Const Volume system SimulateSteamCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index, 0.0); - } else if (SELECT_CASE_var == HCoilType_Electric) { // COIL:ELECTRIC:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING // Simulate reheat coil for the Const Volume system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, 0.0, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_Gas) { // COIL:GAS:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING // Simulate reheat coil for the Const Volume system SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, 0.0, this->ReheatComp_Index); } else { @@ -4838,15 +4748,14 @@ namespace SingleDuct { } void SingleDuctAirTerminal::CalcVAVVS(EnergyPlusData &state, - bool const FirstHVACIteration, // flag for 1st HVAV iteration in the time step - int const ZoneNode, // zone node number - [[maybe_unused]] int const HCoilType, // type of hot water coil !unused1208 - Real64 const HWFlow, // hot water flow (kg/s) - Real64 const HCoilReq, // gas or elec coil demand requested - int const FanType, // type of fan - Real64 const AirFlow, // air flow rate (kg/s) - int const FanOn, // 1 means fan is on - Real64 &LoadMet // load met by unit (watts) + bool const FirstHVACIteration, // flag for 1st HVAV iteration in the time step + int const ZoneNode, // zone node number + Real64 const HWFlow, // hot water flow (kg/s) + Real64 const HCoilReq, // gas or elec coil demand requested + int const FanType, // type of fan + Real64 const AirFlow, // air flow rate (kg/s) + int const FanOn, // 1 means fan is on + Real64 &LoadMet // load met by unit (watts) ) { @@ -4921,7 +4830,7 @@ namespace SingleDuct { } { auto const SELECT_CASE_var(this->ReheatComp_Num); - if (SELECT_CASE_var == HCoilType_SimpleHeating) { // COIL:WATER:SIMPLEHEATING + if (SELECT_CASE_var == HeatingCoilType::SimpleHeating) { // COIL:WATER:SIMPLEHEATING mdot = HWFlow; if (this->HWLoopNum > 0) { SetComponentFlowRate(state, mdot, @@ -4934,7 +4843,7 @@ namespace SingleDuct { } SimulateWaterCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_SteamAirHeating) { // HW Flow is steam mass flow here + } else if (SELECT_CASE_var == HeatingCoilType::SteamAirHeating) { // HW Flow is steam mass flow here mdot = HWFlow; if (this->HWLoopNum > 0) { SetComponentFlowRate(state, mdot, @@ -4946,9 +4855,9 @@ namespace SingleDuct { this->HWCompIndex); } SimulateSteamCoilComponents(state, this->ReheatName, FirstHVACIteration, this->ReheatComp_Index, HCoilReq); - } else if (SELECT_CASE_var == HCoilType_Electric) { // COIL:ELECTRIC:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Electric) { // COIL:ELECTRIC:HEATING SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, HCoilReq, this->ReheatComp_Index); - } else if (SELECT_CASE_var == HCoilType_Gas) { // COIL:GAS:HEATING + } else if (SELECT_CASE_var == HeatingCoilType::Gas) { // COIL:GAS:HEATING SimulateHeatingCoilComponents(state, this->ReheatName, FirstHVACIteration, HCoilReq, this->ReheatComp_Index); } else { ShowFatalError(state, "Invalid Reheat Component=" + this->ReheatComp); @@ -5012,7 +4921,6 @@ namespace SingleDuct { bool FirstHVACSoln; int ZoneNodeIndex; Real64 MinHWFlow; // min hot water flow rate - int HCType; // heating coil type (integer) int FanType; // fan type (as an integer) int FanOp; // fan operation; 0=off, 1=on. Real64 UnitOutput; // cooling output [W] (cooling is negative) @@ -5020,12 +4928,11 @@ namespace SingleDuct { UnitIndex = int(Par(1)); FirstHVACSoln = (Par(2) > 0.0); ZoneNodeIndex = int(Par(3)); - HCType = int(Par(4)); MinHWFlow = Par(5); FanType = int(Par(6)); FanOp = int(Par(7)); - sd_airterminal(UnitIndex).CalcVAVVS( - state, FirstHVACSoln, ZoneNodeIndex, HCType, MinHWFlow, 0.0, FanType, SupplyAirMassFlow, FanOp, UnitOutput); + state.dataSingleDuct->sd_airterminal(UnitIndex).CalcVAVVS( + state, FirstHVACSoln, ZoneNodeIndex, MinHWFlow, 0.0, FanType, SupplyAirMassFlow, FanOp, UnitOutput); Residuum = (Par(8) - UnitOutput) / Par(8); @@ -5088,7 +4995,7 @@ namespace SingleDuct { bool FirstHVACSoln; int ZoneNodeIndex; Real64 AirMassFlow; // supply air mass flow rate [kg/s] - int HCType; // heating coil type (integer) + HeatingCoilType HCType; // heating coil type (integer) int FanType; // fan type (as an integer) int FanOp; // fan operation; 0=off, 1=on. Real64 UnitOutput; // heating output [W] @@ -5100,13 +5007,13 @@ namespace SingleDuct { UnitIndex = int(Par(1)); FirstHVACSoln = (Par(2) > 0.0); ZoneNodeIndex = int(Par(3)); - HCType = int(Par(4)); + HCType = static_cast(int(Par(4))); AirMassFlow = Par(5); FanType = int(Par(6)); FanOp = int(Par(7)); QSteamLoad = 0.0; // vary the load to be met by the steam coil to converge on a steam flow rate to meet the load - if (HCType == HCoilType_SteamAirHeating) { + if (HCType == HeatingCoilType::SteamAirHeating) { // backwards way of varying steam flow rate. Steam coil calculates a flow rate to meet a load. MinSteamFlow = Par(9); MaxSteamFlow = Par(10); @@ -5117,8 +5024,8 @@ namespace SingleDuct { QSteamLoad = MaxSteamCoilCapacity * HWMassFlow / (MaxSteamFlow - MinSteamFlow); } } - sd_airterminal(UnitIndex).CalcVAVVS( - state, FirstHVACSoln, ZoneNodeIndex, HCType, HWMassFlow, QSteamLoad, FanType, AirMassFlow, FanOp, UnitOutput); + state.dataSingleDuct->sd_airterminal(UnitIndex).CalcVAVVS( + state, FirstHVACSoln, ZoneNodeIndex, HWMassFlow, QSteamLoad, FanType, AirMassFlow, FanOp, UnitOutput); Residuum = (Par(8) - UnitOutput) / Par(8); @@ -5191,8 +5098,8 @@ namespace SingleDuct { HWMassFlow = Par(5); FanType = int(Par(6)); FanOp = int(Par(7)); - sd_airterminal(UnitIndex).CalcVAVVS( - state, FirstHVACSoln, ZoneNodeIndex, HCType, HWMassFlow, Par(8), FanType, SupplyAirMassFlow, FanOp, UnitOutput); + state.dataSingleDuct->sd_airterminal(UnitIndex).CalcVAVVS( + state, FirstHVACSoln, ZoneNodeIndex, HWMassFlow, Par(8), FanType, SupplyAirMassFlow, FanOp, UnitOutput); Residuum = (Par(8) - UnitOutput) / Par(8); @@ -5268,10 +5175,10 @@ namespace SingleDuct { FanType = int(Par(6)); FanOp = int(Par(7)); HeatOut = HeatingFrac * MaxHeatOut; - AirMassFlowRate = max(HeatingFrac * sd_airterminal(UnitIndex).HeatAirMassFlowRateMax, - sd_airterminal(UnitIndex).sd_airterminalInlet.AirMassFlowRateMaxAvail * sd_airterminal(UnitIndex).ZoneMinAirFrac); + AirMassFlowRate = max(HeatingFrac * state.dataSingleDuct->sd_airterminal(UnitIndex).HeatAirMassFlowRateMax, + state.dataSingleDuct->sd_airterminal(UnitIndex).sd_airterminalInlet.AirMassFlowRateMaxAvail * state.dataSingleDuct->sd_airterminal(UnitIndex).ZoneMinAirFrac); - sd_airterminal(UnitIndex).CalcVAVVS(state, FirstHVACSoln, ZoneNodeIndex, HCType, 0.0, HeatOut, FanType, AirMassFlowRate, FanOp, UnitOutput); + state.dataSingleDuct->sd_airterminal(UnitIndex).CalcVAVVS(state, FirstHVACSoln, ZoneNodeIndex, 0.0, HeatOut, FanType, AirMassFlowRate, FanOp, UnitOutput); Residuum = (Par(8) - UnitOutput) / Par(8); @@ -5284,7 +5191,7 @@ namespace SingleDuct { // Beginning of Update subroutines for the Sys Module // ***************************************************************************** - void SingleDuctAirTerminal::UpdateSys() + void SingleDuctAirTerminal::UpdateSys() const { // SUBROUTINE INFORMATION: @@ -5324,8 +5231,8 @@ namespace SingleDuct { OutletNode = this->OutletNodeNum; InletNode = this->InletNodeNum; - if (this->SysType_Num == SingleDuctVAVReheat || this->SysType_Num == SingleDuctCBVAVReheat || this->SysType_Num == SingleDuctCBVAVNoReheat || - this->SysType_Num == SingleDuctVAVNoReheat || this->SysType_Num == SingleDuctConstVolNoReheat) { + if (this->SysType_Num == SysType::SingleDuctVAVReheat || this->SysType_Num == SysType::SingleDuctCBVAVReheat || this->SysType_Num == SysType::SingleDuctCBVAVNoReheat || + this->SysType_Num == SysType::SingleDuctVAVNoReheat || this->SysType_Num == SysType::SingleDuctConstVolNoReheat) { // Set the outlet air nodes of the Sys Node(OutletNode).MassFlowRate = this->sd_airterminalOutlet.AirMassFlowRate; Node(OutletNode).Temp = this->sd_airterminalOutlet.AirTemp; @@ -5418,12 +5325,12 @@ namespace SingleDuct { // This subroutine sets an index for a given single duct system -- issues error message if that system // is not a legal system. - if (GetInputFlag) { // First time subroutine has been entered + if (state.dataSingleDuct->GetInputFlag) { // First time subroutine has been entered GetSysInput(state); - GetInputFlag = false; + state.dataSingleDuct->GetInputFlag = false; } - SDSIndex = UtilityRoutines::FindItemInList(SDSName, sd_airterminal, &SingleDuctAirTerminal::SysName); + SDSIndex = UtilityRoutines::FindItemInList(SDSName, state.dataSingleDuct->sd_airterminal, &SingleDuctAirTerminal::SysName); if (SDSIndex == 0) { if (present(ThisObjectType)) { ShowSevereError(state, ThisObjectType() + ", GetHVACSingleDuctSysIndex: Single duct system not found=" + SDSName); @@ -5432,14 +5339,14 @@ namespace SingleDuct { } ErrorsFound = true; } else { - if ((sd_airterminal(SDSIndex).SysType_Num != SingleDuctConstVolReheat) && (sd_airterminal(SDSIndex).SysType_Num != SingleDuctVAVReheat)) { + if ((state.dataSingleDuct->sd_airterminal(SDSIndex).SysType_Num != SysType::SingleDuctConstVolReheat) && (state.dataSingleDuct->sd_airterminal(SDSIndex).SysType_Num != SysType::SingleDuctVAVReheat)) { ShowSevereError(state, ThisObjectType() + ", GetHVACSingleDuctSysIndex: Could not find allowed types=" + SDSName); ShowContinueError(state, "The allowed types are: AirTerminal:SingleDuct:ConstantVolume:Reheat and AirTerminal:SingleDuct:VAV:Reheat"); ErrorsFound = true; } - if (sd_airterminal(SDSIndex).SysType_Num == SingleDuctVAVReheat) { - if (present(DamperInletNode)) DamperInletNode = sd_airterminal(SDSIndex).InletNodeNum; - if (present(DamperOutletNode)) DamperOutletNode = sd_airterminal(SDSIndex).OutletNodeNum; + if (state.dataSingleDuct->sd_airterminal(SDSIndex).SysType_Num == SysType::SingleDuctVAVReheat) { + if (present(DamperInletNode)) DamperInletNode = state.dataSingleDuct->sd_airterminal(SDSIndex).InletNodeNum; + if (present(DamperOutletNode)) DamperOutletNode = state.dataSingleDuct->sd_airterminal(SDSIndex).OutletNodeNum; } } } @@ -5459,12 +5366,12 @@ namespace SingleDuct { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static int SysNum(0); - if (GetATMixerFlag) { - GetATMixerFlag = false; + if (state.dataSingleDuct->GetATMixerFlag) { + state.dataSingleDuct->GetATMixerFlag = false; } if (SysIndex == 0) { - SysNum = UtilityRoutines::FindItemInList(SysName, SysATMixer); + SysNum = UtilityRoutines::FindItemInList(SysName, state.dataSingleDuct->SysATMixer); SysIndex = SysNum; if (SysNum == 0) { ShowFatalError(state, "Object " + SysName + " not found"); @@ -5473,11 +5380,11 @@ namespace SingleDuct { SysNum = SysIndex; } - SysATMixer(SysNum).InitATMixer(state, FirstHVACIteration); + state.dataSingleDuct->SysATMixer(SysNum).InitATMixer(state, FirstHVACIteration); CalcATMixer(state, SysNum); - UpdateATMixer(SysNum); + UpdateATMixer(state, SysNum); } void GetATMixers(EnergyPlusData &state) @@ -5523,19 +5430,19 @@ namespace SingleDuct { bool ZoneNodeNotFound; // Flag for error checking bool errFlag; // error flag from component validation - if (!GetATMixerFlag) { + if (!state.dataSingleDuct->GetATMixerFlag) { return; } - GetATMixerFlag = false; + state.dataSingleDuct->GetATMixerFlag = false; cCurrentModuleObject = "AirTerminal:SingleDuct:Mixer"; - NumATMixers = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - SysATMixer.allocate(NumATMixers); + state.dataSingleDuct->NumATMixers = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + state.dataSingleDuct->SysATMixer.allocate(state.dataSingleDuct->NumATMixers); // Need air distribution units first ZoneAirLoopEquipmentManager::GetZoneAirLoopEquipment(state); - for (ATMixerNum = 1; ATMixerNum <= NumATMixers; ++ATMixerNum) { + for (ATMixerNum = 1; ATMixerNum <= state.dataSingleDuct->NumATMixers; ++ATMixerNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, ATMixerNum, @@ -5549,33 +5456,33 @@ namespace SingleDuct { cAlphaFieldNames, cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - SysATMixer(ATMixerNum).Name = cAlphaArgs(1); + state.dataSingleDuct->SysATMixer(ATMixerNum).Name = cAlphaArgs(1); if (cAlphaArgs(7) == "INLETSIDE") { - SysATMixer(ATMixerNum).MixerType = ATMixer_InletSide; // inlet side mixer + state.dataSingleDuct->SysATMixer(ATMixerNum).MixerType = ATMixer_InletSide; // inlet side mixer } else if (cAlphaArgs(7) == "SUPPLYSIDE") { - SysATMixer(ATMixerNum).MixerType = ATMixer_SupplySide; // supply side mixer + state.dataSingleDuct->SysATMixer(ATMixerNum).MixerType = ATMixer_SupplySide; // supply side mixer } if (cAlphaArgs(2) == "ZONEHVAC:WATERTOAIRHEATPUMP") { - SysATMixer(ATMixerNum).ZoneHVACUnitType = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitType = 1; } else if (cAlphaArgs(2) == "ZONEHVAC:FOURPIPEFANCOIL") { - SysATMixer(ATMixerNum).ZoneHVACUnitType = 2; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitType = 2; } else if (cAlphaArgs(2) == "ZONEHVAC:PACKAGEDTERMINALAIRCONDITIONER") { - SysATMixer(ATMixerNum).ZoneHVACUnitType = 3; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitType = 3; } else if (cAlphaArgs(2) == "ZONEHVAC:PACKAGEDTERMINALHEATPUMP") { - SysATMixer(ATMixerNum).ZoneHVACUnitType = 4; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitType = 4; } else if (cAlphaArgs(2) == "ZONEHVAC:VARIABLEREFRIGERANTFLOW") { - SysATMixer(ATMixerNum).ZoneHVACUnitType = 5; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitType = 5; } else if (cAlphaArgs(2) == "AIRLOOPHVAC:UNITARYSYSTEM") { - SysATMixer(ATMixerNum).ZoneHVACUnitType = 6; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitType = 6; } else if (cAlphaArgs(2) == "ZONEHVAC:UNITVENTILATOR") { - SysATMixer(ATMixerNum).ZoneHVACUnitType = 7; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitType = 7; } - SysATMixer(ATMixerNum).ZoneHVACUnitName = cAlphaArgs(3); + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitName = cAlphaArgs(3); - ValidateComponent(state, cAlphaArgs(2), SysATMixer(ATMixerNum).ZoneHVACUnitName, errFlag, cCurrentModuleObject); + ValidateComponent(state, cAlphaArgs(2), state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneHVACUnitName, errFlag, cCurrentModuleObject); - SysATMixer(ATMixerNum).MixedAirOutNode = GetOnlySingleNode(state, cAlphaArgs(4), + state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), @@ -5585,7 +5492,7 @@ namespace SingleDuct { ObjectIsNotParent, cAlphaFieldNames(4)); - SysATMixer(ATMixerNum).PriInNode = GetOnlySingleNode(state, cAlphaArgs(5), + state.dataSingleDuct->SysATMixer(ATMixerNum).PriInNode = GetOnlySingleNode(state, cAlphaArgs(5), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), @@ -5594,7 +5501,7 @@ namespace SingleDuct { 1, ObjectIsNotParent, cAlphaFieldNames(5)); - SysATMixer(ATMixerNum).SecInNode = GetOnlySingleNode(state, cAlphaArgs(6), + state.dataSingleDuct->SysATMixer(ATMixerNum).SecInNode = GetOnlySingleNode(state, cAlphaArgs(6), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), @@ -5605,27 +5512,27 @@ namespace SingleDuct { cAlphaFieldNames(6)); if (lAlphaFieldBlanks(8)) { - SysATMixer(ATMixerNum).NoOAFlowInputFromUser = true; + state.dataSingleDuct->SysATMixer(ATMixerNum).NoOAFlowInputFromUser = true; } else { - SysATMixer(ATMixerNum).OARequirementsPtr = UtilityRoutines::FindItemInList(cAlphaArgs(8), DataSizing::OARequirements); - if (SysATMixer(ATMixerNum).OARequirementsPtr == 0) { + state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr = UtilityRoutines::FindItemInList(cAlphaArgs(8), DataSizing::OARequirements); + if (state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr == 0) { ShowSevereError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(8) + "=\"" + cAlphaArgs(8) + "\"."); ErrorsFound = true; } else { - SysATMixer(ATMixerNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->SysATMixer(ATMixerNum).NoOAFlowInputFromUser = false; } } if (lAlphaFieldBlanks(9)) { - SysATMixer(ATMixerNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->SysATMixer(ATMixerNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; } else { if (cAlphaArgs(9) == "CURRENTOCCUPANCY") { - SysATMixer(ATMixerNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->SysATMixer(ATMixerNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; } else if (cAlphaArgs(9) == "DESIGNOCCUPANCY") { - SysATMixer(ATMixerNum).OAPerPersonMode = DataZoneEquipment::PerPersonByDesignLevel; + state.dataSingleDuct->SysATMixer(ATMixerNum).OAPerPersonMode = DataZoneEquipment::PerPersonByDesignLevel; } else { - SysATMixer(ATMixerNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; + state.dataSingleDuct->SysATMixer(ATMixerNum).OAPerPersonMode = DataZoneEquipment::PerPersonDCVByCurrentLevel; ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); ShowContinueError(state, "..invalid " + cAlphaFieldNames(9) + "=\"" + cAlphaArgs(9) + "\". The default input of CurrentOccupancy is assigned"); @@ -5633,55 +5540,55 @@ namespace SingleDuct { } // Check for dupes in the three nodes. - if (SysATMixer(ATMixerNum).SecInNode == SysATMixer(ATMixerNum).PriInNode) { - ShowSevereError(state, cCurrentModuleObject + " = " + SysATMixer(ATMixerNum).Name + ' ' + cAlphaArgs(5) + " = " + - NodeID(SysATMixer(ATMixerNum).PriInNode) + " duplicates the " + cAlphaArgs(4) + '.'); + if (state.dataSingleDuct->SysATMixer(ATMixerNum).SecInNode == state.dataSingleDuct->SysATMixer(ATMixerNum).PriInNode) { + ShowSevereError(state, cCurrentModuleObject + " = " + state.dataSingleDuct->SysATMixer(ATMixerNum).Name + ' ' + cAlphaArgs(5) + " = " + + NodeID(state.dataSingleDuct->SysATMixer(ATMixerNum).PriInNode) + " duplicates the " + cAlphaArgs(4) + '.'); ErrorsFound = true; - } else if (SysATMixer(ATMixerNum).SecInNode == SysATMixer(ATMixerNum).MixedAirOutNode) { - ShowSevereError(state, cCurrentModuleObject + " = " + SysATMixer(ATMixerNum).Name + ' ' + cAlphaArgs(6) + " = " + - NodeID(SysATMixer(ATMixerNum).MixedAirOutNode) + " duplicates the " + cAlphaArgs(4) + '.'); + } else if (state.dataSingleDuct->SysATMixer(ATMixerNum).SecInNode == state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode) { + ShowSevereError(state, cCurrentModuleObject + " = " + state.dataSingleDuct->SysATMixer(ATMixerNum).Name + ' ' + cAlphaArgs(6) + " = " + + NodeID(state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode) + " duplicates the " + cAlphaArgs(4) + '.'); ErrorsFound = true; } - if (SysATMixer(ATMixerNum).PriInNode == SysATMixer(ATMixerNum).MixedAirOutNode) { - ShowSevereError(state, cCurrentModuleObject + " = " + SysATMixer(ATMixerNum).Name + ' ' + cAlphaArgs(6) + " = " + - NodeID(SysATMixer(ATMixerNum).MixedAirOutNode) + " duplicates the " + cAlphaArgs(5) + '.'); + if (state.dataSingleDuct->SysATMixer(ATMixerNum).PriInNode == state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode) { + ShowSevereError(state, cCurrentModuleObject + " = " + state.dataSingleDuct->SysATMixer(ATMixerNum).Name + ' ' + cAlphaArgs(6) + " = " + + NodeID(state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode) + " duplicates the " + cAlphaArgs(5) + '.'); ErrorsFound = true; } for (int ADUNum = 1; ADUNum <= NumAirDistUnits; ++ADUNum) { - if (SysATMixer(ATMixerNum).MixedAirOutNode == AirDistUnit(ADUNum).OutletNodeNum) { - AirDistUnit(ADUNum).InletNodeNum = SysATMixer(ATMixerNum).PriInNode; - SysATMixer(ATMixerNum).ADUNum = ADUNum; + if (state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode == AirDistUnit(ADUNum).OutletNodeNum) { + AirDistUnit(ADUNum).InletNodeNum = state.dataSingleDuct->SysATMixer(ATMixerNum).PriInNode; + state.dataSingleDuct->SysATMixer(ATMixerNum).ADUNum = ADUNum; break; } } // one assumes if there isn't one assigned, it's an error? - if (SysATMixer(ATMixerNum).ADUNum == 0) { + if (state.dataSingleDuct->SysATMixer(ATMixerNum).ADUNum == 0) { ShowSevereError(state, RoutineName + "No matching Air Distribution Unit, for System = [" + cCurrentModuleObject + ',' + - SysATMixer(ATMixerNum).Name + "]."); - ShowContinueError(state, "...should have outlet node = " + NodeID(SysATMixer(ATMixerNum).MixedAirOutNode)); + state.dataSingleDuct->SysATMixer(ATMixerNum).Name + "]."); + ShowContinueError(state, "...should have outlet node = " + NodeID(state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode)); ErrorsFound = true; } else { - if (SysATMixer(ATMixerNum).MixerType == ATMixer_InletSide) { + if (state.dataSingleDuct->SysATMixer(ATMixerNum).MixerType == ATMixer_InletSide) { // Air Terminal inlet node must be the same as a zone exhaust node ZoneNodeNotFound = true; for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (NodeNum = 1; NodeNum <= ZoneEquipConfig(CtrlZone).NumExhaustNodes; ++NodeNum) { - if (SysATMixer(ATMixerNum).SecInNode == ZoneEquipConfig(CtrlZone).ExhaustNode(NodeNum)) { + if (state.dataSingleDuct->SysATMixer(ATMixerNum).SecInNode == ZoneEquipConfig(CtrlZone).ExhaustNode(NodeNum)) { ZoneNodeNotFound = false; - AirDistUnit(SysATMixer(ATMixerNum).ADUNum).ZoneEqNum = CtrlZone; - SysATMixer(ATMixerNum).ZoneEqNum = CtrlZone; - SysATMixer(ATMixerNum).ZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + AirDistUnit(state.dataSingleDuct->SysATMixer(ATMixerNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneEqNum = CtrlZone; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; // Must wait until InitATMixer to fill other zone equip config data because ultimate zone inlet node is not known yet // for inlet side mixers - if (!SysATMixer(ATMixerNum).NoOAFlowInputFromUser) { + if (!state.dataSingleDuct->SysATMixer(ATMixerNum).NoOAFlowInputFromUser) { bool UseOccSchFlag = false; bool UseMinOASchFlag = false; - SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = DataZoneEquipment::CalcDesignSpecificationOutdoorAir(state, - SysATMixer(ATMixerNum).OARequirementsPtr, SysATMixer(ATMixerNum).ZoneNum, UseOccSchFlag, UseMinOASchFlag); + state.dataSingleDuct->SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = DataZoneEquipment::CalcDesignSpecificationOutdoorAir(state, + state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr, state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum, UseOccSchFlag, UseMinOASchFlag); } goto ControlledZoneLoop_exit; } @@ -5689,31 +5596,31 @@ namespace SingleDuct { } ControlledZoneLoop_exit:; if (ZoneNodeNotFound) { - ShowSevereError(state, cCurrentModuleObject + " = \"" + SysATMixer(ATMixerNum).Name + + ShowSevereError(state, cCurrentModuleObject + " = \"" + state.dataSingleDuct->SysATMixer(ATMixerNum).Name + "\". Inlet Side Air Terminal Mixer air inlet node name must be the same as a zone exhaust node name."); ShowContinueError(state, "..Zone exhaust node name is specified in ZoneHVAC:EquipmentConnections object."); - ShowContinueError(state, "..Inlet Side CONNECTED Air Terminal Mixer inlet node name = " + NodeID(SysATMixer(ATMixerNum).SecInNode)); + ShowContinueError(state, "..Inlet Side CONNECTED Air Terminal Mixer inlet node name = " + NodeID(state.dataSingleDuct->SysATMixer(ATMixerNum).SecInNode)); ErrorsFound = true; } } - if (SysATMixer(ATMixerNum).MixerType == ATMixer_SupplySide) { + if (state.dataSingleDuct->SysATMixer(ATMixerNum).MixerType == ATMixer_SupplySide) { ZoneNodeNotFound = true; for (CtrlZone = 1; CtrlZone <= state.dataGlobal->NumOfZones; ++CtrlZone) { if (!ZoneEquipConfig(CtrlZone).IsControlled) continue; for (NodeNum = 1; NodeNum <= ZoneEquipConfig(CtrlZone).NumInletNodes; ++NodeNum) { - if (SysATMixer(ATMixerNum).MixedAirOutNode == ZoneEquipConfig(CtrlZone).InletNode(NodeNum)) { + if (state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode == ZoneEquipConfig(CtrlZone).InletNode(NodeNum)) { ZoneNodeNotFound = false; - AirDistUnit(SysATMixer(ATMixerNum).ADUNum).ZoneEqNum = CtrlZone; - SysATMixer(ATMixerNum).ZoneEqNum = CtrlZone; - SysATMixer(ATMixerNum).ZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; + AirDistUnit(state.dataSingleDuct->SysATMixer(ATMixerNum).ADUNum).ZoneEqNum = CtrlZone; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneEqNum = CtrlZone; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum = ZoneEquipConfig(CtrlZone).ActualZoneNum; // Wait until InitATMixer to fill other zone equip config data - if (!SysATMixer(ATMixerNum).NoOAFlowInputFromUser) { + if (!state.dataSingleDuct->SysATMixer(ATMixerNum).NoOAFlowInputFromUser) { bool UseOccSchFlag = false; bool UseMinOASchFlag = false; - SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = DataZoneEquipment::CalcDesignSpecificationOutdoorAir(state, - SysATMixer(ATMixerNum).OARequirementsPtr, SysATMixer(ATMixerNum).ZoneNum, UseOccSchFlag, UseMinOASchFlag); + state.dataSingleDuct->SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = DataZoneEquipment::CalcDesignSpecificationOutdoorAir(state, + state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr, state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum, UseOccSchFlag, UseMinOASchFlag); } goto ControlZoneLoop_exit; } @@ -5721,41 +5628,41 @@ namespace SingleDuct { } ControlZoneLoop_exit:; if (ZoneNodeNotFound) { - ShowSevereError(state, cCurrentModuleObject + " = \"" + SysATMixer(ATMixerNum).Name + + ShowSevereError(state, cCurrentModuleObject + " = \"" + state.dataSingleDuct->SysATMixer(ATMixerNum).Name + "\". Supply Side Air Terminal Mixer air outlet node name must be the same as a zone inlet node name."); ShowContinueError(state, "..Zone inlet node name is specified in ZoneHVAC:EquipmentConnections object."); ShowContinueError(state, "..Supply Side connected Air Terminal Mixer outlet node name = " + - NodeID(SysATMixer(ATMixerNum).MixedAirOutNode)); + NodeID(state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode)); ErrorsFound = true; } } } - TestCompSet(state, cCurrentModuleObject, SysATMixer(ATMixerNum).Name, cAlphaArgs(5), cAlphaArgs(4), "Air Nodes"); + TestCompSet(state, cCurrentModuleObject, state.dataSingleDuct->SysATMixer(ATMixerNum).Name, cAlphaArgs(5), cAlphaArgs(4), "Air Nodes"); - if (SysATMixer(ATMixerNum).OARequirementsPtr == 0) { + if (state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr == 0) { if (ZoneSizingInput.allocated()) { for (int SizingInputNum = 1; SizingInputNum <= NumZoneSizingInput; ++SizingInputNum) { - if (ZoneSizingInput(SizingInputNum).ZoneNum == SysATMixer(ATMixerNum).ZoneNum) { + if (ZoneSizingInput(SizingInputNum).ZoneNum == state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum) { if (ZoneSizingInput(SizingInputNum).ZoneDesignSpecOAIndex == 0) { ShowWarningError(state, RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid data."); ShowContinueError(state, cAlphaFieldNames(8) + " is blank in both the mixer and the Sizing:Zone object for the same zone."); ShowContinueError(state, "The mixer outdoor airflow rate is set to zero."); - SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = 0.0; + state.dataSingleDuct->SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = 0.0; } else { - SysATMixer(ATMixerNum).OARequirementsPtr = ZoneSizingInput(SizingInputNum).ZoneDesignSpecOAIndex; - SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = DataZoneEquipment::CalcDesignSpecificationOutdoorAir(state, - SysATMixer(ATMixerNum).OARequirementsPtr, SysATMixer(ATMixerNum).ZoneNum, false, false); - SysATMixer(ATMixerNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr = ZoneSizingInput(SizingInputNum).ZoneDesignSpecOAIndex; + state.dataSingleDuct->SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = DataZoneEquipment::CalcDesignSpecificationOutdoorAir(state, + state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr, state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum, false, false); + state.dataSingleDuct->SysATMixer(ATMixerNum).NoOAFlowInputFromUser = false; } } } } else { ShowWarningError(state, cAlphaFieldNames(8) + "is blank and there is no Sizing:Zone for the same zone. The mixer outdoor airflow rate is set to zero."); - SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = 0.0; + state.dataSingleDuct->SysATMixer(ATMixerNum).DesignPrimaryAirVolRate = 0.0; } } - SysATMixer(ATMixerNum).MassFlowRateMaxAvail = SysATMixer(ATMixerNum).DesignPrimaryAirVolRate * DataEnvironment::StdRhoAir; + state.dataSingleDuct->SysATMixer(ATMixerNum).MassFlowRateMaxAvail = state.dataSingleDuct->SysATMixer(ATMixerNum).DesignPrimaryAirVolRate * DataEnvironment::StdRhoAir; } if (ErrorsFound) { @@ -5893,25 +5800,25 @@ namespace SingleDuct { static Real64 MixedAirHumRat(0.0); static Real64 MixedAirTemp(0.0); - PriEnthalpy = Node(SysATMixer(SysNum).PriInNode).Enthalpy; - PriHumRat = Node(SysATMixer(SysNum).PriInNode).HumRat; - PriTemp = Node(SysATMixer(SysNum).PriInNode).Temp; - PriMassFlowRate = Node(SysATMixer(SysNum).PriInNode).MassFlowRate; + PriEnthalpy = Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).Enthalpy; + PriHumRat = Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).HumRat; + PriTemp = Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).Temp; + PriMassFlowRate = Node(state.dataSingleDuct->SysATMixer(SysNum).PriInNode).MassFlowRate; - SecAirMassFlowRate = Node(SysATMixer(SysNum).SecInNode).MassFlowRate; - SecAirEnthalpy = Node(SysATMixer(SysNum).SecInNode).Enthalpy; - SecAirHumRat = Node(SysATMixer(SysNum).SecInNode).HumRat; - SecAirTemp = Node(SysATMixer(SysNum).SecInNode).Temp; + SecAirMassFlowRate = Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).MassFlowRate; + SecAirEnthalpy = Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).Enthalpy; + SecAirHumRat = Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).HumRat; + SecAirTemp = Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).Temp; - if (SysATMixer(SysNum).MixerType == ATMixer_SupplySide) { + if (state.dataSingleDuct->SysATMixer(SysNum).MixerType == ATMixer_SupplySide) { MixedAirMassFlowRate = SecAirMassFlowRate + PriMassFlowRate; } else { // for inlet side mixer, the mixed air flow has been set, but we don't know the secondary flow - MixedAirMassFlowRate = Node(SysATMixer(SysNum).MixedAirOutNode).MassFlowRate; + MixedAirMassFlowRate = Node(state.dataSingleDuct->SysATMixer(SysNum).MixedAirOutNode).MassFlowRate; SecAirMassFlowRate = max(MixedAirMassFlowRate - PriMassFlowRate, 0.0); - Node(SysATMixer(SysNum).SecInNode).MassFlowRate = SecAirMassFlowRate; + Node(state.dataSingleDuct->SysATMixer(SysNum).SecInNode).MassFlowRate = SecAirMassFlowRate; if (std::abs(PriMassFlowRate + SecAirMassFlowRate - MixedAirMassFlowRate) > SmallMassFlow) { - ShowSevereError(state, "CalcATMixer: Invalid mass flow rates in AirTerminal:SingleDuct:Mixer=" + SysATMixer(SysNum).Name); + ShowSevereError(state, "CalcATMixer: Invalid mass flow rates in AirTerminal:SingleDuct:Mixer=" + state.dataSingleDuct->SysATMixer(SysNum).Name); ShowContinueErrorTimeStamp(state, format("Primary mass flow rate={:.6R}Secondary mass flow rate={:.6R}Mixed mass flow rate={:.6R}", PriMassFlowRate, @@ -5928,13 +5835,13 @@ namespace SingleDuct { MixedAirTemp = PsyTdbFnHW(MixedAirEnthalpy, MixedAirHumRat); } - SysATMixer(SysNum).MixedAirMassFlowRate = MixedAirMassFlowRate; - SysATMixer(SysNum).MixedAirEnthalpy = MixedAirEnthalpy; - SysATMixer(SysNum).MixedAirHumRat = MixedAirHumRat; - SysATMixer(SysNum).MixedAirTemp = MixedAirTemp; + state.dataSingleDuct->SysATMixer(SysNum).MixedAirMassFlowRate = MixedAirMassFlowRate; + state.dataSingleDuct->SysATMixer(SysNum).MixedAirEnthalpy = MixedAirEnthalpy; + state.dataSingleDuct->SysATMixer(SysNum).MixedAirHumRat = MixedAirHumRat; + state.dataSingleDuct->SysATMixer(SysNum).MixedAirTemp = MixedAirTemp; } - void UpdateATMixer(int const SysNum) + void UpdateATMixer(EnergyPlusData &state, int const SysNum) { // SUBROUTINE INFORMATION: @@ -5966,19 +5873,19 @@ namespace SingleDuct { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int PriInNode = SysATMixer(SysNum).PriInNode; - int SecInNode = SysATMixer(SysNum).SecInNode; - int MixedAirOutNode = SysATMixer(SysNum).MixedAirOutNode; + int PriInNode = state.dataSingleDuct->SysATMixer(SysNum).PriInNode; + int SecInNode = state.dataSingleDuct->SysATMixer(SysNum).SecInNode; + int MixedAirOutNode = state.dataSingleDuct->SysATMixer(SysNum).MixedAirOutNode; // mixed air data - Node(MixedAirOutNode).Temp = SysATMixer(SysNum).MixedAirTemp; - Node(MixedAirOutNode).HumRat = SysATMixer(SysNum).MixedAirHumRat; - Node(MixedAirOutNode).Enthalpy = SysATMixer(SysNum).MixedAirEnthalpy; - Node(MixedAirOutNode).Press = SysATMixer(SysNum).MixedAirPressure; - Node(MixedAirOutNode).MassFlowRate = SysATMixer(SysNum).MixedAirMassFlowRate; + Node(MixedAirOutNode).Temp = state.dataSingleDuct->SysATMixer(SysNum).MixedAirTemp; + Node(MixedAirOutNode).HumRat = state.dataSingleDuct->SysATMixer(SysNum).MixedAirHumRat; + Node(MixedAirOutNode).Enthalpy = state.dataSingleDuct->SysATMixer(SysNum).MixedAirEnthalpy; + Node(MixedAirOutNode).Press = state.dataSingleDuct->SysATMixer(SysNum).MixedAirPressure; + Node(MixedAirOutNode).MassFlowRate = state.dataSingleDuct->SysATMixer(SysNum).MixedAirMassFlowRate; if (Contaminant.CO2Simulation) { - if (SysATMixer(SysNum).MixedAirMassFlowRate <= DataHVACGlobals::VerySmallMassFlow) { + if (state.dataSingleDuct->SysATMixer(SysNum).MixedAirMassFlowRate <= DataHVACGlobals::VerySmallMassFlow) { Node(MixedAirOutNode).CO2 = Node(PriInNode).CO2; } else { Node(MixedAirOutNode).CO2 = @@ -5988,7 +5895,7 @@ namespace SingleDuct { } if (Contaminant.GenericContamSimulation) { - if (SysATMixer(SysNum).MixedAirMassFlowRate <= DataHVACGlobals::VerySmallMassFlow) { + if (state.dataSingleDuct->SysATMixer(SysNum).MixedAirMassFlowRate <= DataHVACGlobals::VerySmallMassFlow) { Node(MixedAirOutNode).GenContam = Node(PriInNode).GenContam; } else { Node(MixedAirOutNode).GenContam = @@ -5998,7 +5905,7 @@ namespace SingleDuct { } // update ADU flow data - because SimATMixer is called from the various zone equipment so the updates in SimZoneAirLoopEquipment won't work - int aduNum = SysATMixer(SysNum).ADUNum; + int aduNum = state.dataSingleDuct->SysATMixer(SysNum).ADUNum; DataDefineEquip::AirDistUnit(aduNum).MassFlowRateTU = Node(PriInNode).MassFlowRate; DataDefineEquip::AirDistUnit(aduNum).MassFlowRateZSup = Node(PriInNode).MassFlowRate; DataDefineEquip::AirDistUnit(aduNum).MassFlowRateSup = Node(PriInNode).MassFlowRate; @@ -6023,19 +5930,19 @@ namespace SingleDuct { // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: - // This subroutine gets: 1) the index of the named AT Mixer in the SysATMixer data array + // This subroutine gets: 1) the index of the named AT Mixer in the state.dataSingleDuct->SysATMixer data array // 2) the node number of the primary air inlet node of the AT Mixer // 3) set the AT Mixer ultimate zone inlet node int ATMixerIndex; // local air terminal mixer index - if (GetATMixerFlag) { + if (state.dataSingleDuct->GetATMixerFlag) { // CALL GetZoneAirLoopEquipment GetATMixers(state); - GetATMixerFlag = false; + state.dataSingleDuct->GetATMixerFlag = false; } - if (NumATMixers <= 0) { + if (state.dataSingleDuct->NumATMixers <= 0) { ATMixerNum = 0; ATMixerName = ""; ATMixerPriNode = 0; @@ -6045,20 +5952,20 @@ namespace SingleDuct { return; } - ATMixerIndex = UtilityRoutines::FindItemInList(ZoneEquipName, SysATMixer, &AirTerminalMixerData::ZoneHVACUnitName); + ATMixerIndex = UtilityRoutines::FindItemInList(ZoneEquipName, state.dataSingleDuct->SysATMixer, &AirTerminalMixerData::ZoneHVACUnitName); if (ATMixerIndex > 0) { ATMixerNum = ATMixerIndex; - ATMixerName = SysATMixer(ATMixerIndex).Name; - ATMixerPriNode = SysATMixer(ATMixerIndex).PriInNode; - ATMixerSecNode = SysATMixer(ATMixerIndex).SecInNode; - ATMixerOutNode = SysATMixer(ATMixerIndex).MixedAirOutNode; - ATMixerType = SysATMixer(ATMixerIndex).MixerType; + ATMixerName = state.dataSingleDuct->SysATMixer(ATMixerIndex).Name; + ATMixerPriNode = state.dataSingleDuct->SysATMixer(ATMixerIndex).PriInNode; + ATMixerSecNode = state.dataSingleDuct->SysATMixer(ATMixerIndex).SecInNode; + ATMixerOutNode = state.dataSingleDuct->SysATMixer(ATMixerIndex).MixedAirOutNode; + ATMixerType = state.dataSingleDuct->SysATMixer(ATMixerIndex).MixerType; if (ATMixerType == ATMixer_InletSide) { - SysATMixer(ATMixerIndex).ZoneInletNode = ZoneEquipOutletNode; + state.dataSingleDuct->SysATMixer(ATMixerIndex).ZoneInletNode = ZoneEquipOutletNode; } else { - SysATMixer(ATMixerIndex).ZoneInletNode = ATMixerOutNode; + state.dataSingleDuct->SysATMixer(ATMixerIndex).ZoneInletNode = ATMixerOutNode; } - SysATMixer(ATMixerNum).InitATMixer(state, false); + state.dataSingleDuct->SysATMixer(ATMixerNum).InitATMixer(state, false); } else { ATMixerNum = 0; ATMixerName = ""; @@ -6069,7 +5976,8 @@ namespace SingleDuct { } } - void SetATMixerPriFlow(int const ATMixerNum, // Air terminal mixer index + void SetATMixerPriFlow(EnergyPlusData &state, + int const ATMixerNum, // Air terminal mixer index Optional PriAirMassFlowRate // Air terminal mixer primary air mass flow rate [kg/s] ) { @@ -6093,7 +6001,7 @@ namespace SingleDuct { int PriAirNode; // air terminal mixer primary air inlet node number if (ATMixerNum <= 0) return; - PriAirNode = SysATMixer(ATMixerNum).PriInNode; + PriAirNode = state.dataSingleDuct->SysATMixer(ATMixerNum).PriInNode; if (present(PriAirMassFlowRate)) { Node(PriAirNode).MassFlowRate = PriAirMassFlowRate; } else { @@ -6109,38 +6017,38 @@ namespace SingleDuct { if (inletATMixerIndex == 0) return; // protect this function from bad inputs if (controlledZoneNum == 0) return; if (curZoneEqNum == 0) return; - if (SingleDuct::SysATMixer(inletATMixerIndex).MixerType == DataHVACGlobals::No_ATMixer) return; + if (state.dataSingleDuct->SysATMixer(inletATMixerIndex).MixerType == DataHVACGlobals::No_ATMixer) return; // ATMixer properties only affect coil sizing when the mixer is on the inlet side of zone equipment - if (SingleDuct::SysATMixer(inletATMixerIndex).MixerType == DataHVACGlobals::ATMixer_SupplySide) { + if (state.dataSingleDuct->SysATMixer(inletATMixerIndex).MixerType == DataHVACGlobals::ATMixer_SupplySide) { // check if user has selected No to account for DOAS system - if (FinalZoneSizing.allocated() && SingleDuct::SysATMixer(inletATMixerIndex).printWarning) { + if (FinalZoneSizing.allocated() && state.dataSingleDuct->SysATMixer(inletATMixerIndex).printWarning) { if (!FinalZoneSizing(curZoneEqNum).AccountForDOAS && FinalZoneSizing(curZoneEqNum).DOASControlStrategy != DOANeutralSup) { - ShowWarningError(state, "AirTerminal:SingleDuct:Mixer: " + SingleDuct::SysATMixer(inletATMixerIndex).Name); + ShowWarningError(state, "AirTerminal:SingleDuct:Mixer: " + state.dataSingleDuct->SysATMixer(inletATMixerIndex).Name); ShowContinueError(state, " Supply side Air Terminal Mixer does not adjust zone equipment coil sizing and may result in inappropriately sized coils."); ShowContinueError(state, " Set Account for Dedicated Outdoor Air System = Yes in Sizing:Zone object for zone = " + FinalZoneSizing(curZoneEqNum).ZoneName); } - SingleDuct::SysATMixer(inletATMixerIndex).printWarning = false; + state.dataSingleDuct->SysATMixer(inletATMixerIndex).printWarning = false; } return; // do nothing else if this is a supply side ATMixer } // check if user has selected Yes to account for DOAS system - if (FinalZoneSizing.allocated() && SingleDuct::SysATMixer(inletATMixerIndex).printWarning) { + if (FinalZoneSizing.allocated() && state.dataSingleDuct->SysATMixer(inletATMixerIndex).printWarning) { if (FinalZoneSizing(curZoneEqNum).AccountForDOAS && FinalZoneSizing(curZoneEqNum).DOASControlStrategy != DOANeutralSup) { - ShowWarningError(state, "AirTerminal:SingleDuct:Mixer: " + SingleDuct::SysATMixer(inletATMixerIndex).Name); + ShowWarningError(state, "AirTerminal:SingleDuct:Mixer: " + state.dataSingleDuct->SysATMixer(inletATMixerIndex).Name); ShowContinueError(state, " Inlet side Air Terminal Mixer automatically adjusts zone equipment coil sizing."); ShowContinueError(state, " Set Account for Dedicated Outdoor Air System = No in Sizing:Zone object for zone = " + FinalZoneSizing(curZoneEqNum).ZoneName); - SingleDuct::SysATMixer(inletATMixerIndex).printWarning = false; + state.dataSingleDuct->SysATMixer(inletATMixerIndex).printWarning = false; } } // proceed to set ATMixer properties used for sizing coils int airLoopIndex = // find air loop associated with ATMixer - DataZoneEquipment::ZoneEquipConfig(controlledZoneNum).InletNodeAirLoopNum(SingleDuct::SysATMixer(inletATMixerIndex).CtrlZoneInNodeIndex); + DataZoneEquipment::ZoneEquipConfig(controlledZoneNum).InletNodeAirLoopNum(state.dataSingleDuct->SysATMixer(inletATMixerIndex).CtrlZoneInNodeIndex); // must be a system sizing run or calculations are not possible bool SizingDesRunThisAirSys = false; // Sizing:System object found flag @@ -6149,7 +6057,7 @@ namespace SingleDuct { if (SizingDesRunThisAirSys) { // set ATMixer outlet air flow rate in ZoneEqSizing array for ATMixer. If this value > 0, then the Sizer will know an ATMixer exists - ZoneEqSizing(curZoneEqNum).ATMixerVolFlow = SingleDuct::SysATMixer(inletATMixerIndex).DesignPrimaryAirVolRate; + ZoneEqSizing(curZoneEqNum).ATMixerVolFlow = state.dataSingleDuct->SysATMixer(inletATMixerIndex).DesignPrimaryAirVolRate; // If air loop has heating coil use SA conditions, else if OA sys has coils then use precool conditions, else use OA conditions if (state.dataAirSystemsData->PrimaryAirSystems(airLoopIndex).CentralHeatCoilExists) { @@ -6294,6 +6202,4 @@ namespace SingleDuct { // End of Reporting subroutines for the Sys Module // ***************************************************************************** -} // namespace SingleDuct - -} // namespace EnergyPlus +} // namespace EnergyPlus::SingleDuct diff --git a/src/EnergyPlus/SingleDuct.hh b/src/EnergyPlus/SingleDuct.hh index 818332d6804..0ccc35b7c3b 100644 --- a/src/EnergyPlus/SingleDuct.hh +++ b/src/EnergyPlus/SingleDuct.hh @@ -63,63 +63,12 @@ struct EnergyPlusData; namespace SingleDuct { - // Using/Aliasing - - // Data - // MODULE PARAMETER DEFINITIONS - extern int const Normal; - extern int const ReverseAction; - extern int const ReverseActionWithLimits; - extern int const HeatingActionNotUsed; - - // SysTypes represented here - extern int const SingleDuctVAVReheat; - extern int const SingleDuctConstVolReheat; - extern int const SingleDuctConstVolNoReheat; - extern int const SingleDuctVAVNoReheat; - extern int const SingleDuctVAVReheatVSFan; - extern int const SingleDuctCBVAVReheat; - extern int const SingleDuctCBVAVNoReheat; - // Reheat Coil Types used here - extern int const HCoilType_None; - extern int const HCoilType_Gas; - extern int const HCoilType_Electric; - extern int const HCoilType_SimpleHeating; - extern int const HCoilType_SteamAirHeating; - - // Minimum Flow Fraction Input Method - extern int const ConstantMinFrac; - extern int const ScheduledMinFrac; - extern int const FixedMin; - extern int const MinFracNotUsed; - extern int NumATMixers; - - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: - extern bool GetInputFlag; // Flag set to make sure you get input once - extern bool GetATMixerFlag; // Flag set to make sure you get input once - extern int NumConstVolSys; - extern Array1D_bool CheckEquipName; - - // INTERFACE BLOCK SPECIFICATIONS - - extern int NumSDAirTerminal; // The Number of single duct air terminals found in the Input - - // Subroutine Specifications for the Module - // Driver/Manager Routines - - // Get Input routines for module - - // Initialization routines for module - - // Algorithms for the module - - // Update routine to check convergence and update nodes - - // Reporting routines for module - - // Types + enum class Action {Normal, ReverseAction, ReverseActionWithLimits, HeatingActionNotUsed}; + enum class SysType { + SingleDuctVAVReheat, SingleDuctConstVolReheat, SingleDuctConstVolNoReheat, SingleDuctVAVNoReheat, + SingleDuctVAVReheatVSFan, SingleDuctCBVAVReheat, SingleDuctCBVAVNoReheat, Unknown}; + enum class HeatingCoilType : int {None, Gas, Electric, SimpleHeating, SteamAirHeating}; + enum class MinFlowFraction {Constant, Scheduled, Fixed, MinFracNotUsed}; struct SingleDuctAirTerminalFlowConditions { @@ -144,11 +93,11 @@ namespace SingleDuct { int SysNum; // index to single duct air terminal unit std::string SysName; // Name of the Sys std::string SysType; // Type of Sys ie. VAV, Mixing, Inducing, etc. - int SysType_Num; // Numeric Equivalent for System type + enum SysType SysType_Num; // Numeric Equivalent for System type std::string Schedule; // Sys Operation Schedule int SchedPtr; // Pointer to the correct schedule std::string ReheatComp; // Type of the Reheat Coil Object - int ReheatComp_Num; // Numeric Equivalent in this module for Coil type + HeatingCoilType ReheatComp_Num; // Numeric Equivalent in this module for Coil type int ReheatComp_Index; // Returned Index number from other routines std::string ReheatName; // name of reheat coil int ReheatComp_PlantType; // typeOf_ number for plant type of heating coil @@ -162,7 +111,7 @@ namespace SingleDuct { Real64 AirMassFlowRateMax; // Max Specified Mass Flow Rate of Sys (cooling max) [kg/sec] Real64 MaxHeatAirVolFlowRate; // Max specified volume flow rate of unit at max heating [m3/s] Real64 HeatAirMassFlowRateMax; // Max Specified Mass Flow Rate of unit at max heating [kg/sec] - int ZoneMinAirFracMethod; // parameter for what method is used for min flow fraction + MinFlowFraction ZoneMinAirFracMethod; // parameter for what method is used for min flow fraction Real64 ZoneMinAirFracDes; // Fraction of supply air used as design minimum flow Real64 ZoneMinAirFrac; // Fraction of supply air used as current minimum flow Real64 ZoneMinAirFracReport; // Fraction of supply air used as minimum flow for reporting (zero if terminal unit flow is zero) @@ -190,7 +139,7 @@ namespace SingleDuct { Real64 ControllerOffset; Real64 MaxReheatTemp; // C bool MaxReheatTempSetByUser; - int DamperHeatingAction; // ! 1=NORMAL; 2=REVERSE ACTION; 3=REVERSE ACTION WITH LIMITS + Action DamperHeatingAction; Real64 DamperPosition; int ADUNum; // index of corresponding air distribution unit int FluidIndex; // Refrigerant index @@ -238,14 +187,14 @@ namespace SingleDuct { // Default Constructor SingleDuctAirTerminal() - : SysNum(-1), SysType_Num(0), SchedPtr(0), ReheatComp_Num(0), ReheatComp_Index(0), ReheatComp_PlantType(0), Fan_Num(0), Fan_Index(0), + : SysNum(-1), SysType_Num(SysType::Unknown), SchedPtr(0), ReheatComp_Num(HeatingCoilType::None), ReheatComp_Index(0), ReheatComp_PlantType(0), Fan_Num(0), Fan_Index(0), ControlCompTypeNum(0), CompErrIndex(0), MaxAirVolFlowRate(0.0), AirMassFlowRateMax(0.0), MaxHeatAirVolFlowRate(0.0), - HeatAirMassFlowRateMax(0.0), ZoneMinAirFracMethod(ConstantMinFrac), ZoneMinAirFracDes(0.0), ZoneMinAirFrac(0.0), + HeatAirMassFlowRateMax(0.0), ZoneMinAirFracMethod(MinFlowFraction::Constant), ZoneMinAirFracDes(0.0), ZoneMinAirFrac(0.0), ZoneMinAirFracReport(0.0), ZoneFixedMinAir(0.0), ZoneMinAirFracSchPtr(0), ConstantMinAirFracSetByUser(false), FixedMinAirSetByUser(false), DesignMinAirFrac(0.0), DesignFixedMinAir(0.0), InletNodeNum(0), OutletNodeNum(0), ReheatControlNode(0), ReheatCoilOutletNode(0), ReheatCoilMaxCapacity(0.0), ReheatAirOutletNode(0), MaxReheatWaterVolFlow(0.0), MaxReheatSteamVolFlow(0.0), MaxReheatWaterFlow(0.0), MaxReheatSteamFlow(0.0), MinReheatWaterVolFlow(0.0), MinReheatSteamVolFlow(0.0), MinReheatWaterFlow(0.0), - MinReheatSteamFlow(0.0), ControllerOffset(0.0), MaxReheatTemp(0.0), MaxReheatTempSetByUser(false), DamperHeatingAction(0), + MinReheatSteamFlow(0.0), ControllerOffset(0.0), MaxReheatTemp(0.0), MaxReheatTempSetByUser(false), DamperHeatingAction(Action::HeatingActionNotUsed), DamperPosition(0.0), ADUNum(0), FluidIndex(0), ErrCount1(0), ErrCount1c(0), ErrCount2(0), ZoneFloorArea(0.0), CtrlZoneNum(0), CtrlZoneInNodeIndex(0), ActualZoneNum(0), MaxAirVolFlowRateDuringReheat(0.0), MaxAirVolFractionDuringReheat(0.0), AirMassFlowDuringReheatMax(0.0), ZoneOutdoorAirMethod(0), OutdoorAirFlowRate(0.0), NoOAFlowInputFromUser(true), OARequirementsPtr(0), @@ -256,35 +205,35 @@ namespace SingleDuct { { } - void InitSys(EnergyPlusData &state, bool const FirstHVACIteration); + void InitSys(EnergyPlusData &state, bool FirstHVACIteration); void SizeSys(EnergyPlusData &state); - void SimVAV(EnergyPlusData &state, bool const FirstHVACIteration, int const ZoneNum, int const ZoneNodeNum); + void SimVAV(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum); - void CalcOAMassFlow(EnergyPlusData &state, Real64 &SAMassFlow, Real64 &AirLoopOAFrac); + void CalcOAMassFlow(EnergyPlusData &state, Real64 &SAMassFlow, Real64 &AirLoopOAFrac) const; - void SimCBVAV(EnergyPlusData &state, bool const FirstHVACIteration, int const ZoneNum, int const ZoneNodeNum); + void SimCBVAV(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum); - void SimVAVVS(EnergyPlusData &state, bool const FirstHVACIteration, int const ZoneNum, int const ZoneNodeNum); + void SimVAVVS(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum); - void SimConstVol(EnergyPlusData &state, bool const FirstHVACIteration, int const ZoneNum, int const ZoneNodeNum); + void SimConstVol(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum); - void CalcVAVVS(EnergyPlusData &state, bool const FirstHVACIteration, int const ZoneNode, int const HCoilType, Real64 const HWFlow, Real64 const HCoilReq, int const FanType, Real64 const AirFlow, int const FanOn, Real64 &LoadMet); + void CalcVAVVS(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNode, Real64 HWFlow, Real64 HCoilReq, int FanType, Real64 AirFlow, int FanOn, Real64 &LoadMet); - static Real64 VAVVSCoolingResidual(EnergyPlusData &state, Real64 const SupplyAirMassFlow, Array1D const &Par); + static Real64 VAVVSCoolingResidual(EnergyPlusData &state, Real64 SupplyAirMassFlow, Array1D const &Par); - static Real64 VAVVSHWNoFanResidual(EnergyPlusData &state, Real64 const HWMassFlow, Array1D const &Par); + static Real64 VAVVSHWNoFanResidual(EnergyPlusData &state, Real64 HWMassFlow, Array1D const &Par); - static Real64 VAVVSHWFanOnResidual(EnergyPlusData &state, Real64 const SupplyAirMassFlow, Array1D const &Par); + static Real64 VAVVSHWFanOnResidual(EnergyPlusData &state, Real64 SupplyAirMassFlow, Array1D const &Par); - static Real64 VAVVSHCFanOnResidual(EnergyPlusData &state, Real64 const HeatingFrac, Array1D const &Par); + static Real64 VAVVSHCFanOnResidual(EnergyPlusData &state, Real64 HeatingFrac, Array1D const &Par); void SimConstVolNoReheat(); void CalcOutdoorAirVolumeFlowRate(EnergyPlusData &state); - void UpdateSys(); + void UpdateSys() const; void ReportSys(EnergyPlusData &state); @@ -342,26 +291,13 @@ namespace SingleDuct { { } - void InitATMixer(EnergyPlusData &state, bool const FirstHVACIteration); + void InitATMixer(EnergyPlusData &state, bool FirstHVACIteration); }; - // Object Data - extern Array1D sd_airterminal; - extern Array1D SysATMixer; - - // Functions - void clear_state(); - - void SimulateSingleDuct(EnergyPlusData &state, std::string const &CompName, bool const FirstHVACIteration, int const ZoneNum, int const ZoneNodeNum, int &CompIndex); - - // Get Input Section of the Module - //****************************************************************************** + void SimulateSingleDuct(EnergyPlusData &state, std::string const &CompName, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum, int &CompIndex); void GetSysInput(EnergyPlusData &state); - // End of Get Input subroutines for the Module - //****************************************************************************** - void GetHVACSingleDuctSysIndex(EnergyPlusData &state, std::string const &SDSName, int &SDSIndex, bool &ErrorsFound, @@ -370,13 +306,13 @@ namespace SingleDuct { Optional_int DamperOutletNode = _ // Damper outlet node number ); - void SimATMixer(EnergyPlusData &state, std::string const &SysName, bool const FirstHVACIteration, int &SysIndex); + void SimATMixer(EnergyPlusData &state, std::string const &SysName, bool FirstHVACIteration, int &SysIndex); void GetATMixers(EnergyPlusData &state); - void CalcATMixer(EnergyPlusData &state, int const SysNum); + void CalcATMixer(EnergyPlusData &state, int SysNum); - void UpdateATMixer(int const SysNum); + void UpdateATMixer(EnergyPlusData &state, int SysNum); void GetATMixer(EnergyPlusData &state, std::string const &ZoneEquipName, // zone unit name name @@ -389,7 +325,7 @@ namespace SingleDuct { int const &ZoneEquipOutletNode // zone equipment outlet node (used with inlet side mixers) ); - void SetATMixerPriFlow(int const ATMixerNum, // Air terminal mixer index + void SetATMixerPriFlow(EnergyPlusData &state, int ATMixerNum, // Air terminal mixer index Optional PriAirMassFlowRate = _ // Air terminal mixer primary air mass flow rate [kg/s] ); @@ -398,11 +334,39 @@ namespace SingleDuct { int const &curZoneEqNum // current zone equipment being simulated ); - // End of Reporting subroutines for the Sys Module - // ***************************************************************************** - } // namespace SingleDuct +struct SingleDuctData : BaseGlobalStruct { + + Array1D SysATMixer; + Array1D sd_airterminal; + std::unordered_map SysUniqueNames; + Array1D_bool CheckEquipName; + int NumATMixers = 0; + int NumConstVolSys = 0; + int NumSDAirTerminal = 0; // The Number of single duct air terminals found in the Input + bool GetInputFlag = true; // Flag set to make sure you get input once + bool GetATMixerFlag = true; // Flag set to make sure you get input once + bool InitSysFlag = true; // Flag set to make sure you do begin simulation initializaztions once + bool InitATMixerFlag = true; // Flag set to make sure you do begin simulation initializaztions once for mixer + bool ZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items + + void clear_state() override { + SysATMixer.deallocate(); + sd_airterminal.deallocate(); + SysUniqueNames.clear(); + CheckEquipName.deallocate(); + NumATMixers = 0; + NumConstVolSys = 0; + NumSDAirTerminal = 0; + GetInputFlag = true; + GetATMixerFlag = true; + InitSysFlag = true; + InitATMixerFlag = true; + ZoneEquipmentListChecked = false; + } +}; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/SizingAnalysisObjects.cc b/src/EnergyPlus/SizingAnalysisObjects.cc index be67b32ba98..7807d5adf0d 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.cc +++ b/src/EnergyPlus/SizingAnalysisObjects.cc @@ -52,6 +52,7 @@ // EnergyPlus Headers #include +#include #include #include #include @@ -64,12 +65,6 @@ namespace EnergyPlus { - bool eioHeaderDoneOnce(false); - - void SizingAnalysisObjects_clear_state() { - eioHeaderDoneOnce = false; - } - ZoneTimestepObject::ZoneTimestepObject() { kindOfSim = DataGlobalConstants::KindOfSim::Unassigned; @@ -545,12 +540,12 @@ void PlantCoinicidentAnalysis::ResolveDesignFlowRate(EnergyPlusData& state, int } // add a seperate eio summary report about what happened, did demand trap get used, what were the key values. - if (!eioHeaderDoneOnce) { + if (!state.dataGlobal->sizingAnalysisEioHeaderDoneOnce) { print(state.files.eio,"{}", "! ,Plant Loop Name,Sizing Pass {#},Measured Mass " "Flow{kg/s},Measured Demand {W},Demand Calculated Mass Flow{kg/s},Sizes Changed {Yes/No},Previous " "Volume Flow Rate {m3/s},New Volume Flow Rate {m3/s},Demand Check Applied {Yes/No},Sizing Factor " "{},Normalized Change {},Specific Heat{J/kg-K},Density {kg/m3}\n"); - eioHeaderDoneOnce = true; + state.dataGlobal->sizingAnalysisEioHeaderDoneOnce = true; } chIteration = fmt::to_string(HVACSizingIterCount); if (setNewSizes) { diff --git a/src/EnergyPlus/SizingAnalysisObjects.hh b/src/EnergyPlus/SizingAnalysisObjects.hh index b3746d013a9..b470c51d2d6 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.hh +++ b/src/EnergyPlus/SizingAnalysisObjects.hh @@ -62,8 +62,6 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -void SizingAnalysisObjects_clear_state(); - class SystemTimestepObject { public: diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index be4ad64228b..d04a1072c2b 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -96,13 +96,6 @@ namespace SizingManager { // This module contains the data and routines relating to managing the sizing // simulations. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: none - - // OTHER NOTES: none - // Using/Aliasing using namespace HeatBalanceManager; using namespace WeatherManager; @@ -113,32 +106,6 @@ namespace SizingManager { using DataStringGlobals::CharTab; using DataZoneEquipment::ZoneEquipConfig; - // Data - // MODULE PARAMETER DEFINITIONS: none - - // DERIVED TYPE DEFINITIONS: none - - // INTERFACE BLOCK SPECIFICATIONS: none - - // MODULE VARIABLE DECLARATIONS: - int NumAirLoops(0); - bool ReportZoneSizingMyOneTimeFlag(true); - bool ReportSysSizingMyOneTimeFlag(true); - bool runZeroingOnce(true); - - // SUBROUTINE SPECIFICATIONS FOR MODULE SimulationManager - - // MODULE SUBROUTINES: - - // Functions - void clear_state() - { - NumAirLoops = 0; - ReportZoneSizingMyOneTimeFlag = true; - ReportSysSizingMyOneTimeFlag = true; - runZeroingOnce = true; - } - void ManageSizing(EnergyPlusData &state) { @@ -441,9 +408,9 @@ namespace SizingManager { ErrorsFound = true; } - if (state.dataGlobal->isPulseZoneSizing && runZeroingOnce) { + if (state.dataGlobal->isPulseZoneSizing && state.dataSizingManager->runZeroingOnce) { RezeroZoneSizingArrays(state); // zero all arrays related to zone sizing. - runZeroingOnce = false; + state.dataSizingManager->runZeroingOnce = false; } } // loop that repeats the zone sizing calcs for the load component report, if requested @@ -461,7 +428,7 @@ namespace SizingManager { Month = LastMonth; DayOfMonth = LastDayOfMonth; - if ((state.dataGlobal->DoSystemSizing) && (NumSysSizInput == 0) && (NumAirLoops > 0)) { + if ((state.dataGlobal->DoSystemSizing) && (NumSysSizInput == 0) && (state.dataSizingManager->NumAirLoops > 0)) { ShowWarningError(state, RoutineName + "For a system sizing run, there must be at least 1 Sizing:System object input. SimulationControl System Sizing option ignored."); @@ -897,63 +864,63 @@ namespace SizingManager { Real64 airLoopHeatingMaximumFlowRateSum(0.0); // sum up heating and max flows for any single duct systems, store 62.1 values by zone - if (allocated(SingleDuct::sd_airterminal) && SingleDuct::NumSDAirTerminal > 0) { - for (int singleDuctATUNum = 1; singleDuctATUNum <= SingleDuct::NumSDAirTerminal; ++singleDuctATUNum) { - if (AirLoopNum == SingleDuct::sd_airterminal(singleDuctATUNum).AirLoopNum) { + if (allocated(state.dataSingleDuct->sd_airterminal) && state.dataSingleDuct->NumSDAirTerminal > 0) { + for (int singleDuctATUNum = 1; singleDuctATUNum <= state.dataSingleDuct->NumSDAirTerminal; ++singleDuctATUNum) { + if (AirLoopNum == state.dataSingleDuct->sd_airterminal(singleDuctATUNum).AirLoopNum) { int termUnitSizingIndex = - DataDefineEquip::AirDistUnit(SingleDuct::sd_airterminal(singleDuctATUNum).ADUNum).TermUnitSizingNum; - airLoopMaxFlowRateSum += SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; + DataDefineEquip::AirDistUnit(state.dataSingleDuct->sd_airterminal(singleDuctATUNum).ADUNum).TermUnitSizingNum; + airLoopMaxFlowRateSum += state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; DataSizing::VpzClgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values - if (SingleDuct::sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SingleDuctConstVolReheat || - SingleDuct::sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SingleDuctConstVolNoReheat) { - airLoopHeatingMinimumFlowRateSum += SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; - airLoopHeatingMaximumFlowRateSum += SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; + if (state.dataSingleDuct->sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SysType::SingleDuctConstVolReheat || + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SysType::SingleDuctConstVolNoReheat) { + airLoopHeatingMinimumFlowRateSum += state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; + airLoopHeatingMaximumFlowRateSum += state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; DataSizing::VpzHtgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values DataSizing::VpzMinClgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values DataSizing::VpzMinHtgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values } else { - airLoopHeatingMinimumFlowRateSum += SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * - SingleDuct::sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; + airLoopHeatingMinimumFlowRateSum += state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; DataSizing::VpzMinClgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * - SingleDuct::sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values DataSizing::VpzMinHtgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * - SingleDuct::sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values - if (SingleDuct::sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate > + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values + if (state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate > 0.0) { // VS fan ATU has this non zero, so use it - airLoopHeatingMaximumFlowRateSum += SingleDuct::sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate; + airLoopHeatingMaximumFlowRateSum += state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate; DataSizing::VpzHtgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate; // store std 62.1 values + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate; // store std 62.1 values } else { - if (SingleDuct::sd_airterminal(singleDuctATUNum).DamperHeatingAction == SingleDuct::ReverseAction) { - airLoopHeatingMaximumFlowRateSum += SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; + if (state.dataSingleDuct->sd_airterminal(singleDuctATUNum).DamperHeatingAction == SingleDuct::Action::ReverseAction) { + airLoopHeatingMaximumFlowRateSum += state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; DataSizing::VpzHtgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values - } else if (SingleDuct::sd_airterminal(singleDuctATUNum).DamperHeatingAction == - SingleDuct::ReverseActionWithLimits) { + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values + } else if (state.dataSingleDuct->sd_airterminal(singleDuctATUNum).DamperHeatingAction == + SingleDuct::Action::ReverseActionWithLimits) { airLoopHeatingMaximumFlowRateSum += - max(SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat, - (SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * - SingleDuct::sd_airterminal(singleDuctATUNum).ZoneMinAirFrac)); + max(state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat, + (state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).ZoneMinAirFrac)); DataSizing::VpzHtgByZone(termUnitSizingIndex) = - max(SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat, - (SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * - SingleDuct::sd_airterminal(singleDuctATUNum).ZoneMinAirFrac)); // store std 62.1 values + max(state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat, + (state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).ZoneMinAirFrac)); // store std 62.1 values } else { - airLoopHeatingMaximumFlowRateSum += SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * - SingleDuct::sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; + airLoopHeatingMaximumFlowRateSum += state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; DataSizing::VpzHtgByZone(termUnitSizingIndex) = - SingleDuct::sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * - SingleDuct::sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * + state.dataSingleDuct->sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values } } } @@ -1198,23 +1165,23 @@ namespace SizingManager { } // sum up flows for any air terminal mixers - if (allocated(SingleDuct::SysATMixer) && (SingleDuct::NumATMixers > 0)) { - for (int aTMixerNum = 1; aTMixerNum <= SingleDuct::NumATMixers; ++aTMixerNum) { - if (AirLoopNum == SingleDuct::SysATMixer(aTMixerNum).AirLoopNum) { - int termUnitSizingIndex = DataDefineEquip::AirDistUnit(SingleDuct::SysATMixer(aTMixerNum).ADUNum).TermUnitSizingNum; - airLoopHeatingMaximumFlowRateSum += SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - airLoopHeatingMinimumFlowRateSum += SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - airLoopMaxFlowRateSum += SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - - DataSizing::VpzClgByZone(termUnitSizingIndex) = SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - DataSizing::VpzMinClgByZone(termUnitSizingIndex) = SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - DataSizing::VpzHtgByZone(termUnitSizingIndex) = SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - DataSizing::VpzMinHtgByZone(termUnitSizingIndex) = SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + if (allocated(state.dataSingleDuct->SysATMixer) && (state.dataSingleDuct->NumATMixers > 0)) { + for (int aTMixerNum = 1; aTMixerNum <= state.dataSingleDuct->NumATMixers; ++aTMixerNum) { + if (AirLoopNum == state.dataSingleDuct->SysATMixer(aTMixerNum).AirLoopNum) { + int termUnitSizingIndex = DataDefineEquip::AirDistUnit(state.dataSingleDuct->SysATMixer(aTMixerNum).ADUNum).TermUnitSizingNum; + airLoopHeatingMaximumFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + airLoopHeatingMinimumFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + airLoopMaxFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + + DataSizing::VpzClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + DataSizing::VpzMinClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + DataSizing::VpzHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + DataSizing::VpzMinHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; // the ZoneHVAC devices will have secondary flow but how to get it, future work - DataSizing::VdzClgByZone(termUnitSizingIndex) = SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - DataSizing::VdzMinClgByZone(termUnitSizingIndex) = SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - DataSizing::VdzHtgByZone(termUnitSizingIndex) = SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; - DataSizing::VdzMinHtgByZone(termUnitSizingIndex) = SingleDuct::SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + DataSizing::VdzClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + DataSizing::VdzMinClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + DataSizing::VdzHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; + DataSizing::VdzMinHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate; } } } @@ -3316,7 +3283,7 @@ namespace SizingManager { static bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine int NumDesDays; // Number of design days in input - NumAirLoops = inputProcessor->getNumObjectsFound(state, "AirLoopHVAC"); + state.dataSizingManager->NumAirLoops = inputProcessor->getNumObjectsFound(state, "AirLoopHVAC"); cCurrentModuleObject = "Sizing:System"; NumSysSizInput = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); @@ -4055,14 +4022,14 @@ namespace SizingManager { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - if (ReportZoneSizingMyOneTimeFlag) { + if (state.dataSizingManager->ReportZoneSizingMyOneTimeFlag) { static constexpr auto Format_990( "! , Zone Name, Load Type, Calc Des Load {W}, User Des Load {W}, Calc Des Air Flow " "Rate {m3/s}, User Des Air Flow Rate {m3/s}, Design Day Name, Date/Time of Peak, Temperature at Peak {C}, " "Humidity Ratio at Peak {kgWater/kgDryAir}, Floor Area {m2}, # Occupants, Calc Outdoor Air Flow Rate {m3/s}, " "Calc DOAS Heat Addition Rate {W}"); print(state.files.eio, "{}\n", Format_990); - ReportZoneSizingMyOneTimeFlag = false; + state.dataSizingManager->ReportZoneSizingMyOneTimeFlag = false; } static constexpr auto Format_991( @@ -4116,12 +4083,12 @@ namespace SizingManager { ) { - if (ReportSysSizingMyOneTimeFlag) { + if (state.dataSizingManager->ReportSysSizingMyOneTimeFlag) { print(state.files.eio, "{}\n", "! , System Name, Load Type, Peak Load Kind, User Design Capacity, Calc Des Air " "Flow Rate [m3/s], User Des Air Flow Rate [m3/s], Design Day Name, Date/Time of Peak"); - ReportSysSizingMyOneTimeFlag = false; + state.dataSizingManager->ReportSysSizingMyOneTimeFlag = false; } std::string dateHrMin = DesDayDate + " " + TimeIndexToHrMinString(state, TimeStepIndex); print(state.files.eio, diff --git a/src/EnergyPlus/SizingManager.hh b/src/EnergyPlus/SizingManager.hh index 95d1fc9314d..7f9df4df057 100644 --- a/src/EnergyPlus/SizingManager.hh +++ b/src/EnergyPlus/SizingManager.hh @@ -63,22 +63,6 @@ struct EnergyPlusData; namespace SizingManager { - // Using/Aliasing - - // Data - // MODULE PARAMETER DEFINITIONS: none - - // DERIVED TYPE DEFINITIONS: none - - // INTERFACE BLOCK SPECIFICATIONS: none - - // MODULE VARIABLE DECLARATIONS: - extern int NumAirLoops; - - // SUBROUTINE SPECIFICATIONS FOR MODULE SimulationManager - - // Types - struct ZoneListData { // Members @@ -92,17 +76,14 @@ namespace SizingManager { } }; - // Functions - void clear_state(); - void ManageSizing(EnergyPlusData &state); bool CalcdoLoadComponentPulseNow(EnergyPlusData &state, - bool const isPulseZoneSizing, - bool const WarmupFlag, - int const HourOfDay, - int const TimeStep, - DataGlobalConstants::KindOfSim const KindOfSim); + bool isPulseZoneSizing, + bool WarmupFlag, + int HourOfDay, + int TimeStep, + DataGlobalConstants::KindOfSim KindOfSim); void ManageSystemSizingAdjustments(EnergyPlusData &state); @@ -114,7 +95,7 @@ namespace SizingManager { void ProcessInputOARequirements(EnergyPlusData &state, std::string const &cCurrentModuleObject, - int const OAIndex, + int OAIndex, Array1D_string const &cAlphaArgs, int &NumAlphas, Array1D const &rNumericArgs, @@ -148,18 +129,18 @@ namespace SizingManager { void ReportZoneSizing(EnergyPlusData &state, std::string const &ZoneName, // the name of the zone std::string const &LoadType, // the description of the input variable - Real64 const CalcDesLoad, // the value from the sizing calculation [W] - Real64 const UserDesLoad, // the value from the sizing calculation modified by user input [W] - Real64 const CalcDesFlow, // calculated design air flow rate [m3/s] - Real64 const UserDesFlow, // user input or modified design air flow rate [m3/s] + Real64 CalcDesLoad, // the value from the sizing calculation [W] + Real64 UserDesLoad, // the value from the sizing calculation modified by user input [W] + Real64 CalcDesFlow, // calculated design air flow rate [m3/s] + Real64 UserDesFlow, // user input or modified design air flow rate [m3/s] std::string const &DesDayName, // the name of the design day that produced the peak std::string const &PeakHrMin, // time stamp of the peak - Real64 const PeakTemp, // temperature at peak [C] - Real64 const PeakHumRat, // humidity ratio at peak [kg water/kg dry air] - Real64 const FloorArea, // zone floor area [m2] - Real64 const TotOccs, // design number of occupants for the zone - Real64 const MinOAVolFlow, // zone design minimum outside air flow rate [m3/s] - Real64 const DOASHeatAddRate // zone design heat addition rate from the DOAS [W] + Real64 PeakTemp, // temperature at peak [C] + Real64 PeakHumRat, // humidity ratio at peak [kg water/kg dry air] + Real64 FloorArea, // zone floor area [m2] + Real64 TotOccs, // design number of occupants for the zone + Real64 MinOAVolFlow, // zone design minimum outside air flow rate [m3/s] + Real64 DOASHeatAddRate // zone design heat addition rate from the DOAS [W] ); void ReportSysSizing(EnergyPlusData &state, @@ -176,12 +157,29 @@ namespace SizingManager { std::string TimeIndexToHrMinString(EnergyPlusData &state, int timeIndex); - void UpdateFacilitySizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator const CallIndicator); + void UpdateFacilitySizing(EnergyPlusData &state, DataGlobalConstants::CallIndicator CallIndicator); void UpdateTermUnitFinalZoneSizing(EnergyPlusData &state); } // namespace SizingManager +struct SizingManagerData : BaseGlobalStruct { + + // MODULE VARIABLE DECLARATIONS: + int NumAirLoops = 0; + bool ReportZoneSizingMyOneTimeFlag = true; + bool ReportSysSizingMyOneTimeFlag = true; + bool runZeroingOnce = true; + + void clear_state() override { + NumAirLoops = 0; + ReportZoneSizingMyOneTimeFlag = true; + ReportSysSizingMyOneTimeFlag = true; + runZeroingOnce = true; + } + +}; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/StateManagement.cc b/src/EnergyPlus/StateManagement.cc index 62d068dca78..f833ae02a25 100644 --- a/src/EnergyPlus/StateManagement.cc +++ b/src/EnergyPlus/StateManagement.cc @@ -173,11 +173,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include @@ -194,16 +192,7 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include void EnergyPlus::clearAllStates(EnergyPlusData &state) { @@ -337,7 +326,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state) PlantPressureSystem::clear_state(); PlantUtilities::clear_state(); PlantPipingSystemsManager::clear_state(); - PlantValves::clear_state(); PluginManagement::clear_state(); PollutionModule::clear_state(); PondGroundHeatExchanger::clear_state(); @@ -354,12 +342,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state) RoomAirModelUserTempPattern::clear_state(); RuntimeLanguageProcessor::clear_state(); ScheduleManager::clear_state(); - SetPointManager::clear_state(); SimAirServingZones::clear_state(); - SimulationManager::clear_state(); - SingleDuct::clear_state(); - SizingAnalysisObjects_clear_state(); // SizingAnalysisObjects does not have a namespace - SizingManager::clear_state(); - EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::clear_state(); ResultsFramework::clear_state(); } diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 171bb052c9f..016470d649f 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -4337,9 +4337,9 @@ namespace UnitarySystems { } // CoilDX_Cooling sets these above // coil outlet node set point has priority, IF not exist, then use system outlet node - if (SetPointManager::NodeHasSPMCtrlVarType(state, thisSys.AirOutNode, SetPointManager::iCtrlVarType_Temp)) + if (SetPointManager::NodeHasSPMCtrlVarType(state, thisSys.AirOutNode, SetPointManager::iCtrlVarType::Temp)) thisSys.m_SystemHeatControlNodeNum = thisSys.AirOutNode; - if (SetPointManager::NodeHasSPMCtrlVarType(state, HeatingCoilOutletNode, SetPointManager::iCtrlVarType_Temp)) + if (SetPointManager::NodeHasSPMCtrlVarType(state, HeatingCoilOutletNode, SetPointManager::iCtrlVarType::Temp)) thisSys.m_SystemHeatControlNodeNum = HeatingCoilOutletNode; thisSys.HeatCoilInletNodeNum = HeatingCoilInletNode; @@ -5440,9 +5440,9 @@ namespace UnitarySystems { thisSys.m_ContSpeedCoolingCoil = true; } // CoilDX_Cooling is set above - if (SetPointManager::NodeHasSPMCtrlVarType(state, thisSys.AirOutNode, SetPointManager::iCtrlVarType_Temp)) + if (SetPointManager::NodeHasSPMCtrlVarType(state, thisSys.AirOutNode, SetPointManager::iCtrlVarType::Temp)) thisSys.m_SystemCoolControlNodeNum = thisSys.AirOutNode; - if (SetPointManager::NodeHasSPMCtrlVarType(state, CoolingCoilOutletNode, SetPointManager::iCtrlVarType_Temp)) + if (SetPointManager::NodeHasSPMCtrlVarType(state, CoolingCoilOutletNode, SetPointManager::iCtrlVarType::Temp)) thisSys.m_SystemCoolControlNodeNum = CoolingCoilOutletNode; thisSys.CoolCoilInletNodeNum = CoolingCoilInletNode; @@ -5807,9 +5807,9 @@ namespace UnitarySystems { } // IF(.NOT. lAlphaBlanks(iSuppHeatCoilTypeAlphaNum))THEN - if (SetPointManager::NodeHasSPMCtrlVarType(state, thisSys.AirOutNode, SetPointManager::iCtrlVarType_Temp)) + if (SetPointManager::NodeHasSPMCtrlVarType(state, thisSys.AirOutNode, SetPointManager::iCtrlVarType::Temp)) thisSys.m_SuppHeatControlNodeNum = thisSys.AirOutNode; - if (SetPointManager::NodeHasSPMCtrlVarType(state, SupHeatCoilOutletNode, SetPointManager::iCtrlVarType_Temp)) + if (SetPointManager::NodeHasSPMCtrlVarType(state, SupHeatCoilOutletNode, SetPointManager::iCtrlVarType::Temp)) thisSys.m_SuppHeatControlNodeNum = SupHeatCoilOutletNode; // Add supplemental heating coil to component sets array diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index d034eb85a12..f40d4a1b6a7 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -6081,8 +6081,7 @@ namespace WaterCoils { using EMSManager::CheckIfNodeSetPointManagedByEMS; using EMSManager::iHumidityRatioMaxSetPoint; using EMSManager::iTemperatureSetPoint; - using SetPointManager::iCtrlVarType_MaxHumRat; - using SetPointManager::iCtrlVarType_Temp; + using SetPointManager::iCtrlVarType; using SetPointManager::NodeHasSPMCtrlVarType; // USE HVACControllers, ONLY: iTemperature, iHumidityRatio, iTemperatureAndHumidityRatio @@ -6141,7 +6140,7 @@ namespace WaterCoils { CheckIfNodeSetPointManagedByEMS(state, SensorNodeNum, iTemperatureSetPoint, EMSSetPointErrorFlag); DataLoopNode::NodeSetpointCheck(SensorNodeNum).needsSetpointChecking = false; if (EMSSetPointErrorFlag) { - if (!NodeHasSPMCtrlVarType(state, SensorNodeNum, iCtrlVarType_Temp)) { + if (!NodeHasSPMCtrlVarType(state, SensorNodeNum, iCtrlVarType::Temp)) { ShowWarningError(state, RoutineName + WaterCoilType + "=\"" + state.dataWaterCoils->WaterCoil(WhichCoil).Name + "\". "); ShowContinueError(state, " ..Temperature setpoint not found on coil air outlet node."); ShowContinueError(state, @@ -6153,7 +6152,7 @@ namespace WaterCoils { CheckIfNodeSetPointManagedByEMS(state, SensorNodeNum, iHumidityRatioMaxSetPoint, EMSSetPointErrorFlag); DataLoopNode::NodeSetpointCheck(SensorNodeNum).needsSetpointChecking = false; if (EMSSetPointErrorFlag) { - if (!NodeHasSPMCtrlVarType(state, SensorNodeNum, iCtrlVarType_MaxHumRat)) { + if (!NodeHasSPMCtrlVarType(state, SensorNodeNum, iCtrlVarType::MaxHumRat)) { ShowWarningError(state, RoutineName + WaterCoilType + "=\"" + state.dataWaterCoils->WaterCoil(WhichCoil).Name + "\". "); ShowContinueError(state, " ..Humidity ratio setpoint not found on coil air outlet node."); ShowContinueError(state, @@ -6165,7 +6164,7 @@ namespace WaterCoils { CheckIfNodeSetPointManagedByEMS(state, SensorNodeNum, iTemperatureSetPoint, EMSSetPointErrorFlag); DataLoopNode::NodeSetpointCheck(SensorNodeNum).needsSetpointChecking = false; if (EMSSetPointErrorFlag) { - if (!NodeHasSPMCtrlVarType(state, SensorNodeNum, iCtrlVarType_Temp)) { + if (!NodeHasSPMCtrlVarType(state, SensorNodeNum, iCtrlVarType::Temp)) { ShowWarningError(state, RoutineName + WaterCoilType + "=\"" + state.dataWaterCoils->WaterCoil(WhichCoil).Name + "\". "); ShowContinueError(state, " ..Temperature setpoint not found on coil air outlet node."); ShowContinueError(state, @@ -6177,7 +6176,7 @@ namespace WaterCoils { CheckIfNodeSetPointManagedByEMS(state, SensorNodeNum, iHumidityRatioMaxSetPoint, EMSSetPointErrorFlag); DataLoopNode::NodeSetpointCheck(SensorNodeNum).needsSetpointChecking = false; if (EMSSetPointErrorFlag) { - if (!NodeHasSPMCtrlVarType(state, SensorNodeNum, iCtrlVarType_MaxHumRat)) { + if (!NodeHasSPMCtrlVarType(state, SensorNodeNum, iCtrlVarType::MaxHumRat)) { ShowWarningError(state, RoutineName + WaterCoilType + "=\"" + state.dataWaterCoils->WaterCoil(WhichCoil).Name + "\". "); ShowContinueError(state, " ..Humidity ratio setpoint not found on coil air outlet node."); ShowContinueError(state, diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc index 023c3ad890d..31fc1282365 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc @@ -189,9 +189,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVReheat_GetInputTest) GetZoneAirLoopEquipment(state); GetSysInput(state); - EXPECT_EQ("AirTerminal:SingleDuct:ConstantVolume:Reheat", sd_airterminal(1).SysType); // AT SD VAV Reheat Type - EXPECT_EQ("REHEAT ZONE 1", sd_airterminal(1).SysName); // AT SD VAV Reheat Name - EXPECT_GT(sd_airterminal(1).ReheatControlNode, 0); // none zero integer node index is expected + EXPECT_EQ("AirTerminal:SingleDuct:ConstantVolume:Reheat", state.dataSingleDuct->sd_airterminal(1).SysType); // AT SD VAV Reheat Type + EXPECT_EQ("REHEAT ZONE 1", state.dataSingleDuct->sd_airterminal(1).SysName); // AT SD VAV Reheat Name + EXPECT_GT(state.dataSingleDuct->sd_airterminal(1).ReheatControlNode, 0); // none zero integer node index is expected } TEST_F(EnergyPlusFixture, AirTerminalSingleDuct4PipeInduction_GetInputTest) @@ -408,10 +408,10 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVHeatCool_GetInputTest) GetZoneAirLoopEquipment(state); GetSysInput(state); - EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", sd_airterminal(1).SysType); // AT SD VAV HeatCool Reheat Type - EXPECT_EQ("ZONE 1 VAV SYSTEM", sd_airterminal(1).SysName); // AT SD VAV HeatCool Reheat Name - EXPECT_EQ("COIL:HEATING:ELECTRIC", sd_airterminal(1).ReheatComp); // Reheat Coil Type - EXPECT_EQ("REHEAT COIL ZONE 1", sd_airterminal(1).ReheatName); // Reheat Coil Name + EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", state.dataSingleDuct->sd_airterminal(1).SysType); // AT SD VAV HeatCool Reheat Type + EXPECT_EQ("ZONE 1 VAV SYSTEM", state.dataSingleDuct->sd_airterminal(1).SysName); // AT SD VAV HeatCool Reheat Name + EXPECT_EQ("COIL:HEATING:ELECTRIC", state.dataSingleDuct->sd_airterminal(1).ReheatComp); // Reheat Coil Type + EXPECT_EQ("REHEAT COIL ZONE 1", state.dataSingleDuct->sd_airterminal(1).ReheatName); // Reheat Coil Name } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheatVarSpeedFan_GetInputTest) @@ -531,10 +531,10 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheatVarSpeedFan_GetInputTest GetZoneAirLoopEquipment(state); GetSysInput(state); - EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", sd_airterminal(1).SysType); // AT SD VAV HeatCool Reheat Type - EXPECT_EQ("SPACE1-1 VAV REHEAT", sd_airterminal(1).SysName); // AT SD VAV HeatCool Reheat Name - EXPECT_EQ("COIL:HEATING:WATER", sd_airterminal(1).ReheatComp); // Reheat Coil Type - EXPECT_EQ("SPACE1-1 ZONE COIL", sd_airterminal(1).ReheatName); // Reheat Coil Name + EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", state.dataSingleDuct->sd_airterminal(1).SysType); // AT SD VAV HeatCool Reheat Type + EXPECT_EQ("SPACE1-1 VAV REHEAT", state.dataSingleDuct->sd_airterminal(1).SysName); // AT SD VAV HeatCool Reheat Name + EXPECT_EQ("COIL:HEATING:WATER", state.dataSingleDuct->sd_airterminal(1).ReheatComp); // Reheat Coil Type + EXPECT_EQ("SPACE1-1 ZONE COIL", state.dataSingleDuct->sd_airterminal(1).ReheatName); // Reheat Coil Name } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheat_NormalActionTest) @@ -627,7 +627,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheat_NormalActionTest) GetZoneEquipmentData1(state); GetZoneAirLoopEquipment(state); GetSysInput(state); - SingleDuct::GetInputFlag = false; + state.dataSingleDuct->GetInputFlag = false; auto &thisZoneEquip(ZoneEquipConfig(state.dataGlobal->NumOfZones)); @@ -637,19 +637,19 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheat_NormalActionTest) DataEnvironment::OutBaroPress = 101325.0; int const SysNum(1); - int const InletNode = sd_airterminal(SysNum).InletNodeNum; - int const OutletNode = sd_airterminal(SysNum).OutletNodeNum; - int const ZonePtr = sd_airterminal(SysNum).ActualZoneNum; + int const InletNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + int const OutletNode = state.dataSingleDuct->sd_airterminal(SysNum).OutletNodeNum; + int const ZonePtr = state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum; int const ZoneAirNodeNum = thisZoneEquip.ZoneNode; - Schedule(sd_airterminal(SysNum).SchedPtr).CurrentValue = 1.0; // unit is always available + Schedule(state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr).CurrentValue = 1.0; // unit is always available // design maximum air mass flow rate - Real64 MassFlowRateMaxAvail = sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; - EXPECT_EQ(1.0, sd_airterminal(SysNum).MaxAirVolFlowRate); + Real64 MassFlowRateMaxAvail = state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; + EXPECT_EQ(1.0, state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate); EXPECT_EQ(1.0, MassFlowRateMaxAvail); - EXPECT_EQ("COIL:HEATING:ELECTRIC", sd_airterminal(SysNum).ReheatComp); - EXPECT_EQ(Normal, sd_airterminal(SysNum).DamperHeatingAction); - EXPECT_EQ(0.2, sd_airterminal(SysNum).ZoneMinAirFracDes); + EXPECT_EQ("COIL:HEATING:ELECTRIC", state.dataSingleDuct->sd_airterminal(SysNum).ReheatComp); + EXPECT_EQ(Action::Normal, state.dataSingleDuct->sd_airterminal(SysNum).DamperHeatingAction); + EXPECT_EQ(0.2, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); // set air inlet node properties Node(InletNode).Temp = 15.0; @@ -677,10 +677,10 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheat_NormalActionTest) // run SimulateSingleDuct(state, ) function SimulateSingleDuct(state, thisAirDistUnit.EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, thisAirDistUnit.EquipIndex(1)); // check min, actual and max air mass flow rates during reheat with Normal Action - EXPECT_EQ(expectedMassFlowAirReheatMin, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(expectedMassFlowAirReheatMin, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); EXPECT_EQ(expectedMassFlowAirReheatMin, Node(InletNode).MassFlowRate); EXPECT_EQ(expectedMassFlowAirReheatMin, Node(OutletNode).MassFlowRate); - EXPECT_EQ(1.0, sd_airterminal(SysNum).AirMassFlowRateMax); + EXPECT_EQ(1.0, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax); } TEST_F(EnergyPlusFixture, SingleDuctVAVAirTerminals_GetInputs) @@ -890,39 +890,39 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVAirTerminals_GetInputs) SingleDuct::GetSysInput(state); // VAV Reheat get input test - EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat", sd_airterminal(1).SysType); // VAV Reheat Type - EXPECT_EQ("VAV REHEAT AT", sd_airterminal(1).SysName); // VAV Reheat Name - EXPECT_TRUE(sd_airterminal(1).ZoneTurndownMinAirFracSchExist); // turndown schdule exists - EXPECT_EQ(sd_airterminal(1).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 - EXPECT_EQ(sd_airterminal(1).ZoneMinAirFracDes, 0.3); // design minimum flow fraction + EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat", state.dataSingleDuct->sd_airterminal(1).SysType); // VAV Reheat Type + EXPECT_EQ("VAV REHEAT AT", state.dataSingleDuct->sd_airterminal(1).SysName); // VAV Reheat Name + EXPECT_TRUE(state.dataSingleDuct->sd_airterminal(1).ZoneTurndownMinAirFracSchExist); // turndown schdule exists + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(1).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(1).ZoneMinAirFracDes, 0.3); // design minimum flow fraction // VAV change over bypass reheat get input test - EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", sd_airterminal(2).SysType); // VAV HeatCool Reheat Type - EXPECT_EQ("VAV CBP GAS REHEAT AT", sd_airterminal(2).SysName); // VAV HeatCool Reheat Name - EXPECT_TRUE(sd_airterminal(2).ZoneTurndownMinAirFracSchExist); // turndown schdule exists - EXPECT_EQ(sd_airterminal(2).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 - EXPECT_EQ(sd_airterminal(2).ZoneMinAirFracDes, 0.20); // design minimum flow fraction + EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", state.dataSingleDuct->sd_airterminal(2).SysType); // VAV HeatCool Reheat Type + EXPECT_EQ("VAV CBP GAS REHEAT AT", state.dataSingleDuct->sd_airterminal(2).SysName); // VAV HeatCool Reheat Name + EXPECT_TRUE(state.dataSingleDuct->sd_airterminal(2).ZoneTurndownMinAirFracSchExist); // turndown schdule exists + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(2).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(2).ZoneMinAirFracDes, 0.20); // design minimum flow fraction // VAV No reheat get input test - EXPECT_EQ("AirTerminal:SingleDuct:VAV:NoReheat", sd_airterminal(3).SysType); // VAV No Reheat Type - EXPECT_EQ("VAV NO REHEAT AT", sd_airterminal(3).SysName); // VAV No Reheat Name - EXPECT_TRUE(sd_airterminal(3).ZoneTurndownMinAirFracSchExist); // turndown schdule exists - EXPECT_EQ(sd_airterminal(3).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 - EXPECT_EQ(sd_airterminal(3).ZoneMinAirFracDes, 0.25); // design minimum flow fraction + EXPECT_EQ("AirTerminal:SingleDuct:VAV:NoReheat", state.dataSingleDuct->sd_airterminal(3).SysType); // VAV No Reheat Type + EXPECT_EQ("VAV NO REHEAT AT", state.dataSingleDuct->sd_airterminal(3).SysName); // VAV No Reheat Name + EXPECT_TRUE(state.dataSingleDuct->sd_airterminal(3).ZoneTurndownMinAirFracSchExist); // turndown schdule exists + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(3).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(3).ZoneMinAirFracDes, 0.25); // design minimum flow fraction // VAV change over bypass no reheat get input test - EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat", sd_airterminal(4).SysType); // VAV HeatCool NoReheat Type - EXPECT_EQ("VAV CBP NOREHEAT AT", sd_airterminal(4).SysName); // VAV HeatCool NoReheat Name - EXPECT_TRUE(sd_airterminal(4).ZoneTurndownMinAirFracSchExist); // turndown schdule exists - EXPECT_EQ(sd_airterminal(4).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 - EXPECT_EQ(sd_airterminal(4).ZoneMinAirFracDes, 0.15); // design minimum flow fraction + EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat", state.dataSingleDuct->sd_airterminal(4).SysType); // VAV HeatCool NoReheat Type + EXPECT_EQ("VAV CBP NOREHEAT AT", state.dataSingleDuct->sd_airterminal(4).SysName); // VAV HeatCool NoReheat Name + EXPECT_TRUE(state.dataSingleDuct->sd_airterminal(4).ZoneTurndownMinAirFracSchExist); // turndown schdule exists + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(4).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(4).ZoneMinAirFracDes, 0.15); // design minimum flow fraction // VAV reheat variable speed fan get input test - EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", sd_airterminal(5).SysType); // VAV Reheat VSFan Type - EXPECT_EQ("VAV REHEAT VS FAN", sd_airterminal(5).SysName); // VAV Reheat VSFan Name - EXPECT_TRUE(sd_airterminal(5).ZoneTurndownMinAirFracSchExist); // turndown schdule exists - EXPECT_EQ(sd_airterminal(5).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 - EXPECT_EQ(sd_airterminal(5).ZoneMinAirFracDes, 0.10); // design minimum flow fraction + EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", state.dataSingleDuct->sd_airterminal(5).SysType); // VAV Reheat VSFan Type + EXPECT_EQ("VAV REHEAT VS FAN", state.dataSingleDuct->sd_airterminal(5).SysName); // VAV Reheat VSFan Name + EXPECT_TRUE(state.dataSingleDuct->sd_airterminal(5).ZoneTurndownMinAirFracSchExist); // turndown schdule exists + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(5).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(5).ZoneMinAirFracDes, 0.10); // design minimum flow fraction } TEST_F(EnergyPlusFixture, SingleDuctVAVReheatAirTerminal_MinFlowTurnDownTest) @@ -1040,12 +1040,12 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatAirTerminal_MinFlowTurnDownTest) SingleDuct::GetSysInput(state); EXPECT_TRUE(compare_err_stream("")); // check VAV reheat air terminal inputs - EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat", sd_airterminal(SysNum).SysType); // VAV Reheat Type - EXPECT_EQ("VAV REHEAT AT", sd_airterminal(SysNum).SysName); // VAV Reheat Name - EXPECT_TRUE(sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist); // turndown schdule exists - EXPECT_EQ(sd_airterminal(SysNum).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 - EXPECT_EQ(sd_airterminal(SysNum).ZoneMinAirFracDes, 0.3); // input from VAV reheat air terminal - EXPECT_EQ(sd_airterminal(SysNum).MaxAirVolFlowRate, 1.0); // input from VAV reheat air terminal + EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat", state.dataSingleDuct->sd_airterminal(SysNum).SysType); // VAV Reheat Type + EXPECT_EQ("VAV REHEAT AT", state.dataSingleDuct->sd_airterminal(SysNum).SysName); // VAV Reheat Name + EXPECT_TRUE(state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist); // turndown schdule exists + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes, 0.3); // input from VAV reheat air terminal + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate, 1.0); // input from VAV reheat air terminal // calculate mass flow rates Real64 SysMinMassFlowRes = 1.0 * DataEnvironment::StdRhoAir * 0.30 * 1.0; // min flow rate at 1.0 turndown fraction @@ -1053,51 +1053,51 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatAirTerminal_MinFlowTurnDownTest) // test with heating load and turndown fraction schedule value set 1.0 DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = 2000.0; - SingleDuct::sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 1; // + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 1; // DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlowRes; state.dataGlobal->BeginEnvrnFlag = true; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); // check inputs and calculated values for turndown fraction set to 1.0 - EXPECT_EQ(0.3, sd_airterminal(SysNum).ZoneMinAirFracDes); - EXPECT_EQ(1.0, sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.3, sd_airterminal(SysNum).ZoneMinAirFracDes * sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.3, sd_airterminal(SysNum).ZoneMinAirFrac); - EXPECT_EQ(SysMaxMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(0.3, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); + EXPECT_EQ(1.0, state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.3, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.3, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(SysMaxMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); EXPECT_EQ(SysMinMassFlowRes, - SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFracDes * - sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); // test with heating load and turndown fraction schedule value set 0.5 - SingleDuct::sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 2; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 2; SysMinMassFlowRes = 1.0 * DataEnvironment::StdRhoAir * 0.30 * 0.5; // min flow rate at 0.5 turndown fraction DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlowRes; state.dataGlobal->BeginEnvrnFlag = true; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); // check inputs and calculated values for turndown fraction set to 0.5 - EXPECT_EQ(0.3, sd_airterminal(SysNum).ZoneMinAirFracDes); - EXPECT_EQ(0.5, sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.15, sd_airterminal(SysNum).ZoneMinAirFracDes * sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.15, sd_airterminal(SysNum).ZoneMinAirFrac); - EXPECT_EQ(SysMaxMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(0.3, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); + EXPECT_EQ(0.5, state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.15, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.15, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(SysMaxMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); EXPECT_EQ(SysMinMassFlowRes, - SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFracDes * - sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); } TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFanAirTerminal_MinFlowTurnDownTest) @@ -1245,12 +1245,12 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFanAirTerminal_MinFlowTurnDownTes SingleDuct::GetSysInput(state); EXPECT_TRUE(compare_err_stream("")); // check VAV reheat air terminal inputs - EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", sd_airterminal(SysNum).SysType); // VAV Reheat Type - EXPECT_EQ("VAV REHEAT VS FAN AT", sd_airterminal(SysNum).SysName); // VAV Reheat Name - EXPECT_TRUE(sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist); // turndown schdule exists - EXPECT_EQ(sd_airterminal(SysNum).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 - EXPECT_EQ(sd_airterminal(SysNum).ZoneMinAirFracDes, 0.1); // input from VAV reheat air terminal - EXPECT_EQ(sd_airterminal(SysNum).MaxAirVolFlowRate, 1.0); // input from VAV reheat air terminal + EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", state.dataSingleDuct->sd_airterminal(SysNum).SysType); // VAV Reheat Type + EXPECT_EQ("VAV REHEAT VS FAN AT", state.dataSingleDuct->sd_airterminal(SysNum).SysName); // VAV Reheat Name + EXPECT_TRUE(state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist); // turndown schdule exists + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes, 0.1); // input from VAV reheat air terminal + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate, 1.0); // input from VAV reheat air terminal // calculate mass flow rates Real64 SysMinMassFlowRes = 1.0 * DataEnvironment::StdRhoAir * 0.10 * 1.0; // min flow rate at 1.0 turndown fraction @@ -1258,51 +1258,51 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFanAirTerminal_MinFlowTurnDownTes // test with heating load and turndown fraction schedule value set 1.0 DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = 2000.0; - SingleDuct::sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 1; // + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 1; // DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlowRes; state.dataGlobal->BeginEnvrnFlag = true; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); // check inputs and calculated values for turndown fraction set to 1.0 - EXPECT_EQ(0.1, sd_airterminal(SysNum).ZoneMinAirFracDes); - EXPECT_EQ(1.0, sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.1, sd_airterminal(SysNum).ZoneMinAirFracDes * sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.1, sd_airterminal(SysNum).ZoneMinAirFrac); - EXPECT_EQ(SysMaxMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(0.1, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); + EXPECT_EQ(1.0, state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.1, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.1, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(SysMaxMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); EXPECT_EQ(SysMinMassFlowRes, - SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFracDes * - sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); // test with heating load and turndown fraction schedule value set 0.5 - SingleDuct::sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 2; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 2; SysMinMassFlowRes = 1.0 * DataEnvironment::StdRhoAir * 0.10 * 0.5; // min flow rate at 0.5 turndown fraction DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlowRes; state.dataGlobal->BeginEnvrnFlag = true; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); // check inputs and calculated values for turndown fraction set to 0.5 - EXPECT_EQ(0.1, sd_airterminal(SysNum).ZoneMinAirFracDes); - EXPECT_EQ(0.5, sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.05, sd_airterminal(SysNum).ZoneMinAirFracDes * sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.05, sd_airterminal(SysNum).ZoneMinAirFrac); - EXPECT_EQ(SysMaxMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(0.1, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); + EXPECT_EQ(0.5, state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.05, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.05, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(SysMaxMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); EXPECT_EQ(SysMinMassFlowRes, - SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFracDes * - sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); } TEST_F(EnergyPlusFixture, SingleDuctVAVHeatCoolReheatAirTerminal_MinFlowTurnDownTest) @@ -1417,12 +1417,12 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVHeatCoolReheatAirTerminal_MinFlowTurnDown SingleDuct::GetSysInput(state); EXPECT_TRUE(compare_err_stream("")); // check VAV heatcool reheat air terminal inputs - EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", sd_airterminal(SysNum).SysType); // VAV HeatCool Reheat Type - EXPECT_EQ("VAV CBP GAS REHEAT AT", sd_airterminal(SysNum).SysName); // VAV HeatCool Reheat Name - EXPECT_TRUE(sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist); // turndown schdule exists - EXPECT_EQ(sd_airterminal(SysNum).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 - EXPECT_EQ(sd_airterminal(SysNum).ZoneMinAirFracDes, 0.2); // input from VAV HeatCool reheat air terminal - EXPECT_EQ(sd_airterminal(SysNum).MaxAirVolFlowRate, 1.0); // input from VAV HeatCool reheat air terminal + EXPECT_EQ("AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat", state.dataSingleDuct->sd_airterminal(SysNum).SysType); // VAV HeatCool Reheat Type + EXPECT_EQ("VAV CBP GAS REHEAT AT", state.dataSingleDuct->sd_airterminal(SysNum).SysName); // VAV HeatCool Reheat Name + EXPECT_TRUE(state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchExist); // turndown schdule exists + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac, 1.0); // initialized to 1.0 + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes, 0.2); // input from VAV HeatCool reheat air terminal + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate, 1.0); // input from VAV HeatCool reheat air terminal // calculate mass flow rates Real64 SysMinMassFlowRes = 1.0 * DataEnvironment::StdRhoAir * 0.20 * 1.0; // min flow rate at 1.0 turndown fraction @@ -1430,51 +1430,51 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVHeatCoolReheatAirTerminal_MinFlowTurnDown // test with heating load and turndown fraction schedule value set 1.0 DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = 2000.0; - SingleDuct::sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 1; // + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 1; // DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlowRes; state.dataGlobal->BeginEnvrnFlag = true; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); // check inputs and calculated values for turndown fraction set to 1.0 - EXPECT_EQ(0.2, sd_airterminal(SysNum).ZoneMinAirFracDes); - EXPECT_EQ(1.0, sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.2, sd_airterminal(SysNum).ZoneMinAirFracDes * sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.2, sd_airterminal(SysNum).ZoneMinAirFrac); - EXPECT_EQ(SysMaxMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(0.2, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); + EXPECT_EQ(1.0, state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.2, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.2, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(SysMaxMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); EXPECT_EQ(SysMinMassFlowRes, - SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFracDes * - sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); // test with heating load and turndown fraction schedule value set 0.5 - SingleDuct::sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 2; + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFracSchPtr = 2; SysMinMassFlowRes = 1.0 * DataEnvironment::StdRhoAir * 0.20 * 0.5; // min flow rate at 0.5 turndown fraction DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlowRes; state.dataGlobal->BeginEnvrnFlag = true; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); // check inputs and calculated values for turndown fraction set to 0.5 - EXPECT_EQ(0.2, sd_airterminal(SysNum).ZoneMinAirFracDes); - EXPECT_EQ(0.5, sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.1, sd_airterminal(SysNum).ZoneMinAirFracDes * sd_airterminal(SysNum).ZoneTurndownMinAirFrac); - EXPECT_EQ(0.1, sd_airterminal(SysNum).ZoneMinAirFrac); - EXPECT_EQ(SysMaxMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); - EXPECT_EQ(SysMinMassFlowRes, SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(0.2, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); + EXPECT_EQ(0.5, state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.1, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + EXPECT_EQ(0.1, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); + EXPECT_EQ(SysMaxMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(SysMinMassFlowRes, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFrac); EXPECT_EQ(SysMinMassFlowRes, - SingleDuct::sd_airterminal(SysNum).AirMassFlowRateMax * sd_airterminal(SysNum).ZoneMinAirFracDes * - sd_airterminal(SysNum).ZoneTurndownMinAirFrac); + state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax * state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes * + state.dataSingleDuct->sd_airterminal(SysNum).ZoneTurndownMinAirFrac); } TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFan_DamperPositionTest) @@ -1600,8 +1600,8 @@ TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFan_DamperPositionTest) SingleDuct::GetSysInput(state); EXPECT_TRUE(compare_err_stream("")); - auto &thisAirTerminal = SingleDuct::sd_airterminal(SysNum); - auto &thisAirTerminalOutlet = SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet; + auto &thisAirTerminal = state.dataSingleDuct->sd_airterminal(SysNum); + auto &thisAirTerminalOutlet = state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet; // check VAV reheat VS Fan air terminal inputs EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", thisAirTerminal.SysType); @@ -1744,7 +1744,7 @@ TEST_F(EnergyPlusFixture, VAVHeatCoolReheatAirTerminal_ZoneOAVolumeFlowRateTest) ZoneAirLoopEquipmentManager::GetZoneAirLoopEquipment(state); SingleDuct::GetSysInput(state); - auto &thisHeatCoolAT = SingleDuct::sd_airterminal(SysNum); + auto &thisHeatCoolAT = state.dataSingleDuct->sd_airterminal(SysNum); EXPECT_TRUE(compare_err_stream("")); // check VAV heatcool reheat air terminal inputs diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc index 766d2e28b12..91497a6ac16 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc @@ -161,12 +161,12 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_GetInput) GetZoneAirLoopEquipment(state); GetSysInput(state); - EXPECT_EQ("AirTerminal:SingleDuct:ConstantVolume:NoReheat", sd_airterminal(1).SysType); // AT SD constant volume no reheat object type - EXPECT_EQ("SDCVNOREHEATAT1", sd_airterminal(1).SysName); // AT SD constant volume no reheat name - EXPECT_EQ("AVAILSCHEDULE", sd_airterminal(1).Schedule); // AT SD constant volume no reheat availability schedule name - EXPECT_EQ(0.50, sd_airterminal(1).MaxAirVolFlowRate); // maximum volume flow Rate - ASSERT_TRUE(sd_airterminal(1).NoOAFlowInputFromUser); // no OA flow input from user - EXPECT_EQ(DataZoneEquipment::PerPersonDCVByCurrentLevel, sd_airterminal(1).OAPerPersonMode); // default value when A6 input field is blank + EXPECT_EQ("AirTerminal:SingleDuct:ConstantVolume:NoReheat", state.dataSingleDuct->sd_airterminal(1).SysType); // AT SD constant volume no reheat object type + EXPECT_EQ("SDCVNOREHEATAT1", state.dataSingleDuct->sd_airterminal(1).SysName); // AT SD constant volume no reheat name + EXPECT_EQ("AVAILSCHEDULE", state.dataSingleDuct->sd_airterminal(1).Schedule); // AT SD constant volume no reheat availability schedule name + EXPECT_EQ(0.50, state.dataSingleDuct->sd_airterminal(1).MaxAirVolFlowRate); // maximum volume flow Rate + ASSERT_TRUE(state.dataSingleDuct->sd_airterminal(1).NoOAFlowInputFromUser); // no OA flow input from user + EXPECT_EQ(DataZoneEquipment::PerPersonDCVByCurrentLevel, state.dataSingleDuct->sd_airterminal(1).OAPerPersonMode); // default value when A6 input field is blank } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_SimConstVolNoReheat) @@ -242,13 +242,13 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_SimConstVolNoReheat) GetSysInput(state); DataEnvironment::StdRhoAir = 1.0; int const SysNum(1); - Real64 MassFlowRateMaxAvail = sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; - sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate = MassFlowRateMaxAvail; - Schedule(sd_airterminal(SysNum).SchedPtr).CurrentValue = 1.0; // unit is always available + Real64 MassFlowRateMaxAvail = state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; + state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate = MassFlowRateMaxAvail; + Schedule(state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr).CurrentValue = 1.0; // unit is always available // run SimConstVolNoReheat() function - sd_airterminal(SysNum).SimConstVolNoReheat(); + state.dataSingleDuct->sd_airterminal(SysNum).SimConstVolNoReheat(); // check the TA outlet air mass flow rate - EXPECT_EQ(MassFlowRateMaxAvail, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(MassFlowRateMaxAvail, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_Sim) @@ -330,14 +330,14 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_Sim) DataEnvironment::OutBaroPress = 101325.0; int const SysNum(1); - int const InletNode = sd_airterminal(SysNum).InletNodeNum; - int const ZonePtr = sd_airterminal(SysNum).ActualZoneNum; + int const InletNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + int const ZonePtr = state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum; int const ZoneAirNodeNum = ZoneEquipConfig(ZonePtr).ZoneNode; - Schedule(sd_airterminal(SysNum).SchedPtr).CurrentValue = 1.0; // unit is always available + Schedule(state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr).CurrentValue = 1.0; // unit is always available // design maximum air mass flow rate - Real64 MassFlowRateMaxAvail = sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; - EXPECT_EQ(1.0, sd_airterminal(SysNum).MaxAirVolFlowRate); + Real64 MassFlowRateMaxAvail = state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; + EXPECT_EQ(1.0, state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate); EXPECT_EQ(1.0, MassFlowRateMaxAvail); // set air inlet node properties @@ -353,14 +353,14 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_Sim) // set inlet mass flow rate to zero Node(InletNode).MassFlowRateMaxAvail = 0.0; FirstHVACIteration = true; - SingleDuct::GetInputFlag = false; + state.dataSingleDuct->GetInputFlag = false; // run SimulateSingleDuct(state, ) function SimulateSingleDuct(state, AirDistUnit(1).EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, AirDistUnit(1).EquipIndex(1)); // check AT air mass flow rates - EXPECT_EQ(MassFlowRateMaxAvail, sd_airterminal(SysNum).AirMassFlowRateMax); // design maximum mass flow rate - EXPECT_EQ(0.0, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRateMaxAvail); // maximum available mass flow rate - EXPECT_EQ(0.0, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); // outlet mass flow rate is zero - EXPECT_EQ(0.0, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // outlet mass flow rate is zero + EXPECT_EQ(MassFlowRateMaxAvail, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax); // design maximum mass flow rate + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRateMaxAvail); // maximum available mass flow rate + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); // outlet mass flow rate is zero + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // outlet mass flow rate is zero FirstHVACIteration = false; Node(InletNode).MassFlowRateMaxAvail = MassFlowRateMaxAvail; @@ -368,13 +368,13 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_Sim) // run SimulateSingleDuct(state, ) function SimulateSingleDuct(state, AirDistUnit(1).EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, AirDistUnit(1).EquipIndex(1)); // check AT air mass flow rates - EXPECT_EQ(MassFlowRateMaxAvail, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); - EXPECT_EQ(MassFlowRateMaxAvail, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(MassFlowRateMaxAvail, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); + EXPECT_EQ(MassFlowRateMaxAvail, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // outlet and inlet nodes air conditions must match exactly - EXPECT_EQ(sd_airterminal(SysNum).sd_airterminalOutlet.AirTemp, sd_airterminal(SysNum).sd_airterminalInlet.AirTemp); - EXPECT_EQ(sd_airterminal(SysNum).sd_airterminalOutlet.AirHumRat, sd_airterminal(SysNum).sd_airterminalInlet.AirHumRat); - EXPECT_EQ(sd_airterminal(SysNum).sd_airterminalOutlet.AirEnthalpy, sd_airterminal(SysNum).sd_airterminalInlet.AirEnthalpy); - EXPECT_EQ(sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirTemp, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirTemp); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirHumRat, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirHumRat); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirEnthalpy, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirEnthalpy); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OASpecification) @@ -506,13 +506,13 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OASpecification) DataEnvironment::OutBaroPress = 101325.0; int const SysNum(1); - int const InletNode = sd_airterminal(SysNum).InletNodeNum; - int const ZonePtr = sd_airterminal(SysNum).ActualZoneNum; + int const InletNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + int const ZonePtr = state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum; int const ZoneAirNodeNum = ZoneEquipConfig(ZonePtr).ZoneNode; // design maximum air mass flow rate - Real64 MassFlowRateMaxAvail = sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; - EXPECT_EQ(3.0, sd_airterminal(SysNum).MaxAirVolFlowRate); + Real64 MassFlowRateMaxAvail = state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; + EXPECT_EQ(3.0, state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate); EXPECT_EQ(3.0, MassFlowRateMaxAvail); // set air inlet node properties @@ -528,21 +528,21 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OASpecification) // set inlet mass flow rate to zero Node(InletNode).MassFlowRateMaxAvail = 0.0; FirstHVACIteration = true; - SingleDuct::GetInputFlag = false; + state.dataSingleDuct->GetInputFlag = false; // run SimulateSingleDuct(state, ) function SimulateSingleDuct(state, AirDistUnit(1).EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, AirDistUnit(1).EquipIndex(1)); // check AT air mass flow rates - EXPECT_EQ(MassFlowRateMaxAvail, sd_airterminal(SysNum).AirMassFlowRateMax); // design maximum mass flow rate - EXPECT_EQ(0.0, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRateMaxAvail); // maximum available mass flow rate - EXPECT_EQ(0.0, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); // outlet mass flow rate is zero - EXPECT_EQ(0.0, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // outlet mass flow rate is zero + EXPECT_EQ(MassFlowRateMaxAvail, state.dataSingleDuct->sd_airterminal(SysNum).AirMassFlowRateMax); // design maximum mass flow rate + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRateMaxAvail); // maximum available mass flow rate + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); // outlet mass flow rate is zero + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // outlet mass flow rate is zero state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; // Needs an airloop, assume 100% OA - sd_airterminal(SysNum).AirLoopNum = 1; + state.dataSingleDuct->sd_airterminal(SysNum).AirLoopNum = 1; state.dataAirLoop->AirLoopFlow.allocate(1); - state.dataAirLoop->AirLoopFlow(sd_airterminal(SysNum).AirLoopNum).OAFrac = 1.0; + state.dataAirLoop->AirLoopFlow(state.dataSingleDuct->sd_airterminal(SysNum).AirLoopNum).OAFrac = 1.0; Node(InletNode).MassFlowRateMaxAvail = MassFlowRateMaxAvail; EXPECT_EQ(3.0, MassFlowRateMaxAvail); @@ -562,8 +562,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OASpecification) // run SimulateSingleDuct() function SimulateSingleDuct(state, AirDistUnit(1).EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, AirDistUnit(1).EquipIndex(1)); // check AT air mass flow rates - EXPECT_EQ(expectedMassFlow, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); - EXPECT_EQ(expectedMassFlow, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(expectedMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); + EXPECT_EQ(expectedMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // 50% occupancy 1.5 people, OA/person = 0.1, OA/zone = 0.5, OA Sched = 1.0 state.dataGlobal->HourOfDay = 12; @@ -573,8 +573,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OASpecification) expectedMassFlow = 1.0 * ((1.5 * 0.1) + 0.5); SimulateSingleDuct(state, AirDistUnit(1).EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, AirDistUnit(1).EquipIndex(1)); // check AT air mass flow rates - EXPECT_EQ(expectedMassFlow, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); - EXPECT_EQ(expectedMassFlow, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(expectedMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); + EXPECT_EQ(expectedMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Nighttime OA Sched = 0.0 state.dataGlobal->HourOfDay = 24; @@ -584,8 +584,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OASpecification) expectedMassFlow = 0.0 * ((1.5 * 0.1) + 0.5); SimulateSingleDuct(state, AirDistUnit(1).EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, AirDistUnit(1).EquipIndex(1)); // check AT air mass flow rates - EXPECT_EQ(expectedMassFlow, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); - EXPECT_EQ(expectedMassFlow, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(expectedMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); + EXPECT_EQ(expectedMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_EMSOverrideAirFlow) @@ -667,13 +667,13 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_EMSOverrideAirFlow) DataEnvironment::OutBaroPress = 101325.0; int const SysNum(1); - int const InletNode = sd_airterminal(SysNum).InletNodeNum; - int const ZonePtr = sd_airterminal(SysNum).ActualZoneNum; + int const InletNode = state.dataSingleDuct->sd_airterminal(SysNum).InletNodeNum; + int const ZonePtr = state.dataSingleDuct->sd_airterminal(SysNum).ActualZoneNum; int const ZoneAirNodeNum = ZoneEquipConfig(ZonePtr).ZoneNode; - Schedule(sd_airterminal(SysNum).SchedPtr).CurrentValue = 1.0; // unit is always available + Schedule(state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr).CurrentValue = 1.0; // unit is always available // design maximum air mass flow rate - Real64 MassFlowRateMaxAvail = sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; - EXPECT_EQ(1.0, sd_airterminal(SysNum).MaxAirVolFlowRate); + Real64 MassFlowRateMaxAvail = state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate * DataEnvironment::StdRhoAir; + EXPECT_EQ(1.0, state.dataSingleDuct->sd_airterminal(SysNum).MaxAirVolFlowRate); EXPECT_EQ(1.0, MassFlowRateMaxAvail); // set air inlet node properties @@ -686,28 +686,28 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_EMSOverrideAirFlow) Node(ZoneAirNodeNum).HumRat = 0.0075; Node(ZoneAirNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(ZoneAirNodeNum).Temp, Node(ZoneAirNodeNum).HumRat); ; - SingleDuct::GetInputFlag = false; + state.dataSingleDuct->GetInputFlag = false; FirstHVACIteration = false; Node(InletNode).MassFlowRateMaxAvail = MassFlowRateMaxAvail; EXPECT_EQ(1.0, MassFlowRateMaxAvail); // run SimulateSingleDuct(state, ) function SimulateSingleDuct(state, AirDistUnit(1).EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, AirDistUnit(1).EquipIndex(1)); // check AT air mass flow rates - EXPECT_EQ(MassFlowRateMaxAvail, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); - EXPECT_EQ(MassFlowRateMaxAvail, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(MassFlowRateMaxAvail, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); + EXPECT_EQ(MassFlowRateMaxAvail, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // outlet and inlet nodes air conditions must match exactly - EXPECT_EQ(sd_airterminal(SysNum).sd_airterminalOutlet.AirTemp, sd_airterminal(SysNum).sd_airterminalInlet.AirTemp); - EXPECT_EQ(sd_airterminal(SysNum).sd_airterminalOutlet.AirHumRat, sd_airterminal(SysNum).sd_airterminalInlet.AirHumRat); - EXPECT_EQ(sd_airterminal(SysNum).sd_airterminalOutlet.AirEnthalpy, sd_airterminal(SysNum).sd_airterminalInlet.AirEnthalpy); - EXPECT_EQ(sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirTemp, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirTemp); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirHumRat, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirHumRat); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirEnthalpy, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirEnthalpy); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); // sets EMS actuators - sd_airterminal(SysNum).EMSOverrideAirFlow = true; - sd_airterminal(SysNum).EMSMassFlowRateValue = 0.5; + state.dataSingleDuct->sd_airterminal(SysNum).EMSOverrideAirFlow = true; + state.dataSingleDuct->sd_airterminal(SysNum).EMSMassFlowRateValue = 0.5; // run SimulateSingleDuct(state, ) function SimulateSingleDuct(state, AirDistUnit(1).EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, AirDistUnit(1).EquipIndex(1)); // check AT air mass flow rates - EXPECT_EQ(sd_airterminal(SysNum).EMSMassFlowRateValue, sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); - EXPECT_EQ(sd_airterminal(SysNum).EMSMassFlowRateValue, sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).EMSMassFlowRateValue, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalInlet.AirMassFlowRate); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(SysNum).EMSMassFlowRateValue, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OAVolumeFlowRateReporting) @@ -842,7 +842,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OAVolumeFlowRateReport state.dataAirLoop->AirLoopFlow.allocate(1); int const SysNum(1); - auto &thisAirTerminal = SingleDuct::sd_airterminal(SysNum); + auto &thisAirTerminal = state.dataSingleDuct->sd_airterminal(SysNum); auto &thisAirTerminalInlet = thisAirTerminal.sd_airterminalInlet; auto &thisAirTerminalOutlet = thisAirTerminal.sd_airterminalOutlet; auto &thisAirDisUnit = AirDistUnit(1); @@ -872,7 +872,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_OAVolumeFlowRateReport // set inlet mass flow rate to zero Node(InletNode).MassFlowRateMaxAvail = 0.0; FirstHVACIteration = true; - SingleDuct::GetInputFlag = false; + state.dataSingleDuct->GetInputFlag = false; // run SimulateSingleDuct(state, ) function SimulateSingleDuct(state, thisAirDisUnit.EquipName(1), FirstHVACIteration, ZonePtr, ZoneAirNodeNum, thisAirDisUnit.EquipIndex(1)); // check AT air mass flow rates @@ -1018,7 +1018,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_SimSensibleOutPutTest) int const AirDistUnitNum(1); int const AirTerminalNum(1); - auto &thisAirTerminal(SingleDuct::sd_airterminal(AirTerminalNum)); + auto &thisAirTerminal(state.dataSingleDuct->sd_airterminal(AirTerminalNum)); int const InletNode = thisAirTerminal.InletNodeNum; int const OutletNode = thisAirTerminal.OutletNodeNum; @@ -1048,7 +1048,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_SimSensibleOutPutTest) Node(InletNode).MassFlowRate = 0.0; Node(InletNode).MassFlowRateMaxAvail = 0.0; FirstHVACIteration = true; - SingleDuct::GetInputFlag = false; + state.dataSingleDuct->GetInputFlag = false; Real64 SysOutputProvided = 0.0; Real64 NonAirSysOutput = 0.0; Real64 LatOutputProvided = 0.0; diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc index 9379009c988..e796ddde571 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc @@ -356,9 +356,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_GetInputPTAC_InletSide) GetZoneAirLoopEquipment(state); GetPTUnit(state); - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("ZoneHVAC:PackagedTerminalAirConditioner", PTUnit(1).UnitType); // zoneHVAC equipment type } @@ -608,9 +608,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTAC_ATMInletSide) GetPTUnitInputFlag = false; // get input test for terminal air single duct mixer on inlet side of PTAC - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("ZoneHVAC:PackagedTerminalAirConditioner", PTUnit(1).UnitType); // zoneHVAC equipment type @@ -663,9 +663,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTAC_ATMInletSide) Node(PTUnit(PTUnitNum).ATMixerPriNode).Enthalpy = DataEnvironment::OutEnthalpy; // set secondary air (recirculating air) conditions to zone air node - Node(SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; - Node(SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; - Node(SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; PTUnit(1).ControlZoneNum = 1; SysSizingRunDone = true; @@ -681,13 +681,13 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTAC_ATMInletSide) Schedule(PTUnit(PTUnitNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // simulate PTAC zoneHVAC equipment SimPTUnit(state, PTUnitNum, ZoneNum, FirstHVACIteration, QUnitOut, OnOffAirFlowRatio, QZnReq, LatOutputProvided); // apply mass conservation to determine secondary air mass flow rate SecondaryAirMassFlowRate = Node(PTUnit(PTUnitNum).AirInNode).MassFlowRate - PrimaryAirMassFlowRate; // check the terminal air mixer secondary air mass flow rate - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOut, 2.0); } @@ -939,9 +939,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTAC_ATMSupplySide) GetPTUnitInputFlag = false; // get input test for terminal air single duct mixer on supply side of PTAC - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("ZoneHVAC:PackagedTerminalAirConditioner", PTUnit(1).UnitType); // zoneHVAC equipment type @@ -1012,16 +1012,16 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTAC_ATMSupplySide) Schedule(PTUnit(PTUnitNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // simulate PTAC zoneHVAC equipment SimPTUnit(state, PTUnitNum, ZoneNum, FirstHVACIteration, QUnitOut, OnOffAirFlowRatio, QZnReq, LatOutputProvided); // apply mass conservation to determine secondary mass flow rate - SecondaryAirMassFlowRate = Node(SysATMixer(1).SecInNode).MassFlowRate; + SecondaryAirMassFlowRate = Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate; // check the terminal air mixer secondary air mass flow rate - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the terminal air mixer outlet air mass flow rate ATMixerOutletMassFlowRate = SecondaryAirMassFlowRate + PrimaryAirMassFlowRate; - ASSERT_EQ(ATMixerOutletMassFlowRate, SysATMixer(1).MixedAirMassFlowRate); + ASSERT_EQ(ATMixerOutletMassFlowRate, state.dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOut, 2.0); } @@ -1353,9 +1353,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTHP_ATMInletSide) GetPTUnitInputFlag = false; // get input test for terminal air single duct mixer on inlet side of PTHP - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("ZoneHVAC:PackagedTerminalHeatPump", PTUnit(1).UnitType); // zoneHVAC equipment type @@ -1408,9 +1408,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTHP_ATMInletSide) Node(PTUnit(PTUnitNum).ATMixerPriNode).Enthalpy = DataEnvironment::OutEnthalpy; // set secondary air (recirculating air) conditions to zone air node - Node(SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; - Node(SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; - Node(SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; PTUnit(1).ControlZoneNum = 1; SysSizingRunDone = true; @@ -1426,13 +1426,13 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTHP_ATMInletSide) Schedule(PTUnit(PTUnitNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // simulate PTHP zoneHVAC equipment SimPTUnit(state, PTUnitNum, ZoneNum, FirstHVACIteration, QUnitOut, OnOffAirFlowRatio, QZnReq, LatOutputProvided); // apply mass conservation to determine secondary air mass flow rate SecondaryAirMassFlowRate = Node(PTUnit(PTUnitNum).AirInNode).MassFlowRate - PrimaryAirMassFlowRate; // check the terminal air mixer secondary air mass flow rate - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOut, 2.0); } @@ -1766,9 +1766,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTHP_ATMSupplySide) GetPTUnitInputFlag = false; // get input test for terminal air single duct mixer on supply side of PTHP - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("ZoneHVAC:PackagedTerminalHeatPump", PTUnit(1).UnitType); // zoneHVAC equipment type @@ -1839,16 +1839,16 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTHP_ATMSupplySide) Schedule(PTUnit(PTUnitNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // simulate PTHP zoneHVAC equipment SimPTUnit(state, PTUnitNum, ZoneNum, FirstHVACIteration, QUnitOut, OnOffAirFlowRatio, QZnReq, LatOutputProvided); // apply mass conservation to determine secondary mass flow rate - SecondaryAirMassFlowRate = Node(SysATMixer(1).SecInNode).MassFlowRate; + SecondaryAirMassFlowRate = Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate; // check the terminal air mixer secondary air mass flow rate - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the terminal air mixer outlet air mass flow rate ATMixerOutletMassFlowRate = SecondaryAirMassFlowRate + PrimaryAirMassFlowRate; - ASSERT_EQ(ATMixerOutletMassFlowRate, SysATMixer(1).MixedAirMassFlowRate); + ASSERT_EQ(ATMixerOutletMassFlowRate, state.dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOut, 2.0); } @@ -2439,9 +2439,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRF_ATMInletSide) GetVRFInputFlag = false; // get input test for terminal air single duct mixer on inlet side of VRF terminal unit - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("TU1", VRFTU(1).Name); // zoneHVAC equipment name // EXPECT_EQ( "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow", VRFTU( 1 ).Name ); // zoneHVAC equipment type @@ -2502,9 +2502,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRF_ATMInletSide) Node(VRFTU(VRFTUNum).ATMixerPriNode).Enthalpy = DataEnvironment::OutEnthalpy; // set secondary air (recirculating air) conditions to zone air node - Node(SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; - Node(SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; - Node(SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; VRFTU(1).ZoneNum = 1; SysSizingRunDone = true; @@ -2520,13 +2520,13 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRF_ATMInletSide) Schedule(VRFTU(VRFTUNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // Simulate zoneHVAC equipment (VRF terminal unit) SimVRF(state, VRFTUNum, FirstHVACIteration, OnOffAirFlowRatio, QUnitOutVRFTU, LatOutputProvided, QZnReq); // check the terminal air mixer secondary air mass flow rate - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the terminal air mixer outlet flow rate must be equal to VRFTU mass flow rate - ASSERT_EQ(HVACInletMassFlowRate, SysATMixer(1).MixedAirMassFlowRate); + ASSERT_EQ(HVACInletMassFlowRate, state.dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 2.0); } @@ -3118,9 +3118,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRF_ATMSupplySide) GetVRFInputFlag = false; // get input test for terminal air single duct mixer on inlet side of VRF terminal unit - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("TU1", VRFTU(1).Name); // zoneHVAC equipment name @@ -3196,15 +3196,15 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRF_ATMSupplySide) Schedule(VRFTU(VRFTUNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // simulate zoneHVAC equipment (VRF terminal unit) SimVRF(state, VRFTUNum, FirstHVACIteration, OnOffAirFlowRatio, QUnitOutVRFTU, LatOutputProvided, QZnReq); // check the terminal air mixer secondary air mass flow rate - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the terminal air mixer outlet air mass flow rate ATMixerOutletMassFlowRate = SecondaryAirMassFlowRate + PrimaryAirMassFlowRate; - ASSERT_EQ(ATMixerOutletMassFlowRate, SysATMixer(1).MixedAirMassFlowRate); + ASSERT_EQ(ATMixerOutletMassFlowRate, state.dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 4.0); } @@ -4868,9 +4868,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMInletSi GetVRFInputFlag = false; // get input test for terminal air single duct mixer on inlet side of VRF terminal unit - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("TU1", VRFTU(1).Name); // zoneHVAC equipment name @@ -4930,9 +4930,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMInletSi Node(VRFTU(VRFTUNum).ATMixerPriNode).Enthalpy = DataEnvironment::OutEnthalpy; // set secondary air (recirculating air) conditions to zone air node - Node(SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; - Node(SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; - Node(SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; VRFTU(1).ZoneNum = 1; SysSizingRunDone = true; @@ -4948,16 +4948,16 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMInletSi Schedule(VRFTU(VRFTUNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // Simulate zoneHVAC equipment (VRF terminal unit) SimVRF(state, VRFTUNum, FirstHVACIteration, OnOffAirFlowRatio, QUnitOutVRFTU, LatOutputProvided, QZnReq); // check the terminal air mixer secondary air mass flow rate, requires updating the secondary flow SecondaryAirMassFlowRate = Node(VRFTU(VRFTUNum).VRFTUInletNodeNum).MassFlowRate - PrimaryAirMassFlowRate; - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the terminal air mixer outlet flow rate must be equal to VRFTU mass flow rate HVACInletMassFlowRate = Node(VRFTU(VRFTUNum).VRFTUInletNodeNum).MassFlowRate; - ASSERT_EQ(HVACInletMassFlowRate, SysATMixer(1).MixedAirMassFlowRate); + ASSERT_EQ(HVACInletMassFlowRate, state.dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate); // check the cooling output delivered is within 5.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 5.0); } @@ -6622,9 +6622,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMSupplyS GetVRFInputFlag = false; // get input test for terminal air single duct mixer on supply side of VRF terminal unit - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type EXPECT_EQ("TU1", VRFTU(1).Name); // zoneHVAC equipment name @@ -6700,16 +6700,16 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMSupplyS Schedule(VRFTU(VRFTUNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // Simulate zoneHVAC equipment (VRF terminal unit) SimVRF(state, VRFTUNum, FirstHVACIteration, OnOffAirFlowRatio, QUnitOutVRFTU, LatOutputProvided, QZnReq); // check the terminal air mixer secondary air mass flow rate, requires updating the secondary flow SecondaryAirMassFlowRate = Node(VRFTU(VRFTUNum).VRFTUInletNodeNum).MassFlowRate; - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the terminal air mixer outlet flow rate must be equal to the mass flow rate of VRFTU + the primary air ATMixerOutletMassFlowRate = SecondaryAirMassFlowRate + PrimaryAirMassFlowRate; - ASSERT_EQ(ATMixerOutletMassFlowRate, SysATMixer(1).MixedAirMassFlowRate); + ASSERT_EQ(ATMixerOutletMassFlowRate, state.dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 2.0); } @@ -6868,9 +6868,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimUnitVent_ATMInletSide) state.dataUnitVentilators->GetUnitVentilatorInputFlag = false; // get input test for terminal air single duct mixer on inlet side of PTHP - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type state.dataGlobal->BeginEnvrnFlag = false; @@ -6919,9 +6919,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimUnitVent_ATMInletSide) Node(state.dataUnitVentilators->UnitVent(UnitVentNum).ATMixerPriNode).Enthalpy = DataEnvironment::OutEnthalpy; // set secondary air (recirculating air) conditions to zone air node - Node(SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; - Node(SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; - Node(SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Temp = Node(ZoneEquipConfig(1).ZoneNode).Temp; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).HumRat = Node(ZoneEquipConfig(1).ZoneNode).HumRat; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).Enthalpy = Node(ZoneEquipConfig(1).ZoneNode).Enthalpy; state.dataUnitVentilators->UnitVent(1).ZonePtr = 1; SysSizingRunDone = true; @@ -6939,13 +6939,13 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimUnitVent_ATMInletSide) Schedule(state.dataUnitVentilators->UnitVent(UnitVentNum).MinOASchedPtr).CurrentValue = 0.5; // min OA fraction is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // simulate Unit Ventilator zoneHVAC equipment SimUnitVentilator(state, state.dataUnitVentilators->UnitVent(UnitVentNum).Name, ZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided, UnitVentNum); // apply mass conservation to determine secondary air mass flow rate SecondaryAirMassFlowRate = Node(state.dataUnitVentilators->UnitVent(UnitVentNum).AirInNode).MassFlowRate - PrimaryAirMassFlowRate; // check the air mixer secondary air mass flow rate - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(state.dataUnitVentilators->QZnReq, QUnitOut, 0.001); } @@ -7105,9 +7105,9 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimUnitVent_ATMSupplySide) state.dataUnitVentilators->GetUnitVentilatorInputFlag = false; // get input test for terminal air single duct mixer on supply side of PTHP - ASSERT_EQ(1, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type // set input variables @@ -7176,16 +7176,16 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimUnitVent_ATMSupplySide) Schedule(state.dataUnitVentilators->UnitVent(UnitVentNum).MinOASchedPtr).CurrentValue = 0.5; // min OA fraction is always available // set secondary air mass flow rate to zero - Node(SysATMixer(1).SecInNode).MassFlowRate = 0.0; + Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; // simulate Unit Ventilator ZoneHVAC equipment SimUnitVentilator(state, state.dataUnitVentilators->UnitVent(UnitVentNum).Name, ZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided, UnitVentNum); // apply mass conservation to determine secondary mass flow rate - SecondaryAirMassFlowRate = Node(SysATMixer(1).SecInNode).MassFlowRate; + SecondaryAirMassFlowRate = Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate; // check the terminal air mixer secondary air mass flow rate - ASSERT_EQ(SecondaryAirMassFlowRate, Node(SysATMixer(1).SecInNode).MassFlowRate); + ASSERT_EQ(SecondaryAirMassFlowRate, Node(state.dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate); // check the air mixer outlet air mass flow rate ATMixerOutletMassFlowRate = SecondaryAirMassFlowRate + PrimaryAirMassFlowRate; - ASSERT_EQ(ATMixerOutletMassFlowRate, SysATMixer(1).MixedAirMassFlowRate); + ASSERT_EQ(ATMixerOutletMassFlowRate, state.dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate); // check the cooling output delivered is within 2.0 Watt of zone cooling load ASSERT_NEAR(QZnReq, QUnitOut, 0.001); } @@ -7345,18 +7345,18 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_GetInputDOASpecs) GetZoneAirLoopEquipment(state); GetATMixers(state); - ASSERT_EQ(2, NumATMixers); - EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", SysATMixer(1).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, SysATMixer(1).MixerType); // air terminal mixer connection type + ASSERT_EQ(2, state.dataSingleDuct->NumATMixers); + EXPECT_EQ("SPACE1-1 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(1).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, state.dataSingleDuct->SysATMixer(1).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type - EXPECT_EQ(1, SysATMixer(1).OARequirementsPtr); // design spec OA pointer - for both mixers this pointer should be 1 + EXPECT_EQ(1, state.dataSingleDuct->SysATMixer(1).OARequirementsPtr); // design spec OA pointer - for both mixers this pointer should be 1 - EXPECT_EQ("SPACE1-2 DOAS AIR TERMINAL", SysATMixer(2).Name); // single duct air terminal mixer name - EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, SysATMixer(2).MixerType); // air terminal mixer connection type + EXPECT_EQ("SPACE1-2 DOAS AIR TERMINAL", state.dataSingleDuct->SysATMixer(2).Name); // single duct air terminal mixer name + EXPECT_EQ(DataHVACGlobals::ATMixer_SupplySide, state.dataSingleDuct->SysATMixer(2).MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(2).EquipType(1)); // Air distribution unit equipment type // design spec OA pointer - for both mixers this pointer should be 1 // before the fix, this was 2 which later caused an array bounds error - EXPECT_EQ(1, SysATMixer(2).OARequirementsPtr); + EXPECT_EQ(1, state.dataSingleDuct->SysATMixer(2).OARequirementsPtr); } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) @@ -7544,11 +7544,11 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) GetFanCoilUnits(state); auto &thisFanCoil(FanCoil(1)); - auto &thisATMixer(SysATMixer(1)); + auto &thisATMixer(state.dataSingleDuct->SysATMixer(1)); auto &thisFan(Fan(1)); // get input test for terminal air single duct mixer on inlet side of PTAC - ASSERT_EQ(1, NumATMixers); + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); EXPECT_EQ("INLET SIDE MIXER", thisATMixer.Name); // single duct air terminal mixer name EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, thisATMixer.MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type @@ -7973,11 +7973,11 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) SystemAvailabilityManager::GetSysAvailManagerInputs(state); auto &thisFanCoil(FanCoil(1)); - auto &thisATMixer(SysATMixer(1)); + auto &thisATMixer(state.dataSingleDuct->SysATMixer(1)); auto &thisAvaiManager(state.dataSystemAvailabilityManager->NCycSysAvailMgrData(1)); // get input test for terminal air single duct mixer on inlet side of PTAC - ASSERT_EQ(1, NumATMixers); + ASSERT_EQ(1, state.dataSingleDuct->NumATMixers); EXPECT_EQ("INLET SIDE MIXER", thisATMixer.Name); // single duct air terminal mixer name EXPECT_EQ(DataHVACGlobals::ATMixer_InletSide, thisATMixer.MixerType); // air terminal mixer connection type EXPECT_EQ("AIRTERMINAL:SINGLEDUCT:MIXER", AirDistUnit(1).EquipType(1)); // Air distribution unit equipment type diff --git a/tst/EnergyPlus/unit/HVACControllers.unit.cc b/tst/EnergyPlus/unit/HVACControllers.unit.cc index 313fad74637..32dd1b0a9bc 100644 --- a/tst/EnergyPlus/unit/HVACControllers.unit.cc +++ b/tst/EnergyPlus/unit/HVACControllers.unit.cc @@ -132,15 +132,15 @@ TEST_F(EnergyPlusFixture, HVACControllers_ResetHumidityRatioCtrlVarType) GetSetPointManagerInputs(state); // check specified control variable type is "HumidityRatio" - ASSERT_EQ(iCtrlVarType_HumRat, AllSetPtMgr(1).CtrlTypeMode); + ASSERT_EQ(iCtrlVarType::HumRat, state.dataSetPointManager->AllSetPtMgr(1).CtrlTypeMode); GetControllerInput(state); // check control variable type in AllSetPtMgr is reset to "MaximumHumidityRatio" - ASSERT_EQ(iCtrlVarType_MaxHumRat, AllSetPtMgr(1).CtrlTypeMode); + ASSERT_EQ(iCtrlVarType::MaxHumRat, state.dataSetPointManager->AllSetPtMgr(1).CtrlTypeMode); // ControllerProps always expects the control variable type to be "HumididtyRatio" ControllerProps(1).HumRatCntrlType = GetHumidityRatioVariableType(state, ControllerProps(1).SensedNode); - ASSERT_EQ(iCtrlVarType_HumRat, ControllerProps(1).HumRatCntrlType); + ASSERT_EQ(iCtrlVarType::HumRat, ControllerProps(1).HumRatCntrlType); ASSERT_EQ(ControllerProps.size(), 1u); EXPECT_EQ(ControllerProps(1).MaxVolFlowActuated, DataSizing::AutoSize); @@ -204,15 +204,15 @@ TEST_F(EnergyPlusFixture, HVACControllers_TestTempAndHumidityRatioCtrlVarType) GetSetPointManagerInputs(state); // check specified control variable type is "HumidityRatio" - ASSERT_EQ(iCtrlVarType_MaxHumRat, AllSetPtMgr(1).CtrlTypeMode); + ASSERT_EQ(iCtrlVarType::MaxHumRat, state.dataSetPointManager->AllSetPtMgr(1).CtrlTypeMode); GetControllerInput(state); // check control variable type in AllSetPtMgr is reset to "MaximumHumidityRatio" - ASSERT_EQ(iCtrlVarType_MaxHumRat, AllSetPtMgr(1).CtrlTypeMode); + ASSERT_EQ(iCtrlVarType::MaxHumRat, state.dataSetPointManager->AllSetPtMgr(1).CtrlTypeMode); // ControllerProps expects the control variable type to be "MaximumHumididtyRatio" ControllerProps(1).HumRatCntrlType = GetHumidityRatioVariableType(state, ControllerProps(1).SensedNode); - ASSERT_EQ(iCtrlVarType_MaxHumRat, ControllerProps(1).HumRatCntrlType); + ASSERT_EQ(iCtrlVarType::MaxHumRat, ControllerProps(1).HumRatCntrlType); // test index for air loop controllers // before controllers are simulated, AirLoopControllerIndex = 0 @@ -348,16 +348,19 @@ TEST_F(EnergyPlusFixture, HVACControllers_SchSetPointMgrsOrderTest) GetSetPointManagerInputs(state); // There are two setpoint managers and are schedule type - ASSERT_EQ(2, NumSchSetPtMgrs); // 2 schedule set point managers - ASSERT_EQ(2, NumAllSetPtMgrs); // 2 all set point managers + ASSERT_EQ(2, state.dataSetPointManager->NumSchSetPtMgrs); // 2 schedule set point managers + ASSERT_EQ(2, state.dataSetPointManager->NumAllSetPtMgrs); // 2 all set point managers // check specified control variable types - ASSERT_EQ(iTemperature, AllSetPtMgr(1).CtrlTypeMode); // is "Temperature" - ASSERT_EQ(iCtrlVarType_MaxHumRat, AllSetPtMgr(2).CtrlTypeMode); // is "MaximumHumidityRatio" + // this was a bug waiting to happen, iTemperature is declared as its own int const in HVACControllers.hh + // and it just happened to have the same value as the iCtrlVarType_Temperature int const in SetPointManager.hh + // changing it to iCtrlVarType::Temp + ASSERT_EQ(iCtrlVarType::Temp, state.dataSetPointManager->AllSetPtMgr(1).CtrlTypeMode); // is "Temperature" + ASSERT_EQ(iCtrlVarType::MaxHumRat, state.dataSetPointManager->AllSetPtMgr(2).CtrlTypeMode); // is "MaximumHumidityRatio" GetControllerInput(state); // check ControllerProps control variable is set to "MaximumHumidityRatio" ControllerProps(1).HumRatCntrlType = GetHumidityRatioVariableType(state, ControllerProps(1).SensedNode); - ASSERT_EQ(iCtrlVarType_MaxHumRat, ControllerProps(1).HumRatCntrlType); // MaximumHumidityRatio + ASSERT_EQ(iCtrlVarType::MaxHumRat, ControllerProps(1).HumRatCntrlType); // MaximumHumidityRatio } TEST_F(EnergyPlusFixture, HVACControllers_WaterCoilOnPrimaryLoopCheckTest) diff --git a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc index 024e3287159..1d27c482a64 100644 --- a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc +++ b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc @@ -841,8 +841,8 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) { DataPlant::PlantLoop(1).OpScheme.allocate(1); DataPlant::PlantLoop(1).OpScheme(1).Name = "TEST PLANTOP SCHEME"; - SetPointManager::NumAllSetPtMgrs = 0; - SetPointManager::NumSchTESSetPtMgrs = 0; + state.dataSetPointManager->NumAllSetPtMgrs = 0; + state.dataSetPointManager->NumSchTESSetPtMgrs = 0; bool ErrorsFound = false; int TESSPBO = 1; @@ -893,7 +893,7 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) { } // We should now alos have two TES SPMs created, and that's all of them - EXPECT_EQ(SetPointManager::NumSchTESSetPtMgrs, 2); - EXPECT_EQ(SetPointManager::NumAllSetPtMgrs, 2); + EXPECT_EQ(state.dataSetPointManager->NumSchTESSetPtMgrs, 2); + EXPECT_EQ(state.dataSetPointManager->NumAllSetPtMgrs, 2); } diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 89b1ca152f4..1b7938e1a25 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -115,11 +115,11 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_WaterSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(2u, heatPumps.size()); + EXPECT_EQ(2u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[1]; - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate the heating side EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); @@ -146,9 +146,9 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_WaterSource) TEST_F(EnergyPlusFixture, PairingCompanionCoils) { - heatPumps.resize(2); - EIRPlantLoopHeatPump *coil1 = &heatPumps[0]; - EIRPlantLoopHeatPump *coil2 = &heatPumps[1]; + state.dataEIRPlantLoopHeatPump->heatPumps.resize(2); + EIRPlantLoopHeatPump *coil1 = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; + EIRPlantLoopHeatPump *coil2 = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; { // a successful try @@ -222,10 +222,10 @@ TEST_F(EnergyPlusFixture, HeatingConstructionFullObjectsNoCompanion) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate the heating side EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); @@ -270,10 +270,10 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullObjectsNoCompanion) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -318,10 +318,10 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullObjectWithDefaults) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -359,10 +359,10 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullyAutoSized_WaterSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -453,10 +453,10 @@ TEST_F(EnergyPlusFixture, Initialization) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisCoolingPLHP->name; @@ -546,11 +546,11 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSou EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(2u, heatPumps.size()); + EXPECT_EQ(2u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[1]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; // validate that we have the right ones EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -733,11 +733,11 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyHardsizedHeatingWithCompanion) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(2u, heatPumps.size()); + EXPECT_EQ(2u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[1]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; // validate that we have the right ones EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -870,11 +870,11 @@ TEST_F(EnergyPlusFixture, TestSizing_WithCompanionNoPlantSizing) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(2u, heatPumps.size()); + EXPECT_EQ(2u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[1]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; // validate that we have the right ones EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -983,10 +983,10 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingError) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate that we have the right ones EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); @@ -1072,10 +1072,10 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingHardSized) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate that we have the right ones EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); @@ -1178,10 +1178,10 @@ TEST_F(EnergyPlusFixture, CoolingOutletSetpointWorker) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a little setup here thisCoolingPLHP->loadSideLocation.loopNum = 1; @@ -1267,10 +1267,10 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisCoolingPLHP->name; @@ -1407,8 +1407,8 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) // call the factory with a valid name to trigger reading inputs EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); - EXPECT_EQ(1u, heatPumps.size()); - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // init the plant component data with the name we have now from the factory call PLHPPlantSupplySideComp.Name = thisCoolingPLHP->name; @@ -1520,10 +1520,10 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_WaterSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisCoolingPLHP->name; @@ -1653,10 +1653,10 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_WaterSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisHeatingPLHP->name; @@ -1725,11 +1725,11 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_WaterSource) TEST_F(EnergyPlusFixture, TestConcurrentOperationChecking) { - heatPumps.resize(4); - EIRPlantLoopHeatPump *coil1 = &heatPumps[0]; - EIRPlantLoopHeatPump *coil2 = &heatPumps[1]; - EIRPlantLoopHeatPump *coil3 = &heatPumps[2]; - EIRPlantLoopHeatPump *coil4 = &heatPumps[3]; + state.dataEIRPlantLoopHeatPump->heatPumps.resize(4); + EIRPlantLoopHeatPump *coil1 = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; + EIRPlantLoopHeatPump *coil2 = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; + EIRPlantLoopHeatPump *coil3 = &state.dataEIRPlantLoopHeatPump->heatPumps[2]; + EIRPlantLoopHeatPump *coil4 = &state.dataEIRPlantLoopHeatPump->heatPumps[3]; // pair up the last two coil3->companionHeatPumpCoil = coil4; @@ -1798,11 +1798,11 @@ TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_AirSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(2u, heatPumps.size()); + EXPECT_EQ(2u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[1]; - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate the heating side EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); @@ -1874,10 +1874,10 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_AirSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisCoolingPLHP->name; @@ -1991,10 +1991,10 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_AirSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisHeatingPLHP->name; @@ -2107,10 +2107,10 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullyAutoSized_AirSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // validate the cooling side EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -2153,11 +2153,11 @@ TEST_F(EnergyPlusFixture, ClearState) // call the factory with a valid name to trigger reading inputs EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); - EXPECT_EQ(heatPumps.size(), 1u); + EXPECT_EQ(state.dataEIRPlantLoopHeatPump->heatPumps.size(), 1u); // test that vector is cleared - EIRPlantLoopHeatPump::clear_state(); - EXPECT_EQ(heatPumps.size(), 0u); + state.dataEIRPlantLoopHeatPump->clear_state(); + EXPECT_EQ(state.dataEIRPlantLoopHeatPump->heatPumps.size(), 0u); } TEST_F(EnergyPlusFixture, Initialization2_AirSource) @@ -2205,10 +2205,10 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisCoolingPLHP->name; @@ -2319,11 +2319,11 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_AirSourc EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(2u, heatPumps.size()); + EXPECT_EQ(2u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[1]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; // validate that we have the right ones EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -2483,11 +2483,11 @@ TEST_F(EnergyPlusFixture, TestSizing_HardsizedFlowAutosizedCoolingWithCompanion_ EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(2u, heatPumps.size()); + EXPECT_EQ(2u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[1]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[1]; // validate that we have the right ones EXPECT_EQ("HP COOLING SIDE", thisCoolingPLHP->name); @@ -2670,10 +2670,10 @@ TEST_F(EnergyPlusFixture, Test_DoPhysics) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(2u, heatPumps.size()); + EXPECT_EQ(2u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a little setup here thisCoolingPLHP->loadSideLocation.loopNum = 1; @@ -2770,10 +2770,10 @@ TEST_F(EnergyPlusFixture, CoolingMetering) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRCooling, "HP COOLING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisCoolingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisCoolingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisCoolingPLHP->name; @@ -2870,10 +2870,10 @@ TEST_F(EnergyPlusFixture, HeatingMetering) EIRPlantLoopHeatPump::factory(state, DataPlant::TypeOf_HeatPumpEIRHeating, "HP HEATING SIDE"); // verify the size of the vector and the processed condition - EXPECT_EQ(1u, heatPumps.size()); + EXPECT_EQ(1u, state.dataEIRPlantLoopHeatPump->heatPumps.size()); // for now we know the order is maintained, so get each heat pump object - EIRPlantLoopHeatPump *thisHeatingPLHP = &heatPumps[0]; + EIRPlantLoopHeatPump *thisHeatingPLHP = &state.dataEIRPlantLoopHeatPump->heatPumps[0]; // do a bit of extra wiring up to the plant PLHPPlantLoadSideComp.Name = thisHeatingPLHP->name; diff --git a/tst/EnergyPlus/unit/PlantManager.unit.cc b/tst/EnergyPlus/unit/PlantManager.unit.cc index 0081884cdd6..d81c78e9190 100644 --- a/tst/EnergyPlus/unit/PlantManager.unit.cc +++ b/tst/EnergyPlus/unit/PlantManager.unit.cc @@ -211,15 +211,15 @@ namespace PlantManager { GetPlantLoopData(state); ASSERT_FALSE(ErrorsFound); // there two setpoint amanegrs in the loop - EXPECT_EQ(1, NumSchSetPtMgrs); // SetpointManager:Scheduled - EXPECT_EQ(1, NumOutAirSetPtMgrs); // SetpointManager:OutdoorAirReset - EXPECT_EQ(2, NumAllSetPtMgrs); + EXPECT_EQ(1, state.dataSetPointManager->NumSchSetPtMgrs); // SetpointManager:Scheduled + EXPECT_EQ(1, state.dataSetPointManager->NumOutAirSetPtMgrs); // SetpointManager:OutdoorAirReset + EXPECT_EQ(2, state.dataSetPointManager->NumAllSetPtMgrs); // Schedule Setpoint Manager assigned at a plant loop supply outlet node - EXPECT_EQ(SchSetPtMgr(1).CtrlVarType, "TEMPERATURE"); - EXPECT_EQ(SchSetPtMgr(1).CtrlNodeListName, "CHILLED WATER LOOP SUPPLY OUTLET"); + EXPECT_EQ(state.dataSetPointManager->SchSetPtMgr(1).CtrlVarType, "TEMPERATURE"); + EXPECT_EQ(state.dataSetPointManager->SchSetPtMgr(1).CtrlNodeListName, "CHILLED WATER LOOP SUPPLY OUTLET"); // OAReset Setpoint Manager assigned at a plant loop supply inlet node - EXPECT_EQ(OutAirSetPtMgr(1).CtrlVarType, "TEMPERATURE"); - EXPECT_EQ(OutAirSetPtMgr(1).CtrlNodeListName, "CHILLED WATER LOOP SUPPLY INLET"); + EXPECT_EQ(state.dataSetPointManager->OutAirSetPtMgr(1).CtrlVarType, "TEMPERATURE"); + EXPECT_EQ(state.dataSetPointManager->OutAirSetPtMgr(1).CtrlNodeListName, "CHILLED WATER LOOP SUPPLY INLET"); } } // namespace PlantManager } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 19bbe003f7c..daacc0b6342 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -531,9 +531,9 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) int const DualOpComp(2); // a component that heats or cools (ice storage tank) int schManNum = 1; - SetPointManager::SchTESSetPtMgr.allocate(schManNum); - SetPointManager::SchTESSetPtMgr(schManNum).NonChargeCHWTemp = 5; - SetPointManager::SchTESSetPtMgr(schManNum).ChargeCHWTemp = -5; + state.dataSetPointManager->SchTESSetPtMgr.allocate(schManNum); + state.dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp = 5; + state.dataSetPointManager->SchTESSetPtMgr(schManNum).ChargeCHWTemp = -5; // indexes in Schedule int const OnSched = 1; @@ -552,29 +552,29 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) DataEnvironment::DayOfYear_Schedule = 1; ScheduleManager::UpdateScheduleValues(state); - SetPointManager::SchTESSetPtMgr(schManNum).CompOpType = CoolOpComp; + state.dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = CoolOpComp; - SetPointManager::SchTESSetPtMgr(schManNum).SchedPtr = OnSched; + state.dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtr = OnSched; - SetPointManager::SchTESSetPtMgr(schManNum).calculate(state); - EXPECT_EQ(SetPointManager::SchTESSetPtMgr(schManNum).NonChargeCHWTemp, SetPointManager::SchTESSetPtMgr(schManNum).SetPt); + state.dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(state); + EXPECT_EQ(state.dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp, state.dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); - SetPointManager::SchTESSetPtMgr(schManNum).SchedPtr = OffSched; - SetPointManager::SchTESSetPtMgr(schManNum).SchedPtrCharge = OffSched; + state.dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtr = OffSched; + state.dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtrCharge = OffSched; - SetPointManager::SchTESSetPtMgr(schManNum).calculate(state); - EXPECT_EQ(SetPointManager::SchTESSetPtMgr(schManNum).NonChargeCHWTemp, SetPointManager::SchTESSetPtMgr(schManNum).SetPt); + state.dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(state); + EXPECT_EQ(state.dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp, state.dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); - SetPointManager::SchTESSetPtMgr(schManNum).SchedPtr = OffSched; - SetPointManager::SchTESSetPtMgr(schManNum).SchedPtrCharge = OnSched; + state.dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtr = OffSched; + state.dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtrCharge = OnSched; - SetPointManager::SchTESSetPtMgr(schManNum).calculate(state); - EXPECT_EQ(SetPointManager::SchTESSetPtMgr(schManNum).ChargeCHWTemp, SetPointManager::SchTESSetPtMgr(schManNum).SetPt); + state.dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(state); + EXPECT_EQ(state.dataSetPointManager->SchTESSetPtMgr(schManNum).ChargeCHWTemp, state.dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); - SetPointManager::SchTESSetPtMgr(schManNum).CompOpType = DualOpComp; + state.dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DualOpComp; - SetPointManager::SchTESSetPtMgr(schManNum).calculate(state); - EXPECT_EQ(SetPointManager::SchTESSetPtMgr(schManNum).NonChargeCHWTemp, SetPointManager::SchTESSetPtMgr(schManNum).SetPt); + state.dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(state); + EXPECT_EQ(state.dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp, state.dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); } TEST_F(EnergyPlusFixture, SZRHOAFractionImpact) @@ -701,8 +701,8 @@ TEST_F(EnergyPlusFixture, SZRHOAFractionImpact) DataZoneEquipment::ZoneEquipConfig(1).InletNodeAirLoopNum(1) = 1; SetPointManager::GetSetPointManagerInputs(state); - EXPECT_EQ(SetPointManager::SingZoneRhSetPtMgr(1).ControlZoneNum, 1); - SetPointManager::SingZoneRhSetPtMgr(1).AirLoopNum = 1; + EXPECT_EQ(state.dataSetPointManager->SingZoneRhSetPtMgr(1).ControlZoneNum, 1); + state.dataSetPointManager->SingZoneRhSetPtMgr(1).AirLoopNum = 1; DataZoneEquipment::ZoneEquipInputsFilled = true; state.dataAirLoop->AirLoopInputsFilled = true; @@ -1215,8 +1215,8 @@ TEST_F(EnergyPlusFixture, ColdestSetPointMgrInSingleDuct) EXPECT_EQ(0, state.dataAirLoop->AirToZoneNodeInfo(1).NumZonesHeated); // no heated only zone (served by dual-duct) SetPointManager::GetSetPointManagerInputs(state); - SetPointManager::WarmestSetPtMgr(1).AirLoopNum = 1; - SetPointManager::ColdestSetPtMgr(1).AirLoopNum = 1; + state.dataSetPointManager->WarmestSetPtMgr(1).AirLoopNum = 1; + state.dataSetPointManager->ColdestSetPtMgr(1).AirLoopNum = 1; SetPointManager::InitSetPointManagers(state); DataZoneEnergyDemands::ZoneSysEnergyDemand.allocate(1); @@ -1234,7 +1234,7 @@ TEST_F(EnergyPlusFixture, ColdestSetPointMgrInSingleDuct) SetPointManager::UpdateSetPointManagers(state); EXPECT_EQ(DataLoopNode::NodeID(13), "VAV SYS 1 OUTLET NODE"); - EXPECT_DOUBLE_EQ(16.0, SetPointManager::WarmestSetPtMgr(1).SetPt); // no cooling load, sets to maximum limit value + EXPECT_DOUBLE_EQ(16.0, state.dataSetPointManager->WarmestSetPtMgr(1).SetPt); // no cooling load, sets to maximum limit value Real64 CpAir(0.0); Real64 ZoneSetPointTemp(0.0); @@ -1244,7 +1244,7 @@ TEST_F(EnergyPlusFixture, ColdestSetPointMgrInSingleDuct) DataZoneEnergyDemands::ZoneSysEnergyDemand(1).TotalOutputRequired / (CpAir * DataLoopNode::Node(2).MassFlowRateMax); // check the value of ZoneSetPointTemp matches to the value calculated by ColdestSetPtMgr EXPECT_EQ(DataLoopNode::NodeID(12), "HCOIL OUTLET NODE"); - EXPECT_DOUBLE_EQ(ZoneSetPointTemp, SetPointManager::ColdestSetPtMgr(1).SetPt); // 29.74 deg C + EXPECT_DOUBLE_EQ(ZoneSetPointTemp, state.dataSetPointManager->ColdestSetPtMgr(1).SetPt); // 29.74 deg C EXPECT_DOUBLE_EQ(ZoneSetPointTemp, DataLoopNode::Node(12).TempSetPoint); // 29.74 deg C } @@ -1269,13 +1269,13 @@ TEST_F(EnergyPlusFixture, SetPointManager_OutdoorAirResetMaxTempTest) SetPointManager::GetSetPointManagerInputs(state); // check Set Point Manager get inputs - EXPECT_EQ(SetPointManager::OutAirSetPtMgr(1).CtrlVarType, "MAXIMUMTEMPERATURE"); - EXPECT_EQ(SetPointManager::OutAirSetPtMgr(1).CtrlTypeMode, SetPointManager::iCtrlVarType_MaxTemp); - EXPECT_EQ(SetPointManager::AllSetPtMgr(1).SPMType, SetPointManager::iSPMType_OutsideAir); - EXPECT_EQ(80.0, SetPointManager::OutAirSetPtMgr(1).OutLowSetPt1); - EXPECT_EQ(-17.778, SetPointManager::OutAirSetPtMgr(1).OutLow1); - EXPECT_EQ(40.0, SetPointManager::OutAirSetPtMgr(1).OutHighSetPt1); - EXPECT_EQ(21.11, SetPointManager::OutAirSetPtMgr(1).OutHigh1); + EXPECT_EQ(state.dataSetPointManager->OutAirSetPtMgr(1).CtrlVarType, "MAXIMUMTEMPERATURE"); + EXPECT_EQ(state.dataSetPointManager->OutAirSetPtMgr(1).CtrlTypeMode, SetPointManager::iCtrlVarType::MaxTemp); + EXPECT_EQ(state.dataSetPointManager->AllSetPtMgr(1).SPMType, SetPointManager::SetPointManagerType::OutsideAir); + EXPECT_EQ(80.0, state.dataSetPointManager->OutAirSetPtMgr(1).OutLowSetPt1); + EXPECT_EQ(-17.778, state.dataSetPointManager->OutAirSetPtMgr(1).OutLow1); + EXPECT_EQ(40.0, state.dataSetPointManager->OutAirSetPtMgr(1).OutHighSetPt1); + EXPECT_EQ(21.11, state.dataSetPointManager->OutAirSetPtMgr(1).OutHigh1); // set out door dry bukb temp DataEnvironment::OutDryBulbTemp = -20.0; // do init @@ -1286,7 +1286,7 @@ TEST_F(EnergyPlusFixture, SetPointManager_OutdoorAirResetMaxTempTest) // check OA Reset Set Point Manager sim EXPECT_EQ(80.0, DataLoopNode::Node(1).TempSetPointHi); // change the low outdoor air setpoint reset value to 60.0C - SetPointManager::OutAirSetPtMgr(1).OutLowSetPt1 = 60.0; + state.dataSetPointManager->OutAirSetPtMgr(1).OutLowSetPt1 = 60.0; // re simulate OA Reset Set Point Manager SetPointManager::SimSetPointManagers(state); SetPointManager::UpdateSetPointManagers(state); @@ -1325,13 +1325,13 @@ TEST_F(EnergyPlusFixture, SetPointManager_OutdoorAirResetMinTempTest) SetPointManager::GetSetPointManagerInputs(state); // check Set Point Manager get inputs - EXPECT_EQ(SetPointManager::OutAirSetPtMgr(1).CtrlVarType, "MINIMUMTEMPERATURE"); - EXPECT_EQ(SetPointManager::OutAirSetPtMgr(1).CtrlTypeMode, SetPointManager::iCtrlVarType_MinTemp); - EXPECT_EQ(SetPointManager::AllSetPtMgr(1).SPMType, SetPointManager::iSPMType_OutsideAir); - EXPECT_EQ(80.0, SetPointManager::OutAirSetPtMgr(1).OutLowSetPt1); - EXPECT_EQ(-17.778, SetPointManager::OutAirSetPtMgr(1).OutLow1); - EXPECT_EQ(40.0, SetPointManager::OutAirSetPtMgr(1).OutHighSetPt1); - EXPECT_EQ(21.11, SetPointManager::OutAirSetPtMgr(1).OutHigh1); + EXPECT_EQ(state.dataSetPointManager->OutAirSetPtMgr(1).CtrlVarType, "MINIMUMTEMPERATURE"); + EXPECT_EQ(state.dataSetPointManager->OutAirSetPtMgr(1).CtrlTypeMode, SetPointManager::iCtrlVarType::MinTemp); + EXPECT_EQ(state.dataSetPointManager->AllSetPtMgr(1).SPMType, SetPointManager::SetPointManagerType::OutsideAir); + EXPECT_EQ(80.0, state.dataSetPointManager->OutAirSetPtMgr(1).OutLowSetPt1); + EXPECT_EQ(-17.778, state.dataSetPointManager->OutAirSetPtMgr(1).OutLow1); + EXPECT_EQ(40.0, state.dataSetPointManager->OutAirSetPtMgr(1).OutHighSetPt1); + EXPECT_EQ(21.11, state.dataSetPointManager->OutAirSetPtMgr(1).OutHigh1); // set out door dry bukb temp DataEnvironment::OutDryBulbTemp = 22.0; // do init @@ -1342,7 +1342,7 @@ TEST_F(EnergyPlusFixture, SetPointManager_OutdoorAirResetMinTempTest) // check OA Reset Set Point Manager sim EXPECT_EQ(40.0, DataLoopNode::Node(1).TempSetPointLo); // change the low outdoor air setpoint reset value to 60.0C - SetPointManager::OutAirSetPtMgr(1).OutHighSetPt1 = 35.0; + state.dataSetPointManager->OutAirSetPtMgr(1).OutHighSetPt1 = 35.0; // re simulate OA Reset Set Point Manager SetPointManager::SimSetPointManagers(state); SetPointManager::UpdateSetPointManagers(state); diff --git a/tst/EnergyPlus/unit/SingleDuct.unit.cc b/tst/EnergyPlus/unit/SingleDuct.unit.cc index 980f0e1e4c1..b5066d15dd0 100644 --- a/tst/EnergyPlus/unit/SingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/SingleDuct.unit.cc @@ -170,61 +170,61 @@ TEST_F(EnergyPlusFixture, VAVNoReheatTerminalUnitSchedule) DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = 2000.0; // Heating load - expect min flow rate // First test - AlwaysOff Schedule - expecting no flow - SingleDuct::sd_airterminal(SysNum).SchedPtr = 1; + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = 1; DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMinMassFlow; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlow; state.dataGlobal->BeginEnvrnFlag = true; // Must be true for initial pass thru SingleDuct::InitSys for this terminal unit FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - EXPECT_EQ(0.0, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(0.0, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Second test - AlwaysOn Schedule - expecting flow // Reset flows and switch to AlwaysOn Schedule DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMinMassFlow; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlow; - SingleDuct::sd_airterminal(SysNum).SchedPtr = 2; + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = 2; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - EXPECT_EQ(SysMaxMassFlow, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMinMassFlow, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + EXPECT_EQ(SysMaxMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMinMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Test with cooling load DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = -2000.0; // Cooling load - expect max flow rate // First test - AlwaysOff Schedule - expecting no flow - SingleDuct::sd_airterminal(SysNum).SchedPtr = 1; + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = 1; DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMinMassFlow; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlow; state.dataGlobal->BeginEnvrnFlag = true; // Must be true for initial pass thru SingleDuct::InitSys for this terminal unit FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - EXPECT_EQ(0.0, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(0.0, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Second test - AlwaysOn Schedule - expecting flow // Reset flows and switch to AlwaysOn Schedule DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMinMassFlow; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlow; - SingleDuct::sd_airterminal(SysNum).SchedPtr = 2; + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = 2; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - EXPECT_EQ(SysMaxMassFlow, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMaxMassFlow, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + EXPECT_EQ(SysMaxMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMaxMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Cleanup DataHeatBalFanSys::TempControlType.deallocate(); @@ -342,61 +342,61 @@ TEST_F(EnergyPlusFixture, VAVReheatTerminalUnitSchedule) DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = 2000.0; // Heating load - expect min flow rate // First test - AlwaysOff Schedule - expecting no flow - SingleDuct::sd_airterminal(SysNum).SchedPtr = 1; + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = 1; DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMinMassFlow; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlow; state.dataGlobal->BeginEnvrnFlag = true; // Must be true for initial pass thru SingleDuct::InitSys for this terminal unit FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - EXPECT_EQ(0.0, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(0.0, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Second test - AlwaysOn Schedule - expecting flow // Reset flows and switch to AlwaysOn Schedule DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMinMassFlow; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlow; - SingleDuct::sd_airterminal(SysNum).SchedPtr = 2; + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = 2; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - EXPECT_EQ(SysMaxMassFlow, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMinMassFlow, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + EXPECT_EQ(SysMaxMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMinMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Test with cooling load DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = -2000.0; // Cooling load - expect max flow rate // First test - AlwaysOff Schedule - expecting no flow - SingleDuct::sd_airterminal(SysNum).SchedPtr = 1; + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = 1; DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMinMassFlow; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlow; state.dataGlobal->BeginEnvrnFlag = true; // Must be true for initial pass thru SingleDuct::InitSys for this terminal unit FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true state.dataGlobal->BeginEnvrnFlag = false; FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - EXPECT_EQ(0.0, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(0.0, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(0.0, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Second test - AlwaysOn Schedule - expecting flow // Reset flows and switch to AlwaysOn Schedule DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMinMassFlow; DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlow; - SingleDuct::sd_airterminal(SysNum).SchedPtr = 2; + state.dataSingleDuct->sd_airterminal(SysNum).SchedPtr = 2; FirstHVACIteration = true; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true FirstHVACIteration = false; - SingleDuct::sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false - SingleDuct::sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); - EXPECT_EQ(SysMaxMassFlow, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); - EXPECT_EQ(SysMaxMassFlow, SingleDuct::sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); + state.dataSingleDuct->sd_airterminal(SysNum).InitSys(state, FirstHVACIteration); // Run thru init a second time with FirstHVACIteration set to false + state.dataSingleDuct->sd_airterminal(SysNum).SimVAV(state, FirstHVACIteration, ZoneNum, ZoneNodeNum); + EXPECT_EQ(SysMaxMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRateMaxAvail); + EXPECT_EQ(SysMaxMassFlow, state.dataSingleDuct->sd_airterminal(SysNum).sd_airterminalOutlet.AirMassFlowRate); // Cleanup DataHeatBalFanSys::TempControlType.deallocate(); @@ -1261,39 +1261,39 @@ TEST_F(EnergyPlusFixture, SingleDuct_ZeroFloorAreaTest) // zone floor area of zone 1 = 0, zone 2 > 0. Expect TU MaxAirVolFlowRateDuringReheat = 0 only for zone 1. // this test isn't relevant anymore since defaulting is done differently - Real64 MaxAirVolFlowRateDuringReheatDes = min(FinalZoneSizing(1).DesHeatVolFlowMax, SingleDuct::sd_airterminal(1).MaxAirVolFlowRate); - // Real64 MaxAirVolFlowRateDuringReheatDes = min( 0.002032 * SingleDuct::sd_airterminal( 1 ).ZoneFloorArea, SingleDuct::sd_airterminal( 1 ).MaxAirVolFlowRate ); + Real64 MaxAirVolFlowRateDuringReheatDes = min(FinalZoneSizing(1).DesHeatVolFlowMax, state.dataSingleDuct->sd_airterminal(1).MaxAirVolFlowRate); + // Real64 MaxAirVolFlowRateDuringReheatDes = min( 0.002032 * state.dataSingleDuct->sd_airterminal( 1 ).ZoneFloorArea, state.dataSingleDuct->sd_airterminal( 1 ).MaxAirVolFlowRate ); // apply limit based on min stop MaxAirVolFlowRateDuringReheatDes = - max(MaxAirVolFlowRateDuringReheatDes, (SingleDuct::sd_airterminal(1).MaxAirVolFlowRate * SingleDuct::sd_airterminal(1).ZoneMinAirFrac)); + max(MaxAirVolFlowRateDuringReheatDes, (state.dataSingleDuct->sd_airterminal(1).MaxAirVolFlowRate * state.dataSingleDuct->sd_airterminal(1).ZoneMinAirFrac)); // This isn't relevant any more since the default is calculated differently - Real64 MaxAirVolFractionDuringReheatDes = min(1.0, (FinalZoneSizing(1).DesHeatVolFlowMax / SingleDuct::sd_airterminal(1).MaxAirVolFlowRate)); - // Real64 MaxAirVolFractionDuringReheatDes = min( 1.0, ( 0.002032 * SingleDuct::sd_airterminal( 1 ).ZoneFloorArea / SingleDuct::sd_airterminal( 1 ).MaxAirVolFlowRate ) + Real64 MaxAirVolFractionDuringReheatDes = min(1.0, (FinalZoneSizing(1).DesHeatVolFlowMax / state.dataSingleDuct->sd_airterminal(1).MaxAirVolFlowRate)); + // Real64 MaxAirVolFractionDuringReheatDes = min( 1.0, ( 0.002032 * state.dataSingleDuct->sd_airterminal( 1 ).ZoneFloorArea / state.dataSingleDuct->sd_airterminal( 1 ).MaxAirVolFlowRate ) // ); apply limit based on min stop - MaxAirVolFractionDuringReheatDes = max(MaxAirVolFractionDuringReheatDes, SingleDuct::sd_airterminal(1).ZoneMinAirFrac); + MaxAirVolFractionDuringReheatDes = max(MaxAirVolFractionDuringReheatDes, state.dataSingleDuct->sd_airterminal(1).ZoneMinAirFrac); // apply model math MaxAirVolFlowRateDuringReheatDes = - min(max(MaxAirVolFlowRateDuringReheatDes, MaxAirVolFractionDuringReheatDes * SingleDuct::sd_airterminal(1).MaxAirVolFlowRate), - SingleDuct::sd_airterminal(1).MaxAirVolFlowRate); + min(max(MaxAirVolFlowRateDuringReheatDes, MaxAirVolFractionDuringReheatDes * state.dataSingleDuct->sd_airterminal(1).MaxAirVolFlowRate), + state.dataSingleDuct->sd_airterminal(1).MaxAirVolFlowRate); // EXPECT zone floor area == 0, others as calculated above - EXPECT_EQ(SingleDuct::sd_airterminal(1).ZoneFloorArea, 0.0); - EXPECT_NEAR(SingleDuct::sd_airterminal(1).MaxAirVolFlowRateDuringReheat, MaxAirVolFlowRateDuringReheatDes, 0.0000000000001); - EXPECT_NEAR(MaxAirVolFractionDuringReheatDes, SingleDuct::sd_airterminal(1).MaxAirVolFractionDuringReheat, 0.0000000000001); + EXPECT_EQ(state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea, 0.0); + EXPECT_NEAR(state.dataSingleDuct->sd_airterminal(1).MaxAirVolFlowRateDuringReheat, MaxAirVolFlowRateDuringReheatDes, 0.0000000000001); + EXPECT_NEAR(MaxAirVolFractionDuringReheatDes, state.dataSingleDuct->sd_airterminal(1).MaxAirVolFractionDuringReheat, 0.0000000000001); - MaxAirVolFlowRateDuringReheatDes = min(FinalZoneSizing(2).DesHeatVolFlowMax, SingleDuct::sd_airterminal(2).MaxAirVolFlowRate); + MaxAirVolFlowRateDuringReheatDes = min(FinalZoneSizing(2).DesHeatVolFlowMax, state.dataSingleDuct->sd_airterminal(2).MaxAirVolFlowRate); MaxAirVolFlowRateDuringReheatDes = - max(MaxAirVolFlowRateDuringReheatDes, (SingleDuct::sd_airterminal(2).MaxAirVolFlowRate * SingleDuct::sd_airterminal(2).ZoneMinAirFrac)); - MaxAirVolFractionDuringReheatDes = min(1.0, (FinalZoneSizing(2).DesHeatVolFlowMax / SingleDuct::sd_airterminal(2).MaxAirVolFlowRate)); - MaxAirVolFractionDuringReheatDes = max(MaxAirVolFractionDuringReheatDes, SingleDuct::sd_airterminal(2).ZoneMinAirFrac); + max(MaxAirVolFlowRateDuringReheatDes, (state.dataSingleDuct->sd_airterminal(2).MaxAirVolFlowRate * state.dataSingleDuct->sd_airterminal(2).ZoneMinAirFrac)); + MaxAirVolFractionDuringReheatDes = min(1.0, (FinalZoneSizing(2).DesHeatVolFlowMax / state.dataSingleDuct->sd_airterminal(2).MaxAirVolFlowRate)); + MaxAirVolFractionDuringReheatDes = max(MaxAirVolFractionDuringReheatDes, state.dataSingleDuct->sd_airterminal(2).ZoneMinAirFrac); MaxAirVolFlowRateDuringReheatDes = - min(max(MaxAirVolFlowRateDuringReheatDes, MaxAirVolFractionDuringReheatDes * SingleDuct::sd_airterminal(2).MaxAirVolFlowRate), - SingleDuct::sd_airterminal(2).MaxAirVolFlowRate); + min(max(MaxAirVolFlowRateDuringReheatDes, MaxAirVolFractionDuringReheatDes * state.dataSingleDuct->sd_airterminal(2).MaxAirVolFlowRate), + state.dataSingleDuct->sd_airterminal(2).MaxAirVolFlowRate); // EXPECT zone floor area > 0, others as calculated above - EXPECT_GT(SingleDuct::sd_airterminal(2).ZoneFloorArea, 0.0); - EXPECT_NEAR(SingleDuct::sd_airterminal(2).MaxAirVolFlowRateDuringReheat, MaxAirVolFlowRateDuringReheatDes, 0.0000000000001); - EXPECT_NEAR(MaxAirVolFractionDuringReheatDes, SingleDuct::sd_airterminal(2).MaxAirVolFractionDuringReheat, 0.0000000000001); + EXPECT_GT(state.dataSingleDuct->sd_airterminal(2).ZoneFloorArea, 0.0); + EXPECT_NEAR(state.dataSingleDuct->sd_airterminal(2).MaxAirVolFlowRateDuringReheat, MaxAirVolFlowRateDuringReheatDes, 0.0000000000001); + EXPECT_NEAR(MaxAirVolFractionDuringReheatDes, state.dataSingleDuct->sd_airterminal(2).MaxAirVolFractionDuringReheat, 0.0000000000001); } TEST_F(EnergyPlusFixture, TestOAMassFlowRateUsingStdRhoAir) @@ -1306,7 +1306,7 @@ TEST_F(EnergyPlusFixture, TestOAMassFlowRateUsingStdRhoAir) Real64 SAMassFlow; Real64 AirLoopOAFrac; - SingleDuct::sd_airterminal.allocate(1); + state.dataSingleDuct->sd_airterminal.allocate(1); Zone.allocate(1); DataZoneEquipment::ZoneEquipConfig.allocate(1); state.dataAirLoop->AirLoopFlow.allocate(1); @@ -1315,11 +1315,11 @@ TEST_F(EnergyPlusFixture, TestOAMassFlowRateUsingStdRhoAir) DataHeatBalance::ZoneIntGain.allocate(1); Zone(1).FloorArea = 10.0; - SingleDuct::sd_airterminal(1).CtrlZoneNum = 1; - SingleDuct::sd_airterminal(1).ActualZoneNum = 1; - SingleDuct::sd_airterminal(1).NoOAFlowInputFromUser = false; - SingleDuct::sd_airterminal(1).OARequirementsPtr = 1; - SingleDuct::sd_airterminal(1).AirLoopNum = 1; + state.dataSingleDuct->sd_airterminal(1).CtrlZoneNum = 1; + state.dataSingleDuct->sd_airterminal(1).ActualZoneNum = 1; + state.dataSingleDuct->sd_airterminal(1).NoOAFlowInputFromUser = false; + state.dataSingleDuct->sd_airterminal(1).OARequirementsPtr = 1; + state.dataSingleDuct->sd_airterminal(1).AirLoopNum = 1; DataZoneEquipment::ZoneEquipConfig(1).InletNodeAirLoopNum.allocate(1); DataZoneEquipment::ZoneEquipConfig(1).InletNodeAirLoopNum(1) = 1; @@ -1333,12 +1333,12 @@ TEST_F(EnergyPlusFixture, TestOAMassFlowRateUsingStdRhoAir) DataEnvironment::StdRhoAir = 1.20; DataHeatBalance::ZoneIntGain(1).NOFOCC = 0.1; - SingleDuct::sd_airterminal(1).CalcOAMassFlow(state, SAMassFlow, AirLoopOAFrac); + state.dataSingleDuct->sd_airterminal(1).CalcOAMassFlow(state, SAMassFlow, AirLoopOAFrac); EXPECT_NEAR(0.0131547, SAMassFlow, 0.00001); EXPECT_NEAR(0.4, AirLoopOAFrac, 0.00001); // Cleanup - SingleDuct::sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); Zone.deallocate(); DataZoneEquipment::ZoneEquipConfig.deallocate(); state.dataAirLoop->AirLoopFlow.deallocate(); @@ -2492,12 +2492,11 @@ TEST_F(EnergyPlusFixture, TerminalUnitMixerInitTest) // Address #6205 // Address #6241 - using SingleDuct::SysATMixer; int ATMixerNum = 1; - SingleDuct::NumATMixers = 1; + state.dataSingleDuct->NumATMixers = 1; DataHeatBalance::TotPeople = 1; - SysATMixer.allocate(ATMixerNum); + state.dataSingleDuct->SysATMixer.allocate(ATMixerNum); DataZoneEquipment::ZoneEquipConfig.allocate(1); state.dataAirLoop->AirLoopFlow.allocate(1); DataLoopNode::Node.allocate(3); @@ -2505,14 +2504,14 @@ TEST_F(EnergyPlusFixture, TerminalUnitMixerInitTest) Zone.allocate(1); DataHeatBalance::ZoneIntGain.allocate(1); - SysATMixer(ATMixerNum).SecInNode = 1; - SysATMixer(ATMixerNum).PriInNode = 2; - SysATMixer(ATMixerNum).MixedAirOutNode = 3; - SysATMixer(ATMixerNum).AirLoopNum = 1; - SysATMixer(ATMixerNum).ZoneNum = 1; - SysATMixer(ATMixerNum).ZoneEqNum = 1; - SysATMixer(ATMixerNum).NoOAFlowInputFromUser = false; - SysATMixer(ATMixerNum).OARequirementsPtr = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).SecInNode = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).PriInNode = 2; + state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode = 3; + state.dataSingleDuct->SysATMixer(ATMixerNum).AirLoopNum = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneEqNum = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr = 1; state.dataAirLoop->AirLoopFlow(1).OAFrac = 1.0; @@ -2528,21 +2527,21 @@ TEST_F(EnergyPlusFixture, TerminalUnitMixerInitTest) DataHeatBalance::ZoneIntGain(1).NOFOCC = 5.0; DataEnvironment::StdRhoAir = 1.20; - SysATMixer(1).MassFlowRateMaxAvail = 1.0; + state.dataSingleDuct->SysATMixer(1).MassFlowRateMaxAvail = 1.0; // No airloop data exists, so skip these parts of the init - SysATMixer(1).OneTimeInitFlag = false; - SysATMixer(1).OneTimeInitFlag2 = false; + state.dataSingleDuct->SysATMixer(1).OneTimeInitFlag = false; + state.dataSingleDuct->SysATMixer(1).OneTimeInitFlag2 = false; // Current occupancy - SysATMixer(1).OAPerPersonMode = 1; - SysATMixer(1).InitATMixer(state, true); + state.dataSingleDuct->SysATMixer(1).OAPerPersonMode = 1; + state.dataSingleDuct->SysATMixer(1).InitATMixer(state, true); EXPECT_NEAR(DataLoopNode::Node(2).MassFlowRate, 0.72, 0.0001); // Design occupancy - SysATMixer(1).OAPerPersonMode = 2; + state.dataSingleDuct->SysATMixer(1).OAPerPersonMode = 2; Zone(1).TotOccupants = 10; - SysATMixer(1).InitATMixer(state, true); + state.dataSingleDuct->SysATMixer(1).InitATMixer(state, true); EXPECT_NEAR(DataLoopNode::Node(2).MassFlowRate, 1.32, 0.0001); - SysATMixer.deallocate(); + state.dataSingleDuct->SysATMixer.deallocate(); DataZoneEquipment::ZoneEquipConfig.deallocate(); state.dataAirLoop->AirLoopFlow.deallocate(); DataLoopNode::Node.deallocate(); @@ -2556,12 +2555,11 @@ TEST_F(EnergyPlusFixture, TerminalUnitMixerInitTest2) // Address #6205 // Address #6241 - using SingleDuct::SysATMixer; int ATMixerNum = 1; - SingleDuct::NumATMixers = 1; + state.dataSingleDuct->NumATMixers = 1; DataHeatBalance::TotPeople = 1; - SysATMixer.allocate(ATMixerNum); + state.dataSingleDuct->SysATMixer.allocate(ATMixerNum); DataZoneEquipment::ZoneEquipConfig.allocate(1); state.dataAirLoop->AirLoopFlow.allocate(1); DataLoopNode::Node.allocate(3); @@ -2569,14 +2567,14 @@ TEST_F(EnergyPlusFixture, TerminalUnitMixerInitTest2) Zone.allocate(1); DataHeatBalance::ZoneIntGain.allocate(1); - SysATMixer(ATMixerNum).SecInNode = 1; - SysATMixer(ATMixerNum).PriInNode = 2; - SysATMixer(ATMixerNum).MixedAirOutNode = 3; - SysATMixer(ATMixerNum).AirLoopNum = 1; - SysATMixer(ATMixerNum).ZoneNum = 1; - SysATMixer(ATMixerNum).ZoneEqNum = 1; - SysATMixer(ATMixerNum).NoOAFlowInputFromUser = false; - SysATMixer(ATMixerNum).OARequirementsPtr = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).SecInNode = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).PriInNode = 2; + state.dataSingleDuct->SysATMixer(ATMixerNum).MixedAirOutNode = 3; + state.dataSingleDuct->SysATMixer(ATMixerNum).AirLoopNum = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneNum = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).ZoneEqNum = 1; + state.dataSingleDuct->SysATMixer(ATMixerNum).NoOAFlowInputFromUser = false; + state.dataSingleDuct->SysATMixer(ATMixerNum).OARequirementsPtr = 1; DataZoneEquipment::ZoneEquipConfig(1).InletNodeAirLoopNum.allocate(1); DataZoneEquipment::ZoneEquipConfig(1).InletNodeAirLoopNum(1) = 1; @@ -2597,35 +2595,35 @@ TEST_F(EnergyPlusFixture, TerminalUnitMixerInitTest2) DataHeatBalance::ZoneIntGain(1).NOFOCC = 5.0; DataEnvironment::StdRhoAir = 1.0; - SysATMixer(1).MassFlowRateMaxAvail = 1.0; + state.dataSingleDuct->SysATMixer(1).MassFlowRateMaxAvail = 1.0; // No airloop data exists, so skip these parts of the init - SysATMixer(1).OneTimeInitFlag = false; - SysATMixer(1).OneTimeInitFlag2 = false; + state.dataSingleDuct->SysATMixer(1).OneTimeInitFlag = false; + state.dataSingleDuct->SysATMixer(1).OneTimeInitFlag2 = false; // Current occupancy - SysATMixer(1).OAPerPersonMode = 1; + state.dataSingleDuct->SysATMixer(1).OAPerPersonMode = 1; // InletSideMixer, Mixed air outlet mass flow > OA requirement, expect primary flow to equal OA requirement - SysATMixer(1).MixerType = DataHVACGlobals::ATMixer_InletSide; - DataLoopNode::Node(SysATMixer(1).MixedAirOutNode).MassFlowRate = 1.0; - SysATMixer(1).InitATMixer(state, true); - EXPECT_NEAR(DataLoopNode::Node(SysATMixer(1).PriInNode).MassFlowRate, 0.5, 0.0001); + state.dataSingleDuct->SysATMixer(1).MixerType = DataHVACGlobals::ATMixer_InletSide; + DataLoopNode::Node(state.dataSingleDuct->SysATMixer(1).MixedAirOutNode).MassFlowRate = 1.0; + state.dataSingleDuct->SysATMixer(1).InitATMixer(state, true); + EXPECT_NEAR(DataLoopNode::Node(state.dataSingleDuct->SysATMixer(1).PriInNode).MassFlowRate, 0.5, 0.0001); // InletSideMixer, Mixed air outlet mass flow < OA requirement, expect primary flow to equal mixed air flow - DataLoopNode::Node(SysATMixer(1).MixedAirOutNode).MassFlowRate = 0.10; - SysATMixer(1).InitATMixer(state, true); - EXPECT_NEAR(DataLoopNode::Node(SysATMixer(1).PriInNode).MassFlowRate, 0.10, 0.0001); + DataLoopNode::Node(state.dataSingleDuct->SysATMixer(1).MixedAirOutNode).MassFlowRate = 0.10; + state.dataSingleDuct->SysATMixer(1).InitATMixer(state, true); + EXPECT_NEAR(DataLoopNode::Node(state.dataSingleDuct->SysATMixer(1).PriInNode).MassFlowRate, 0.10, 0.0001); // SupplySideMixer, Mixed air outlet mass flow > OA requirement, expect primary flow to equal OA requirement - SysATMixer(1).MixerType = DataHVACGlobals::ATMixer_SupplySide; - DataLoopNode::Node(SysATMixer(1).MixedAirOutNode).MassFlowRate = 1.0; - SysATMixer(1).InitATMixer(state, true); - EXPECT_NEAR(DataLoopNode::Node(SysATMixer(1).PriInNode).MassFlowRate, 0.5, 0.0001); + state.dataSingleDuct->SysATMixer(1).MixerType = DataHVACGlobals::ATMixer_SupplySide; + DataLoopNode::Node(state.dataSingleDuct->SysATMixer(1).MixedAirOutNode).MassFlowRate = 1.0; + state.dataSingleDuct->SysATMixer(1).InitATMixer(state, true); + EXPECT_NEAR(DataLoopNode::Node(state.dataSingleDuct->SysATMixer(1).PriInNode).MassFlowRate, 0.5, 0.0001); // SupplySideMixer, Mixed air outlet mass flow < OA requirement, expect primary flow to equal OA requirement - DataLoopNode::Node(SysATMixer(1).MixedAirOutNode).MassFlowRate = 0.10; - SysATMixer(1).InitATMixer(state, true); - EXPECT_NEAR(DataLoopNode::Node(SysATMixer(1).PriInNode).MassFlowRate, 0.5, 0.0001); - SysATMixer.deallocate(); + DataLoopNode::Node(state.dataSingleDuct->SysATMixer(1).MixedAirOutNode).MassFlowRate = 0.10; + state.dataSingleDuct->SysATMixer(1).InitATMixer(state, true); + EXPECT_NEAR(DataLoopNode::Node(state.dataSingleDuct->SysATMixer(1).PriInNode).MassFlowRate, 0.5, 0.0001); + state.dataSingleDuct->SysATMixer.deallocate(); DataZoneEquipment::ZoneEquipConfig.deallocate(); state.dataAirLoop->AirLoopFlow.deallocate(); DataLoopNode::Node.deallocate(); @@ -2707,17 +2705,17 @@ TEST_F(EnergyPlusFixture, VAVReheatTerminal_SizeMinFrac) CurZoneEqNum = 1; CurTermUnitSizingNum = 1; DataSizing::TermUnitFinalZoneSizing(1).DesCoolVolFlowMin = 0.5; - SingleDuct::sd_airterminal(SysNum).SizeSys(state); - EXPECT_EQ(0.5, SingleDuct::sd_airterminal(SysNum).ZoneMinAirFracDes); + state.dataSingleDuct->sd_airterminal(SysNum).SizeSys(state); + EXPECT_EQ(0.5, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); // Second test - design min flow > max flow ZoneSizingRunDone = true; CurZoneEqNum = 1; CurTermUnitSizingNum = 1; - SingleDuct::sd_airterminal(SysNum).ZoneMinAirFracDes = AutoSize; // need to reset this so it sizes again + state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes = AutoSize; // need to reset this so it sizes again DataSizing::TermUnitFinalZoneSizing(1).DesCoolVolFlowMin = 1.5; - SingleDuct::sd_airterminal(SysNum).SizeSys(state); - EXPECT_EQ(1.0, SingleDuct::sd_airterminal(SysNum).ZoneMinAirFracDes); + state.dataSingleDuct->sd_airterminal(SysNum).SizeSys(state); + EXPECT_EQ(1.0, state.dataSingleDuct->sd_airterminal(SysNum).ZoneMinAirFracDes); } TEST_F(EnergyPlusFixture, setATMixerSizingProperties_Test) { @@ -2746,10 +2744,10 @@ TEST_F(EnergyPlusFixture, setATMixerSizingProperties_Test) FinalSysSizing(1).DesMainVolFlow = 1.2345; FinalSysSizing(1).DesOutAirVolFlow = 1.2345; - SingleDuct::SysATMixer.allocate(1); - SingleDuct::SysATMixer(1).CtrlZoneInNodeIndex = 1; - SingleDuct::SysATMixer(1).DesignPrimaryAirVolRate = FinalSysSizing(1).DesMainVolFlow; - SingleDuct::SysATMixer(1).MixerType = DataHVACGlobals::ATMixer_InletSide; + state.dataSingleDuct->SysATMixer.allocate(1); + state.dataSingleDuct->SysATMixer(1).CtrlZoneInNodeIndex = 1; + state.dataSingleDuct->SysATMixer(1).DesignPrimaryAirVolRate = FinalSysSizing(1).DesMainVolFlow; + state.dataSingleDuct->SysATMixer(1).MixerType = DataHVACGlobals::ATMixer_InletSide; state.dataAirSystemsData->PrimaryAirSystems.allocate(1); state.dataAirSystemsData->PrimaryAirSystems(1).CentralCoolCoilExists = true; @@ -2765,7 +2763,7 @@ TEST_F(EnergyPlusFixture, setATMixerSizingProperties_Test) // set ATMixer properties used for sizing SingleDuct::setATMixerSizingProperties(state, ATMixerIndex, ControlledZoneNum, CurZoneEqNum); - EXPECT_DOUBLE_EQ(ZoneEqSizing(1).ATMixerVolFlow, SingleDuct::SysATMixer(1).DesignPrimaryAirVolRate); + EXPECT_DOUBLE_EQ(ZoneEqSizing(1).ATMixerVolFlow, state.dataSingleDuct->SysATMixer(1).DesignPrimaryAirVolRate); EXPECT_DOUBLE_EQ(ZoneEqSizing(1).ATMixerCoolPriDryBulb, FinalSysSizing(1).CoolSupTemp); EXPECT_DOUBLE_EQ(ZoneEqSizing(1).ATMixerCoolPriHumRat, FinalSysSizing(1).CoolSupHumRat); EXPECT_DOUBLE_EQ(ZoneEqSizing(1).ATMixerHeatPriDryBulb, FinalSysSizing(1).HeatSupTemp); @@ -2782,7 +2780,7 @@ TEST_F(EnergyPlusFixture, setATMixerSizingProperties_Test) EXPECT_DOUBLE_EQ(ZoneEqSizing(1).ATMixerHeatPriHumRat, FinalSysSizing(1).PreheatHumRat); // set ATMixer properties used for sizing - SingleDuct::SysATMixer(1).DesignPrimaryAirVolRate /= 2.0; + state.dataSingleDuct->SysATMixer(1).DesignPrimaryAirVolRate /= 2.0; SingleDuct::setATMixerSizingProperties(state, ATMixerIndex, ControlledZoneNum, CurZoneEqNum); EXPECT_NEAR(ZoneEqSizing(1).ATMixerCoolPriDryBulb, FinalSysSizing(1).PrecoolTemp, 0.0000001); @@ -2792,7 +2790,7 @@ TEST_F(EnergyPlusFixture, setATMixerSizingProperties_Test) state.dataAirSystemsData->PrimaryAirSystems(1).NumOAHeatCoils = 0; state.dataAirSystemsData->PrimaryAirSystems(1).NumOACoolCoils = 0; - SingleDuct::SysATMixer(1).DesignPrimaryAirVolRate *= 2.0; + state.dataSingleDuct->SysATMixer(1).DesignPrimaryAirVolRate *= 2.0; SingleDuct::setATMixerSizingProperties(state, ATMixerIndex, ControlledZoneNum, CurZoneEqNum); diff --git a/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc b/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc index 296487428a4..1460c4e0ce3 100644 --- a/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc +++ b/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc @@ -272,9 +272,9 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils1) PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state.dataWaterCoils->WaterCoil_SimpleHeating; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state.dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state.dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - sd_airterminal(1).HWLoopNum = 1; - sd_airterminal(1).HWLoopSide = 1; - sd_airterminal(1).HWBranchIndex = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; + state.dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; PlantSizData(1).DeltaT = 11.0; PlantSizData(1).ExitTemp = 82; PlantSizData(1).PlantLoopName = "HotWaterLoop"; @@ -315,9 +315,9 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils1) max(FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow, FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow) * FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlowFrac); TermUnitFinalZoneSizing(CurTermUnitSizingNum) = FinalZoneSizing(CurZoneEqNum); - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; OutputReportPredefined::SetPredefinedTables(state); - sd_airterminal(1).SizeSys(state); + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); SizeWaterCoil(state, 1); EXPECT_NEAR(state.dataWaterCoils->WaterCoil(1).UACoil, 199.86, 0.01); @@ -328,7 +328,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils1) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); ZoneEqSizing.deallocate(); PlantLoop.deallocate(); PlantSizData.deallocate(); @@ -510,9 +510,9 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils2) PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state.dataWaterCoils->WaterCoil_SimpleHeating; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state.dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state.dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - sd_airterminal(1).HWLoopNum = 1; - sd_airterminal(1).HWLoopSide = 1; - sd_airterminal(1).HWBranchIndex = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; + state.dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; PlantSizData(1).DeltaT = 11.0; PlantSizData(1).ExitTemp = 82; PlantSizData(1).PlantLoopName = "HotWaterLoop"; @@ -552,9 +552,9 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils2) max(FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow, FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow) * FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlowFrac); TermUnitFinalZoneSizing(CurTermUnitSizingNum) = FinalZoneSizing(CurZoneEqNum); - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; - sd_airterminal(1).SizeSys(state); + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); SizeWaterCoil(state, 1); EXPECT_NEAR(state.dataWaterCoils->WaterCoil(1).MaxWaterVolFlowRate, .0000850575, 0.000000001); EXPECT_NEAR(state.dataWaterCoils->WaterCoil(1).UACoil, 85.97495, 0.01); @@ -566,7 +566,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils2) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); ZoneEqSizing.deallocate(); PlantLoop.deallocate(); PlantSizData.deallocate(); @@ -747,9 +747,9 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils3) PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state.dataWaterCoils->WaterCoil_SimpleHeating; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state.dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state.dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - sd_airterminal(1).HWLoopNum = 1; - sd_airterminal(1).HWLoopSide = 1; - sd_airterminal(1).HWBranchIndex = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; + state.dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; PlantSizData(1).DeltaT = 11.0; PlantSizData(1).ExitTemp = 82; PlantSizData(1).PlantLoopName = "HotWaterLoop"; @@ -789,8 +789,8 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils3) max(FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow, FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow) * FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlowFrac); TermUnitFinalZoneSizing(CurTermUnitSizingNum) = FinalZoneSizing(CurZoneEqNum); - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; - sd_airterminal(1).SizeSys(state); + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); SizeWaterCoil(state, 1); EXPECT_NEAR(state.dataWaterCoils->WaterCoil(1).MaxWaterVolFlowRate, .0000850575, 0.000000001); EXPECT_NEAR(state.dataWaterCoils->WaterCoil(1).UACoil, 85.97495, 0.01); @@ -802,7 +802,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils3) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); ZoneEqSizing.deallocate(); PlantLoop.deallocate(); PlantSizData.deallocate(); @@ -984,9 +984,9 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils4) PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state.dataWaterCoils->WaterCoil_SimpleHeating; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state.dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state.dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - sd_airterminal(1).HWLoopNum = 1; - sd_airterminal(1).HWLoopSide = 1; - sd_airterminal(1).HWBranchIndex = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; + state.dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; PlantSizData(1).DeltaT = 11.0; PlantSizData(1).ExitTemp = 82; PlantSizData(1).PlantLoopName = "HotWaterLoop"; @@ -1026,8 +1026,8 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils4) max(FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow, FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow) * FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlowFrac); TermUnitFinalZoneSizing(CurTermUnitSizingNum) = FinalZoneSizing(CurZoneEqNum); - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; - sd_airterminal(1).SizeSys(state); + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); SizeWaterCoil(state, 1); EXPECT_NEAR(state.dataWaterCoils->WaterCoil(1).MaxWaterVolFlowRate, .0000850575, 0.000000001); EXPECT_NEAR(state.dataWaterCoils->WaterCoil(1).UACoil, 300.00, 0.01); @@ -1039,7 +1039,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils4) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); ZoneEqSizing.deallocate(); PlantLoop.deallocate(); PlantSizData.deallocate(); @@ -1395,17 +1395,17 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils6) PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state.dataWaterCoils->WaterCoil_SimpleHeating; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state.dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state.dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - sd_airterminal(1).HWLoopNum = 1; - sd_airterminal(1).HWLoopSide = 1; - sd_airterminal(1).HWBranchIndex = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; + state.dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; + state.dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; CurZoneEqNum = 1; CurTermUnitSizingNum = 1; CurSysNum = 0; Zone(1).FloorArea = 99.16; - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; OutputReportPredefined::SetPredefinedTables(state); - sd_airterminal(1).SizeSys(state); + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); state.dataGlobal->BeginEnvrnFlag = true; // water coil is user input for water flow and UA with performance input method = UFactorTimesAreaAndDesignWaterFlowRate and Rated Capacity = @@ -1421,7 +1421,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils6) // not set in Init for water heating coils and not used elsewhere other than sizing EXPECT_EQ(state.dataWaterCoils->WaterCoil(1).DesTotWaterCoilLoad, DataSizing::AutoSize); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); } } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc b/tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc index 81deab5b060..6b59650dc33 100644 --- a/tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc +++ b/tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc @@ -282,11 +282,11 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing1) EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlowPerArea, 0.0); EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlow2, 0.0); EXPECT_NEAR(FinalZoneSizing(CurZoneEqNum).DesHeatVolFlowMax, 0.084324, 0.000001); - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; UpdateTermUnitFinalZoneSizing(state); // Fills the TermUnitFinalZoneSizing array - sd_airterminal(1).SizeSys(state); - EXPECT_DOUBLE_EQ(sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.22); - EXPECT_NEAR(sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.084324, 0.000001); + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); + EXPECT_DOUBLE_EQ(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.22); + EXPECT_NEAR(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.084324, 0.000001); Node.deallocate(); ZoneEquipConfig.deallocate(); @@ -295,7 +295,7 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing1) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); } TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing2) @@ -462,11 +462,11 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing2) EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlowPerArea, .002032); EXPECT_NEAR(FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlow2, 0.196047, 0.000001); // EXPECT_NEAR( FinalZoneSizing( CurZoneEqNum ).DesHeatVolFlowMax, 0.084324, 0.000001 ); - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; UpdateTermUnitFinalZoneSizing(state); // Fills the TermUnitFinalZoneSizing array - sd_airterminal(1).SizeSys(state); - EXPECT_NEAR(sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.348739, 0.000001); - EXPECT_NEAR(sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.196047, 0.000001); + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); + EXPECT_NEAR(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.348739, 0.000001); + EXPECT_NEAR(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.196047, 0.000001); Node.deallocate(); ZoneEquipConfig.deallocate(); @@ -475,7 +475,7 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing2) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); } TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing3) @@ -643,10 +643,10 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing3) EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlowPerArea, 0.0); EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlow2, 0.0); EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatVolFlowMax, 0.11); - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; - sd_airterminal(1).SizeSys(state); - EXPECT_DOUBLE_EQ(sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.22); - EXPECT_NEAR(sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.092756, 0.000001); + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); + EXPECT_DOUBLE_EQ(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.22); + EXPECT_NEAR(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.092756, 0.000001); Node.deallocate(); ZoneEquipConfig.deallocate(); @@ -655,7 +655,7 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing3) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); } TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing4) @@ -792,10 +792,10 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing4) ZoneSizingRunDone = false; CurZoneEqNum = 1; Zone(1).FloorArea = 96.48; - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; - sd_airterminal(1).SizeSys(state); - EXPECT_NEAR(sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.348739, 0.000001); - EXPECT_NEAR(sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.196047, 0.000001); + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); + EXPECT_NEAR(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.348739, 0.000001); + EXPECT_NEAR(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.196047, 0.000001); Node.deallocate(); ZoneEquipConfig.deallocate(); @@ -804,7 +804,7 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing4) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); } TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing5) @@ -972,11 +972,11 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing5) EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlowPerArea, 0.0); EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatMaxAirFlow2, 0.0); EXPECT_DOUBLE_EQ(FinalZoneSizing(CurZoneEqNum).DesHeatVolFlowMax, 0.08); - sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; + state.dataSingleDuct->sd_airterminal(1).ZoneFloorArea = Zone(1).FloorArea; UpdateTermUnitFinalZoneSizing(state); // Fills the TermUnitFinalZoneSizing array - sd_airterminal(1).SizeSys(state); - EXPECT_DOUBLE_EQ(sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.07351776 / 0.21081); - EXPECT_DOUBLE_EQ(sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.08); + state.dataSingleDuct->sd_airterminal(1).SizeSys(state); + EXPECT_DOUBLE_EQ(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).ZoneMinAirFracDes, 0.07351776 / 0.21081); + EXPECT_DOUBLE_EQ(state.dataSingleDuct->sd_airterminal(CurZoneEqNum).MaxAirVolFlowRateDuringReheat, 0.08); Node.deallocate(); ZoneEquipConfig.deallocate(); @@ -985,7 +985,7 @@ TEST_F(EnergyPlusFixture, VAVDefMinMaxFlowTestSizing5) TermUnitFinalZoneSizing.deallocate(); CalcFinalZoneSizing.deallocate(); TermUnitSizing.deallocate(); - sd_airterminal.deallocate(); + state.dataSingleDuct->sd_airterminal.deallocate(); } } // namespace EnergyPlus