From 40a94b98f0e239b1b28811ad34f9dc694ce6c379 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Tue, 31 Mar 2026 12:53:53 -0700 Subject: [PATCH 1/3] Set the AFN coil runtime fraction in `simulate()`. --- src/EnergyPlus/UnitarySystem.cc | 169 +++++++++++++++++++++++++------- 1 file changed, 131 insertions(+), 38 deletions(-) diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 06bd75e2ca5..0d460417b6b 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -140,6 +140,15 @@ namespace UnitarySystems { return; } + // Save the current AFN coil runtime fraction for comparison with the one calculated below + Real64 refAFNLoopHeatingCoilMaxRTF(0.0); + Real64 refAFNLoopCoolingCoilMaxRTF(0.0); + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP && AirLoopNum > 0) { + refAFNLoopHeatingCoilMaxRTF = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF; + refAFNLoopCoolingCoilMaxRTF = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; + } + // MassFlowRateMaxAvail issues are impeding non-VAV air loop equipment by limiting air flow // temporarily open up flow limits while simulating, and then set this same value at the INLET after this parent has simulated Real64 tempMassFlowRateMaxAvail = state.dataLoopNodes->Node(this->AirInNode).MassFlowRateMaxAvail; @@ -160,6 +169,128 @@ namespace UnitarySystems { // Report the current output this->reportUnitarySystem(state, AirLoopNum); + // Get the actual maximum RTF for AFN simulations + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP && AirLoopNum > 0) { + Real64 heatingCoilRTF = 0.0; + Real64 coolingCoilRTF = 0.0; + Real64 suppHeatingCoilRTF = 0.0; + bool errorFound(false); + switch (this->m_HeatingCoilType_Num) { + case HVAC::Coil_HeatingGasOrOtherFuel: + case HVAC::Coil_HeatingElectric: + case HVAC::Coil_HeatingDesuperheater: + case HVAC::Coil_HeatingElectric_MultiStage: + case HVAC::Coil_HeatingGas_MultiStage: { + if (this->m_HeatingCoilIndex > 0) { + heatingCoilRTF = state.dataHeatingCoils->HeatingCoil(this->m_HeatingCoilIndex).RTF; + } + } break; + case HVAC::CoilDX_HeatingEmpirical: + case HVAC::CoilDX_MultiSpeedHeating: { + if (this->m_HeatingCoilIndex > 0) { + heatingCoilRTF = state.dataDXCoils->DXCoil(this->m_HeatingCoilIndex).HeatingCoilRuntimeFraction; + } + } break; + case HVAC::Coil_HeatingWaterToAirHPSimple: { + if (this->m_HeatingCoilIndex > 0) { + heatingCoilRTF = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(this->m_HeatingCoilIndex).RunFrac; + } + } break; + case HVAC::Coil_HeatingWaterToAirHP: { + if (this->m_HeatingCoilIndex > 0) { + heatingCoilRTF = state.dataWaterToAirHeatPump->WatertoAirHP(this->m_HeatingCoilIndex).RunFrac; + } + } break; + case HVAC::Coil_HeatingWaterToAirHPVSEquationFit: + case HVAC::Coil_HeatingAirToAirVariableSpeed: { + if (this->m_HeatingCoilIndex > 0) { + heatingCoilRTF = state.dataVariableSpeedCoils->VarSpeedCoil(this->m_HeatingCoilIndex).RunFrac; + } + } break; + case HVAC::Coil_HeatingSteam: + case HVAC::Coil_HeatingWater: + case HVAC::Coil_UserDefined: { + heatingCoilRTF = 1.0; + } break; + default:; + } + if (errorFound) { + ShowSevereError(state, EnergyPlus::format("The index of \"{}\" is not found", this->m_HeatingCoilName)); + ShowContinueError(state, EnergyPlus::format("...occurs for {}", this->m_HeatingCoilName)); + errorFound = false; + } + switch (this->m_SuppHeatCoilType_Num) { + case HVAC::Coil_HeatingGasOrOtherFuel: + case HVAC::Coil_HeatingElectric: + case HVAC::Coil_HeatingDesuperheater: + case HVAC::Coil_HeatingElectric_MultiStage: { + if (this->m_SuppHeatCoilIndex > 0) { + suppHeatingCoilRTF = state.dataHeatingCoils->HeatingCoil(this->m_SuppHeatCoilIndex).RTF; + } + } break; + case HVAC::Coil_HeatingSteam: + case HVAC::Coil_HeatingWater: + case HVAC::Coil_UserDefined: { + heatingCoilRTF = 1.0; + } break; + default:; + } + if (errorFound) { + ShowSevereError(state, EnergyPlus::format("The index of \"{}\" is not found", this->m_SuppHeatCoilName)); + ShowContinueError(state, EnergyPlus::format("...occurs for {}", this->m_SuppHeatCoilName)); + errorFound = false; + } + state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = + max(refAFNLoopHeatingCoilMaxRTF, heatingCoilRTF, suppHeatingCoilRTF); + + switch (this->m_CoolingCoilType_Num) { + case HVAC::CoilDX_Cooling: { + if (this->m_CoolingCoilIndex > 0) { + coolingCoilRTF = state.dataCoilCoolingDX->coilCoolingDXs[this->m_CoolingCoilIndex].coolingCoilRuntimeFraction; + } + } break; + case HVAC::CoilDX_CoolingSingleSpeed: + case HVAC::CoilDX_MultiSpeedCooling: + case HVAC::CoilDX_CoolingTwoSpeed: + case HVAC::CoilDX_CoolingTwoStageWHumControl: { + if (this->m_CoolingCoilIndex > 0) { + coolingCoilRTF = state.dataDXCoils->DXCoil(this->m_CoolingCoilIndex).CoolingCoilRuntimeFraction; + } + } break; + case HVAC::CoilDX_PackagedThermalStorageCooling: { + if (this->m_CoolingCoilIndex > 0) { + coolingCoilRTF = state.dataPackagedThermalStorageCoil->TESCoil(this->m_CoolingCoilIndex).RuntimeFraction; + } + } break; + case HVAC::Coil_CoolingWaterToAirHPSimple: { + if (this->m_CoolingCoilIndex > 0) { + coolingCoilRTF = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(this->m_CoolingCoilIndex).RunFrac; + } + } break; + case HVAC::Coil_CoolingWaterToAirHP: { + if (this->m_CoolingCoilIndex > 0) { + coolingCoilRTF = state.dataWaterToAirHeatPump->WatertoAirHP(this->m_CoolingCoilIndex).RunFrac; + } + } break; + case HVAC::Coil_CoolingWaterToAirHPVSEquationFit: + case HVAC::Coil_CoolingAirToAirVariableSpeed: { + if (this->m_CoolingCoilIndex > 0) { + coolingCoilRTF = state.dataVariableSpeedCoils->VarSpeedCoil(this->m_CoolingCoilIndex).RunFrac; + } + } break; + case HVAC::Coil_CoolingWater: + case HVAC::Coil_CoolingWaterDetailed: + case HVAC::Coil_UserDefined: + case HVAC::CoilDX_CoolingHXAssisted: + case HVAC::CoilWater_CoolingHXAssisted: { + coolingCoilRTF = 1.0; + } break; + default:; + } + state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = max(refAFNLoopCoolingCoilMaxRTF, coolingCoilRTF); + } + // CoolActive = false; // set in call from ZoneEquipmentManager if (this->m_CoolingPartLoadFrac * double(CompressorOn) > 0.0) { CoolActive = true; @@ -14597,17 +14728,6 @@ namespace UnitarySystems { int CompIndex = this->m_HeatingCoilIndex; HVAC::FanOp fanOp = this->m_FanOpMode; Real64 DesOutTemp = this->m_DesiredOutletTemp; - - Real64 LoopHeatingCoilMaxRTFSave = 0.0; - Real64 LoopDXCoilMaxRTFSave = 0.0; - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP) { - LoopHeatingCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF; - state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = 0.0; - LoopDXCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; - state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = 0.0; - } - Real64 PartLoadFrac = 0.0; Real64 SpeedRatio = 0.0; Real64 CycRatio = 0.0; @@ -15233,14 +15353,6 @@ namespace UnitarySystems { this->m_HeatingCycRatio = CycRatio; HeatCoilLoad = ReqOutput; - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP) { - state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = - max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave); - state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = - max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave); - } - if (this->m_HeatingCoilType_Num == HVAC::Coil_HeatingWater || this->m_HeatingCoilType_Num == HVAC::Coil_HeatingSteam) { mdot = PartLoadFrac * this->MaxHeatCoilFluidFlow; PlantUtilities::SetComponentFlowRate(state, mdot, this->HeatCoilFluidInletNode, this->HeatCoilFluidOutletNodeNum, this->HeatCoilPlantLoc); @@ -15283,17 +15395,6 @@ namespace UnitarySystems { Real64 DesOutTemp = this->m_DesiredOutletTemp; std::string_view CompName = this->m_SuppHeatCoilName; - Real64 LoopHeatingCoilMaxRTFSave = 0.0; - Real64 LoopDXCoilMaxRTFSave = 0.0; - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP) { - auto &afnInfo = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum); - LoopHeatingCoilMaxRTFSave = afnInfo.AFNLoopHeatingCoilMaxRTF; - afnInfo.AFNLoopHeatingCoilMaxRTF = 0.0; - LoopDXCoilMaxRTFSave = afnInfo.AFNLoopDXCoilRTF; - afnInfo.AFNLoopDXCoilRTF = 0.0; - } - // IF there is a fault of coil SAT Sensor if (this->m_FaultyCoilSATFlag) { // calculate the sensor offset using fault information @@ -15646,14 +15747,6 @@ namespace UnitarySystems { } // IF SENSIBLE LOAD } // IF((GetCurrentScheduleValue(state, UnitarySystem(UnitarySysNum)%m_SysAvailSchedPtr) > 0.0d0) .AND. & - // LoopHeatingCoilMaxRTF used for AirflowNetwork gets set in child components (gas and fuel) - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP) { - auto &afnInfo = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum); - afnInfo.AFNLoopHeatingCoilMaxRTF = max(afnInfo.AFNLoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave); - afnInfo.AFNLoopDXCoilRTF = max(afnInfo.AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave); - } - if (this->m_SuppHeatCoilType_Num == HVAC::Coil_HeatingWater || this->m_SuppHeatCoilType_Num == HVAC::Coil_HeatingSteam) { mdot = PartLoadFrac * this->m_MaxSuppCoilFluidFlow; PlantUtilities::SetComponentFlowRate( From 991df4ffabdd3bfbed90e625cf9f422eb48034d0 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Tue, 31 Mar 2026 14:01:58 -0700 Subject: [PATCH 2/3] Add unit test --- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 724 ++++++++++++++++++++++ 1 file changed, 724 insertions(+) diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index d181ba081cb..1b292db3882 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -27719,3 +27719,727 @@ TEST_F(EnergyPlusFixture, CoilSystemCoolingDX_RunOnLatentLoad) EXPECT_NEAR(0.008917, CoilSys.m_DesiredOutletHumRat, 0.000001); EXPECT_NEAR(0.008917, state->dataLoopNodes->Node(CoilSys.AirOutNode).HumRat, 0.000001); } + +TEST_F(EnergyPlusFixture, UnitarySystem_AFN_RTF) +{ + std::string const idf_objects = delimited_string({ + " SimulationControl,", + " Yes, !- Do Zone Sizing Calculation", + " Yes, !- Do System Sizing Calculation", + " No, !- Do Plant Sizing Calculation", + " Yes, !- Run Simulation for Sizing Periods", + " No; !- Run Simulation for Weather File Run Periods", + + " Site:Location,", + " CHICAGO_IL_USA TMY2-94846, !- Name", + " 41.78, !- Latitude {deg}", + " -87.75, !- Longitude {deg}", + " -6.00, !- Time Zone {hr}", + " 190.00; !- Elevation {m}", + + " SizingPeriod:DesignDay,", + " CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, !- Name", + " 1, !- Month", + " 21, !- Day of Month", + " WinterDesignDay, !- Day Type", + " -17.3, !- Maximum Dry-Bulb Temperature {C}", + " 0.0, !- Daily Dry-Bulb Temperature Range {deltaC}", + " , !- Dry-Bulb Temperature Range Modifier Type", + " , !- Dry-Bulb Temperature Range Modifier Day Schedule Name", + " Wetbulb, !- Humidity Condition Type", + " -17.3, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C}", + " , !- Humidity Condition Day Schedule Name", + " , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir}", + " , !- Enthalpy at Maximum Dry-Bulb {J/kg}", + " , !- Daily Wet-Bulb Temperature Range {deltaC}", + " 99063., !- Barometric Pressure {Pa}", + " 4.9, !- Wind Speed {m/s}", + " 270, !- Wind Direction {deg}", + " No, !- Rain Indicator", + " No, !- Snow Indicator", + " No, !- Daylight Saving Time Indicator", + " ASHRAEClearSky, !- Solar Model Indicator", + " , !- Beam Solar Day Schedule Name", + " , !- Diffuse Solar Day Schedule Name", + " , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless}", + " , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless}", + " 0.0; !- Sky Clearness", + + " Material,", + " A1 - 1 IN STUCCO, !- Name", + " Smooth, !- Roughness", + " 2.5389841E-02, !- Thickness {m}", + " 0.6918309, !- Conductivity {W/m-K}", + " 1858.142, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.9200000, !- Solar Absorptance", + " 0.9200000; !- Visible Absorptance", + + " Material,", + " C4 - 4 IN COMMON BRICK, !- Name", + " Rough, !- Roughness", + " 0.1014984, !- Thickness {m}", + " 0.7264224, !- Conductivity {W/m-K}", + " 1922.216, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7600000, !- Solar Absorptance", + " 0.7600000; !- Visible Absorptance", + + " Material,", + " E1 - 3 / 4 IN PLASTER OR GYP BOARD, !- Name", + " Smooth, !- Roughness", + " 1.9050000E-02, !- Thickness {m}", + " 0.7264224, !- Conductivity {W/m-K}", + " 1601.846, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.9200000, !- Solar Absorptance", + " 0.9200000; !- Visible Absorptance", + + " Material,", + " C6 - 8 IN CLAY TILE, !- Name", + " Smooth, !- Roughness", + " 0.2033016, !- Thickness {m}", + " 0.5707605, !- Conductivity {W/m-K}", + " 1121.292, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.8200000, !- Solar Absorptance", + " 0.8200000; !- Visible Absorptance", + + " Material,", + " C10 - 8 IN HW CONCRETE, !- Name", + " MediumRough, !- Roughness", + " 0.2033016, !- Thickness {m}", + " 1.729577, !- Conductivity {W/m-K}", + " 2242.585, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.6500000, !- Solar Absorptance", + " 0.6500000; !- Visible Absorptance", + + " Material,", + " E2 - 1 / 2 IN SLAG OR STONE, !- Name", + " Rough, !- Roughness", + " 1.2710161E-02, !- Thickness {m}", + " 1.435549, !- Conductivity {W/m-K}", + " 881.0155, !- Density {kg/m3}", + " 1673.600, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.5500000, !- Solar Absorptance", + " 0.5500000; !- Visible Absorptance", + + " Material,", + " E3 - 3 / 8 IN FELT AND MEMBRANE, !- Name", + " Rough, !- Roughness", + " 9.5402403E-03, !- Thickness {m}", + " 0.1902535, !- Conductivity {W/m-K}", + " 1121.292, !- Density {kg/m3}", + " 1673.600, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " B5 - 1 IN DENSE INSULATION, !- Name", + " VeryRough, !- Roughness", + " 2.5389841E-02, !- Thickness {m}", + " 4.3239430E-02, !- Conductivity {W/m-K}", + " 91.30524, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.5000000, !- Solar Absorptance", + " 0.5000000; !- Visible Absorptance", + + " Material,", + " C12 - 2 IN HW CONCRETE, !- Name", + " MediumRough, !- Roughness", + " 5.0901599E-02, !- Thickness {m}", + " 1.729577, !- Conductivity {W/m-K}", + " 2242.585, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.6500000, !- Solar Absorptance", + " 0.6500000; !- Visible Absorptance", + + " Construction,", + " EXTWALL80, !- Name", + " A1 - 1 IN STUCCO, !- Outside Layer", + " C4 - 4 IN COMMON BRICK, !- Layer 2", + " E1 - 3 / 4 IN PLASTER OR GYP BOARD; !- Layer 3", + + " Construction,", + " FLOOR SLAB 8 IN, !- Name", + " C10 - 8 IN HW CONCRETE; !- Outside Layer", + + " Construction,", + " ROOF34, !- Name", + " E2 - 1 / 2 IN SLAG OR STONE, !- Outside Layer", + " E3 - 3 / 8 IN FELT AND MEMBRANE, !- Layer 2", + " B5 - 1 IN DENSE INSULATION, !- Layer 3", + " C12 - 2 IN HW CONCRETE; !- Layer 4", + + " Zone,", + " EAST ZONE, !- Name", + " 0, !- Direction of Relative North {deg}", + " 0, !- X Origin {m}", + " 0, !- Y Origin {m}", + " 0, !- Z Origin {m}", + " 1, !- Type", + " 1, !- Multiplier", + " autocalculate, !- Ceiling Height {m}", + " autocalculate; !- Volume {m3}", + + " BuildingSurface:Detailed,", + " Zn002:Wall001, !- Name", + " Wall, !- Surface Type", + " EXTWALL80, !- Construction Name", + " EAST ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 12.19200,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m}", + " 12.19200,6.096000,0, !- X,Y,Z ==> Vertex 2 {m}", + " 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 3 {m}", + " 6.096000,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Zn002:Wall002, !- Name", + " Wall, !- Surface Type", + " EXTWALL80, !- Construction Name", + " EAST ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 6.096000,0,3.048000, !- X,Y,Z ==> Vertex 1 {m}", + " 6.096000,0,0, !- X,Y,Z ==> Vertex 2 {m}", + " 12.19200,0,0, !- X,Y,Z ==> Vertex 3 {m}", + " 12.19200,0,3.048000; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Zn002:Wall003, !- Name", + " Wall, !- Surface Type", + " EXTWALL80, !- Construction Name", + " EAST ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 12.19200,0,3.048000, !- X,Y,Z ==> Vertex 1 {m}", + " 12.19200,0,0, !- X,Y,Z ==> Vertex 2 {m}", + " 12.19200,6.096000,0, !- X,Y,Z ==> Vertex 3 {m}", + " 12.19200,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Zn002:Wall004, !- Name", + " Wall, !- Surface Type", + " EXTWALL80, !- Construction Name", + " EAST ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 6.096000,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m}", + " 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 2 {m}", + " 6.096000,0,0, !- X,Y,Z ==> Vertex 3 {m}", + " 6.096000,0,3.048000; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Zn002:Flr001, !- Name", + " Floor, !- Surface Type", + " FLOOR SLAB 8 IN, !- Construction Name", + " EAST ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Zn002:Flr001, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 1.000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 6.096000,0,0, !- X,Y,Z ==> Vertex 1 {m}", + " 6.096000,6.096000,0, !- X,Y,Z ==> Vertex 2 {m}", + " 12.19200,6.096000,0, !- X,Y,Z ==> Vertex 3 {m}", + " 12.19200,0,0; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Zn002:Roof001, !- Name", + " Roof, !- Surface Type", + " ROOF34, !- Construction Name", + " EAST ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 6.096000,6.096000,3.048000, !- X,Y,Z ==> Vertex 1 {m}", + " 6.096000,0,3.048000, !- X,Y,Z ==> Vertex 2 {m}", + " 12.19200,0,3.048000, !- X,Y,Z ==> Vertex 3 {m}", + " 12.19200,6.096000,3.048000; !- X,Y,Z ==> Vertex 4 {m}", + + " Schedule:Compact,", + " FANANDCOILAVAILSCHED, !- Name", + " , !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: Alldays, !- Field 2", + " Until: 24:00,1.00; !- Field 3", + + " Schedule:Compact,", + " OUTDOORAIRAVAILSCHED, !- Name", + " , !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00,1.00; !- Field 3", + + " Schedule:Compact,", + " OAFRACTIONSCHED, !- Name", + " , !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00,0.30; !- Field 3", + + " Schedule:Compact,", + " HEATING SETPOINTS, !- Name", + " , !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00,23.00; !- Field 3", + + " Schedule:Compact,", + " COOLING SETPOINTS, !- Name", + " , !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00,24.00; !- Field 3", + + " Schedule:Compact,", + " ZONE CONTROL TYPE SCHED, !- Name", + " , !- Schedule Type Limits Name", + " Through: 3/31, !- Field 1", + " For: Alldays, !- Field 2", + " Until: 24:00,1, !- Field 3", + " Through: 9/30, !- Field 5", + " For: Alldays, !- Field 6", + " Until: 24:00,2, !- Field 7", + " Through: 12/31, !- Field 9", + " For: Alldays, !- Field 10", + " Until: 24:00,1; !- Field 11", + + " Schedule:Compact,", + " CyclingFanSchedule, !- Name", + " , !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00,0.0; !- Field 3", + + " DesignSpecification:OutdoorAir,", + " SZ DSOA West Zone, !- Name", + " flow/person, !- Outdoor Air Method", + " 0.00944, !- Outdoor Air Flow per Person {m3/s-person}", + " 0.0, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2}", + " 0.0; !- Outdoor Air Flow per Zone {m3/s}", + + " Sizing:Zone,", + " EAST ZONE, !- Zone or ZoneList Name", + " SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method", + " 14., !- Zone Cooling Design Supply Air Temperature {C}", + " , !- Zone Cooling Design Supply Air Temperature Difference {deltaC}", + " SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method", + " 45., !- Zone Heating Design Supply Air Temperature {C}", + " , !- Zone Heating Design Supply Air Temperature Difference {deltaC}", + " 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir}", + " 0.009, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir}", + " SZ DSOA EAST ZONE, !- Design Specification Outdoor Air Object Name", + " 0.0, !- Zone Heating Sizing Factor", + " 0.0, !- Zone Cooling Sizing Factor", + " DesignDay, !- Cooling Design Air Flow Method", + " 0, !- Cooling Design Air Flow Rate {m3/s}", + " , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2}", + " , !- Cooling Minimum Air Flow {m3/s}", + " , !- Cooling Minimum Air Flow Fraction", + " DesignDay, !- Heating Design Air Flow Method", + " 0, !- Heating Design Air Flow Rate {m3/s}", + " , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2}", + " , !- Heating Maximum Air Flow {m3/s}", + " ; !- Heating Maximum Air Flow Fraction", + + " DesignSpecification:OutdoorAir,", + " SZ DSOA EAST ZONE, !- Name", + " flow/person, !- Outdoor Air Method", + " 0.00944, !- Outdoor Air Flow per Person {m3/s-person}", + " 0.0, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2}", + " 0.0; !- Outdoor Air Flow per Zone {m3/s}", + + " Sizing:System,", + " ACandF Sys, !- AirLoop Name", + " sensible, !- Type of Load to Size On", + " autosize, !- Design Outdoor Air Flow Rate {m3/s}", + " 0.0, !- Central Heating Maximum System Air Flow Ratio", + " 7.0, !- Preheat Design Temperature {C}", + " 0.008, !- Preheat Design Humidity Ratio {kgWater/kgDryAir}", + " 11.0, !- Precool Design Temperature {C}", + " 0.008, !- Precool Design Humidity Ratio {kgWater/kgDryAir}", + " 13., !- Central Cooling Design Supply Air Temperature {C}", + " 45., !- Central Heating Design Supply Air Temperature {C}", + " noncoincident, !- Type of Zone Sum to Use", + " no, !- 100% Outdoor Air in Cooling", + " no, !- 100% Outdoor Air in Heating", + " 0.008, !- Central Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir}", + " 0.008, !- Central Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir}", + " DesignDay, !- Cooling Supply Air Flow Rate Method", + " 0, !- Cooling Supply Air Flow Rate {m3/s}", + " , !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2}", + " , !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate", + " , !- Cooling Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}", + " DesignDay, !- Heating Supply Air Flow Rate Method", + " 0, !- Heating Supply Air Flow Rate {m3/s}", + " , !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2}", + " , !- Heating Fraction of Autosized Heating Supply Air Flow Rate", + " , !- Heating Fraction of Autosized Cooling Supply Air Flow Rate", + " , !- Heating Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}", + " , !- System Outdoor Air Method", + " 1.0, !- Zone Maximum Outdoor Air Fraction {dimensionless}", + " CoolingDesignCapacity, !- Cooling Design Capacity Method", + " autosize, !- Cooling Design Capacity {W}", + " , !- Cooling Design Capacity Per Floor Area {W/m2}", + " , !- Fraction of Autosized Cooling Design Capacity", + " FractionOfAutosizedHeatingCapacity, !- Heating Design Capacity Method", + " autosize, !- Heating Design Capacity {W}", + " , !- Heating Design Capacity Per Floor Area {W/m2}", + " 1.25, !- Fraction of Autosized Heating Design Capacity", + " VAV; !- Central Cooling Capacity Control Method", + + " Curve:Biquadratic,", + " HPACCoolCapFT, !- Name", + " 0.766956, !- Coefficient1 Constant", + " 0.0107756, !- Coefficient2 x", + " -0.0000414703, !- Coefficient3 x**2", + " 0.00134961, !- Coefficient4 y", + " -0.000261144, !- Coefficient5 y**2", + " 0.000457488, !- Coefficient6 x*y", + " 12.77778, !- Minimum Value of x", + " 23.88889, !- Maximum Value of x", + " 18.0, !- Minimum Value of y", + " 46.11111, !- Maximum Value of y", + " , !- Minimum Curve Output", + " , !- Maximum Curve Output", + " Temperature, !- Input Unit Type for X", + " Temperature, !- Input Unit Type for Y", + " Dimensionless; !- Output Unit Type", + + " Curve:Biquadratic,", + " HPACCOOLEIRFT, !- Name", + " 0.297145, !- Coefficient1 Constant", + " 0.0430933, !- Coefficient2 x", + " -0.000748766, !- Coefficient3 x**2", + " 0.00597727, !- Coefficient4 y", + " 0.000482112, !- Coefficient5 y**2", + " -0.000956448, !- Coefficient6 x*y", + " 12.77778, !- Minimum Value of x", + " 23.88889, !- Maximum Value of x", + " 18.0, !- Minimum Value of y", + " 46.11111, !- Maximum Value of y", + " , !- Minimum Curve Output", + " , !- Maximum Curve Output", + " Temperature, !- Input Unit Type for X", + " Temperature, !- Input Unit Type for Y", + " Dimensionless; !- Output Unit Type", + + " Curve:Quadratic,", + " HPACCoolCapFFF, !- Name", + " 0.8, !- Coefficient1 Constant", + " 0.2, !- Coefficient2 x", + " 0.0, !- Coefficient3 x**2", + " 0.5, !- Minimum Value of x", + " 1.5; !- Maximum Value of x", + + " Curve:Quadratic,", + " HPACCOOLEIRFFF, !- Name", + " 1.156, !- Coefficient1 Constant", + " -0.1816, !- Coefficient2 x", + " 0.0256, !- Coefficient3 x**2", + " 0.5, !- Minimum Value of x", + " 1.5; !- Maximum Value of x", + + " Curve:Quadratic,", + " HPACCOOLPLFFPLR, !- Name", + " 0.85, !- Coefficient1 Constant", + " 0.15, !- Coefficient2 x", + " 0.0, !- Coefficient3 x**2", + " 0.0, !- Minimum Value of x", + " 1.0; !- Maximum Value of x", + + " BranchList,", + " Air Loop Branches, !- Name", + " Air Loop Main Branch; !- Branch 1 Name", + + " Branch,", + " Air Loop Main Branch, !- Name", + " , !- Pressure Drop Curve Name", + " AirLoopHVAC:OutdoorAirSystem, !- Component 1 Object Type", + " OA Sys 1, !- Component 1 Name", + " Outdoor Air Mixer Inlet Node, !- Component 1 Inlet Node Name", + " Mixed Air Node, !- Component 1 Outlet Node Name", + " AirLoopHVAC:UnitarySystem, !- Component 2 Object Type", + " ACandF, !- Component 2 Name", + " Mixed Air Node, !- Component 2 Inlet Node Name", + " Air Loop Outlet Node; !- Component 2 Outlet Node Name", + + " AirLoopHVAC,", + " ACandF Sys, !- Name", + " , !- Controller List Name", + " Heat Pump 1 Avail List, !- Availability Manager List Name", + " autosize, !- Design Supply Air Flow Rate {m3/s}", + " Air Loop Branches, !- Branch List Name", + " , !- Connector List Name", + " Outdoor Air Mixer Inlet Node, !- Supply Side Inlet Node Name", + " Return Air Mixer Outlet, !- Demand Side Outlet Node Name", + " Zone Equipment Inlet Node, !- Demand Side Inlet Node Names", + " Air Loop Outlet Node; !- Supply Side Outlet Node Names", + + " AirLoopHVAC:ControllerList,", + " OA Sys 1 Controllers, !- Name", + " Controller:OutdoorAir, !- Controller 1 Object Type", + " OA Controller 1; !- Controller 1 Name", + + " AirLoopHVAC:OutdoorAirSystem:EquipmentList,", + " OA Sys 1 Equipment, !- Name", + " OutdoorAir:Mixer, !- Component 1 Object Type", + " OA Mixing Box 1; !- Component 1 Name", + + " AirLoopHVAC:OutdoorAirSystem,", + " OA Sys 1, !- Name", + " OA Sys 1 Controllers, !- Controller List Name", + " OA Sys 1 Equipment; !- Outdoor Air Equipment List Name", + + " OutdoorAir:NodeList,", + " Outside Air Inlet Node; !- Node or NodeList Name 1", + + " OutdoorAir:Mixer,", + " OA Mixing Box 1, !- Name", + " Mixed Air Node, !- Mixed Air Node Name", + " Outside Air Inlet Node, !- Outdoor Air Stream Node Name", + " Relief Air Outlet Node, !- Relief Air Stream Node Name", + " Outdoor Air Mixer Inlet Node; !- Return Air Stream Node Name", + + " AvailabilityManagerAssignmentList,", + " Heat Pump 1 Avail List, !- Name", + " AvailabilityManager:Scheduled, !- Availability Manager 1 Object Type", + " Heat Pump 1 Avail; !- Availability Manager 1 Name", + + " AvailabilityManagerAssignmentList,", + " Outdoor Air 1 Avail List,!- Name", + " AvailabilityManager:Scheduled, !- Availability Manager 1 Object Type", + " Outdoor Air 1 Avail; !- Availability Manager 1 Name", + + " AvailabilityManager:Scheduled,", + " Heat Pump 1 Avail, !- Name", + " FanAndCoilAvailSched; !- Schedule Name", + + " AvailabilityManager:Scheduled,", + " Outdoor Air 1 Avail, !- Name", + " OutdoorAirAvailSched; !- Schedule Name", + + " Controller:OutdoorAir,", + " OA Controller 1, !- Name", + " Relief Air Outlet Node, !- Relief Air Outlet Node Name", + " Outdoor Air Mixer Inlet Node, !- Return Air Node Name", + " Mixed Air Node, !- Mixed Air Node Name", + " Outside Air Inlet Node, !- Actuator Node Name", + " autosize, !- Minimum Outdoor Air Flow Rate {m3/s}", + " autosize, !- Maximum Outdoor Air Flow Rate {m3/s}", + " NoEconomizer, !- Economizer Control Type", + " ModulateFlow, !- Economizer Control Action Type", + " , !- Economizer Maximum Limit Dry-Bulb Temperature {C}", + " , !- Economizer Maximum Limit Enthalpy {J/kg}", + " , !- Economizer Maximum Limit Dewpoint Temperature {C}", + " , !- Electronic Enthalpy Limit Curve Name", + " , !- Economizer Minimum Limit Dry-Bulb Temperature {C}", + " NoLockout, !- Lockout Type", + " ProportionalMinimum, !- Minimum Limit Type", + " OAFractionSched; !- Minimum Outdoor Air Schedule Name", + + " ZoneHVAC:EquipmentConnections,", + " EAST ZONE, !- Zone Name", + " Zone2Equipment, !- Zone Conditioning Equipment List Name", + " Zone 2 Inlet Node, !- Zone Air Inlet Node or NodeList Name", + " , !- Zone Air Exhaust Node or NodeList Name", + " Zone 2 Node, !- Zone Air Node Name", + " Zone 2 Outlet Node; !- Zone Return Air Node Name", + + " ZoneHVAC:EquipmentList,", + " Zone2Equipment, !- Name", + " SequentialLoad, !- Load Distribution Scheme", + " ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type", + " Zone2DirectAirADU, !- Zone Equipment 1 Name", + " 1, !- Zone Equipment 1 Cooling Sequence", + " 1; !- Zone Equipment 1 Heating or No-Load Sequence", + + " ZoneHVAC:AirDistributionUnit,", + " Zone2DirectAirADU, !- Name", + " Zone 2 Inlet Node, !- Air Distribution Unit Outlet Node Name", + " AirTerminal:SingleDuct:ConstantVolume:NoReheat, !- Air Terminal Object Type", + " Zone2DirectAir; !- Air Terminal Name", + + " AirTerminal:SingleDuct:ConstantVolume:NoReheat,", + " Zone2DirectAir, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " Zone 2 Inlet Node 2AT, !- Air Inlet Node Name", + " Zone 2 Inlet Node, !- Air Outlet Node Name", + " autosize; !- Maximum Air Flow Rate {m3/s}", + + " AirLoopHVAC:UnitarySystem,", + " ACandF, !- Name", + " Load, !- Control Type", + " East Zone, !- Controlling Zone or Thermostat Location", + " None, !- Dehumidification Control Type", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " Mixed Air Node, !- Air Inlet Node Name", + " Air Loop Outlet Node, !- Air Outlet Node Name", + " Fan:OnOff, !- Supply Fan Object Type", + " Supply Fan 1, !- Supply Fan Name", + " BlowThrough, !- Fan Placement", + " CyclingFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", + " Coil:Heating:Fuel, !- Heating Coil Object Type", + " GasCoil, !- Heating Coil Name", + " 1, !- DX Heating Coil Sizing Ratio", + " Coil:Cooling:DX:SingleSpeed,!- Cooling Coil Object Type", + " ACDXCoil 1; !- Cooling Coil Name", + + " ZoneControl:Thermostat,", + " Zone 2 Thermostat, !- Name", + " EAST ZONE, !- Zone or ZoneList Name", + " Zone Control Type Sched, !- Control Type Schedule Name", + " ThermostatSetpoint:SingleHeating, !- Control 1 Object Type", + " Heating Setpoint with SB,!- Control 1 Name", + " ThermostatSetpoint:SingleCooling, !- Control 2 Object Type", + " Cooling Setpoint with SB;!- Control 2 Name", + + " ThermostatSetpoint:SingleHeating,", + " Heating Setpoint with SB,!- Name", + " Heating Setpoints; !- Setpoint Temperature Schedule Name", + + " ThermostatSetpoint:SingleCooling,", + " Cooling Setpoint with SB,!- Name", + " Cooling Setpoints; !- Setpoint Temperature Schedule Name", + + " AirLoopHVAC:SupplyPath,", + " ACandFSupplyPath, !- Name", + " Zone Equipment Inlet Node, !- Supply Air Path Inlet Node Name", + " AirLoopHVAC:ZoneSplitter,!- Component 1 Object Type", + " Zone Supply Air Splitter;!- Component 1 Name", + + " AirLoopHVAC:ReturnPath,", + " ACandFReturnPath, !- Name", + " Return Air Mixer Outlet, !- Return Air Path Outlet Node Name", + " AirLoopHVAC:ZoneMixer, !- Component 1 Object Type", + " Zone Return Air Mixer; !- Component 1 Name", + + " AirLoopHVAC:ZoneSplitter,", + " Zone Supply Air Splitter,!- Name", + " Zone Equipment Inlet Node, !- Inlet Node Name", + " Zone 2 Inlet Node 2AT; !- Outlet 2 Node Name", + + " AirLoopHVAC:ZoneMixer,", + " Zone Return Air Mixer, !- Name", + " Return Air Mixer Outlet, !- Outlet Node Name", + " Zone 2 Outlet Node; !- Inlet 2 Node Name", + + " Coil:Cooling:DX:SingleSpeed,", + " ACDXCoil 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " autosize, !- Gross Rated Total Cooling Capacity {W}", + " autosize, !- Gross Rated Sensible Heat Ratio", + " 3.0, !- Gross Rated Cooling COP {W/W}", + " autosize, !- Rated Air Flow Rate {m3/s}", + " , !- 2017 Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)}", + " , !- 2023 Rated Evaporator Fan Power Per Volume Flow Rate {W/(m3/s)}", + " DX Cooling Coil Air Inlet Node, !- Air Inlet Node Name", + " Heating Coil Air Inlet Node, !- Air Outlet Node Name", + " HPACCoolCapFT, !- Total Cooling Capacity Function of Temperature Curve Name", + " HPACCoolCapFFF, !- Total Cooling Capacity Function of Flow Fraction Curve Name", + " HPACCOOLEIRFT, !- Energy Input Ratio Function of Temperature Curve Name", + " HPACCOOLEIRFFF, !- Energy Input Ratio Function of Flow Fraction Curve Name", + " HPACCOOLPLFFPLR; !- Part Load Fraction Correlation Curve Name", + + " Coil:Heating:Fuel,", + " GasCoil, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " NaturalGas, !- Fuel Type", + " 0.8, !- Burner Efficiency", + " autosize, !- Nominal Capacity {W}", + " Heating Coil Air Inlet Node, !- Air Inlet Node Name", + " Air Loop Outlet Node; !- Air Outlet Node Name", + + " Fan:OnOff,", + " Supply Fan 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " 0.7, !- Fan Total Efficiency", + " 300.0, !- Pressure Rise {Pa}", + " autosize, !- Maximum Flow Rate {m3/s}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Airstream Fraction", + " Mixed Air Node, !- Air Inlet Node Name", + " DX Cooling Coil Air Inlet Node; !- Air Outlet Node Name", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + state->init_state(*state); + + int CompIndex(0); + int AirLoopNum(1); + bool FirstHVACIteration(false); + + SimulationManager::ManageSimulation(*state); + + // Set AFN properties + state->afn->distribution_simulated = true; + state->dataAirLoop->AirLoopAFNInfo.allocate(1); + state->dataHeatingCoils->HeatingCoil(1).AirLoopNum = 1; + + state->dataZoneEnergyDemand->ZoneSysEnergyDemand[0].RemainingOutputRequired = 25000.0; + state->dataZoneEnergyDemand->ZoneSysEnergyDemand[0].RemainingOutputReqToCoolSP = 25000.0; + state->dataZoneEnergyDemand->ZoneSysEnergyDemand[0].RemainingOutputReqToHeatSP = 25000.0; + + state->dataGlobal->BeginEnvrnFlag = false; + auto &thisSys = state->dataUnitarySystems->unitarySys[0]; + bool HeatActive = true; + bool CoolActive = false; + int constexpr ZoneOAUnitNum = 0; + Real64 constexpr OAUCoilOutTemp = 0.0; + bool const ZoneEquipment = true; + Real64 sensOut = 0.0; + Real64 latOut = 0.0; + thisSys.simulate(*state, + thisSys.Name, + FirstHVACIteration, + AirLoopNum, + CompIndex, + HeatActive, + CoolActive, + ZoneOAUnitNum, + OAUCoilOutTemp, + ZoneEquipment, + sensOut, + latOut); + + // Check that the runtime fraction is less than one so the impact of cycling fan is correctly accounted for in the AFN + EXPECT_TRUE(state->dataAirLoop->AirLoopAFNInfo(1).AFNLoopHeatingCoilMaxRTF < 1); +} From c5c2f0aaa0e9ea435682b9a837c395a9384a0712 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Wed, 1 Apr 2026 08:44:41 -0700 Subject: [PATCH 3/3] Address review comments. --- src/EnergyPlus/UnitarySystem.cc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 0d460417b6b..f01b58ba8fb 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -143,8 +143,7 @@ namespace UnitarySystems { // Save the current AFN coil runtime fraction for comparison with the one calculated below Real64 refAFNLoopHeatingCoilMaxRTF(0.0); Real64 refAFNLoopCoolingCoilMaxRTF(0.0); - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP && AirLoopNum > 0) { + if (state.afn->distribution_simulated && AirLoopNum > 0 && state.dataSize->CurOASysNum == 0) { refAFNLoopHeatingCoilMaxRTF = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF; refAFNLoopCoolingCoilMaxRTF = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; } @@ -170,8 +169,7 @@ namespace UnitarySystems { this->reportUnitarySystem(state, AirLoopNum); // Get the actual maximum RTF for AFN simulations - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP && AirLoopNum > 0) { + if (state.afn->distribution_simulated && AirLoopNum > 0 && state.dataSize->CurOASysNum == 0) { Real64 heatingCoilRTF = 0.0; Real64 coolingCoilRTF = 0.0; Real64 suppHeatingCoilRTF = 0.0; @@ -10837,8 +10835,7 @@ namespace UnitarySystems { Real64 TotalOutputDelta = 0.0; // delta total output rate, {W} int ZoneInNode = this->m_ZoneInletNode; Real64 MassFlowRate = state.dataLoopNodes->Node(ZoneInNode).MassFlowRate / this->ControlZoneMassFlowFrac; - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP) { + if (state.afn->distribution_simulated && AirLoopNum > 0 && state.dataSize->CurOASysNum == 0) { DeltaMassRate = state.dataLoopNodes->Node(this->AirOutNode).MassFlowRate - state.dataLoopNodes->Node(ZoneInNode).MassFlowRate / this->ControlZoneMassFlowFrac; if (DeltaMassRate < 0.0) { @@ -12879,8 +12876,7 @@ namespace UnitarySystems { Real64 DesOutHumRat = this->m_DesiredOutletHumRat; int CoilType_Num = this->m_CoolingCoilType_Num; Real64 LoopDXCoilMaxRTFSave = 0.0; - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP) { + if (state.afn->distribution_simulated && AirLoopNum > 0 && state.dataSize->CurOASysNum == 0) { LoopDXCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = 0.0; } @@ -14675,8 +14671,7 @@ namespace UnitarySystems { this->m_CoolingCycRatio = CycRatio; this->m_DehumidificationMode = DehumidMode; - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP) { + if (state.afn->distribution_simulated && AirLoopNum > 0 && state.dataSize->CurOASysNum == 0) { state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave); } @@ -16394,8 +16389,7 @@ namespace UnitarySystems { this->m_ElecPower = locFanElecPower + elecCoolingPower + elecHeatingPower + suppHeatingPower + defrostElecPower + this->m_TotalAuxElecPower; this->m_ElecPowerConsumption = this->m_ElecPower * ReportingConstant; - if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && - this->m_sysType != SysType::PackagedWSHP) { + if (state.afn->distribution_simulated && AirLoopNum > 0 && state.dataSize->CurOASysNum == 0) { state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOnMassFlowrate = state.dataUnitarySystems->CompOnMassFlow; state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOffMassFlowrate = state.dataUnitarySystems->CompOffMassFlow; state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopFanOperationMode = this->m_FanOpMode;