From 0c726b9ed10e1064a377bd854cf8b364a31e2f49 Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 14:27:35 -0500 Subject: [PATCH 01/15] reduce --- src/EnergyPlus/VentilatedSlab.cc | 67 +++++++++++--------------------- 1 file changed, 23 insertions(+), 44 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 5977ddd2751..b88effc29b1 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -4439,36 +4439,21 @@ namespace VentilatedSlab { auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 CpAppAir; // Specific heat of air - int RadSurfNum; // DO loop counter for radiant surfaces in the ventilated slab - int SurfNum; // Surface index number for the current ventilated slab - int AirInletNode; // Node number for the air side inlet of the ventilated slab - Real64 TotalHeatSource; // Total heat source or sink for a particular system (sum of all surface source/sinks) - int TotRadSurfaces; // Total number of radiant surfaces in this system - Real64 AirMassFlow; // Flow rate of water in the radiant system - int AirOutletNode; // Node number for the water side outlet of the radiant system - int FanOutNode; // Node number for the water side outlet of the radiant system - Real64 ZoneMult; // Zone multiplier - int ZoneNum; // Zone for this ventilated slab - int MixOutNode; // Node number for the water side outlet of the radiant system - int OANode; // Node number for the water side outlet of the radiant system - Real64 OAFraction; // Outside air fraction of inlet air - int ZoneInletNode; // Node number for the air side inlet of the ventilated slab + Real64 OAFraction; // Outside air fraction of inlet air - ZoneNum = ventSlab.ZonePtr; - TotRadSurfaces = ventSlab.NumOfSurfaces; - MixOutNode = ventSlab.OAMixerOutNode; - OANode = ventSlab.OutsideAirNode; - AirOutletNode = ventSlab.RadInNode; - FanOutNode = ventSlab.FanOutletNode; - AirMassFlow = state.dataLoopNodes->Node(AirOutletNode).MassFlowRate; - ZoneInletNode = ventSlab.ZoneAirInNode; - CpAppAir = PsyCpAirFnW(state.dataLoopNodes->Node(AirOutletNode).HumRat); - AirInletNode = ventSlab.ReturnAirNode; + int TotRadSurfaces = ventSlab.NumOfSurfaces; + int MixOutNode = ventSlab.OAMixerOutNode; // Node number for the water side outlet of the radiant system + int OANode = ventSlab.OutsideAirNode; + int AirOutletNode = ventSlab.RadInNode; + int FanOutNode = ventSlab.FanOutletNode; + Real64 AirMassFlow = state.dataLoopNodes->Node(AirOutletNode).MassFlowRate; + int ZoneInletNode = ventSlab.ZoneAirInNode; // Node number for the air side inlet of the ventilated slab + Real64 CpAppAir = PsyCpAirFnW(state.dataLoopNodes->Node(AirOutletNode).HumRat); + int AirInletNode = ventSlab.ReturnAirNode; // Node number for the air side inlet of the ventilated slab - for (RadSurfNum = 1; RadSurfNum <= TotRadSurfaces; ++RadSurfNum) { + for (int RadSurfNum = 1; RadSurfNum <= TotRadSurfaces; ++RadSurfNum) { - SurfNum = ventSlab.SurfacePtr(RadSurfNum); + int SurfNum = ventSlab.SurfacePtr(RadSurfNum); if (ventSlab.LastSysTimeElapsed == SysTimeElapsed) { // Still iterating or reducing system time step, so subtract old values which were not valid @@ -4483,13 +4468,13 @@ namespace VentilatedSlab { ventSlab.LastTimeStepSys = TimeStepSys; // First sum up all of the heat sources/sinks associated with this system - TotalHeatSource = 0.0; - for (RadSurfNum = 1; RadSurfNum <= ventSlab.NumOfSurfaces; ++RadSurfNum) { - SurfNum = ventSlab.SurfacePtr(RadSurfNum); + Real64 TotalHeatSource = 0.0; + for (int RadSurfNum = 1; RadSurfNum <= ventSlab.NumOfSurfaces; ++RadSurfNum) { + int SurfNum = ventSlab.SurfacePtr(RadSurfNum); TotalHeatSource += state.dataHeatBalFanSys->QRadSysSource(SurfNum); } - ZoneNum = ventSlab.ZonePtr; - ZoneMult = double(state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier); + int ZoneNum = ventSlab.ZonePtr; + int ZoneMult = double(state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier); TotalHeatSource *= ZoneMult; // Update the heating side of things @@ -4515,12 +4500,12 @@ namespace VentilatedSlab { } else { if ((ventSlab.SysConfg == VentilatedSlabConfig::SlabOnly) || (ventSlab.SysConfg == VentilatedSlabConfig::SeriesSlabs)) { state.dataLoopNodes->Node(FanOutNode) = state.dataLoopNodes->Node(AirOutletNode); - state.dataHeatBalFanSys->QRadSysSource(SurfNum) = 0.0; + state.dataHeatBalFanSys->QRadSysSource = 0.0; } else if (ventSlab.SysConfg == VentilatedSlabConfig::SlabAndZone) { state.dataLoopNodes->Node(ZoneInletNode) = state.dataLoopNodes->Node(AirInletNode); state.dataLoopNodes->Node(FanOutNode) = state.dataLoopNodes->Node(AirOutletNode); // Fan Resolve - state.dataHeatBalFanSys->QRadSysSource(SurfNum) = 0.0; + state.dataHeatBalFanSys->QRadSysSource = 0.0; } } @@ -4705,20 +4690,14 @@ namespace VentilatedSlab { Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); - int RadSurfNum; // DO loop counter for radiant surfaces in the system - int SurfNum; // Surface number (index) in Surface derived type - Real64 TotalVentSlabRadPower; // Total source/sink power for the radiant system (sum of all surfaces of the system) - Real64 ZoneMult; // Total zone multiplier to apply to the system level variables - // Slab Part - TotalVentSlabRadPower = 0.0; - ZoneMult = 1.0; + Real64 TotalVentSlabRadPower = 0.0; // Total source/sink power for the radiant system (sum of all surfaces of the system) - for (RadSurfNum = 1; RadSurfNum <= ventSlab.NumOfSurfaces; ++RadSurfNum) { - SurfNum = ventSlab.SurfacePtr(RadSurfNum); + for (int RadSurfNum = 1; RadSurfNum <= ventSlab.NumOfSurfaces; ++RadSurfNum) { + int SurfNum = ventSlab.SurfacePtr(RadSurfNum); TotalVentSlabRadPower += state.dataHeatBalFanSys->QRadSysSource(SurfNum); } - ZoneMult = double(state.dataHeatBal->Zone(ventSlab.ZonePtr).Multiplier * state.dataHeatBal->Zone(ventSlab.ZonePtr).ListMultiplier); + Real64 ZoneMult = double(state.dataHeatBal->Zone(ventSlab.ZonePtr).Multiplier * state.dataHeatBal->Zone(ventSlab.ZonePtr).ListMultiplier); TotalVentSlabRadPower *= ZoneMult; ventSlab.RadHeatingPower = 0.0; ventSlab.RadCoolingPower = 0.0; From 73fbcbb237c11b2615c5d3d4bcb2e1dd0687c1ac Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 14:34:06 -0500 Subject: [PATCH 02/15] reassigned --- src/EnergyPlus/VentilatedSlab.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index b88effc29b1..ea8fee68583 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -3333,11 +3333,10 @@ namespace VentilatedSlab { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr); + MaxOAFrac = min(1.0, max(0.0, GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); } else { MaxOAFrac = 0.0; } - MaxOAFrac = min(1.0, max(0.0, MinOAFrac)); state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate; break; } From 4b25bf1d20a5689fc0481aeb6c0d9c6342ec194f Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 14:37:30 -0500 Subject: [PATCH 03/15] reassigned --- src/EnergyPlus/VentilatedSlab.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index ea8fee68583..8365e8db691 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -3243,11 +3243,10 @@ namespace VentilatedSlab { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr); + MaxOAFrac = min(1.0, max(0.0, GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); } else { MaxOAFrac = 0.0; } - MaxOAFrac = min(1.0, max(0.0, MinOAFrac)); state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate; break; } From 3ffbd82b03db1aaca9100ae468b5d57c5bbd139b Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 14:45:28 -0500 Subject: [PATCH 04/15] reassigned --- src/EnergyPlus/VentilatedSlab.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 8365e8db691..9d803aeeee0 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -3068,11 +3068,10 @@ namespace VentilatedSlab { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr); + MaxOAFrac = min(1.0, max(0.0, GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); } else { MaxOAFrac = 0.0; } - MaxOAFrac = min(1.0, max(0.0, MinOAFrac)); state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate; break; } From 0bb3bcaa871f8b2b941ffd95ef49e39f8209aa89 Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 14:59:31 -0500 Subject: [PATCH 05/15] reduce --- src/EnergyPlus/VentilatedSlab.cc | 103 ++++++++++++++----------------- 1 file changed, 48 insertions(+), 55 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 9d803aeeee0..3f9d6092a04 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -1830,8 +1830,7 @@ namespace VentilatedSlab { // SUBROUTINE PARAMETER DEFINITIONS: static constexpr std::string_view RoutineName("SizeVentilatedSlab"); - auto &ZoneEqSizing(state.dataSize->ZoneEqSizing); - auto &CurZoneEqNum(state.dataSize->CurZoneEqNum); + int CurZoneEqNum = state.dataSize->CurZoneEqNum; auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -1922,23 +1921,24 @@ namespace VentilatedSlab { FieldNum = 1; PrintFlag = true; SizingString = state.dataVentilatedSlab->VentSlabNumericFields(Item).FieldNames(FieldNum) + " [m3/s]"; + auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod > 0) { SizingMethod = HVAC::CoolingAirflowSizing; SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod; - ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = SAFMethod; + zoneEqSizing.SizingMethod(SizingMethod) = SAFMethod; if (SAFMethod == None || SAFMethod == SupplyAirFlowRate || SAFMethod == FlowPerFloorArea || SAFMethod == FractionOfAutosizedCoolingAirflow) { if (SAFMethod == SupplyAirFlowRate) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow > 0.0) { - ZoneEqSizing(CurZoneEqNum).AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; - ZoneEqSizing(CurZoneEqNum).SystemAirFlow = true; + zoneEqSizing.AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; + zoneEqSizing.SystemAirFlow = true; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; } else if (SAFMethod == FlowPerFloorArea) { - ZoneEqSizing(CurZoneEqNum).SystemAirFlow = true; - ZoneEqSizing(CurZoneEqNum).AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow * - state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; - TempSize = ZoneEqSizing(CurZoneEqNum).AirVolFlow; + zoneEqSizing.SystemAirFlow = true; + zoneEqSizing.AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow * + state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; + TempSize = zoneEqSizing.AirVolFlow; state.dataSize->DataScalableSizingON = true; } else if (SAFMethod == FractionOfAutosizedCoolingAirflow) { state.dataSize->DataFracOfAutosizedCoolingAirflow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; @@ -1980,20 +1980,20 @@ namespace VentilatedSlab { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingSAFMethod > 0) { SizingMethod = HeatingAirflowSizing; SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingSAFMethod; - ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = SAFMethod; + zoneEqSizing.SizingMethod(SizingMethod) = SAFMethod; if (SAFMethod == None || SAFMethod == SupplyAirFlowRate || SAFMethod == FlowPerFloorArea || SAFMethod == FractionOfAutosizedHeatingAirflow) { if (SAFMethod == SupplyAirFlowRate) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow > 0.0) { - ZoneEqSizing(CurZoneEqNum).AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; - ZoneEqSizing(CurZoneEqNum).SystemAirFlow = true; + zoneEqSizing.AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; + zoneEqSizing.SystemAirFlow = true; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; } else if (SAFMethod == FlowPerFloorArea) { - ZoneEqSizing(CurZoneEqNum).SystemAirFlow = true; - ZoneEqSizing(CurZoneEqNum).AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow * - state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; - TempSize = ZoneEqSizing(CurZoneEqNum).AirVolFlow; + zoneEqSizing.SystemAirFlow = true; + zoneEqSizing.AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow * + state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; + TempSize = zoneEqSizing.AirVolFlow; state.dataSize->DataScalableSizingON = true; } else if (SAFMethod == FractionOfAutosizedHeatingAirflow) { state.dataSize->DataFracOfAutosizedHeatingAirflow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; @@ -2176,27 +2176,26 @@ namespace VentilatedSlab { } if (DoWaterCoilSizing) { if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= SmallAirVolFlow) { + auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); SizingMethod = HeatingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { zoneHVACIndex = ventSlab.HVACSizingIndex; CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; - ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod; + zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedHeatingCapacity) { if (CapSizingMethod == HeatingDesignCapacity) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity > 0.0) { - ZoneEqSizing(CurZoneEqNum).HeatingCapacity = true; - ZoneEqSizing(CurZoneEqNum).DesHeatingLoad = - state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; + zoneEqSizing.HeatingCapacity = true; + zoneEqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; } else { state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; } else if (CapSizingMethod == CapacityPerFloorArea) { - ZoneEqSizing(CurZoneEqNum).HeatingCapacity = true; - ZoneEqSizing(CurZoneEqNum).DesHeatingLoad = - state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity * - state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; + zoneEqSizing.HeatingCapacity = true; + zoneEqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity * + state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; state.dataSize->DataScalableCapSizingON = true; } else if (CapSizingMethod == FractionOfAutosizedHeatingCapacity) { state.dataSize->DataFracOfAutosizedHeatingCapacity = @@ -2300,25 +2299,24 @@ namespace VentilatedSlab { if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= SmallAirVolFlow) { SizingMethod = HeatingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { + auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); zoneHVACIndex = ventSlab.HVACSizingIndex; CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; - ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod; + zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedHeatingCapacity) { if (CapSizingMethod == HeatingDesignCapacity) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity > 0.0) { - ZoneEqSizing(CurZoneEqNum).HeatingCapacity = true; - ZoneEqSizing(CurZoneEqNum).DesHeatingLoad = - state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; + zoneEqSizing.HeatingCapacity = true; + zoneEqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; } else { state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; } else if (CapSizingMethod == CapacityPerFloorArea) { - ZoneEqSizing(CurZoneEqNum).HeatingCapacity = true; - ZoneEqSizing(CurZoneEqNum).DesHeatingLoad = - state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity * - state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; + zoneEqSizing.HeatingCapacity = true; + zoneEqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity * + state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; state.dataSize->DataScalableCapSizingON = true; } else if (CapSizingMethod == FractionOfAutosizedHeatingCapacity) { state.dataSize->DataFracOfAutosizedHeatingCapacity = @@ -2444,25 +2442,24 @@ namespace VentilatedSlab { if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolMassFlow >= SmallAirVolFlow) { SizingMethod = CoolingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { + auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); zoneHVACIndex = ventSlab.HVACSizingIndex; CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod; - ZoneEqSizing(CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod; + zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == CoolingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedCoolingCapacity) { if (CapSizingMethod == CoolingDesignCapacity) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity > 0.0) { - ZoneEqSizing(CurZoneEqNum).CoolingCapacity = true; - ZoneEqSizing(CurZoneEqNum).DesCoolingLoad = - state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity; + zoneEqSizing.CoolingCapacity = true; + zoneEqSizing.DesCoolingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity; } else { state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity; } else if (CapSizingMethod == CapacityPerFloorArea) { - ZoneEqSizing(CurZoneEqNum).CoolingCapacity = true; - ZoneEqSizing(CurZoneEqNum).DesCoolingLoad = - state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity * - state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; + zoneEqSizing.CoolingCapacity = true; + zoneEqSizing.DesCoolingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity * + state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; state.dataSize->DataScalableCapSizingON = true; } else if (CapSizingMethod == FractionOfAutosizedCoolingCapacity) { state.dataSize->DataFracOfAutosizedHeatingCapacity = @@ -2548,8 +2545,9 @@ namespace VentilatedSlab { WaterCoils::SetCoilDesFlow(state, ventSlab.heatingCoilTypeCh, ventSlab.heatingCoilName, ventSlab.MaxAirVolFlow, ErrorsFound); if (CurZoneEqNum > 0) { - ZoneEqSizing(CurZoneEqNum).MaxHWVolFlow = ventSlab.MaxVolHotWaterFlow; - ZoneEqSizing(CurZoneEqNum).MaxCWVolFlow = ventSlab.MaxVolColdWaterFlow; + auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); + zoneEqSizing.MaxHWVolFlow = ventSlab.MaxVolHotWaterFlow; + zoneEqSizing.MaxCWVolFlow = ventSlab.MaxVolColdWaterFlow; } if (ErrorsFound) { @@ -2796,7 +2794,7 @@ namespace VentilatedSlab { RadSurfNum = ventSlab.NumOfSurfaces; Tinlet = state.dataLoopNodes->Node(InletNode).Temp; Toutdoor = state.dataLoopNodes->Node(OutsideAirNode).Temp; - auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); + auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); // Control Type Check switch (ventSlab.controlType) { @@ -3702,12 +3700,6 @@ namespace VentilatedSlab { Real64 CDiaDS; Real64 FlowFrac; Real64 MSlabAirInTemp; - bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine - std::string MSlabIn; - std::string MSlabOut; - std::string SlabName; - int MSlabInletNode; - int MSlabOutletNode; if (state.dataVentilatedSlab->FirstTimeFlag) { state.dataVentilatedSlab->AirTempOut.allocate(state.dataVentilatedSlab->MaxCloNumOfSurfaces); @@ -4224,11 +4216,12 @@ namespace VentilatedSlab { // Internal Node Temperature Check MSlabAirInTemp = state.dataLoopNodes->Node(SlabInNode).Temp; + bool ErrorsFound = false; // Set to true if errors in input, fatal at end of routine for (RadSurfNum = 1; RadSurfNum <= ventSlab.NumOfSurfaces; ++RadSurfNum) { - SlabName = ventSlab.SurfaceName(RadSurfNum); - MSlabIn = ventSlab.SlabIn(RadSurfNum); - MSlabOut = ventSlab.SlabOut(RadSurfNum); + std::string SlabName = ventSlab.SurfaceName(RadSurfNum); + std::string MSlabIn = ventSlab.SlabIn(RadSurfNum); + std::string MSlabOut = ventSlab.SlabOut(RadSurfNum); ventSlab.MSlabInNode = GetOnlySingleNode(state, MSlabIn, ErrorsFound, @@ -4247,8 +4240,8 @@ namespace VentilatedSlab { DataLoopNode::ConnectionType::Internal, NodeInputManager::CompFluidStream::Primary, ObjectIsNotParent); - MSlabInletNode = ventSlab.MSlabInNode; - MSlabOutletNode = ventSlab.MSlabOutNode; + int MSlabInletNode = ventSlab.MSlabInNode; + int MSlabOutletNode = ventSlab.MSlabOutNode; SurfNum = ventSlab.SurfacePtr(RadSurfNum); if (AirMassFlow > 0.0) { @@ -4344,7 +4337,7 @@ namespace VentilatedSlab { // outdoor air streams. // Using/Aliasing - auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); + auto const &ventSlab = state.dataVentilatedSlab->VentSlab(Item); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int AirRelNode; // relief air node number in ventilated slab loop From cd143dbd62662ba2c584bbf596ffaca1f491ef64 Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 15:11:18 -0500 Subject: [PATCH 06/15] reduce --- src/EnergyPlus/VentilatedSlab.cc | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 3f9d6092a04..793b30f850a 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -1834,8 +1834,6 @@ namespace VentilatedSlab { auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int PltSizHeatNum; // index of plant sizing object for 1st heating loop - int PltSizCoolNum; // index of plant sizing object for 1st cooling loop bool ErrorsFound; Real64 DesCoilLoad; Real64 TempSteamIn; @@ -1874,21 +1872,12 @@ namespace VentilatedSlab { // HeatingCapacitySizing, etc.) bool PrintFlag; // TRUE when sizing information is reported in the eio file int zoneHVACIndex; // index of zoneHVAC equipment sizing specification - int SAFMethod(0); // supply air flow rate sizing method (SupplyAirFlowRate, FlowPerFloorArea, FractionOfAutosizedCoolingAirflow, - // FractionOfAutosizedHeatingAirflow ...) - int CapSizingMethod(0); // capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, and - // FractionOfAutosizedHeatingCapacity ) Real64 CoolingAirVolFlowScalable; // cooling airvolume for rate determined using scalable sizing method Real64 HeatingAirVolFlowScalable; // heating airvolume for rate determined using scalable sizing method bool DoWaterCoilSizing = false; // if TRUE do water coil sizing calculation Real64 WaterCoilSizDeltaT; // water coil deltaT for design water flow rate autosizing - int CoilNum; // index of water coil object - DoWaterCoilSizing = false; WaterCoilSizDeltaT = 0.0; - CoilNum = 0; - PltSizCoolNum = 0; - PltSizHeatNum = 0; ErrorsFound = false; IsAutoSize = false; MaxAirVolFlowDes = 0.0; @@ -1924,7 +1913,7 @@ namespace VentilatedSlab { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod > 0) { SizingMethod = HVAC::CoolingAirflowSizing; - SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod; + int SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod; zoneEqSizing.SizingMethod(SizingMethod) = SAFMethod; if (SAFMethod == None || SAFMethod == SupplyAirFlowRate || SAFMethod == FlowPerFloorArea || SAFMethod == FractionOfAutosizedCoolingAirflow) { @@ -1979,7 +1968,7 @@ namespace VentilatedSlab { } if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingSAFMethod > 0) { SizingMethod = HeatingAirflowSizing; - SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingSAFMethod; + int SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingSAFMethod; zoneEqSizing.SizingMethod(SizingMethod) = SAFMethod; if (SAFMethod == None || SAFMethod == SupplyAirFlowRate || SAFMethod == FlowPerFloorArea || SAFMethod == FractionOfAutosizedHeatingAirflow) { @@ -2156,9 +2145,9 @@ namespace VentilatedSlab { CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); if (IsAutoSize) { - PltSizHeatNum = MyPlantSizingIndex( + int PltSizHeatNum = MyPlantSizingIndex( state, "Coil:Heating:Water", ventSlab.heatingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); - CoilNum = WaterCoils::GetWaterCoilIndex(state, "COIL:HEATING:WATER", ventSlab.heatingCoilName, ErrorsFound); + int CoilNum = WaterCoils::GetWaterCoilIndex(state, "COIL:HEATING:WATER", ventSlab.heatingCoilName, ErrorsFound); if (state.dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp) { WaterCoilSizDeltaT = state.dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp; DoWaterCoilSizing = true; @@ -2180,7 +2169,7 @@ namespace VentilatedSlab { SizingMethod = HeatingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { zoneHVACIndex = ventSlab.HVACSizingIndex; - CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; + int CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedHeatingCapacity) { @@ -2293,7 +2282,7 @@ namespace VentilatedSlab { CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); CoilSteamOutletNode = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); if (IsAutoSize) { - PltSizHeatNum = MyPlantSizingIndex( + int PltSizHeatNum = MyPlantSizingIndex( state, "Coil:Heating:Steam", ventSlab.heatingCoilName, CoilSteamInletNode, CoilSteamOutletNode, ErrorsFound); if (PltSizHeatNum > 0) { if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= SmallAirVolFlow) { @@ -2301,7 +2290,7 @@ namespace VentilatedSlab { if (ventSlab.HVACSizingIndex > 0) { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); zoneHVACIndex = ventSlab.HVACSizingIndex; - CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; + int CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedHeatingCapacity) { @@ -2421,8 +2410,9 @@ namespace VentilatedSlab { CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); if (IsAutoSize) { - PltSizCoolNum = MyPlantSizingIndex(state, CoolingCoilType, CoolingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); - CoilNum = WaterCoils::GetWaterCoilIndex(state, CoolingCoilType, CoolingCoilName, ErrorsFound); + int PltSizCoolNum = + MyPlantSizingIndex(state, CoolingCoilType, CoolingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); + int CoilNum = WaterCoils::GetWaterCoilIndex(state, CoolingCoilType, CoolingCoilName, ErrorsFound); if (state.dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp) { WaterCoilSizDeltaT = state.dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp; DoWaterCoilSizing = true; @@ -2444,7 +2434,7 @@ namespace VentilatedSlab { if (ventSlab.HVACSizingIndex > 0) { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); zoneHVACIndex = ventSlab.HVACSizingIndex; - CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod; + int CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod; zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == CoolingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedCoolingCapacity) { From cd04a7a869d859d09432214046fafadf0ec68652 Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 15:21:24 -0500 Subject: [PATCH 07/15] reduce --- src/EnergyPlus/VentilatedSlab.cc | 51 +++++++++++--------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 793b30f850a..aac638e2f9e 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -1841,10 +1841,6 @@ namespace VentilatedSlab { Real64 EnthSteamOutWet; Real64 LatentHeatSteam; Real64 SteamDensity; - int CoilWaterInletNode(0); - int CoilWaterOutletNode(0); - int CoilSteamInletNode(0); - int CoilSteamOutletNode(0); std::string CoolingCoilName; std::string CoolingCoilType; Real64 rho; @@ -2142,8 +2138,8 @@ namespace VentilatedSlab { } else { // Autosize or hard-size with sizing run CheckZoneSizing(state, cMO_VentilatedSlab, ventSlab.Name); - CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); - CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); + int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); + int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); if (IsAutoSize) { int PltSizHeatNum = MyPlantSizingIndex( state, "Coil:Heating:Water", ventSlab.heatingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); @@ -2279,8 +2275,8 @@ namespace VentilatedSlab { } else { // Autosize or hard-size with sizing run CheckZoneSizing(state, "ZoneHVAC:VentilatedSlab", ventSlab.Name); - CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); - CoilSteamOutletNode = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); + int CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); + int CoilSteamOutletNode = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); if (IsAutoSize) { int PltSizHeatNum = MyPlantSizingIndex( state, "Coil:Heating:Steam", ventSlab.heatingCoilName, CoilSteamInletNode, CoilSteamOutletNode, ErrorsFound); @@ -2407,8 +2403,8 @@ namespace VentilatedSlab { CoolingCoilName = ventSlab.coolingCoilName; CoolingCoilType = ventSlab.coolingCoilTypeCh; } - CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); - CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); + int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); + int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); if (IsAutoSize) { int PltSizCoolNum = MyPlantSizingIndex(state, CoolingCoilType, CoolingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); @@ -3467,7 +3463,6 @@ namespace VentilatedSlab { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 AirMassFlow; // total mass flow through the system Real64 CpAirZn; // specific heat of dry air at zone conditions (zone conditions same as system inlet) - int HCoilInAirNode; // inlet node number for fan exit/coil inlet int InletNode; // system air inlet node int OutletNode; // system air outlet node // unused0309 INTEGER :: HCoilOutAirNode @@ -3507,7 +3502,7 @@ namespace VentilatedSlab { if (!state.dataVentilatedSlab->HCoilOn) { QCoilReq = 0.0; } else { - HCoilInAirNode = ventSlab.FanOutletNode; + int HCoilInAirNode = ventSlab.FanOutletNode; CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(HCoilInAirNode).HumRat); QCoilReq = state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * (state.dataLoopNodes->Node(ventSlab.RadInNode).Temp) - @@ -3646,7 +3641,6 @@ namespace VentilatedSlab { static std::string const CurrentModuleObject("ZoneHVAC:VentilatedSlab"); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int ConstrNum; // Index for construction number in Construct derived type Real64 CpAirZn; // Intermediate calculational variable for specific heat of air Real64 DewPointTemp; // Dew-point temperature based on the zone air conditions Real64 EpsMdotCpAirZn; // Epsilon (heat exchanger terminology) times water mass flow rate times water specific heat @@ -3660,12 +3654,8 @@ namespace VentilatedSlab { int SurfNum2; // Index for radiant surface in Surface derived type // unused0309 INTEGER :: RadSurfNumNum Real64 TotalVentSlabRadPower; // Total heat source/sink to radiant system - Real64 AirMassFlow; // air mass flow rate in the radiant system, kg/s - int SlabInNode; // Node number of the air entering the radiant system Real64 AirOutletTempCheck; // Radiant system air outlet temperature (calculated from mixing all outlet streams together) Real64 AirTempIn; // Temperature of the air entering the radiant system, in C - int ZoneNum; // number of zone being served - Real64 ZoneMult; // Zone multiplier for this system Real64 Ca; // Coefficients to relate the inlet air temperature to the heat source Real64 Cb; Real64 Cc; @@ -3679,11 +3669,6 @@ namespace VentilatedSlab { Real64 Ck; Real64 Cl; // For more info on Ca through Cl, refer Constant Flow Radiant System - int FanOutletNode; // unit air outlet node - int OAInletNode; // unit air outlet node - int MixoutNode; // unit air outlet node - int ReturnAirNode; // description - int ZoneAirInNode; // supply air node // For Phase 3 Real64 CNumDS; Real64 CLengDS; @@ -3696,17 +3681,17 @@ namespace VentilatedSlab { state.dataVentilatedSlab->FirstTimeFlag = false; } - SlabInNode = ventSlab.RadInNode; - FanOutletNode = ventSlab.FanOutletNode; - OAInletNode = ventSlab.OutsideAirNode; - MixoutNode = ventSlab.OAMixerOutNode; - ReturnAirNode = ventSlab.ReturnAirNode; - ZoneAirInNode = ventSlab.ZoneAirInNode; + int SlabInNode = ventSlab.RadInNode; + int FanOutletNode = ventSlab.FanOutletNode; + int OAInletNode = ventSlab.OutsideAirNode; + int MixoutNode = ventSlab.OAMixerOutNode; + int ReturnAirNode = ventSlab.ReturnAirNode; + int ZoneAirInNode = ventSlab.ZoneAirInNode; // Set the conditions on the air side inlet - ZoneNum = ventSlab.ZonePtr; - ZoneMult = double(state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier); - AirMassFlow = state.dataLoopNodes->Node(ventSlab.RadInNode).MassFlowRate / ZoneMult; + int ZoneNum = ventSlab.ZonePtr; + Real64 ZoneMult = double(state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier); + Real64 AirMassFlow = state.dataLoopNodes->Node(ventSlab.RadInNode).MassFlowRate / ZoneMult; auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); if (state.dataVentilatedSlab->OperatingMode == HeatingMode) { @@ -3783,7 +3768,7 @@ namespace VentilatedSlab { // linking the inlet air temperature to the heat source/sink to the radiant system. // The coefficients are based on the Constant Flow Radiation System. - ConstrNum = state.dataSurface->Surface(SurfNum).Construction; + int ConstrNum = state.dataSurface->Surface(SurfNum).Construction; auto const &thisConstruct = state.dataConstruction->Construct(ConstrNum); Ca = state.dataHeatBalFanSys->RadSysTiHBConstCoef(SurfNum); @@ -4061,7 +4046,7 @@ namespace VentilatedSlab { // linking the inlet air temperature to the heat source/sink to the radiant system. // The coefficients are based on the Constant Flow Radiation System. - ConstrNum = state.dataSurface->Surface(SurfNum).Construction; + int ConstrNum = state.dataSurface->Surface(SurfNum).Construction; Ca = state.dataHeatBalFanSys->RadSysTiHBConstCoef(SurfNum); Cb = state.dataHeatBalFanSys->RadSysTiHBToutCoef(SurfNum); From 1f9df2256a4f0f5e730a06171014062df42cdc0c Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 15:33:48 -0500 Subject: [PATCH 08/15] reduce --- src/EnergyPlus/VentilatedSlab.cc | 68 +++++++++++++------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index aac638e2f9e..b17fb7a5881 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -1548,8 +1548,6 @@ namespace VentilatedSlab { Real64 RhoAir; // air density at InNode Real64 TempSteamIn; Real64 SteamDensity; - int ZoneAirInNode; - int MixOut; Real64 rho; bool errFlag; @@ -1747,8 +1745,6 @@ namespace VentilatedSlab { OutNode = ventSlab.RadInNode; OutsideAirNode = ventSlab.OutsideAirNode; AirRelNode = ventSlab.AirReliefNode; - ZoneAirInNode = ventSlab.ZoneAirInNode; - MixOut = ventSlab.OAMixerOutNode; // First, set the flow conditions up so that there is flow through the ventilated // slab system(this will be shut down if the system is not available or there @@ -1870,7 +1866,7 @@ namespace VentilatedSlab { int zoneHVACIndex; // index of zoneHVAC equipment sizing specification Real64 CoolingAirVolFlowScalable; // cooling airvolume for rate determined using scalable sizing method Real64 HeatingAirVolFlowScalable; // heating airvolume for rate determined using scalable sizing method - bool DoWaterCoilSizing = false; // if TRUE do water coil sizing calculation + bool DoWaterCoilSizing; // if TRUE do water coil sizing calculation Real64 WaterCoilSizDeltaT; // water coil deltaT for design water flow rate autosizing WaterCoilSizDeltaT = 0.0; @@ -2644,22 +2640,17 @@ namespace VentilatedSlab { Real64 Toutdoor; // temperature of outdoor air being introduced into the ventilated slab [degrees C] Real64 MaxSteamFlow; Real64 MinSteamFlow; - Real64 RadInTemp; // "Desired" radiant system air inlet temperature [Celsius]**setpoint - Real64 SetPointTemp; // temperature that will be used to control the radiant system [Celsius] - Real64 SetPointTempHi; // Current high point in setpoint temperature range - Real64 SetPointTempLo; // Current low point in setpoint temperature range - Real64 AirTempHi; // Current high point in water temperature range - Real64 AirTempLo; // Current low point in water temperature range - Real64 AirTempHeatHi; // Current high point in water temperature range - Real64 AirTempCoolLo; // Current low point in water temperature range - Real64 CpFan; // Intermediate calculational variable for specific heat of air <Node(MSlabInletNode).Temp = state.dataLoopNodes->Node(InletNode).Temp; state.dataLoopNodes->Node(MSlabOutletNode).Temp = state.dataLoopNodes->Node(MSlabInletNode).Temp; @@ -3646,12 +3637,9 @@ namespace VentilatedSlab { Real64 EpsMdotCpAirZn; // Epsilon (heat exchanger terminology) times water mass flow rate times water specific heat Real64 Mdot; // Intermediate calculation variable for mass flow rate in a surface within the radiant system int RadSurfNum; // DO loop counter for the surfaces that comprise a particular radiant system - int RadSurfNum2; // DO loop counter for the surfaces that comprise a particular radiant system - int RadSurfNum3; // DO loop counter for the surfaces that comprise a particular radiant system // unused0309 INTEGER :: RadSurfNum4 ! DO loop counter for the surfaces that comprise a particular radiant system - int SurfNum; // Index for radiant surface in Surface derived type - int SurfNum2; // Index for radiant surface in Surface derived type + int SurfNum; // Index for radiant surface in Surface derived type // unused0309 INTEGER :: RadSurfNumNum Real64 TotalVentSlabRadPower; // Total heat source/sink to radiant system Real64 AirOutletTempCheck; // Radiant system air outlet temperature (calculated from mixing all outlet streams together) @@ -3836,8 +3824,8 @@ namespace VentilatedSlab { state.dataLoopNodes->Node(ReturnAirNode).MassFlowRate = 0.0; AirMassFlow = 0.0; - for (RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { - SurfNum2 = ventSlab.SurfacePtr(RadSurfNum2); + for (int RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { + int SurfNum2 = ventSlab.SurfacePtr(RadSurfNum2); state.dataHeatBalFanSys->QRadSysSource(SurfNum2) = 0.0; if (state.dataSurface->Surface(SurfNum2).ExtBoundCond > 0 && state.dataSurface->Surface(SurfNum2).ExtBoundCond != SurfNum2) @@ -3868,7 +3856,7 @@ namespace VentilatedSlab { if (state.dataVentilatedSlab->OperatingMode == CoolingMode) { DewPointTemp = PsyTdpFnWPb(state, thisZoneHB.airHumRat, state.dataEnvrn->OutBaroPress); - for (RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { + for (int RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { if (state.dataHeatBalSurf->SurfInsideTempHist(1)(ventSlab.SurfacePtr(RadSurfNum2)) < (DewPointTemp + CondDeltaTemp)) { // Condensation warning--must shut off radiant system state.dataLoopNodes->Node(SlabInNode).MassFlowRate = 0.0; @@ -3878,8 +3866,8 @@ namespace VentilatedSlab { state.dataLoopNodes->Node(ReturnAirNode).MassFlowRate = 0.0; state.dataLoopNodes->Node(FanOutletNode).Temp = state.dataLoopNodes->Node(SlabInNode).Temp; AirMassFlow = 0.0; - for (RadSurfNum3 = 1; RadSurfNum3 <= ventSlab.NumOfSurfaces; ++RadSurfNum3) { - SurfNum2 = ventSlab.SurfacePtr(RadSurfNum3); + for (int RadSurfNum3 = 1; RadSurfNum3 <= ventSlab.NumOfSurfaces; ++RadSurfNum3) { + int SurfNum2 = ventSlab.SurfacePtr(RadSurfNum3); state.dataHeatBalFanSys->QRadSysSource(SurfNum2) = 0.0; if (state.dataSurface->Surface(SurfNum2).ExtBoundCond > 0 && state.dataSurface->Surface(SurfNum2).ExtBoundCond != SurfNum2) @@ -4096,8 +4084,8 @@ namespace VentilatedSlab { state.dataLoopNodes->Node(ReturnAirNode).MassFlowRate = 0.0; AirMassFlow = 0.0; - for (RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { - SurfNum2 = ventSlab.SurfacePtr(RadSurfNum2); + for (int RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { + int SurfNum2 = ventSlab.SurfacePtr(RadSurfNum2); state.dataHeatBalFanSys->QRadSysSource(SurfNum2) = 0.0; if (state.dataSurface->Surface(SurfNum2).ExtBoundCond > 0 && state.dataSurface->Surface(SurfNum2).ExtBoundCond != SurfNum2) @@ -4122,7 +4110,7 @@ namespace VentilatedSlab { DewPointTemp = PsyTdpFnWPb(state, state.dataZoneTempPredictorCorrector->zoneHeatBalance(ventSlab.ZPtr(RadSurfNum)).airHumRat, state.dataEnvrn->OutBaroPress); - for (RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { + for (int RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { if (state.dataHeatBalSurf->SurfInsideTempHist(1)(ventSlab.SurfacePtr(RadSurfNum2)) < (DewPointTemp + CondDeltaTemp)) { // Condensation warning--must shut off radiant system state.dataLoopNodes->Node(SlabInNode).MassFlowRate = 0.0; @@ -4132,8 +4120,8 @@ namespace VentilatedSlab { state.dataLoopNodes->Node(ReturnAirNode).MassFlowRate = 0.0; state.dataLoopNodes->Node(FanOutletNode).Temp = state.dataLoopNodes->Node(SlabInNode).Temp; AirMassFlow = 0.0; - for (RadSurfNum3 = 1; RadSurfNum3 <= ventSlab.NumOfSurfaces; ++RadSurfNum3) { - SurfNum2 = ventSlab.SurfacePtr(RadSurfNum3); + for (int RadSurfNum3 = 1; RadSurfNum3 <= ventSlab.NumOfSurfaces; ++RadSurfNum3) { + int SurfNum2 = ventSlab.SurfacePtr(RadSurfNum3); state.dataHeatBalFanSys->QRadSysSource(SurfNum2) = 0.0; if (state.dataSurface->Surface(SurfNum2).ExtBoundCond > 0 && state.dataSurface->Surface(SurfNum2).ExtBoundCond != SurfNum2) From 0096d0d60dbe8c961c5f74ba5026ecffe944bd3a Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 15:38:53 -0500 Subject: [PATCH 09/15] unused --- src/EnergyPlus/VentilatedSlab.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index b17fb7a5881..cad0d940565 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -1540,8 +1540,6 @@ namespace VentilatedSlab { int SurfNum; // Intermediate variable for keeping track of the surface number int ZoneNum; // Intermediate variable for keeping track of the zone number int AirRelNode; // relief air node number in Ventilated Slab loop - int ColdConNode; // cold water control node number in Ventilated Slab loop - int HotConNode; // hot water control node number in Ventilated Slab loop int InNode; // inlet node number in Ventilated Slab loop int OutNode; // outlet node number in Ventilated Slab loop int OutsideAirNode; // outside air node number in Ventilated Slab loop @@ -1644,8 +1642,6 @@ namespace VentilatedSlab { // Coil Part InNode = ventSlab.ReturnAirNode; OutNode = ventSlab.RadInNode; - HotConNode = ventSlab.HotControlNode; - ColdConNode = ventSlab.ColdControlNode; OutsideAirNode = ventSlab.OutsideAirNode; RhoAir = state.dataEnvrn->StdRhoAir; From 8f2f795da09f875b6a169e077f94c6f67cba6110 Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 15:49:51 -0500 Subject: [PATCH 10/15] reduce --- src/EnergyPlus/VentilatedSlab.cc | 66 ++++++++++++-------------------- 1 file changed, 25 insertions(+), 41 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index cad0d940565..582da785aaf 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -263,7 +263,6 @@ namespace VentilatedSlab { int Item; // Item to be "gotten" int BaseNum; // Temporary number for creating RadiantSystemTypes structure bool errFlag; // interim error flag - int SurfListNum; // Index within the SurfList derived type for a surface list name int SurfNum; // DO loop counter for surfaces bool IsValid; // Set for outside air node check Array1D_string cAlphaArgs; // Alpha input items for object @@ -357,7 +356,7 @@ namespace VentilatedSlab { } ventSlab.SurfListName = state.dataIPShortCut->cAlphaArgs(4); - SurfListNum = 0; + int SurfListNum = 0; // IF (NumOfSlabLists > 0) SurfListNum = Util::FindItemInList(VentSlab(Item)%SurfListName, SlabList%Name, NumOfSlabLists) if (state.dataSurfLists->NumOfSurfListVentSlab > 0) SurfListNum = Util::FindItemInList(ventSlab.SurfListName, state.dataSurfLists->SlabList); @@ -1529,25 +1528,12 @@ namespace VentilatedSlab { // SUBROUTINE PARAMETER DEFINITIONS: static constexpr std::string_view RoutineName("InitVentilatedSlab"); - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int RadNum; // Number of the radiant system (DO loop counter) - int SurfNum; // Intermediate variable for keeping track of the surface number - int ZoneNum; // Intermediate variable for keeping track of the zone number - int AirRelNode; // relief air node number in Ventilated Slab loop - int InNode; // inlet node number in Ventilated Slab loop - int OutNode; // outlet node number in Ventilated Slab loop - int OutsideAirNode; // outside air node number in Ventilated Slab loop - Real64 RhoAir; // air density at InNode + int AirRelNode; // relief air node number in Ventilated Slab loop + Real64 RhoAir; // air density at InNode Real64 TempSteamIn; Real64 SteamDensity; Real64 rho; - bool errFlag; // Do the one time initializations @@ -1561,7 +1547,7 @@ namespace VentilatedSlab { for (auto &thisVentSlab : state.dataVentilatedSlab->VentSlab) { thisVentSlab.TotalSurfaceArea = 0.0; int numRadSurfs = thisVentSlab.NumOfSurfaces; - for (SurfNum = 1; SurfNum <= numRadSurfs; ++SurfNum) { + for (int SurfNum = 1; SurfNum <= numRadSurfs; ++SurfNum) { thisVentSlab.TotalSurfaceArea += state.dataSurface->Surface(thisVentSlab.SurfacePtr(SurfNum)).Area; } thisVentSlab.QRadSysSrcAvg.dimension(numRadSurfs, 0.0); @@ -1589,7 +1575,7 @@ namespace VentilatedSlab { if (state.dataVentilatedSlab->MyPlantScanFlag(Item) && allocated(state.dataPlnt->PlantLoop)) { if ((ventSlab.heatingCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) || (ventSlab.heatingCoilType == DataPlant::PlantEquipmentType::CoilSteamAirHeating)) { - errFlag = false; + bool errFlag = false; ScanPlantLoopsForObject(state, ventSlab.heatingCoilName, ventSlab.heatingCoilType, ventSlab.HWPlantLoc, errFlag, _, _, _, _, _); if (errFlag) { ShowContinueError(state, format("Reference Unit=\"{}\", type=ZoneHVAC:VentilatedSlab", ventSlab.Name)); @@ -1600,7 +1586,7 @@ namespace VentilatedSlab { } if ((ventSlab.coolingCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || (ventSlab.coolingCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) { - errFlag = false; + bool errFlag = false; ScanPlantLoopsForObject(state, ventSlab.coolingCoilPlantName, ventSlab.coolingCoilType, ventSlab.CWPlantLoc, errFlag); if (errFlag) { ShowContinueError(state, format("Reference Unit=\"{}\", type=ZoneHVAC:VentilatedSlab", ventSlab.Name)); @@ -1619,7 +1605,7 @@ namespace VentilatedSlab { // need to check all Ventilated Slab units to see if they are on Zone Equipment List or issue warning if (!state.dataVentilatedSlab->ZoneEquipmentListChecked && state.dataZoneEquip->ZoneEquipInputsFilled) { state.dataVentilatedSlab->ZoneEquipmentListChecked = true; - for (RadNum = 1; RadNum <= state.dataVentilatedSlab->NumOfVentSlabs; ++RadNum) { + for (int RadNum = 1; RadNum <= state.dataVentilatedSlab->NumOfVentSlabs; ++RadNum) { if (CheckZoneEquipmentList(state, cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(RadNum).Name)) continue; ShowSevereError( state, @@ -1636,13 +1622,14 @@ namespace VentilatedSlab { state.dataVentilatedSlab->MySizeFlag(Item) = false; } + int InNode = ventSlab.ReturnAirNode; + int OutNode = ventSlab.RadInNode; + int OutsideAirNode = ventSlab.OutsideAirNode; + // Do the one time initializations if (state.dataGlobal->BeginEnvrnFlag && state.dataVentilatedSlab->MyEnvrnFlag(Item) && !state.dataVentilatedSlab->MyPlantScanFlag(Item)) { // Coil Part - InNode = ventSlab.ReturnAirNode; - OutNode = ventSlab.RadInNode; - OutsideAirNode = ventSlab.OutsideAirNode; RhoAir = state.dataEnvrn->StdRhoAir; if (state.dataVentilatedSlab->NumOfVentSlabs > 0) { @@ -1737,9 +1724,6 @@ namespace VentilatedSlab { } // These initializations are done every iteration... - InNode = ventSlab.ReturnAirNode; - OutNode = ventSlab.RadInNode; - OutsideAirNode = ventSlab.OutsideAirNode; AirRelNode = ventSlab.AirReliefNode; // First, set the flow conditions up so that there is flow through the ventilated @@ -1779,7 +1763,7 @@ namespace VentilatedSlab { state.dataLoopNodes->Node(OutsideAirNode).Press = state.dataEnvrn->OutBaroPress; // The first pass through in a particular time step - ZoneNum = ventSlab.ZonePtr; + int ZoneNum = ventSlab.ZonePtr; ventSlab.ZeroVentSlabSourceSumHATsurf = state.dataHeatBal->Zone(ZoneNum).sumHATsurf(state); // Set this to figure what part of the load the radiant system meets ventSlab.QRadSysSrcAvg = 0.0; // Initialize this variable to zero (radiant system defaults to off) @@ -1837,7 +1821,6 @@ namespace VentilatedSlab { std::string CoolingCoilType; Real64 rho; Real64 Cp; - int DummyWaterIndex(1); bool IsAutoSize; // Indicator to autosize Real64 MaxAirVolFlowDes; // Autosized maximum air flow for reporting Real64 MaxAirVolFlowUser; // Hardsized maximum air flow for reporting @@ -2327,6 +2310,7 @@ namespace VentilatedSlab { LatentHeatSteam = EnthSteamInDry - EnthSteamOutWet; SteamDensity = FluidProperties::GetSatDensityRefrig( state, fluidNameSteam, TempSteamIn, 1.0, ventSlab.heatingCoil_FluidIndex, RoutineName); + int DummyWaterIndex = 1; Cp = GetSpecificHeatGlycol(state, fluidNameWater, Constant::HWInitConvTemp, DummyWaterIndex, RoutineName); rho = GetDensityGlycol(state, fluidNameWater, Constant::HWInitConvTemp, DummyWaterIndex, RoutineName); MaxVolHotSteamFlowDes = @@ -2636,18 +2620,17 @@ namespace VentilatedSlab { Real64 Toutdoor; // temperature of outdoor air being introduced into the ventilated slab [degrees C] Real64 MaxSteamFlow; Real64 MinSteamFlow; - Real64 RadInTemp; // "Desired" radiant system air inlet temperature [Celsius]**setpoint - Real64 SetPointTemp; // temperature that will be used to control the radiant system [Celsius] - Real64 SetPointTempHi; // Current high point in setpoint temperature range - Real64 SetPointTempLo; // Current low point in setpoint temperature range - Real64 AirTempHi; // Current high point in water temperature range - Real64 AirTempLo; // Current low point in water temperature range - Real64 AirTempHeatHi; // Current high point in water temperature range - Real64 AirTempCoolLo; // Current low point in water temperature range - Real64 CpFan; // Intermediate calculational variable for specific heat of air < Date: Sat, 30 Nov 2024 16:05:53 -0500 Subject: [PATCH 11/15] clean, reduce, unused --- src/EnergyPlus/VentilatedSlab.cc | 577 +++++++++++++++---------------- 1 file changed, 278 insertions(+), 299 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 582da785aaf..866113a01a7 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -102,8 +102,6 @@ namespace VentilatedSlab { // MODULE INFORMATION: // AUTHOR Young Tae Chae, Rick Strand // DATE WRITTEN June 2008 - // MODIFIED - // RE-ENGINEERED na // PURPOSE OF THIS MODULE: // Simulate Ventilated Slab Systems. @@ -121,7 +119,6 @@ namespace VentilatedSlab { // Using/Aliasing using namespace DataLoopNode; - using HVAC::SmallAirVolFlow; using namespace ScheduleManager; using namespace Psychrometrics; @@ -146,8 +143,7 @@ namespace VentilatedSlab { // AUTHOR Rick Strand // DATE WRITTEN May 2000 // MODIFIED Don Shirey, Aug 2009 (LatOutputProvided) - // RE-ENGINEERED - // This is re-engineered by Rick Strand and Young T. Chae for Ventilated Slab (June, 2008) + // RE-ENGINEERED Rick Strand and Young T. Chae for Ventilated Slab (June, 2008) // PURPOSE OF THIS SUBROUTINE: // This is the main driver subroutine for the Ventilated Slab simulation. @@ -208,7 +204,6 @@ namespace VentilatedSlab { // AUTHOR Young Tae Chae, Rick Strand // DATE WRITTEN June 2008 // MODIFIED July 2012, Chandan Sharma - FSEC: Added zone sys avail managers - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine obtains the input for ventilated slab and sets @@ -224,8 +219,6 @@ namespace VentilatedSlab { static constexpr std::string_view routineName = "GetVentilatedSlabInput"; // Using/Aliasing - using BranchNodeConnections::SetUpCompSets; - using NodeInputManager::GetOnlySingleNode; auto &GetWaterCoilMaxFlowRate(WaterCoils::GetCoilMaxWaterFlowRate); auto &GetSteamCoilMaxFlowRate(SteamCoils::GetCoilMaxWaterFlowRate); auto &GetHXAssistedCoilFlowRate(HVACHXAssistedCoolingCoil::GetCoilMaxWaterFlowRate); @@ -754,158 +747,158 @@ namespace VentilatedSlab { if (ventSlab.SysConfg == VentilatedSlabConfig::SlabOnly) { - ventSlab.ReturnAirNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(18), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-OA MIXER", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.ReturnAirNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(18), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); - ventSlab.RadInNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(19), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - - ventSlab.OAMixerOutNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(23), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-OA MIXER", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.FanOutletNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(24), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Internal, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(18), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-OA MIXER", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(18), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); + ventSlab.RadInNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(19), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + + ventSlab.OAMixerOutNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(23), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-OA MIXER", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.FanOutletNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(24), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Internal, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); } else if (ventSlab.SysConfg == VentilatedSlabConfig::SeriesSlabs) { - ventSlab.ReturnAirNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(18), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-OA MIXER", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.ReturnAirNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(18), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); - ventSlab.RadInNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(19), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - - ventSlab.OAMixerOutNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(23), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-OA MIXER", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.FanOutletNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(24), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Internal, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(18), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-OA MIXER", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(18), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); + ventSlab.RadInNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(19), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + + ventSlab.OAMixerOutNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(23), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-OA MIXER", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.FanOutletNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(24), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Internal, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); } else if (ventSlab.SysConfg == VentilatedSlabConfig::SlabAndZone) { - ventSlab.ReturnAirNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(18), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-SYSTEM", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); - ventSlab.ReturnAirNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(18), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); - ventSlab.ReturnAirNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(18), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-OA MIXER", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.RadInNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(19), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.OAMixerOutNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(23), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-OA MIXER", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.FanOutletNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(24), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Internal, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(18), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-SYSTEM", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); + ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(18), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); + ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(18), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-OA MIXER", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.RadInNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(19), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.OAMixerOutNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(23), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-OA MIXER", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.FanOutletNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(24), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Internal, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); } if (ventSlab.SysConfg == VentilatedSlabConfig::SlabOnly) { @@ -926,37 +919,37 @@ namespace VentilatedSlab { ErrorsFound = true; } - ventSlab.ZoneAirInNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(20), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-SYSTEM", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); - - ventSlab.ZoneAirInNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(20), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + ventSlab.ZoneAirInNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(20), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-SYSTEM", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); + + ventSlab.ZoneAirInNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(20), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); } // Set connection type to 'Inlet', because it now uses an OA node - ventSlab.OutsideAirNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(21), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-OA MIXER", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Inlet, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + ventSlab.OutsideAirNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(21), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-OA MIXER", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); if (!lAlphaBlanks(21)) { CheckAndAddAirNodeNumber(state, ventSlab.OutsideAirNode, IsValid); @@ -967,15 +960,15 @@ namespace VentilatedSlab { } } - ventSlab.AirReliefNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(22), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name + "-OA MIXER", - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::ReliefAir, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + ventSlab.AirReliefNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(22), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name + "-OA MIXER", + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::ReliefAir, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); // Fan information: ventSlab.FanName = state.dataIPShortCut->cAlphaArgs(25); @@ -1000,13 +993,13 @@ namespace VentilatedSlab { } // Add fan to component sets array - SetUpCompSets(state, - CurrentModuleObject, - ventSlab.Name, - "UNDEFINED", - state.dataIPShortCut->cAlphaArgs(25), - state.dataIPShortCut->cAlphaArgs(23), - state.dataIPShortCut->cAlphaArgs(24)); + BranchNodeConnections::SetUpCompSets(state, + CurrentModuleObject, + ventSlab.Name, + "UNDEFINED", + state.dataIPShortCut->cAlphaArgs(25), + state.dataIPShortCut->cAlphaArgs(23), + state.dataIPShortCut->cAlphaArgs(24)); // Coil options assign @@ -1110,15 +1103,15 @@ namespace VentilatedSlab { format("{}=\"{}\" invalid {} is blank and must be entered.", CurrentModuleObject, ventSlab.Name, cAlphaFields(29))); ErrorsFound = true; } - ventSlab.HotControlNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(29), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Water, - DataLoopNode::ConnectionType::Actuator, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + ventSlab.HotControlNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(29), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Water, + DataLoopNode::ConnectionType::Actuator, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); } ventSlab.HotControlOffset = 0.001; @@ -1218,15 +1211,15 @@ namespace VentilatedSlab { ventSlab.MinVolColdWaterFlow = 0.0; - ventSlab.ColdControlNode = GetOnlySingleNode(state, - state.dataIPShortCut->cAlphaArgs(32), - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - ventSlab.Name, - DataLoopNode::NodeFluidType::Water, - DataLoopNode::ConnectionType::Actuator, - NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + ventSlab.ColdControlNode = NodeInputManager::GetOnlySingleNode(state, + state.dataIPShortCut->cAlphaArgs(32), + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + ventSlab.Name, + DataLoopNode::NodeFluidType::Water, + DataLoopNode::ConnectionType::Actuator, + NodeInputManager::CompFluidStream::Primary, + ObjectIsParent); if (lAlphaBlanks(32)) { ShowSevereError( @@ -1268,44 +1261,44 @@ namespace VentilatedSlab { switch (ventSlab.coilOption) { case CoilType::Both: { // 'HeatingAndCooling' // Add cooling coil to component sets array when present - SetUpCompSets(state, - CurrentModuleObject, - ventSlab.Name, - state.dataIPShortCut->cAlphaArgs(30), - state.dataIPShortCut->cAlphaArgs(31), - state.dataIPShortCut->cAlphaArgs(24), - "UNDEFINED"); + BranchNodeConnections::SetUpCompSets(state, + CurrentModuleObject, + ventSlab.Name, + state.dataIPShortCut->cAlphaArgs(30), + state.dataIPShortCut->cAlphaArgs(31), + state.dataIPShortCut->cAlphaArgs(24), + "UNDEFINED"); // Add heating coil to component sets array when cooling coil present - SetUpCompSets(state, - CurrentModuleObject, - ventSlab.Name, - state.dataIPShortCut->cAlphaArgs(27), - state.dataIPShortCut->cAlphaArgs(28), - "UNDEFINED", - state.dataIPShortCut->cAlphaArgs(19)); + BranchNodeConnections::SetUpCompSets(state, + CurrentModuleObject, + ventSlab.Name, + state.dataIPShortCut->cAlphaArgs(27), + state.dataIPShortCut->cAlphaArgs(28), + "UNDEFINED", + state.dataIPShortCut->cAlphaArgs(19)); break; } case CoilType::Heating: { // 'Heating' // Add heating coil to component sets array when no cooling coil present - SetUpCompSets(state, - CurrentModuleObject, - ventSlab.Name, - state.dataIPShortCut->cAlphaArgs(27), - state.dataIPShortCut->cAlphaArgs(28), - state.dataIPShortCut->cAlphaArgs(24), - state.dataIPShortCut->cAlphaArgs(19)); + BranchNodeConnections::SetUpCompSets(state, + CurrentModuleObject, + ventSlab.Name, + state.dataIPShortCut->cAlphaArgs(27), + state.dataIPShortCut->cAlphaArgs(28), + state.dataIPShortCut->cAlphaArgs(24), + state.dataIPShortCut->cAlphaArgs(19)); break; } case CoilType::Cooling: { // 'Cooling' // Add cooling coil to component sets array when no heating coil present - SetUpCompSets(state, - CurrentModuleObject, - ventSlab.Name, - state.dataIPShortCut->cAlphaArgs(30), - state.dataIPShortCut->cAlphaArgs(31), - state.dataIPShortCut->cAlphaArgs(24), - state.dataIPShortCut->cAlphaArgs(19)); + BranchNodeConnections::SetUpCompSets(state, + CurrentModuleObject, + ventSlab.Name, + state.dataIPShortCut->cAlphaArgs(30), + state.dataIPShortCut->cAlphaArgs(31), + state.dataIPShortCut->cAlphaArgs(24), + state.dataIPShortCut->cAlphaArgs(19)); break; } case CoilType::None: @@ -1821,7 +1814,6 @@ namespace VentilatedSlab { std::string CoolingCoilType; Real64 rho; Real64 Cp; - bool IsAutoSize; // Indicator to autosize Real64 MaxAirVolFlowDes; // Autosized maximum air flow for reporting Real64 MaxAirVolFlowUser; // Hardsized maximum air flow for reporting Real64 OutAirVolFlowDes; // Autosized outdoor air flow for reporting @@ -1850,7 +1842,6 @@ namespace VentilatedSlab { WaterCoilSizDeltaT = 0.0; ErrorsFound = false; - IsAutoSize = false; MaxAirVolFlowDes = 0.0; MaxAirVolFlowUser = 0.0; OutAirVolFlowDes = 0.0; @@ -1916,7 +1907,6 @@ namespace VentilatedSlab { CoolingAirVolFlowScalable = sizingCoolingAirFlow.size(state, TempSize, ErrorsFound); } else if (SAFMethod == FlowPerCoolingCapacity) { - SizingMethod = CoolingCapacitySizing; TempSize = AutoSize; PrintFlag = false; state.dataSize->DataScalableSizingON = true; @@ -1968,7 +1958,6 @@ namespace VentilatedSlab { sizingHeatingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); HeatingAirVolFlowScalable = sizingHeatingAirFlow.size(state, TempSize, ErrorsFound); } else if (SAFMethod == FlowPerHeatingCapacity) { - SizingMethod = HeatingCapacitySizing; TempSize = AutoSize; PrintFlag = false; state.dataSize->DataScalableSizingON = true; @@ -1978,7 +1967,6 @@ namespace VentilatedSlab { sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); state.dataSize->DataAutosizedHeatingCapacity = sizerHeatingCapacity.size(state, TempSize, ErrorsFound); state.dataSize->DataFlowPerHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; - SizingMethod = HeatingAirflowSizing; PrintFlag = true; TempSize = AutoSize; HeatingAirFlowSizer sizingHeatingAirFlow; @@ -2005,7 +1993,7 @@ namespace VentilatedSlab { ventSlab.MaxAirVolFlow = sizerSystemAirFlow.size(state, TempSize, ErrorsFound); } - IsAutoSize = false; + bool IsAutoSize = false; if (ventSlab.OutAirVolFlow == AutoSize) { IsAutoSize = true; } @@ -2062,7 +2050,7 @@ namespace VentilatedSlab { } else { CheckZoneSizing(state, cMO_VentilatedSlab, ventSlab.Name); MinOutAirVolFlowDes = min(state.dataSize->FinalZoneSizing(CurZoneEqNum).MinOA, ventSlab.MaxAirVolFlow); - if (MinOutAirVolFlowDes < SmallAirVolFlow) { + if (MinOutAirVolFlowDes < HVAC::SmallAirVolFlow) { MinOutAirVolFlowDes = 0.0; } if (IsAutoSize) { @@ -2135,7 +2123,7 @@ namespace VentilatedSlab { } } if (DoWaterCoilSizing) { - if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= SmallAirVolFlow) { + if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= HVAC::SmallAirVolFlow) { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); SizingMethod = HeatingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { @@ -2196,9 +2184,6 @@ namespace VentilatedSlab { MaxVolHotWaterFlowDes = 0.0; } } - } - - if (IsAutoSize) { ventSlab.MaxVolHotWaterFlow = MaxVolHotWaterFlowDes; BaseSizer::reportSizerOutput( state, cMO_VentilatedSlab, ventSlab.Name, "Design Size Maximum Hot Water Flow [m3/s]", MaxVolHotWaterFlowDes); @@ -2256,7 +2241,7 @@ namespace VentilatedSlab { int PltSizHeatNum = MyPlantSizingIndex( state, "Coil:Heating:Steam", ventSlab.heatingCoilName, CoilSteamInletNode, CoilSteamOutletNode, ErrorsFound); if (PltSizHeatNum > 0) { - if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= SmallAirVolFlow) { + if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= HVAC::SmallAirVolFlow) { SizingMethod = HeatingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); @@ -2323,8 +2308,6 @@ namespace VentilatedSlab { ShowContinueError(state, format("Occurs in ZoneHVAC:VentilatedSlab Object={}", ventSlab.Name)); ErrorsFound = true; } - } - if (IsAutoSize) { ventSlab.MaxVolHotSteamFlow = MaxVolHotSteamFlowDes; BaseSizer::reportSizerOutput( state, cMO_VentilatedSlab, ventSlab.Name, "Design Size Maximum Steam Flow [m3/s]", MaxVolHotSteamFlowDes); @@ -2401,7 +2384,7 @@ namespace VentilatedSlab { } } if (DoWaterCoilSizing) { - if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolMassFlow >= SmallAirVolFlow) { + if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolMassFlow >= HVAC::SmallAirVolFlow) { SizingMethod = CoolingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); @@ -2463,8 +2446,6 @@ namespace VentilatedSlab { MaxVolColdWaterFlowDes = 0.0; } } - } - if (IsAutoSize) { ventSlab.MaxVolColdWaterFlow = MaxVolColdWaterFlowDes; BaseSizer::reportSizerOutput( state, cMO_VentilatedSlab, ventSlab.Name, "Design Size Maximum Cold Water Flow [m3/s]", MaxVolColdWaterFlowDes); @@ -2576,7 +2557,6 @@ namespace VentilatedSlab { using HeatingCoils::CheckHeatingCoilSchedule; using HVACHXAssistedCoolingCoil::CheckHXAssistedCoolingCoilSchedule; - using NodeInputManager::GetOnlySingleNode; using ScheduleManager::GetCurrentScheduleValue; using SteamCoils::CheckSteamCoilSchedule; using WaterCoils::CheckWaterCoilSchedule; @@ -2835,24 +2815,24 @@ namespace VentilatedSlab { std::string SlabName = ventSlab.SurfaceName(RadSurfNum); std::string MSlabIn = ventSlab.SlabIn(RadSurfNum); std::string MSlabOut = ventSlab.SlabOut(RadSurfNum); - ventSlab.MSlabInNode = GetOnlySingleNode(state, - MSlabIn, - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - SlabName, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Internal, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.MSlabOutNode = GetOnlySingleNode(state, - MSlabOut, - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - SlabName, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Internal, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + ventSlab.MSlabInNode = NodeInputManager::GetOnlySingleNode(state, + MSlabIn, + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + SlabName, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Internal, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.MSlabOutNode = NodeInputManager::GetOnlySingleNode(state, + MSlabOut, + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + SlabName, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Internal, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); int MSlabInletNode = ventSlab.MSlabInNode; int MSlabOutletNode = ventSlab.MSlabOutNode; @@ -3599,7 +3579,6 @@ namespace VentilatedSlab { // Using/Aliasing using HeatingCoils::SimulateHeatingCoilComponents; - using NodeInputManager::GetOnlySingleNode; using SteamCoils::SimulateSteamCoilComponents; using WaterCoils::SimulateWaterCoilComponents; auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); @@ -4165,24 +4144,24 @@ namespace VentilatedSlab { std::string SlabName = ventSlab.SurfaceName(RadSurfNum); std::string MSlabIn = ventSlab.SlabIn(RadSurfNum); std::string MSlabOut = ventSlab.SlabOut(RadSurfNum); - ventSlab.MSlabInNode = GetOnlySingleNode(state, - MSlabIn, - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - SlabName, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Internal, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); - ventSlab.MSlabOutNode = GetOnlySingleNode(state, - MSlabOut, - ErrorsFound, - DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, - SlabName, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Internal, - NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + ventSlab.MSlabInNode = NodeInputManager::GetOnlySingleNode(state, + MSlabIn, + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + SlabName, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Internal, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); + ventSlab.MSlabOutNode = NodeInputManager::GetOnlySingleNode(state, + MSlabOut, + ErrorsFound, + DataLoopNode::ConnectionObjectType::ZoneHVACVentilatedSlab, + SlabName, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Internal, + NodeInputManager::CompFluidStream::Primary, + ObjectIsNotParent); int MSlabInletNode = ventSlab.MSlabInNode; int MSlabOutletNode = ventSlab.MSlabOutNode; SurfNum = ventSlab.SurfacePtr(RadSurfNum); From 444c4ab94c55c77dc13efc176b1e0371ed161dd1 Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 16:25:02 -0500 Subject: [PATCH 12/15] using --- src/EnergyPlus/VentilatedSlab.cc | 256 +++++++++++++------------------ 1 file changed, 106 insertions(+), 150 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 866113a01a7..557d118cc2e 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -222,15 +222,10 @@ namespace VentilatedSlab { auto &GetWaterCoilMaxFlowRate(WaterCoils::GetCoilMaxWaterFlowRate); auto &GetSteamCoilMaxFlowRate(SteamCoils::GetCoilMaxWaterFlowRate); auto &GetHXAssistedCoilFlowRate(HVACHXAssistedCoolingCoil::GetCoilMaxWaterFlowRate); - using HVACHXAssistedCoolingCoil::GetHXCoilTypeAndName; - using ScheduleManager::GetScheduleIndex; using namespace DataLoopNode; using namespace DataSurfaceLists; - using OutAirNodeManager::CheckAndAddAirNodeNumber; - // SUBROUTINE PARAMETER DEFINITIONS: - constexpr std::array(VentilatedSlabConfig::Num)> VentilatedSlabConfigNamesUC{ "SLABONLY", "SLABANDZONE", "SERIESSLABS"}; @@ -322,7 +317,8 @@ namespace VentilatedSlab { ventSlab.Name = state.dataIPShortCut->cAlphaArgs(1); if (lAlphaBlanks(2)) { ventSlab.SchedPtr = ScheduleManager::ScheduleAlwaysOn; - } else if ((ventSlab.SchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(2))) == 0) { // convert schedule name to pointer + } else if ((ventSlab.SchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(2))) == + 0) { // convert schedule name to pointer ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", CurrentModuleObject, @@ -481,7 +477,8 @@ namespace VentilatedSlab { switch (ventSlab.outsideAirControlType) { case OutsideAirControlType::VariablePercent: { - ventSlab.MaxOASchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(7)); // convert schedule name to pointer + ventSlab.MaxOASchedPtr = + ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(7)); // convert schedule name to pointer if (ventSlab.MaxOASchedPtr == 0) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -502,7 +499,8 @@ namespace VentilatedSlab { break; } case OutsideAirControlType::FixedOAControl: { - ventSlab.MaxOASchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(7)); // convert schedule name to pointer + ventSlab.MaxOASchedPtr = + ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(7)); // convert schedule name to pointer if (ventSlab.MaxOASchedPtr == 0) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -523,7 +521,8 @@ namespace VentilatedSlab { break; } case OutsideAirControlType::FixedTemperature: { - ventSlab.TempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(7)); // convert schedule name to pointer + ventSlab.TempSchedPtr = + ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(7)); // convert schedule name to pointer if (ventSlab.TempSchedPtr == 0) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -542,7 +541,8 @@ namespace VentilatedSlab { } } - ventSlab.MinOASchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(6)); // convert schedule name to pointer + ventSlab.MinOASchedPtr = + ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(6)); // convert schedule name to pointer if (ventSlab.MinOASchedPtr == 0) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -614,7 +614,7 @@ namespace VentilatedSlab { // Heating User Input Data For Ventilated Slab Control : // High Air Temp : - ventSlab.HotAirHiTempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(10)); + ventSlab.HotAirHiTempSchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(10)); if ((ventSlab.HotAirHiTempSchedPtr == 0) && (!lAlphaBlanks(10))) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -627,7 +627,7 @@ namespace VentilatedSlab { // Low Air Temp : - ventSlab.HotAirLoTempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(11)); + ventSlab.HotAirLoTempSchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(11)); if ((ventSlab.HotAirLoTempSchedPtr == 0) && (!lAlphaBlanks(11))) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -638,7 +638,7 @@ namespace VentilatedSlab { ErrorsFound = true; } - ventSlab.HotCtrlHiTempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(12)); + ventSlab.HotCtrlHiTempSchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(12)); if ((ventSlab.HotCtrlHiTempSchedPtr == 0) && (!lAlphaBlanks(12))) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -649,7 +649,7 @@ namespace VentilatedSlab { ErrorsFound = true; } - ventSlab.HotCtrlLoTempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(13)); + ventSlab.HotCtrlLoTempSchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(13)); if ((ventSlab.HotCtrlLoTempSchedPtr == 0) && (!lAlphaBlanks(13))) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -662,7 +662,7 @@ namespace VentilatedSlab { // Cooling User Input Data For Ventilated Slab Control : // Cooling High Temp Sch. - ventSlab.ColdAirHiTempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(14)); + ventSlab.ColdAirHiTempSchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(14)); if ((ventSlab.ColdAirHiTempSchedPtr == 0) && (!lAlphaBlanks(14))) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -675,7 +675,7 @@ namespace VentilatedSlab { // Cooling Low Temp Sch. - ventSlab.ColdAirLoTempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(15)); + ventSlab.ColdAirLoTempSchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(15)); if ((ventSlab.ColdAirLoTempSchedPtr == 0) && (!lAlphaBlanks(15))) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -688,7 +688,7 @@ namespace VentilatedSlab { // Cooling Control High Sch. - ventSlab.ColdCtrlHiTempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(16)); + ventSlab.ColdCtrlHiTempSchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(16)); if ((ventSlab.ColdCtrlHiTempSchedPtr == 0) && (!lAlphaBlanks(16))) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -701,7 +701,7 @@ namespace VentilatedSlab { // Cooling Control Low Sch. - ventSlab.ColdCtrlLoTempSchedPtr = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(17)); + ventSlab.ColdCtrlLoTempSchedPtr = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(17)); if ((ventSlab.ColdCtrlLoTempSchedPtr == 0) && (!lAlphaBlanks(17))) { ShowSevereError(state, format(R"({}="{}" invalid {}="{}" not found.)", @@ -952,7 +952,7 @@ namespace VentilatedSlab { ObjectIsNotParent); if (!lAlphaBlanks(21)) { - CheckAndAddAirNodeNumber(state, ventSlab.OutsideAirNode, IsValid); + OutAirNodeManager::CheckAndAddAirNodeNumber(state, ventSlab.OutsideAirNode, IsValid); if (!IsValid) { ShowWarningError( state, @@ -1161,12 +1161,12 @@ namespace VentilatedSlab { break; } case CoolingCoilType::HXAssisted: { - GetHXCoilTypeAndName(state, - state.dataIPShortCut->cAlphaArgs(30), - state.dataIPShortCut->cAlphaArgs(31), - ErrorsFound, - ventSlab.coolingCoilPlantType, - ventSlab.coolingCoilPlantName); + HVACHXAssistedCoolingCoil::GetHXCoilTypeAndName(state, + state.dataIPShortCut->cAlphaArgs(30), + state.dataIPShortCut->cAlphaArgs(31), + ErrorsFound, + ventSlab.coolingCoilPlantType, + ventSlab.coolingCoilPlantName); if (Util::SameString(ventSlab.coolingCoilPlantType, "Coil:Cooling:Water")) { ventSlab.coolingCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; } else if (Util::SameString(ventSlab.coolingCoilPlantType, "Coil:Cooling:Water:DetailedGeometry")) { @@ -1319,18 +1319,6 @@ namespace VentilatedSlab { // Setup Report variables for the VENTILATED SLAB for (Item = 1; Item <= state.dataVentilatedSlab->NumOfVentSlabs; ++Item) { - // CALL SetupOutputVariable(state, 'Ventilated Slab Direct Heat Loss Rate [W]', & - // VentSlab(Item)%DirectHeatLossRate,'System', & - // 'Average', VentSlab(Item)%Name) - // CALL SetupOutputVariable(state, 'Ventilated Slab Direct Heat Loss [W]', & - // VentSlab(Item)%DirectHeatLoss,'System', & - // 'Sum', VentSlab(Item)%Name) - // CALL SetupOutputVariable(state, 'Ventilated Slab Direct Heat Gain Rate [W]', & - // VentSlab(Item)%DirectHeatGainRate,'System', & - // 'Average', VentSlab(Item)%Name) - // CALL SetupOutputVariable(state, 'Ventilated Slab Direct Heat Gain [J]', & - // VentSlab(Item)%DirectHeatGain,'System', & - // 'Sum', VentSlab(Item)%Name) auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); SetupOutputVariable(state, "Zone Ventilated Slab Radiant Heating Rate", @@ -1494,7 +1482,6 @@ namespace VentilatedSlab { // AUTHOR Young Tae Chae, Rick Strand // DATE WRITTEN June 2008 // MODIFIED July 2012, Chandan Sharma - FSEC: Added zone sys avail managers - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine initializes all of the data elements which are necessary @@ -1503,21 +1490,9 @@ namespace VentilatedSlab { // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - // REFERENCES: - // na - // Using/Aliasing auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); - using DataZoneEquipment::CheckZoneEquipmentList; - using FluidProperties::GetDensityGlycol; - using PlantUtilities::InitComponentNodes; - using PlantUtilities::ScanPlantLoopsForObject; - using ScheduleManager::GetCurrentScheduleValue; - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: static constexpr std::string_view RoutineName("InitVentilatedSlab"); @@ -1569,7 +1544,8 @@ namespace VentilatedSlab { if ((ventSlab.heatingCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) || (ventSlab.heatingCoilType == DataPlant::PlantEquipmentType::CoilSteamAirHeating)) { bool errFlag = false; - ScanPlantLoopsForObject(state, ventSlab.heatingCoilName, ventSlab.heatingCoilType, ventSlab.HWPlantLoc, errFlag, _, _, _, _, _); + PlantUtilities::ScanPlantLoopsForObject( + state, ventSlab.heatingCoilName, ventSlab.heatingCoilType, ventSlab.HWPlantLoc, errFlag, _, _, _, _, _); if (errFlag) { ShowContinueError(state, format("Reference Unit=\"{}\", type=ZoneHVAC:VentilatedSlab", ventSlab.Name)); ShowFatalError(state, "InitVentilatedSlab: Program terminated due to previous condition(s)."); @@ -1580,7 +1556,7 @@ namespace VentilatedSlab { if ((ventSlab.coolingCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || (ventSlab.coolingCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) { bool errFlag = false; - ScanPlantLoopsForObject(state, ventSlab.coolingCoilPlantName, ventSlab.coolingCoilType, ventSlab.CWPlantLoc, errFlag); + PlantUtilities::ScanPlantLoopsForObject(state, ventSlab.coolingCoilPlantName, ventSlab.coolingCoilType, ventSlab.CWPlantLoc, errFlag); if (errFlag) { ShowContinueError(state, format("Reference Unit=\"{}\", type=ZoneHVAC:VentilatedSlab", ventSlab.Name)); ShowFatalError(state, "InitVentilatedSlab: Program terminated due to previous condition(s)."); @@ -1599,7 +1575,7 @@ namespace VentilatedSlab { if (!state.dataVentilatedSlab->ZoneEquipmentListChecked && state.dataZoneEquip->ZoneEquipInputsFilled) { state.dataVentilatedSlab->ZoneEquipmentListChecked = true; for (int RadNum = 1; RadNum <= state.dataVentilatedSlab->NumOfVentSlabs; ++RadNum) { - if (CheckZoneEquipmentList(state, cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(RadNum).Name)) continue; + if (DataZoneEquipment::CheckZoneEquipmentList(state, cMO_VentilatedSlab, state.dataVentilatedSlab->VentSlab(RadNum).Name)) continue; ShowSevereError( state, format("InitVentilatedSlab: Ventilated Slab Unit=[{},{}] is not on any ZoneHVAC:EquipmentList. It will not be simulated.", @@ -1666,16 +1642,16 @@ namespace VentilatedSlab { if (ventSlab.heatingCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating && !state.dataVentilatedSlab->MyPlantScanFlag(Item)) { - rho = GetDensityGlycol(state, - state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidName, - Constant::HWInitConvTemp, - state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidIndex, - RoutineName); + rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidName, + Constant::HWInitConvTemp, + state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidIndex, + RoutineName); ventSlab.MaxHotWaterFlow = rho * ventSlab.MaxVolHotWaterFlow; ventSlab.MinHotWaterFlow = rho * ventSlab.MinVolHotWaterFlow; - InitComponentNodes( + PlantUtilities::InitComponentNodes( state, ventSlab.MinHotWaterFlow, ventSlab.MaxHotWaterFlow, ventSlab.HotControlNode, ventSlab.HotCoilOutNodeNum); } if (ventSlab.heatingCoilType == DataPlant::PlantEquipmentType::CoilSteamAirHeating && @@ -1686,7 +1662,7 @@ namespace VentilatedSlab { ventSlab.MaxHotSteamFlow = SteamDensity * ventSlab.MaxVolHotSteamFlow; ventSlab.MinHotSteamFlow = SteamDensity * ventSlab.MinVolHotSteamFlow; - InitComponentNodes( + PlantUtilities::InitComponentNodes( state, ventSlab.MinHotSteamFlow, ventSlab.MaxHotSteamFlow, ventSlab.HotControlNode, ventSlab.HotCoilOutNodeNum); } } //(VentSlab(Item)%HCoilPresent) @@ -1695,14 +1671,14 @@ namespace VentilatedSlab { // Only initialize these if a cooling coil is actually present if ((ventSlab.coolingCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) || (ventSlab.coolingCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling)) { - rho = GetDensityGlycol(state, - state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidName, - Constant::CWInitConvTemp, - state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidIndex, - RoutineName); + rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidName, + Constant::CWInitConvTemp, + state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidIndex, + RoutineName); ventSlab.MaxColdWaterFlow = rho * ventSlab.MaxVolColdWaterFlow; ventSlab.MinColdWaterFlow = rho * ventSlab.MinVolColdWaterFlow; - InitComponentNodes( + PlantUtilities::InitComponentNodes( state, ventSlab.MinColdWaterFlow, ventSlab.MaxColdWaterFlow, ventSlab.ColdControlNode, ventSlab.ColdCoilOutNodeNum); } } @@ -1774,7 +1750,6 @@ namespace VentilatedSlab { // DATE WRITTEN June 2008 // MODIFIED July 2013 Daeho Kang, add component sizing table entries // July 2014, B. Nigusse, added scalable sizing - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine is for sizing Ventilated Slab components for which flow rates have not been @@ -1785,16 +1760,6 @@ namespace VentilatedSlab { // Using/Aliasing using namespace DataSizing; - using FluidProperties::GetDensityGlycol; - using FluidProperties::GetSpecificHeatGlycol; - using HVAC::CoolingCapacitySizing; - using HVAC::HeatingAirflowSizing; - using HVAC::HeatingCapacitySizing; - using HVACHXAssistedCoolingCoil::GetHXCoilType; - using HVACHXAssistedCoolingCoil::GetHXDXCoilName; - using PlantUtilities::MyPlantSizingIndex; - using SteamCoils::GetCoilSteamInletNode; - using SteamCoils::GetCoilSteamOutletNode; // SUBROUTINE PARAMETER DEFINITIONS: static constexpr std::string_view RoutineName("SizeVentilatedSlab"); @@ -1928,7 +1893,7 @@ namespace VentilatedSlab { } } if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingSAFMethod > 0) { - SizingMethod = HeatingAirflowSizing; + SizingMethod = HVAC::HeatingAirflowSizing; int SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingSAFMethod; zoneEqSizing.SizingMethod(SizingMethod) = SAFMethod; if (SAFMethod == None || SAFMethod == SupplyAirFlowRate || SAFMethod == FlowPerFloorArea || @@ -2104,7 +2069,7 @@ namespace VentilatedSlab { int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, "Coil:Heating:Water", ventSlab.heatingCoilName, ErrorsFound); if (IsAutoSize) { - int PltSizHeatNum = MyPlantSizingIndex( + int PltSizHeatNum = PlantUtilities::MyPlantSizingIndex( state, "Coil:Heating:Water", ventSlab.heatingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); int CoilNum = WaterCoils::GetWaterCoilIndex(state, "COIL:HEATING:WATER", ventSlab.heatingCoilName, ErrorsFound); if (state.dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp) { @@ -2125,7 +2090,7 @@ namespace VentilatedSlab { if (DoWaterCoilSizing) { if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= HVAC::SmallAirVolFlow) { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); - SizingMethod = HeatingCapacitySizing; + SizingMethod = HVAC::HeatingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { zoneHVACIndex = ventSlab.HVACSizingIndex; int CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; @@ -2169,16 +2134,16 @@ namespace VentilatedSlab { sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); DesCoilLoad = sizerHeatingCapacity.size(state, TempSize, ErrorsFound); } - rho = GetDensityGlycol(state, - state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidName, - Constant::HWInitConvTemp, - state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidIndex, - RoutineName); - Cp = GetSpecificHeatGlycol(state, - state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidName, - Constant::HWInitConvTemp, - state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidIndex, - RoutineName); + rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidName, + Constant::HWInitConvTemp, + state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidIndex, + RoutineName); + Cp = FluidProperties::GetSpecificHeatGlycol(state, + state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidName, + Constant::HWInitConvTemp, + state.dataPlnt->PlantLoop(ventSlab.HWPlantLoc.loopNum).FluidIndex, + RoutineName); MaxVolHotWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); } else { MaxVolHotWaterFlowDes = 0.0; @@ -2235,14 +2200,14 @@ namespace VentilatedSlab { } else { // Autosize or hard-size with sizing run CheckZoneSizing(state, "ZoneHVAC:VentilatedSlab", ventSlab.Name); - int CoilSteamInletNode = GetCoilSteamInletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); - int CoilSteamOutletNode = GetCoilSteamOutletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); + int CoilSteamInletNode = SteamCoils::GetCoilSteamInletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); + int CoilSteamOutletNode = SteamCoils::GetCoilSteamOutletNode(state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ErrorsFound); if (IsAutoSize) { - int PltSizHeatNum = MyPlantSizingIndex( + int PltSizHeatNum = PlantUtilities::MyPlantSizingIndex( state, "Coil:Heating:Steam", ventSlab.heatingCoilName, CoilSteamInletNode, CoilSteamOutletNode, ErrorsFound); if (PltSizHeatNum > 0) { if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow >= HVAC::SmallAirVolFlow) { - SizingMethod = HeatingCapacitySizing; + SizingMethod = HVAC::HeatingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); zoneHVACIndex = ventSlab.HVACSizingIndex; @@ -2296,8 +2261,10 @@ namespace VentilatedSlab { SteamDensity = FluidProperties::GetSatDensityRefrig( state, fluidNameSteam, TempSteamIn, 1.0, ventSlab.heatingCoil_FluidIndex, RoutineName); int DummyWaterIndex = 1; - Cp = GetSpecificHeatGlycol(state, fluidNameWater, Constant::HWInitConvTemp, DummyWaterIndex, RoutineName); - rho = GetDensityGlycol(state, fluidNameWater, Constant::HWInitConvTemp, DummyWaterIndex, RoutineName); + Cp = FluidProperties::GetSpecificHeatGlycol( + state, fluidNameWater, Constant::HWInitConvTemp, DummyWaterIndex, RoutineName); + rho = + FluidProperties::GetDensityGlycol(state, fluidNameWater, Constant::HWInitConvTemp, DummyWaterIndex, RoutineName); MaxVolHotSteamFlowDes = DesCoilLoad / ((state.dataSize->PlantSizData(PltSizHeatNum).DeltaT * Cp * rho) + SteamDensity * LatentHeatSteam); } else { @@ -2356,8 +2323,10 @@ namespace VentilatedSlab { } else { CheckZoneSizing(state, cMO_VentilatedSlab, ventSlab.Name); if (ventSlab.cCoilType == CoolingCoilType::HXAssisted) { - CoolingCoilName = GetHXDXCoilName(state, ventSlab.coolingCoilTypeCh, ventSlab.coolingCoilName, ErrorsFound); - CoolingCoilType = GetHXCoilType(state, ventSlab.coolingCoilTypeCh, ventSlab.coolingCoilName, ErrorsFound); + CoolingCoilName = + HVACHXAssistedCoolingCoil::GetHXDXCoilName(state, ventSlab.coolingCoilTypeCh, ventSlab.coolingCoilName, ErrorsFound); + CoolingCoilType = + HVACHXAssistedCoolingCoil::GetHXCoilType(state, ventSlab.coolingCoilTypeCh, ventSlab.coolingCoilName, ErrorsFound); } else { CoolingCoilName = ventSlab.coolingCoilName; CoolingCoilType = ventSlab.coolingCoilTypeCh; @@ -2365,8 +2334,8 @@ namespace VentilatedSlab { int CoilWaterInletNode = WaterCoils::GetCoilWaterInletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); int CoilWaterOutletNode = WaterCoils::GetCoilWaterOutletNode(state, CoolingCoilType, CoolingCoilName, ErrorsFound); if (IsAutoSize) { - int PltSizCoolNum = - MyPlantSizingIndex(state, CoolingCoilType, CoolingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); + int PltSizCoolNum = PlantUtilities::MyPlantSizingIndex( + state, CoolingCoilType, CoolingCoilName, CoilWaterInletNode, CoilWaterOutletNode, ErrorsFound); int CoilNum = WaterCoils::GetWaterCoilIndex(state, CoolingCoilType, CoolingCoilName, ErrorsFound); if (state.dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp) { WaterCoilSizDeltaT = state.dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp; @@ -2385,7 +2354,7 @@ namespace VentilatedSlab { } if (DoWaterCoilSizing) { if (state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolMassFlow >= HVAC::SmallAirVolFlow) { - SizingMethod = CoolingCapacitySizing; + SizingMethod = HVAC::CoolingCapacitySizing; if (ventSlab.HVACSizingIndex > 0) { auto &zoneEqSizing = state.dataSize->ZoneEqSizing(CurZoneEqNum); zoneHVACIndex = ventSlab.HVACSizingIndex; @@ -2431,16 +2400,16 @@ namespace VentilatedSlab { sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); DesCoilLoad = sizerCoolingCapacity.size(state, TempSize, ErrorsFound); } - rho = GetDensityGlycol(state, - state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidName, - 5., - state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidIndex, - RoutineName); - Cp = GetSpecificHeatGlycol(state, - state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidName, - 5., - state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidIndex, - RoutineName); + rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidName, + 5., + state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidIndex, + RoutineName); + Cp = FluidProperties::GetSpecificHeatGlycol(state, + state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidName, + 5., + state.dataPlnt->PlantLoop(ventSlab.CWPlantLoc.loopNum).FluidIndex, + RoutineName); MaxVolColdWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); } else { MaxVolColdWaterFlowDes = 0.0; @@ -2478,8 +2447,8 @@ namespace VentilatedSlab { } if (ventSlab.cCoilType == CoolingCoilType::HXAssisted) { - CoolingCoilName = GetHXDXCoilName(state, ventSlab.coolingCoilTypeCh, ventSlab.coolingCoilName, ErrorsFound); - CoolingCoilType = GetHXCoilType(state, ventSlab.coolingCoilTypeCh, ventSlab.coolingCoilName, ErrorsFound); + CoolingCoilName = HVACHXAssistedCoolingCoil::GetHXDXCoilName(state, ventSlab.coolingCoilTypeCh, ventSlab.coolingCoilName, ErrorsFound); + CoolingCoilType = HVACHXAssistedCoolingCoil::GetHXCoilType(state, ventSlab.coolingCoilTypeCh, ventSlab.coolingCoilName, ErrorsFound); } else { CoolingCoilName = ventSlab.coolingCoilName; CoolingCoilType = ventSlab.coolingCoilTypeCh; @@ -2512,7 +2481,6 @@ namespace VentilatedSlab { // DATE WRITTEN June 2008 // MODIFIED Don Shirey, Aug 2009 (LatOutputProvided) // July 2012, Chandan Sharma - FSEC: Added zone sys avail managers - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine mainly controls the action of the Ventilated Slab @@ -2550,35 +2518,22 @@ namespace VentilatedSlab { // REFERENCES: // ASHRAE Systems and Equipment Handbook (SI), 1996. page 31.3 - // USE STATEMENTS: - // Using/Aliasing auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); using HeatingCoils::CheckHeatingCoilSchedule; using HVACHXAssistedCoolingCoil::CheckHXAssistedCoolingCoilSchedule; - using ScheduleManager::GetCurrentScheduleValue; using SteamCoils::CheckSteamCoilSchedule; using WaterCoils::CheckWaterCoilSchedule; - // Locals - Real64 QZnReq; - - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: - Real64 constexpr LowTempDiff(0.1); // Smallest allowed temperature difference for comparisons // (below this value the temperatures are assumed equal) Real64 constexpr LowOAFracDiff(0.01); // Smallest allowed outside air fraction difference for comparison // (below this value the fractions are assumed equal) - // INTERFACE BLOCK SPECIFICATIONS - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + Real64 QZnReq; Real64 AirMassFlow; // air mass flow rate [kg/sec] int AirRelNode; // outside air relief node int ControlNode; // the hot water or cold water inlet node @@ -2772,10 +2727,11 @@ namespace VentilatedSlab { // Load Check - AirTempHeatHi = GetCurrentScheduleValue(state, ventSlab.HotCtrlHiTempSchedPtr); - AirTempCoolLo = GetCurrentScheduleValue(state, ventSlab.ColdCtrlLoTempSchedPtr); + AirTempHeatHi = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.HotCtrlHiTempSchedPtr); + AirTempCoolLo = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.ColdCtrlLoTempSchedPtr); - if (((SetPointTemp >= AirTempHeatHi) && (SetPointTemp <= AirTempCoolLo)) || (GetCurrentScheduleValue(state, ventSlab.SchedPtr) <= 0)) { + if (((SetPointTemp >= AirTempHeatHi) && (SetPointTemp <= AirTempCoolLo)) || + (ScheduleManager::GetCurrentScheduleValue(state, ventSlab.SchedPtr) <= 0)) { // System is off or has no load upon it; set the flow rates to zero and then // simulate the components with the no flow conditions @@ -2849,15 +2805,15 @@ namespace VentilatedSlab { state.dataVentilatedSlab->OperatingMode = HeatingMode; // Check the setpoint and temperature span - SetPointTempHi = GetCurrentScheduleValue(state, ventSlab.HotCtrlHiTempSchedPtr); - SetPointTempLo = GetCurrentScheduleValue(state, ventSlab.HotCtrlLoTempSchedPtr); + SetPointTempHi = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.HotCtrlHiTempSchedPtr); + SetPointTempLo = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.HotCtrlLoTempSchedPtr); if (SetPointTempHi < SetPointTempLo) { ShowSevereError(state, format("Heating setpoint temperature mismatch in{}", ventSlab.Name)); ShowContinueError(state, "High setpoint temperature is less than low setpoint temperature--check your schedule input"); ShowFatalError(state, "Preceding condition causes termination."); } - AirTempHi = GetCurrentScheduleValue(state, ventSlab.HotAirHiTempSchedPtr); - AirTempLo = GetCurrentScheduleValue(state, ventSlab.HotAirLoTempSchedPtr); + AirTempHi = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.HotAirHiTempSchedPtr); + AirTempLo = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.HotAirLoTempSchedPtr); if (AirTempHi < AirTempLo) { ShowSevereError(state, format("Heating Air temperature mismatch in{}", ventSlab.Name)); @@ -2901,7 +2857,7 @@ namespace VentilatedSlab { state.dataVentilatedSlab->HCoilOn = true; if (state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate > 0.0) { - MinOAFrac = GetCurrentScheduleValue(state, ventSlab.MinOASchedPtr) * + MinOAFrac = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.MinOASchedPtr) * (ventSlab.MinOutAirMassFlow / state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate); } else { MinOAFrac = 0.0; @@ -2943,14 +2899,14 @@ namespace VentilatedSlab { } else { // Tinlet < Toutdoor - MaxOAFrac = GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr); + MaxOAFrac = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr); state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate; } break; } case OutsideAirControlType::FixedTemperature: { // This is basically the same algorithm as for the heating case... - Tdesired = GetCurrentScheduleValue(state, ventSlab.TempSchedPtr); + Tdesired = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.TempSchedPtr); MaxOAFrac = 1.0; if (std::abs(Tinlet - Toutdoor) <= LowTempDiff) { // no difference in indoor and outdoor conditions-->set OA to minimum @@ -3003,7 +2959,7 @@ namespace VentilatedSlab { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = min(1.0, max(0.0, GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); + MaxOAFrac = min(1.0, max(0.0, ScheduleManager::GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); } else { MaxOAFrac = 0.0; } @@ -3019,7 +2975,7 @@ namespace VentilatedSlab { } case OutsideAirControlType::FixedTemperature: { // This is basically the same algorithm as for the heating case... - Tdesired = GetCurrentScheduleValue(state, ventSlab.TempSchedPtr); + Tdesired = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.TempSchedPtr); MaxOAFrac = 1.0; if (std::abs(Tinlet - Toutdoor) <= LowTempDiff) { // no difference in indoor and outdoor conditions-->set OA to minimum @@ -3114,16 +3070,16 @@ namespace VentilatedSlab { state.dataVentilatedSlab->OperatingMode = CoolingMode; - SetPointTempHi = GetCurrentScheduleValue(state, ventSlab.ColdCtrlHiTempSchedPtr); - SetPointTempLo = GetCurrentScheduleValue(state, ventSlab.ColdCtrlLoTempSchedPtr); + SetPointTempHi = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.ColdCtrlHiTempSchedPtr); + SetPointTempLo = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.ColdCtrlLoTempSchedPtr); if (SetPointTempHi < SetPointTempLo) { ShowSevereError(state, format("Cooling setpoint temperature mismatch in{}", ventSlab.Name)); ShowContinueError(state, "High setpoint temperature is less than low setpoint temperature--check your schedule input"); ShowFatalError(state, "Preceding condition causes termination."); } - AirTempHi = GetCurrentScheduleValue(state, ventSlab.ColdAirHiTempSchedPtr); - AirTempLo = GetCurrentScheduleValue(state, ventSlab.ColdAirLoTempSchedPtr); + AirTempHi = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.ColdAirHiTempSchedPtr); + AirTempLo = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.ColdAirLoTempSchedPtr); if (AirTempHi < AirTempLo) { ShowSevereError(state, format("Cooling Air temperature mismatch in{}", ventSlab.Name)); ShowContinueError(state, "High Air temperature is less than low Air temperature--check your schedule input"); @@ -3154,7 +3110,7 @@ namespace VentilatedSlab { state.dataVentilatedSlab->HCoilOn = false; if (state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate > 0.0) { - MinOAFrac = GetCurrentScheduleValue(state, ventSlab.MinOASchedPtr) * + MinOAFrac = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.MinOASchedPtr) * (ventSlab.MinOutAirMassFlow / state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate); } else { MinOAFrac = 0.0; @@ -3177,7 +3133,7 @@ namespace VentilatedSlab { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = min(1.0, max(0.0, GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); + MaxOAFrac = min(1.0, max(0.0, ScheduleManager::GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); } else { MaxOAFrac = 0.0; } @@ -3201,14 +3157,14 @@ namespace VentilatedSlab { } else { // Tinlet > Toutdoor - MaxOAFrac = GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr); + MaxOAFrac = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr); state.dataVentilatedSlab->OAMassFlowRate = MaxOAFrac * state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate; } break; } case OutsideAirControlType::FixedTemperature: { // This is basically the same algorithm as for the heating case... - Tdesired = GetCurrentScheduleValue(state, ventSlab.TempSchedPtr); + Tdesired = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.TempSchedPtr); MaxOAFrac = 1.0; if (std::abs(Tinlet - Toutdoor) <= LowTempDiff) { // no difference in indoor and outdoor conditions-->set OA to minimum @@ -3266,7 +3222,7 @@ namespace VentilatedSlab { // In this control type, the outdoor air flow rate is fixed to the maximum value // which is equal to the minimum value, regardless of all the other conditions. if (state.dataLoopNodes->Node(OutsideAirNode).MassFlowRate > 0.0) { - MaxOAFrac = min(1.0, max(0.0, GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); + MaxOAFrac = min(1.0, max(0.0, ScheduleManager::GetCurrentScheduleValue(state, ventSlab.MaxOASchedPtr))); } else { MaxOAFrac = 0.0; } @@ -3280,7 +3236,7 @@ namespace VentilatedSlab { } case OutsideAirControlType::FixedTemperature: { // This is basically the same algorithm as for the heating case... - Tdesired = GetCurrentScheduleValue(state, ventSlab.TempSchedPtr); + Tdesired = ScheduleManager::GetCurrentScheduleValue(state, ventSlab.TempSchedPtr); MaxOAFrac = 1.0; From c3661e9d11f88c343aaf410498a1cf00768b19d9 Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 16:36:03 -0500 Subject: [PATCH 13/15] using --- src/EnergyPlus/VentilatedSlab.cc | 98 ++++++++++++-------------------- 1 file changed, 37 insertions(+), 61 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 557d118cc2e..5717dc51f30 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -2521,11 +2521,6 @@ namespace VentilatedSlab { // Using/Aliasing auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); - using HeatingCoils::CheckHeatingCoilSchedule; - using HVACHXAssistedCoolingCoil::CheckHXAssistedCoolingCoilSchedule; - using SteamCoils::CheckSteamCoilSchedule; - using WaterCoils::CheckWaterCoilSchedule; - // SUBROUTINE PARAMETER DEFINITIONS: Real64 constexpr LowTempDiff(0.1); // Smallest allowed temperature difference for comparisons // (below this value the temperatures are assumed equal) @@ -2573,21 +2568,21 @@ namespace VentilatedSlab { switch (ventSlab.hCoilType) { case HeatingCoilType::Water: { - CheckWaterCoilSchedule(state, ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); + WaterCoils::CheckWaterCoilSchedule(state, ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Steam: { - CheckSteamCoilSchedule( + SteamCoils::CheckSteamCoilSchedule( state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Electric: { - CheckHeatingCoilSchedule( + HeatingCoils::CheckHeatingCoilSchedule( state, "Coil:Heating:Electric", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Gas: { - CheckHeatingCoilSchedule( + HeatingCoils::CheckHeatingCoilSchedule( state, "Coil:Heating:Fuel", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } @@ -2598,15 +2593,15 @@ namespace VentilatedSlab { switch (ventSlab.cCoilType) { case CoolingCoilType::WaterCooling: case CoolingCoilType::DetailedCooling: { - CheckWaterCoilSchedule(state, ventSlab.coolingCoilName, ventSlab.coolingCoilSchedValue, ventSlab.coolingCoil_Index); + WaterCoils::CheckWaterCoilSchedule(state, ventSlab.coolingCoilName, ventSlab.coolingCoilSchedValue, ventSlab.coolingCoil_Index); break; } case CoolingCoilType::HXAssisted: { - CheckHXAssistedCoolingCoilSchedule(state, - "CoilSystem:Cooling:Water:HeatExchangerAssisted", - ventSlab.coolingCoilName, - ventSlab.coolingCoilSchedValue, - ventSlab.coolingCoil_Index); + HVACHXAssistedCoolingCoil::CheckHXAssistedCoolingCoilSchedule(state, + "CoilSystem:Cooling:Water:HeatExchangerAssisted", + ventSlab.coolingCoilName, + ventSlab.coolingCoilSchedValue, + ventSlab.coolingCoil_Index); break; } default: @@ -2618,21 +2613,21 @@ namespace VentilatedSlab { switch (ventSlab.hCoilType) { case HeatingCoilType::Water: { - CheckWaterCoilSchedule(state, ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); + WaterCoils::CheckWaterCoilSchedule(state, ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Steam: { - CheckSteamCoilSchedule( + SteamCoils::CheckSteamCoilSchedule( state, "Coil:Heating:Steam", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Electric: { - CheckHeatingCoilSchedule( + HeatingCoils::CheckHeatingCoilSchedule( state, "Coil:Heating:Electric", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Gas: { - CheckHeatingCoilSchedule( + HeatingCoils::CheckHeatingCoilSchedule( state, "Coil:Heating:Fuel", ventSlab.heatingCoilName, ventSlab.heatingCoilSchedValue, ventSlab.heatingCoil_Index); break; } @@ -2646,15 +2641,15 @@ namespace VentilatedSlab { switch (ventSlab.cCoilType) { case CoolingCoilType::WaterCooling: case CoolingCoilType::DetailedCooling: { - CheckWaterCoilSchedule(state, ventSlab.coolingCoilName, ventSlab.coolingCoilSchedValue, ventSlab.coolingCoil_Index); + WaterCoils::CheckWaterCoilSchedule(state, ventSlab.coolingCoilName, ventSlab.coolingCoilSchedValue, ventSlab.coolingCoil_Index); break; } case CoolingCoilType::HXAssisted: { - CheckHXAssistedCoolingCoilSchedule(state, - "CoilSystem:Cooling:Water:HeatExchangerAssisted", - ventSlab.coolingCoilName, - ventSlab.coolingCoilSchedValue, - ventSlab.coolingCoil_Index); + HVACHXAssistedCoolingCoil::CheckHXAssistedCoolingCoilSchedule(state, + "CoilSystem:Cooling:Water:HeatExchangerAssisted", + ventSlab.coolingCoilName, + ventSlab.coolingCoilSchedValue, + ventSlab.coolingCoil_Index); break; } default: @@ -3346,7 +3341,6 @@ namespace VentilatedSlab { // AUTHOR Young Tae Chae, Rick Strand // DATE WRITTEN June 2008 // MODIFIED July 2012, Chandan Sharma - FSEC: Added zone sys avail managers - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine launches the individual component simulations. @@ -3362,10 +3356,6 @@ namespace VentilatedSlab { // Using/Aliasing auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); - using HeatingCoils::SimulateHeatingCoilComponents; - using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; - using SteamCoils::SimulateSteamCoilComponents; - using WaterCoils::SimulateWaterCoilComponents; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 AirMassFlow; // total mass flow through the system @@ -3383,15 +3373,15 @@ namespace VentilatedSlab { if ((ventSlab.coolingCoilPresent) && (ventSlab.coolingCoilSchedValue >= 0.0)) { if (ventSlab.cCoilType == CoolingCoilType::HXAssisted) { - SimHXAssistedCoolingCoil(state, - ventSlab.coolingCoilName, - FirstHVACIteration, - HVAC::CompressorOp::On, - 0.0, - ventSlab.coolingCoil_Index, - HVAC::FanOp::Continuous); + HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil(state, + ventSlab.coolingCoilName, + FirstHVACIteration, + HVAC::CompressorOp::On, + 0.0, + ventSlab.coolingCoil_Index, + HVAC::FanOp::Continuous); } else { - SimulateWaterCoilComponents(state, ventSlab.coolingCoilName, FirstHVACIteration, ventSlab.coolingCoil_Index); + WaterCoils::SimulateWaterCoilComponents(state, ventSlab.coolingCoilName, FirstHVACIteration, ventSlab.coolingCoil_Index); } } @@ -3401,7 +3391,7 @@ namespace VentilatedSlab { case HeatingCoilType::Water: { - SimulateWaterCoilComponents(state, ventSlab.heatingCoilName, FirstHVACIteration, ventSlab.heatingCoil_Index); + WaterCoils::SimulateWaterCoilComponents(state, ventSlab.heatingCoilName, FirstHVACIteration, ventSlab.heatingCoil_Index); break; } case HeatingCoilType::Steam: { @@ -3418,7 +3408,7 @@ namespace VentilatedSlab { if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SimulateSteamCoilComponents(state, ventSlab.heatingCoilName, FirstHVACIteration, ventSlab.heatingCoil_Index, QCoilReq); + SteamCoils::SimulateSteamCoilComponents(state, ventSlab.heatingCoilName, FirstHVACIteration, ventSlab.heatingCoil_Index, QCoilReq); break; } case HeatingCoilType::Electric: @@ -3435,7 +3425,8 @@ namespace VentilatedSlab { if (QCoilReq < 0.0) QCoilReq = 0.0; // a heating coil can only heat, not cool - SimulateHeatingCoilComponents(state, ventSlab.heatingCoilName, FirstHVACIteration, QCoilReq, ventSlab.heatingCoil_Index); + HeatingCoils::SimulateHeatingCoilComponents( + state, ventSlab.heatingCoilName, FirstHVACIteration, QCoilReq, ventSlab.heatingCoil_Index); break; } default: @@ -3519,7 +3510,6 @@ namespace VentilatedSlab { // AUTHOR Young Tae Chae, Rick Strand // DATE WRITTEN June 2008 // MODIFIED Sep 2011 LKL/BG - resimulate only zones needing it for Radiant systems - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine launches the individual component simulations. @@ -3534,9 +3524,6 @@ namespace VentilatedSlab { // simulation. Other than that, the subroutine is very straightforward. // Using/Aliasing - using HeatingCoils::SimulateHeatingCoilComponents; - using SteamCoils::SimulateSteamCoilComponents; - using WaterCoils::SimulateWaterCoilComponents; auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); // SUBROUTINE PARAMETER DEFINITIONS: @@ -4194,8 +4181,6 @@ namespace VentilatedSlab { // SUBROUTINE INFORMATION: // AUTHOR Rick Strand // DATE WRITTEN May 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This responsibility of this subroutine is to set the air flow rates @@ -4218,16 +4203,12 @@ namespace VentilatedSlab { auto const &ventSlab = state.dataVentilatedSlab->VentSlab(Item); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int AirRelNode; // relief air node number in ventilated slab loop - int InletNode; // inlet node number for ventilated slab loop - Real64 OAFraction; // Outside air fraction of inlet air - int OAMixOutNode; // outside air mixer outlet node for ventilated slab loop - int OutsideAirNode; // outside air node number in ventilated slab loop + Real64 OAFraction; // Outside air fraction of inlet air - AirRelNode = ventSlab.AirReliefNode; - InletNode = ventSlab.ReturnAirNode; - OAMixOutNode = ventSlab.OAMixerOutNode; - OutsideAirNode = ventSlab.OutsideAirNode; + int AirRelNode = ventSlab.AirReliefNode; // relief air node number in ventilated slab loop + int InletNode = ventSlab.ReturnAirNode; // inlet node number for ventilated slab loop + int OAMixOutNode = ventSlab.OAMixerOutNode; // outside air mixer outlet node for ventilated slab loop + int OutsideAirNode = ventSlab.OutsideAirNode; // outside air node number in ventilated slab loop // "Resolve" the air flow rates... @@ -4282,8 +4263,6 @@ namespace VentilatedSlab { // SUBROUTINE INFORMATION: // AUTHOR Young Tae Chae, Rick Strand // DATE WRITTEN November 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine does any updating that needs to be done for low @@ -4418,7 +4397,6 @@ namespace VentilatedSlab { // AUTHOR Rick Strand // DATE WRITTEN December 2000 // MODIFIED June 2008 (air properties) - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine calculates the radiant system "heat exchanger" @@ -4545,8 +4523,6 @@ namespace VentilatedSlab { // SUBROUTINE INFORMATION: // AUTHOR Rick Strand // DATE WRITTEN November 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine simply produces output for the low temperature radiant system. From 352260e9af2bfac33f4225c3dd599315b0aaf4ae Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Sat, 30 Nov 2024 16:50:24 -0500 Subject: [PATCH 14/15] using --- src/EnergyPlus/VentilatedSlab.cc | 214 +++++++++++++++---------------- 1 file changed, 102 insertions(+), 112 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 5717dc51f30..4b7127c08c9 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -117,11 +117,6 @@ namespace VentilatedSlab { // ASHRAE Systems and Equipment Handbook (SI), 1996. pp. 31.1-31.3 // Fred Buhl's fan coil module (FanCoilUnits.cc) - // Using/Aliasing - using namespace DataLoopNode; - using namespace ScheduleManager; - using namespace Psychrometrics; - static std::string const fluidNameSteam("STEAM"); static std::string const fluidNameWater("WATER"); std::string const cMO_VentilatedSlab = "ZoneHVAC:VentilatedSlab"; @@ -222,8 +217,6 @@ namespace VentilatedSlab { auto &GetWaterCoilMaxFlowRate(WaterCoils::GetCoilMaxWaterFlowRate); auto &GetSteamCoilMaxFlowRate(SteamCoils::GetCoilMaxWaterFlowRate); auto &GetHXAssistedCoilFlowRate(HVACHXAssistedCoolingCoil::GetCoilMaxWaterFlowRate); - using namespace DataLoopNode; - using namespace DataSurfaceLists; // SUBROUTINE PARAMETER DEFINITIONS: constexpr std::array(VentilatedSlabConfig::Num)> VentilatedSlabConfigNamesUC{ @@ -282,7 +275,7 @@ namespace VentilatedSlab { lNumericBlanks.dimension(NumNumbers, true); // make sure data is gotten for surface lists - BaseNum = GetNumberOfSurfListVentSlab(state); + BaseNum = DataSurfaceLists::GetNumberOfSurfListVentSlab(state); state.dataVentilatedSlab->NumOfVentSlabs = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject); // Allocate the local derived type and do one-time initializations for all parts of it @@ -487,7 +480,7 @@ namespace VentilatedSlab { cAlphaFields(7), state.dataIPShortCut->cAlphaArgs(7))); ErrorsFound = true; - } else if (!CheckScheduleValueMinMax(state, ventSlab.MaxOASchedPtr, ">=", 0.0, "<=", 1.0)) { + } else if (!ScheduleManager::CheckScheduleValueMinMax(state, ventSlab.MaxOASchedPtr, ">=", 0.0, "<=", 1.0)) { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" values out of range [0,1].", CurrentModuleObject, @@ -509,7 +502,7 @@ namespace VentilatedSlab { cAlphaFields(7), state.dataIPShortCut->cAlphaArgs(7))); ErrorsFound = true; - } else if (!CheckScheduleValueMinMax(state, ventSlab.MaxOASchedPtr, true, 0.0)) { + } else if (!ScheduleManager::CheckScheduleValueMinMax(state, ventSlab.MaxOASchedPtr, true, 0.0)) { ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" values out of range (must be >=0).", CurrentModuleObject, @@ -755,7 +748,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Outlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(18), ErrorsFound, @@ -764,7 +757,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); ventSlab.RadInNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(19), ErrorsFound, @@ -773,7 +766,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.OAMixerOutNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(23), @@ -783,7 +776,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Outlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.FanOutletNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(24), ErrorsFound, @@ -792,7 +785,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Internal, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); } else if (ventSlab.SysConfg == VentilatedSlabConfig::SeriesSlabs) { @@ -804,7 +797,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Outlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(18), ErrorsFound, @@ -813,7 +806,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); ventSlab.RadInNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(19), ErrorsFound, @@ -822,7 +815,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.OAMixerOutNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(23), @@ -832,7 +825,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Outlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.FanOutletNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(24), ErrorsFound, @@ -841,7 +834,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Internal, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); } else if (ventSlab.SysConfg == VentilatedSlabConfig::SlabAndZone) { @@ -853,7 +846,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(18), ErrorsFound, @@ -862,7 +855,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); ventSlab.ReturnAirNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(18), ErrorsFound, @@ -871,7 +864,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.RadInNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(19), ErrorsFound, @@ -880,7 +873,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.OAMixerOutNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(23), ErrorsFound, @@ -889,7 +882,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Outlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.FanOutletNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(24), ErrorsFound, @@ -898,7 +891,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Internal, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); } if (ventSlab.SysConfg == VentilatedSlabConfig::SlabOnly) { @@ -927,7 +920,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Outlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); ventSlab.ZoneAirInNode = NodeInputManager::GetOnlySingleNode(state, state.dataIPShortCut->cAlphaArgs(20), @@ -937,7 +930,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Outlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); } // Set connection type to 'Inlet', because it now uses an OA node @@ -949,7 +942,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Inlet, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); if (!lAlphaBlanks(21)) { OutAirNodeManager::CheckAndAddAirNodeNumber(state, ventSlab.OutsideAirNode, IsValid); @@ -968,7 +961,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::ReliefAir, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); // Fan information: ventSlab.FanName = state.dataIPShortCut->cAlphaArgs(25); @@ -1111,7 +1104,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Water, DataLoopNode::ConnectionType::Actuator, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); } ventSlab.HotControlOffset = 0.001; @@ -1219,7 +1212,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Water, DataLoopNode::ConnectionType::Actuator, NodeInputManager::CompFluidStream::Primary, - ObjectIsParent); + DataLoopNode::ObjectIsParent); if (lAlphaBlanks(32)) { ShowSevereError( @@ -1758,9 +1751,6 @@ namespace VentilatedSlab { // METHODOLOGY EMPLOYED: // Obtains flow rates from the zone sizing arrays and plant sizing data. - // Using/Aliasing - using namespace DataSizing; - // SUBROUTINE PARAMETER DEFINITIONS: static constexpr std::string_view RoutineName("SizeVentilatedSlab"); @@ -1842,23 +1832,23 @@ namespace VentilatedSlab { SizingMethod = HVAC::CoolingAirflowSizing; int SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod; zoneEqSizing.SizingMethod(SizingMethod) = SAFMethod; - if (SAFMethod == None || SAFMethod == SupplyAirFlowRate || SAFMethod == FlowPerFloorArea || - SAFMethod == FractionOfAutosizedCoolingAirflow) { - if (SAFMethod == SupplyAirFlowRate) { + if (SAFMethod == DataSizing::None || SAFMethod == DataSizing::SupplyAirFlowRate || SAFMethod == DataSizing::FlowPerFloorArea || + SAFMethod == DataSizing::FractionOfAutosizedCoolingAirflow) { + if (SAFMethod == DataSizing::SupplyAirFlowRate) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow > 0.0) { zoneEqSizing.AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; zoneEqSizing.SystemAirFlow = true; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; - } else if (SAFMethod == FlowPerFloorArea) { + } else if (SAFMethod == DataSizing::FlowPerFloorArea) { zoneEqSizing.SystemAirFlow = true; zoneEqSizing.AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow * state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; TempSize = zoneEqSizing.AirVolFlow; state.dataSize->DataScalableSizingON = true; - } else if (SAFMethod == FractionOfAutosizedCoolingAirflow) { + } else if (SAFMethod == DataSizing::FractionOfAutosizedCoolingAirflow) { state.dataSize->DataFracOfAutosizedCoolingAirflow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; state.dataSize->DataScalableSizingON = true; } else { TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; @@ -1871,8 +1861,8 @@ namespace VentilatedSlab { sizingCoolingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); CoolingAirVolFlowScalable = sizingCoolingAirFlow.size(state, TempSize, ErrorsFound); - } else if (SAFMethod == FlowPerCoolingCapacity) { - TempSize = AutoSize; + } else if (SAFMethod == DataSizing::FlowPerCoolingCapacity) { + TempSize = DataSizing::AutoSize; PrintFlag = false; state.dataSize->DataScalableSizingON = true; state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow; @@ -1882,7 +1872,7 @@ namespace VentilatedSlab { state.dataSize->DataAutosizedCoolingCapacity = sizerCoolingCapacity.size(state, TempSize, ErrorsFound); state.dataSize->DataFlowPerCoolingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow; PrintFlag = true; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; CoolingAirFlowSizer sizingCoolingAirFlow; std::string stringOverride = "Maximum Air Flow Rate [m3/s]"; if (state.dataGlobal->isEpJSON) stringOverride = "maximum_air_flow_rate [m3/s]"; @@ -1896,23 +1886,23 @@ namespace VentilatedSlab { SizingMethod = HVAC::HeatingAirflowSizing; int SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingSAFMethod; zoneEqSizing.SizingMethod(SizingMethod) = SAFMethod; - if (SAFMethod == None || SAFMethod == SupplyAirFlowRate || SAFMethod == FlowPerFloorArea || - SAFMethod == FractionOfAutosizedHeatingAirflow) { - if (SAFMethod == SupplyAirFlowRate) { + if (SAFMethod == DataSizing::None || SAFMethod == DataSizing::SupplyAirFlowRate || SAFMethod == DataSizing::FlowPerFloorArea || + SAFMethod == DataSizing::FractionOfAutosizedHeatingAirflow) { + if (SAFMethod == DataSizing::SupplyAirFlowRate) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow > 0.0) { zoneEqSizing.AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; zoneEqSizing.SystemAirFlow = true; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; - } else if (SAFMethod == FlowPerFloorArea) { + } else if (SAFMethod == DataSizing::FlowPerFloorArea) { zoneEqSizing.SystemAirFlow = true; zoneEqSizing.AirVolFlow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow * state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; TempSize = zoneEqSizing.AirVolFlow; state.dataSize->DataScalableSizingON = true; - } else if (SAFMethod == FractionOfAutosizedHeatingAirflow) { + } else if (SAFMethod == DataSizing::FractionOfAutosizedHeatingAirflow) { state.dataSize->DataFracOfAutosizedHeatingAirflow = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; state.dataSize->DataScalableSizingON = true; } else { TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; @@ -1922,8 +1912,8 @@ namespace VentilatedSlab { // sizingHeatingAirFlow.setHVACSizingIndexData(FanCoil(FanCoilNum).HVACSizingIndex); sizingHeatingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); HeatingAirVolFlowScalable = sizingHeatingAirFlow.size(state, TempSize, ErrorsFound); - } else if (SAFMethod == FlowPerHeatingCapacity) { - TempSize = AutoSize; + } else if (SAFMethod == DataSizing::FlowPerHeatingCapacity) { + TempSize = DataSizing::AutoSize; PrintFlag = false; state.dataSize->DataScalableSizingON = true; state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow; @@ -1933,7 +1923,7 @@ namespace VentilatedSlab { state.dataSize->DataAutosizedHeatingCapacity = sizerHeatingCapacity.size(state, TempSize, ErrorsFound); state.dataSize->DataFlowPerHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; PrintFlag = true; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; HeatingAirFlowSizer sizingHeatingAirFlow; sizingHeatingAirFlow.overrideSizingString(SizingString); // sizingHeatingAirFlow.setHVACSizingIndexData(FanCoil(FanCoilNum).HVACSizingIndex); @@ -1959,7 +1949,7 @@ namespace VentilatedSlab { } bool IsAutoSize = false; - if (ventSlab.OutAirVolFlow == AutoSize) { + if (ventSlab.OutAirVolFlow == DataSizing::AutoSize) { IsAutoSize = true; } if (CurZoneEqNum > 0) { @@ -2003,7 +1993,7 @@ namespace VentilatedSlab { } IsAutoSize = false; - if (ventSlab.MinOutAirVolFlow == AutoSize) { + if (ventSlab.MinOutAirVolFlow == DataSizing::AutoSize) { IsAutoSize = true; } if (CurZoneEqNum > 0) { @@ -2052,7 +2042,7 @@ namespace VentilatedSlab { } IsAutoSize = false; - if (ventSlab.MaxVolHotWaterFlow == AutoSize) { + if (ventSlab.MaxVolHotWaterFlow == DataSizing::AutoSize) { IsAutoSize = true; } if (ventSlab.hCoilType == HeatingCoilType::Water) { @@ -2095,9 +2085,9 @@ namespace VentilatedSlab { zoneHVACIndex = ventSlab.HVACSizingIndex; int CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; - if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || - CapSizingMethod == FractionOfAutosizedHeatingCapacity) { - if (CapSizingMethod == HeatingDesignCapacity) { + if (CapSizingMethod == DataSizing::HeatingDesignCapacity || CapSizingMethod == DataSizing::CapacityPerFloorArea || + CapSizingMethod == DataSizing::FractionOfAutosizedHeatingCapacity) { + if (CapSizingMethod == DataSizing::HeatingDesignCapacity) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity > 0.0) { zoneEqSizing.HeatingCapacity = true; zoneEqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; @@ -2105,16 +2095,16 @@ namespace VentilatedSlab { state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; - } else if (CapSizingMethod == CapacityPerFloorArea) { + } else if (CapSizingMethod == DataSizing::CapacityPerFloorArea) { zoneEqSizing.HeatingCapacity = true; zoneEqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity * state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; state.dataSize->DataScalableCapSizingON = true; - } else if (CapSizingMethod == FractionOfAutosizedHeatingCapacity) { + } else if (CapSizingMethod == DataSizing::FractionOfAutosizedHeatingCapacity) { state.dataSize->DataFracOfAutosizedHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; state.dataSize->DataScalableCapSizingON = true; } } @@ -2128,7 +2118,7 @@ namespace VentilatedSlab { } else { SizingString = ""; PrintFlag = false; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; HeatingCapacitySizer sizerHeatingCapacity; sizerHeatingCapacity.overrideSizingString(SizingString); sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); @@ -2186,7 +2176,7 @@ namespace VentilatedSlab { } IsAutoSize = false; - if (ventSlab.MaxVolHotSteamFlow == AutoSize) { + if (ventSlab.MaxVolHotSteamFlow == DataSizing::AutoSize) { IsAutoSize = true; } if (ventSlab.hCoilType == HeatingCoilType::Steam) { @@ -2213,9 +2203,9 @@ namespace VentilatedSlab { zoneHVACIndex = ventSlab.HVACSizingIndex; int CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod; zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; - if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || - CapSizingMethod == FractionOfAutosizedHeatingCapacity) { - if (CapSizingMethod == HeatingDesignCapacity) { + if (CapSizingMethod == DataSizing::HeatingDesignCapacity || CapSizingMethod == DataSizing::CapacityPerFloorArea || + CapSizingMethod == DataSizing::FractionOfAutosizedHeatingCapacity) { + if (CapSizingMethod == DataSizing::HeatingDesignCapacity) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity > 0.0) { zoneEqSizing.HeatingCapacity = true; zoneEqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; @@ -2223,16 +2213,16 @@ namespace VentilatedSlab { state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; - } else if (CapSizingMethod == CapacityPerFloorArea) { + } else if (CapSizingMethod == DataSizing::CapacityPerFloorArea) { zoneEqSizing.HeatingCapacity = true; zoneEqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity * state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; state.dataSize->DataScalableCapSizingON = true; - } else if (CapSizingMethod == FractionOfAutosizedHeatingCapacity) { + } else if (CapSizingMethod == DataSizing::FractionOfAutosizedHeatingCapacity) { state.dataSize->DataFracOfAutosizedHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; state.dataSize->DataScalableCapSizingON = true; } } @@ -2246,7 +2236,7 @@ namespace VentilatedSlab { } else { SizingString = ""; PrintFlag = false; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; HeatingCapacitySizer sizerHeatingCapacity; sizerHeatingCapacity.overrideSizingString(SizingString); sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); @@ -2311,7 +2301,7 @@ namespace VentilatedSlab { } IsAutoSize = false; - if (ventSlab.MaxVolColdWaterFlow == AutoSize) { + if (ventSlab.MaxVolColdWaterFlow == DataSizing::AutoSize) { IsAutoSize = true; } if (CurZoneEqNum > 0) { @@ -2360,9 +2350,9 @@ namespace VentilatedSlab { zoneHVACIndex = ventSlab.HVACSizingIndex; int CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod; zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod; - if (CapSizingMethod == CoolingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || - CapSizingMethod == FractionOfAutosizedCoolingCapacity) { - if (CapSizingMethod == CoolingDesignCapacity) { + if (CapSizingMethod == DataSizing::CoolingDesignCapacity || CapSizingMethod == DataSizing::CapacityPerFloorArea || + CapSizingMethod == DataSizing::FractionOfAutosizedCoolingCapacity) { + if (CapSizingMethod == DataSizing::CoolingDesignCapacity) { if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity > 0.0) { zoneEqSizing.CoolingCapacity = true; zoneEqSizing.DesCoolingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity; @@ -2370,16 +2360,16 @@ namespace VentilatedSlab { state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow; } TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity; - } else if (CapSizingMethod == CapacityPerFloorArea) { + } else if (CapSizingMethod == DataSizing::CapacityPerFloorArea) { zoneEqSizing.CoolingCapacity = true; zoneEqSizing.DesCoolingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity * state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea; state.dataSize->DataScalableCapSizingON = true; - } else if (CapSizingMethod == FractionOfAutosizedCoolingCapacity) { + } else if (CapSizingMethod == DataSizing::FractionOfAutosizedCoolingCapacity) { state.dataSize->DataFracOfAutosizedHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity; state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; state.dataSize->DataScalableCapSizingON = true; } } @@ -2393,7 +2383,7 @@ namespace VentilatedSlab { } else { SizingString = ""; PrintFlag = false; - TempSize = AutoSize; + TempSize = DataSizing::AutoSize; state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow; CoolingCapacitySizer sizerCoolingCapacity; sizerCoolingCapacity.overrideSizingString(SizingString); @@ -2709,8 +2699,8 @@ namespace VentilatedSlab { break; } case ControlType::DewPointTemp: { - SetPointTemp = - PsyTdpFnWPb(state, state.dataZoneTempPredictorCorrector->zoneHeatBalance(ventSlab.ZonePtr).airHumRat, state.dataEnvrn->OutBaroPress); + SetPointTemp = Psychrometrics::PsyTdpFnWPb( + state, state.dataZoneTempPredictorCorrector->zoneHeatBalance(ventSlab.ZonePtr).airHumRat, state.dataEnvrn->OutBaroPress); break; } default: { // Should never get here @@ -2774,7 +2764,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Internal, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.MSlabOutNode = NodeInputManager::GetOnlySingleNode(state, MSlabOut, ErrorsFound, @@ -2783,7 +2773,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Internal, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); int MSlabInletNode = ventSlab.MSlabInNode; int MSlabOutletNode = ventSlab.MSlabOutNode; @@ -3018,7 +3008,7 @@ namespace VentilatedSlab { state.dataFans->fans(ventSlab.Fan_Index)->simulate(state, FirstHVACIteration, _, _); - CpFan = PsyCpAirFnW(state.dataLoopNodes->Node(FanOutletNode).HumRat); + CpFan = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(FanOutletNode).HumRat); QZnReq = (state.dataLoopNodes->Node(OutletNode).MassFlowRate) * CpFan * (RadInTemp - state.dataLoopNodes->Node(FanOutletNode).Temp); @@ -3282,7 +3272,7 @@ namespace VentilatedSlab { SimVentSlabOAMixer(state, Item); state.dataFans->fans(ventSlab.Fan_Index)->simulate(state, FirstHVACIteration, _, _); - CpFan = PsyCpAirFnW(state.dataLoopNodes->Node(FanOutletNode).HumRat); + CpFan = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(FanOutletNode).HumRat); QZnReq = (state.dataLoopNodes->Node(OutletNode).MassFlowRate) * CpFan * (RadInTemp - state.dataLoopNodes->Node(FanOutletNode).Temp); @@ -3400,7 +3390,7 @@ namespace VentilatedSlab { QCoilReq = 0.0; } else { int HCoilInAirNode = ventSlab.FanOutletNode; - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(HCoilInAirNode).HumRat); + CpAirZn = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(HCoilInAirNode).HumRat); QCoilReq = state.dataLoopNodes->Node(HCoilInAirNode).MassFlowRate * CpAirZn * (state.dataLoopNodes->Node(ventSlab.RadInNode).Temp) - (state.dataLoopNodes->Node(HCoilInAirNode).Temp); @@ -3419,7 +3409,7 @@ namespace VentilatedSlab { } else { HCoilInAirTemp = state.dataLoopNodes->Node(ventSlab.FanOutletNode).Temp; HCoilOutAirTemp = state.dataLoopNodes->Node(ventSlab.RadInNode).Temp; - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); + CpAirZn = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); QCoilReq = state.dataLoopNodes->Node(ventSlab.FanOutletNode).MassFlowRate * CpAirZn * (HCoilOutAirTemp - HCoilInAirTemp); } @@ -3438,8 +3428,8 @@ namespace VentilatedSlab { OutletNode = ventSlab.RadInNode; AirMassFlow = state.dataLoopNodes->Node(OutletNode).MassFlowRate; - LoadMet = AirMassFlow * (PsyHFnTdbW(state.dataLoopNodes->Node(OutletNode).Temp, state.dataLoopNodes->Node(InletNode).HumRat) - - PsyHFnTdbW(state.dataLoopNodes->Node(InletNode).Temp, state.dataLoopNodes->Node(InletNode).HumRat)); + LoadMet = AirMassFlow * (Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(OutletNode).Temp, state.dataLoopNodes->Node(InletNode).HumRat) - + Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(InletNode).Temp, state.dataLoopNodes->Node(InletNode).HumRat)); } void CalcVentilatedSlabCoilOutput(EnergyPlusData &state, @@ -3478,10 +3468,12 @@ namespace VentilatedSlab { AirMassFlow = state.dataLoopNodes->Node(OutletNode).MassFlowRate; // QTotUnitOut = AirMassFlow * ( Node( OutletNode ).Enthalpy - Node( FanOutletNode ).Enthalpy ); - QTotUnitOut = AirMassFlow * (PsyHFnTdbW(state.dataLoopNodes->Node(OutletNode).Temp, state.dataLoopNodes->Node(OutletNode).HumRat) - - PsyHFnTdbW(state.dataLoopNodes->Node(FanOutletNode).Temp, state.dataLoopNodes->Node(FanOutletNode).HumRat)); - QUnitOut = AirMassFlow * (PsyHFnTdbW(state.dataLoopNodes->Node(OutletNode).Temp, state.dataLoopNodes->Node(FanOutletNode).HumRat) - - PsyHFnTdbW(state.dataLoopNodes->Node(FanOutletNode).Temp, state.dataLoopNodes->Node(FanOutletNode).HumRat)); + QTotUnitOut = AirMassFlow * + (Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(OutletNode).Temp, state.dataLoopNodes->Node(OutletNode).HumRat) - + Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(FanOutletNode).Temp, state.dataLoopNodes->Node(FanOutletNode).HumRat)); + QUnitOut = AirMassFlow * + (Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(OutletNode).Temp, state.dataLoopNodes->Node(FanOutletNode).HumRat) - + Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(FanOutletNode).Temp, state.dataLoopNodes->Node(FanOutletNode).HumRat)); // Limit sensible <= total when cooling (which is negative, so use max) QUnitOut = max(QUnitOut, QTotUnitOut); @@ -3678,7 +3670,7 @@ namespace VentilatedSlab { Cl = Ch + ((Ci * (Cc + Cb * Cf) + Cj * (Cf + Ce * Cc)) / (1.0 - Ce * Cb)); Mdot = AirMassFlow * ventSlab.SurfaceFlowFrac(RadSurfNum); - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); + CpAirZn = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); state.dataHeatBalFanSys->QRadSysSource(SurfNum) = ventSlab.CoreNumbers * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / state.dataSurface->Surface(SurfNum).Area)); @@ -3757,7 +3749,7 @@ namespace VentilatedSlab { // conditions. if (state.dataVentilatedSlab->OperatingMode == CoolingMode) { - DewPointTemp = PsyTdpFnWPb(state, thisZoneHB.airHumRat, state.dataEnvrn->OutBaroPress); + DewPointTemp = Psychrometrics::PsyTdpFnWPb(state, thisZoneHB.airHumRat, state.dataEnvrn->OutBaroPress); for (int RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { if (state.dataHeatBalSurf->SurfInsideTempHist(1)(ventSlab.SurfacePtr(RadSurfNum2)) < (DewPointTemp + CondDeltaTemp)) { // Condensation warning--must shut off radiant system @@ -3828,7 +3820,7 @@ namespace VentilatedSlab { // Return Air temp Check if (ventSlab.SysConfg == VentilatedSlabConfig::SlabOnly) { if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); + CpAirZn = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); state.dataLoopNodes->Node(ReturnAirNode).Temp = state.dataLoopNodes->Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); if ((std::abs(state.dataLoopNodes->Node(ReturnAirNode).Temp - AirOutletTempCheck) > TempCheckLimit) && @@ -3955,7 +3947,7 @@ namespace VentilatedSlab { Cl = Ch + ((Ci * (Cc + Cb * Cf) + Cj * (Cf + Ce * Cc)) / (1.0 - Ce * Cb)); Mdot = AirMassFlow * FlowFrac; - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); + CpAirZn = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); state.dataHeatBalFanSys->QRadSysSource(SurfNum) = CNumDS * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / state.dataSurface->Surface(SurfNum).Area)); @@ -4009,9 +4001,10 @@ namespace VentilatedSlab { // conditions. if (state.dataVentilatedSlab->OperatingMode == CoolingMode) { - DewPointTemp = PsyTdpFnWPb(state, - state.dataZoneTempPredictorCorrector->zoneHeatBalance(ventSlab.ZPtr(RadSurfNum)).airHumRat, - state.dataEnvrn->OutBaroPress); + DewPointTemp = + Psychrometrics::PsyTdpFnWPb(state, + state.dataZoneTempPredictorCorrector->zoneHeatBalance(ventSlab.ZPtr(RadSurfNum)).airHumRat, + state.dataEnvrn->OutBaroPress); for (int RadSurfNum2 = 1; RadSurfNum2 <= ventSlab.NumOfSurfaces; ++RadSurfNum2) { if (state.dataHeatBalSurf->SurfInsideTempHist(1)(ventSlab.SurfacePtr(RadSurfNum2)) < (DewPointTemp + CondDeltaTemp)) { // Condensation warning--must shut off radiant system @@ -4095,7 +4088,7 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Internal, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ventSlab.MSlabOutNode = NodeInputManager::GetOnlySingleNode(state, MSlabOut, ErrorsFound, @@ -4104,14 +4097,14 @@ namespace VentilatedSlab { DataLoopNode::NodeFluidType::Air, DataLoopNode::ConnectionType::Internal, NodeInputManager::CompFluidStream::Primary, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); int MSlabInletNode = ventSlab.MSlabInNode; int MSlabOutletNode = ventSlab.MSlabOutNode; SurfNum = ventSlab.SurfacePtr(RadSurfNum); if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); + CpAirZn = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); state.dataLoopNodes->Node(MSlabInletNode).Temp = MSlabAirInTemp; state.dataLoopNodes->Node(MSlabOutletNode).Temp = state.dataLoopNodes->Node(MSlabInletNode).Temp - @@ -4126,7 +4119,7 @@ namespace VentilatedSlab { // Return Air temp Check if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); + CpAirZn = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); state.dataLoopNodes->Node(ReturnAirNode).Temp = state.dataLoopNodes->Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); @@ -4240,7 +4233,7 @@ namespace VentilatedSlab { } state.dataLoopNodes->Node(InletNode).Enthalpy = - PsyHFnTdbW(state.dataLoopNodes->Node(InletNode).Temp, state.dataLoopNodes->Node(InletNode).HumRat); + Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(InletNode).Temp, state.dataLoopNodes->Node(InletNode).HumRat); // Perform an energy and moisture mass balance on the mixing portion of the OA Mixer of the ventilated slab state.dataLoopNodes->Node(OAMixOutNode).Enthalpy = @@ -4250,7 +4243,7 @@ namespace VentilatedSlab { // Find the other key state points based on calculated conditions state.dataLoopNodes->Node(OAMixOutNode).Temp = - PsyTdbFnHW(state.dataLoopNodes->Node(OAMixOutNode).Enthalpy, state.dataLoopNodes->Node(OAMixOutNode).HumRat); + Psychrometrics::PsyTdbFnHW(state.dataLoopNodes->Node(OAMixOutNode).Enthalpy, state.dataLoopNodes->Node(OAMixOutNode).HumRat); state.dataLoopNodes->Node(OAMixOutNode).Press = state.dataLoopNodes->Node(InletNode).Press; } @@ -4295,7 +4288,7 @@ namespace VentilatedSlab { int FanOutNode = ventSlab.FanOutletNode; Real64 AirMassFlow = state.dataLoopNodes->Node(AirOutletNode).MassFlowRate; int ZoneInletNode = ventSlab.ZoneAirInNode; // Node number for the air side inlet of the ventilated slab - Real64 CpAppAir = PsyCpAirFnW(state.dataLoopNodes->Node(AirOutletNode).HumRat); + Real64 CpAppAir = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(AirOutletNode).HumRat); int AirInletNode = ventSlab.ReturnAirNode; // Node number for the air side inlet of the ventilated slab for (int RadSurfNum = 1; RadSurfNum <= TotRadSurfaces; ++RadSurfNum) { @@ -4379,7 +4372,7 @@ namespace VentilatedSlab { OAFraction * state.dataLoopNodes->Node(OANode).HumRat + (1.0 - OAFraction) * state.dataLoopNodes->Node(AirInletNode).HumRat; state.dataLoopNodes->Node(MixOutNode).Temp = - PsyTdbFnHW(state.dataLoopNodes->Node(MixOutNode).Enthalpy, state.dataLoopNodes->Node(MixOutNode).HumRat); + Psychrometrics::PsyTdbFnHW(state.dataLoopNodes->Node(MixOutNode).Enthalpy, state.dataLoopNodes->Node(MixOutNode).HumRat); } } @@ -4485,7 +4478,7 @@ namespace VentilatedSlab { PRactual = Pr[Index - 1] + InterpFrac * (Pr[Index] - Pr[Index - 1]); } // arguments are glycol name, temperature, and concentration - CpAppAir = PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); + CpAppAir = Psychrometrics::PsyCpAirFnW(state.dataLoopNodes->Node(ventSlab.RadInNode).HumRat); SysAirMassFlow = AirMassFlow / CoreNumbers; // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) @@ -4527,9 +4520,6 @@ namespace VentilatedSlab { // PURPOSE OF THIS SUBROUTINE: // This subroutine simply produces output for the low temperature radiant system. - // METHODOLOGY EMPLOYED: - // Standard EnergyPlus methodology. - // Using/Aliasing Real64 TimeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; auto &ventSlab = state.dataVentilatedSlab->VentSlab(Item); From f70203145c07aceffdeb70ba2aaa82a8ee9233ec Mon Sep 17 00:00:00 2001 From: Richard Raustad Date: Mon, 2 Dec 2024 13:49:39 -0500 Subject: [PATCH 15/15] Address comment --- src/EnergyPlus/VentilatedSlab.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 4b7127c08c9..2d2cb56dd2a 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -4338,14 +4338,12 @@ namespace VentilatedSlab { } } else { - if ((ventSlab.SysConfg == VentilatedSlabConfig::SlabOnly) || (ventSlab.SysConfg == VentilatedSlabConfig::SeriesSlabs)) { - state.dataLoopNodes->Node(FanOutNode) = state.dataLoopNodes->Node(AirOutletNode); - state.dataHeatBalFanSys->QRadSysSource = 0.0; - - } else if (ventSlab.SysConfg == VentilatedSlabConfig::SlabAndZone) { + state.dataLoopNodes->Node(FanOutNode) = state.dataLoopNodes->Node(AirOutletNode); + if (ventSlab.SysConfg == VentilatedSlabConfig::SlabAndZone) { state.dataLoopNodes->Node(ZoneInletNode) = state.dataLoopNodes->Node(AirInletNode); - state.dataLoopNodes->Node(FanOutNode) = state.dataLoopNodes->Node(AirOutletNode); // Fan Resolve - state.dataHeatBalFanSys->QRadSysSource = 0.0; + } + for (int const surfNum : ventSlab.SurfacePtr) { + state.dataHeatBalFanSys->QRadSysSource(surfNum) = 0.0; } }