diff --git a/.github/workflows/test_pull_requests.yml b/.github/workflows/test_pull_requests.yml index 85dc29c84e6..05f549c93a4 100644 --- a/.github/workflows/test_pull_requests.yml +++ b/.github/workflows/test_pull_requests.yml @@ -168,7 +168,7 @@ jobs: - name: Install Regression Tool if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built - run: pip install energyplus-regressions>=2.1.3 + run: pip install energyplus-regressions>=2.1.4 - name: Run Regressions if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index edbeecbfff0..487e7ab3f2e 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -364,6 +364,7 @@ void GetSysInput(EnergyPlusData &state) airTerm.SysName = Alphas(1); airTerm.sysType = CurrentModuleObject; airTerm.SysType_Num = SysType::SingleDuctVAVReheat; + airTerm.ReheatComp = Alphas(7); if (Util::SameString(airTerm.ReheatComp, "Coil:Heating:Fuel")) { airTerm.ReheatComp_Num = HeatingCoilType::Gas; @@ -380,12 +381,28 @@ void GetSysInput(EnergyPlusData &state) ShowContinueError(state, format("Occurs in {} = {}", airTerm.sysType, airTerm.SysName)); ErrorsFound = true; } + airTerm.ReheatName = Alphas(8); - ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType); - if (IsNotOK) { - ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName)); - ErrorsFound = true; + if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) { + HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8)); + ErrorsFound = true; + } + } else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) { + airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8)); + ErrorsFound = true; + } + } else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8)); + ErrorsFound = true; + } } + if (lAlphaBlanks(2)) { airTerm.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((airTerm.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -692,10 +709,24 @@ void GetSysInput(EnergyPlusData &state) ErrorsFound = true; } airTerm.ReheatName = Alphas(6); - ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType); - if (IsNotOK) { - ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName)); - ErrorsFound = true; + if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) { + HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6)); + ErrorsFound = true; + } + } else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) { + airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6)); + ErrorsFound = true; + } + } else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6)); + ErrorsFound = true; + } } if (lAlphaBlanks(2)) { @@ -919,10 +950,24 @@ void GetSysInput(EnergyPlusData &state) ErrorsFound = true; } airTerm.ReheatName = Alphas(6); - ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType); - if (IsNotOK) { - ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName)); - ErrorsFound = true; + if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) { + HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6)); + ErrorsFound = true; + } + } else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) { + airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6)); + ErrorsFound = true; + } + } else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6)); + ErrorsFound = true; + } } if (lAlphaBlanks(2)) { @@ -1654,10 +1699,25 @@ void GetSysInput(EnergyPlusData &state) ShowContinueError(state, format("Occurs in {} = {}", airTerm.sysType, airTerm.SysName)); ErrorsFound = true; } - ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType); - if (IsNotOK) { - ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName)); - ErrorsFound = true; + + if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) { + HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8)); + ErrorsFound = true; + } + } else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) { + airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8)); + ErrorsFound = true; + } + } else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) { + airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound); + if (airTerm.ReheatComp_Index == 0) { + ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8)); + ErrorsFound = true; + } } airTerm.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(5))); diff --git a/tst/EnergyPlus/unit/EconomicTariff.unit.cc b/tst/EnergyPlus/unit/EconomicTariff.unit.cc index a21d82817a9..c40a1c42c8c 100644 --- a/tst/EnergyPlus/unit/EconomicTariff.unit.cc +++ b/tst/EnergyPlus/unit/EconomicTariff.unit.cc @@ -420,6 +420,7 @@ TEST_F(EnergyPlusFixture, EconomicTariff_LEEDtariffReporting_Test) state->dataEconTariff->tariff(1).totalAnnualEnergy = 4855.21; state->dataEconTariff->tariff(1).kindMtr = EconomicTariff::MeterType::ElecPurchased; state->dataEconTariff->tariff(1).reportMeterIndx = GetMeterIndex(*state, "ELECTRICITY:FACILITY"); + state->dataEconTariff->tariff(1).demandWindow = DemandWindow::Day; state->dataEconTariff->tariff(2).tariffName = "SmallCGUnit"; state->dataEconTariff->tariff(2).isSelected = true; @@ -427,18 +428,21 @@ TEST_F(EnergyPlusFixture, EconomicTariff_LEEDtariffReporting_Test) state->dataEconTariff->tariff(2).totalAnnualEnergy = 0.00; state->dataEconTariff->tariff(2).kindMtr = EconomicTariff::MeterType::Gas; state->dataEconTariff->tariff(2).reportMeterIndx = GetMeterIndex(*state, "NATURALGAS:FACILITY"); + state->dataEconTariff->tariff(2).demandWindow = DemandWindow::Day; state->dataEconTariff->tariff(3).tariffName = "DistrictCoolingUnit"; state->dataEconTariff->tariff(3).isSelected = true; state->dataEconTariff->tariff(3).totalAnnualCost = 55.22; state->dataEconTariff->tariff(3).totalAnnualEnergy = 8.64; state->dataEconTariff->tariff(3).reportMeterIndx = GetMeterIndex(*state, "DISTRICTCOOLING:FACILITY"); + state->dataEconTariff->tariff(3).demandWindow = DemandWindow::Day; state->dataEconTariff->tariff(4).tariffName = "DistrictHeatingUnit"; state->dataEconTariff->tariff(4).isSelected = true; state->dataEconTariff->tariff(4).totalAnnualCost = 15.98; state->dataEconTariff->tariff(4).totalAnnualEnergy = 1.47; state->dataEconTariff->tariff(4).reportMeterIndx = GetMeterIndex(*state, "DISTRICTHEATINGWATER:FACILITY"); + state->dataEconTariff->tariff(4).demandWindow = DemandWindow::Day; SetPredefinedTables(*state); // need to setup the predefined table entry numbers