Skip to content

Commit 2d9f6e1

Browse files
authored
Merge c008272 into 1cfef92
2 parents 1cfef92 + c008272 commit 2d9f6e1

3 files changed

Lines changed: 81 additions & 17 deletions

File tree

.github/workflows/test_pull_requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168

169169
- name: Install Regression Tool
170170
if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built
171-
run: pip install energyplus-regressions>=2.1.3
171+
run: pip install energyplus-regressions>=2.1.4
172172

173173
- name: Run Regressions
174174
if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built

src/EnergyPlus/SingleDuct.cc

Lines changed: 76 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ void GetSysInput(EnergyPlusData &state)
364364
airTerm.SysName = Alphas(1);
365365
airTerm.sysType = CurrentModuleObject;
366366
airTerm.SysType_Num = SysType::SingleDuctVAVReheat;
367+
367368
airTerm.ReheatComp = Alphas(7);
368369
if (Util::SameString(airTerm.ReheatComp, "Coil:Heating:Fuel")) {
369370
airTerm.ReheatComp_Num = HeatingCoilType::Gas;
@@ -380,12 +381,28 @@ void GetSysInput(EnergyPlusData &state)
380381
ShowContinueError(state, format("Occurs in {} = {}", airTerm.sysType, airTerm.SysName));
381382
ErrorsFound = true;
382383
}
384+
383385
airTerm.ReheatName = Alphas(8);
384-
ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType);
385-
if (IsNotOK) {
386-
ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName));
387-
ErrorsFound = true;
386+
if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) {
387+
HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound);
388+
if (airTerm.ReheatComp_Index == 0) {
389+
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
390+
ErrorsFound = true;
391+
}
392+
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) {
393+
airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
394+
if (airTerm.ReheatComp_Index == 0) {
395+
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
396+
ErrorsFound = true;
397+
}
398+
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) {
399+
airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
400+
if (airTerm.ReheatComp_Index == 0) {
401+
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
402+
ErrorsFound = true;
403+
}
388404
}
405+
389406
if (lAlphaBlanks(2)) {
390407
airTerm.availSched = Sched::GetScheduleAlwaysOn(state);
391408
} else if ((airTerm.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) {
@@ -692,10 +709,24 @@ void GetSysInput(EnergyPlusData &state)
692709
ErrorsFound = true;
693710
}
694711
airTerm.ReheatName = Alphas(6);
695-
ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType);
696-
if (IsNotOK) {
697-
ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName));
698-
ErrorsFound = true;
712+
if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) {
713+
HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound);
714+
if (airTerm.ReheatComp_Index == 0) {
715+
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
716+
ErrorsFound = true;
717+
}
718+
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) {
719+
airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
720+
if (airTerm.ReheatComp_Index == 0) {
721+
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
722+
ErrorsFound = true;
723+
}
724+
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) {
725+
airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
726+
if (airTerm.ReheatComp_Index == 0) {
727+
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
728+
ErrorsFound = true;
729+
}
699730
}
700731

701732
if (lAlphaBlanks(2)) {
@@ -919,10 +950,24 @@ void GetSysInput(EnergyPlusData &state)
919950
ErrorsFound = true;
920951
}
921952
airTerm.ReheatName = Alphas(6);
922-
ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType);
923-
if (IsNotOK) {
924-
ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName));
925-
ErrorsFound = true;
953+
if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) {
954+
HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound);
955+
if (airTerm.ReheatComp_Index == 0) {
956+
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
957+
ErrorsFound = true;
958+
}
959+
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) {
960+
airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
961+
if (airTerm.ReheatComp_Index == 0) {
962+
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
963+
ErrorsFound = true;
964+
}
965+
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) {
966+
airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
967+
if (airTerm.ReheatComp_Index == 0) {
968+
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
969+
ErrorsFound = true;
970+
}
926971
}
927972

928973
if (lAlphaBlanks(2)) {
@@ -1654,10 +1699,25 @@ void GetSysInput(EnergyPlusData &state)
16541699
ShowContinueError(state, format("Occurs in {} = {}", airTerm.sysType, airTerm.SysName));
16551700
ErrorsFound = true;
16561701
}
1657-
ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType);
1658-
if (IsNotOK) {
1659-
ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName));
1660-
ErrorsFound = true;
1702+
1703+
if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) {
1704+
HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound);
1705+
if (airTerm.ReheatComp_Index == 0) {
1706+
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
1707+
ErrorsFound = true;
1708+
}
1709+
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) {
1710+
airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
1711+
if (airTerm.ReheatComp_Index == 0) {
1712+
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
1713+
ErrorsFound = true;
1714+
}
1715+
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) {
1716+
airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
1717+
if (airTerm.ReheatComp_Index == 0) {
1718+
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
1719+
ErrorsFound = true;
1720+
}
16611721
}
16621722

16631723
airTerm.fanType = static_cast<HVAC::FanType>(getEnumValue(HVAC::fanTypeNamesUC, Alphas(5)));

tst/EnergyPlus/unit/EconomicTariff.unit.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,25 +420,29 @@ TEST_F(EnergyPlusFixture, EconomicTariff_LEEDtariffReporting_Test)
420420
state->dataEconTariff->tariff(1).totalAnnualEnergy = 4855.21;
421421
state->dataEconTariff->tariff(1).kindMtr = EconomicTariff::MeterType::ElecPurchased;
422422
state->dataEconTariff->tariff(1).reportMeterIndx = GetMeterIndex(*state, "ELECTRICITY:FACILITY");
423+
state->dataEconTariff->tariff(1).demandWindow = DemandWindow::Day;
423424

424425
state->dataEconTariff->tariff(2).tariffName = "SmallCGUnit";
425426
state->dataEconTariff->tariff(2).isSelected = true;
426427
state->dataEconTariff->tariff(2).totalAnnualCost = 415.56;
427428
state->dataEconTariff->tariff(2).totalAnnualEnergy = 0.00;
428429
state->dataEconTariff->tariff(2).kindMtr = EconomicTariff::MeterType::Gas;
429430
state->dataEconTariff->tariff(2).reportMeterIndx = GetMeterIndex(*state, "NATURALGAS:FACILITY");
431+
state->dataEconTariff->tariff(2).demandWindow = DemandWindow::Day;
430432

431433
state->dataEconTariff->tariff(3).tariffName = "DistrictCoolingUnit";
432434
state->dataEconTariff->tariff(3).isSelected = true;
433435
state->dataEconTariff->tariff(3).totalAnnualCost = 55.22;
434436
state->dataEconTariff->tariff(3).totalAnnualEnergy = 8.64;
435437
state->dataEconTariff->tariff(3).reportMeterIndx = GetMeterIndex(*state, "DISTRICTCOOLING:FACILITY");
438+
state->dataEconTariff->tariff(3).demandWindow = DemandWindow::Day;
436439

437440
state->dataEconTariff->tariff(4).tariffName = "DistrictHeatingUnit";
438441
state->dataEconTariff->tariff(4).isSelected = true;
439442
state->dataEconTariff->tariff(4).totalAnnualCost = 15.98;
440443
state->dataEconTariff->tariff(4).totalAnnualEnergy = 1.47;
441444
state->dataEconTariff->tariff(4).reportMeterIndx = GetMeterIndex(*state, "DISTRICTHEATINGWATER:FACILITY");
445+
state->dataEconTariff->tariff(4).demandWindow = DemandWindow::Day;
442446

443447
SetPredefinedTables(*state); // need to setup the predefined table entry numbers
444448

0 commit comments

Comments
 (0)