Skip to content

Commit

Permalink
Fix more crashes and diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Dec 20, 2024
1 parent 13c52af commit 4243a37
Show file tree
Hide file tree
Showing 12 changed files with 227 additions and 38 deletions.
4 changes: 2 additions & 2 deletions src/EnergyPlus/PlantCentralGSHP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,7 @@ void WrapperSpecs::CalcWrapperModel(EnergyPlusData &state, Real64 &MyLoad, int c
}

// Add ancilliary power if scheduled
if (this->ancillaryPowerSched->getCurrentVal() > 0) {
if (this->ancillaryPowerSched != nullptr) {
WrapperElecPowerCool += (this->AncillaryPower * this->ancillaryPowerSched->getCurrentVal());
}

Expand Down Expand Up @@ -3211,7 +3211,7 @@ void WrapperSpecs::CalcWrapperModel(EnergyPlusData &state, Real64 &MyLoad, int c
}

// Check if ancilliary power is used
if (this->ancillaryPowerSched->getCurrentVal() > 0) {
if (this->ancillaryPowerSched != nullptr) {
WrapperElecPowerHeat += (this->AncillaryPower * this->ancillaryPowerSched->getCurrentVal());
}

Expand Down
4 changes: 3 additions & 1 deletion src/EnergyPlus/SurfaceGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9494,7 +9494,9 @@ namespace SurfaceGeometry {
windowShadingControl.ShadingControlIsScheduled = getYesNoValue(s_ipsc->cAlphaArgs(7)) == BooleanSwitch::Yes;
windowShadingControl.GlareControlIsActive = getYesNoValue(s_ipsc->cAlphaArgs(8)) == BooleanSwitch::Yes;

if (windowShadingControl.ShadingType != DataSurfaces::WinShadingType::IntBlind) {
if (windowShadingControl.ShadingType != DataSurfaces::WinShadingType::IntBlind &&
windowShadingControl.ShadingType != DataSurfaces::WinShadingType::ExtBlind &&
windowShadingControl.ShadingType != DataSurfaces::WinShadingType::BGBlind) {
} else if (s_ipsc->cAlphaArgs(10).empty()) {
ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(10), s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3));
ErrorsFound = true;
Expand Down
10 changes: 5 additions & 5 deletions testfiles/DOAToPTHP.idf
Original file line number Diff line number Diff line change
Expand Up @@ -2186,35 +2186,35 @@
SPACE1-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

ZoneControl:ContaminantController,
SPACE2-1 Contaminant Controller, !- Name
SPACE2-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

ZoneControl:ContaminantController,
SPACE3-1 Contaminant Controller, !- Name
SPACE3-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

ZoneControl:ContaminantController,
SPACE4-1 Contaminant Controller, !- Name
SPACE4-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

ZoneControl:ContaminantController,
SPACE5-1 Contaminant Controller, !- Name
SPACE5-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

!- =========== ALL OBJECTS IN CLASS: THERMOSTATSETPOINT:DUALSETPOINT ===========

Expand Down
10 changes: 5 additions & 5 deletions testfiles/DOAToUnitarySystem.idf
Original file line number Diff line number Diff line change
Expand Up @@ -2258,35 +2258,35 @@
SPACE1-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

ZoneControl:ContaminantController,
SPACE2-1 Contaminant Controller, !- Name
SPACE2-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

ZoneControl:ContaminantController,
SPACE3-1 Contaminant Controller, !- Name
SPACE3-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

ZoneControl:ContaminantController,
SPACE4-1 Contaminant Controller, !- Name
SPACE4-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

ZoneControl:ContaminantController,
SPACE5-1 Contaminant Controller, !- Name
SPACE5-1, !- Zone Name
HVACTemplate-Always 1, !- Carbon Dioxide Control Availability Schedule Name
Zone Setpoint CO2 Concentration, !- Carbon Dioxide Setpoint Schedule Name
Zone Minimum CO2 Concentration; !- Minimum Carbon Dioxide Concentration Schedule Name
; !- Minimum Carbon Dioxide Concentration Schedule Name

!- =========== ALL OBJECTS IN CLASS: THERMOSTATSETPOINT:DUALSETPOINT ===========

Expand Down
9 changes: 9 additions & 0 deletions tst/EnergyPlus/unit/AirflowNetworkComponents.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,15 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestTriangularWindowWarning)
state->init_state(*state);
state->afn->get_input();
std::string const error_string = delimited_string({
" ** Warning ** ProcessScheduleInput: Schedule:Constant = ONSCH",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = AULA PEOPLE SCHED",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = SEMPRE 21",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** AirflowNetwork::Solver::get_input: AirflowNetwork:MultiZone:Surface=\"WINDOW1\".",
" ** ~~~ ** The opening is a Triangular subsurface. A rectangular subsurface will be used with equivalent width and height.",
});
Expand Down
11 changes: 10 additions & 1 deletion tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10710,7 +10710,16 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneVentingAirBoundary)
// Expect warnings about the air boundary surface
EXPECT_TRUE(has_err_output(false));
std::string const expectedErrString = delimited_string(
{" ** Warning ** AirflowNetwork::Solver::get_input: AirflowNetwork:MultiZone:Surface=\"AIR WALL AULA 2\" is an air boundary surface.",
{" ** Warning ** ProcessScheduleInput: Schedule:Constant = ONSCH",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = AULA PEOPLE SCHED",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = SEMPRE 21",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** AirflowNetwork::Solver::get_input: AirflowNetwork:MultiZone:Surface=\"AIR WALL AULA 2\" is an air boundary surface.",
" ** ~~~ ** Ventilation Control Mode = TEMPERATURE is not valid. Resetting to Constant.",
" ** Warning ** AirflowNetwork::Solver::get_input: : AirflowNetwork:MultiZone:Surface = AIR WALL AULA 2",
" ** ~~~ ** Venting Availbility Schedule is not empty.",
Expand Down
5 changes: 4 additions & 1 deletion tst/EnergyPlus/unit/HeatBalanceManager.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData2)
EXPECT_TRUE(ErrorsFound);

std::string const error_string =
delimited_string({" ** Severe ** CreateAirBoundaryConstructions: Construction:AirBoundary = Air Boundary with Bad Mixing Schedule",
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYS2",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Severe ** CreateAirBoundaryConstructions: Construction:AirBoundary = Air Boundary with Bad Mixing Schedule",
" ** ~~~ ** Simple Mixing Schedule Name = xyz, item not found.",
" ** Severe ** Errors found in creating the constructions defined with Construction:AirBoundary.",
" ** Warning ** This building has no thermal mass which can cause an unstable solution.",
Expand Down
10 changes: 8 additions & 2 deletions tst/EnergyPlus/unit/InternalHeatGains.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ TEST_F(EnergyPlusFixture, InternalHeatGains_OtherEquipment_NegativeDesignLevel)
ASSERT_THROW(InternalHeatGains::GetInternalHeatGainsInput(*state), std::runtime_error);

std::string const error_string = delimited_string(
{" ** Severe ** GetInternalHeatGains: OtherEquipment=\"OTHEREQ1\", Design Level is not allowed to be negative",
{" ** Warning ** ProcessScheduleInput: Schedule:Constant = SCHEDULE1",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Severe ** GetInternalHeatGains: OtherEquipment=\"OTHEREQ1\", Design Level is not allowed to be negative",
" ** ~~~ ** ... when a fuel type of FuelOilNo1 is specified.",
" ** Fatal ** GetInternalHeatGains: Errors found in Getting Internal Gains Input, Program Stopped",
" ...Summary of Errors that led to program termination:",
Expand Down Expand Up @@ -216,7 +219,10 @@ TEST_F(EnergyPlusFixture, InternalHeatGains_OtherEquipment_BadFuelType)
state->init_state(*state);

std::string error_string =
delimited_string({" ** Severe ** <root>[OtherEquipment][OtherEq1][fuel_type] - \"Water\" - Failed to match against any enum values."});
delimited_string({" ** Severe ** <root>[OtherEquipment][OtherEq1][fuel_type] - \"Water\" - Failed to match against any enum values.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = SCHEDULE1",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated."});
EXPECT_TRUE(compare_err_stream(error_string, true));

bool ErrorsFound(false);
Expand Down
64 changes: 57 additions & 7 deletions tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ TEST_F(EnergyPlusFixture, ParallelPIUTest1)
Fans::GetFanInput(*state);
state->dataFans->GetFanInputFlag = false;
PoweredInductionUnits::GetPIUs(*state);
EXPECT_TRUE(compare_err_stream(""));
std::string error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSOFF",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSON",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated."});
EXPECT_TRUE(compare_err_stream(error_string));
state->dataHeatBalFanSys->TempControlType.allocate(1);
state->dataHeatBalFanSys->TempControlType(1) = HVAC::SetptType::DualHeatCool;

Expand Down Expand Up @@ -418,7 +425,15 @@ TEST_F(EnergyPlusFixture, SeriesPIUTest1)
Fans::GetFanInput(*state);
state->dataFans->GetFanInputFlag = false;
PoweredInductionUnits::GetPIUs(*state);
EXPECT_TRUE(compare_err_stream(""));

std::string error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSOFF",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSON",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated."});
EXPECT_TRUE(compare_err_stream(error_string));
state->dataHeatBalFanSys->TempControlType.allocate(1);
state->dataHeatBalFanSys->TempControlType(1) = HVAC::SetptType::DualHeatCool;

Expand Down Expand Up @@ -2092,7 +2107,14 @@ TEST_F(EnergyPlusFixture, VSParallelPIUStagedHeat)
Fans::GetFanInput(*state);
state->dataFans->GetFanInputFlag = false;
PoweredInductionUnits::GetPIUs(*state);
EXPECT_TRUE(compare_err_stream(""));
std::string error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSOFF",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSON",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated."});
EXPECT_TRUE(compare_err_stream(error_string));
state->dataHeatBalFanSys->TempControlType.allocate(1);
state->dataHeatBalFanSys->TempControlType(1) = HVAC::SetptType::DualHeatCool;
state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1);
Expand Down Expand Up @@ -2289,7 +2311,14 @@ TEST_F(EnergyPlusFixture, VSParallelPIUModulatedHeat)
Fans::GetFanInput(*state);
state->dataFans->GetFanInputFlag = false;
PoweredInductionUnits::GetPIUs(*state);
EXPECT_TRUE(compare_err_stream(""));
std::string error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSOFF",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSON",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated."});
EXPECT_TRUE(compare_err_stream(error_string));
state->dataHeatBalFanSys->TempControlType.allocate(1);
state->dataHeatBalFanSys->TempControlType(1) = HVAC::SetptType::DualHeatCool;
state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1);
Expand Down Expand Up @@ -2526,7 +2555,14 @@ TEST_F(EnergyPlusFixture, VSSeriesPIUStagedHeat)
state->dataFans->GetFanInputFlag = false;
Fans::GetFanInput(*state);
PoweredInductionUnits::GetPIUs(*state);
EXPECT_TRUE(compare_err_stream(""));
std::string error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSOFF",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSON",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated."});
EXPECT_TRUE(compare_err_stream(error_string));
state->dataHeatBalFanSys->TempControlType.allocate(1);
state->dataHeatBalFanSys->TempControlType(1) = HVAC::SetptType::DualHeatCool;
state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1);
Expand Down Expand Up @@ -2727,7 +2763,14 @@ TEST_F(EnergyPlusFixture, VSSeriesPIUModulatedHeat)
Fans::GetFanInput(*state);
state->dataFans->GetFanInputFlag = false;
PoweredInductionUnits::GetPIUs(*state);
EXPECT_TRUE(compare_err_stream(""));
std::string error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSOFF",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSON",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated."});
EXPECT_TRUE(compare_err_stream(error_string));
state->dataHeatBalFanSys->TempControlType.allocate(1);
state->dataHeatBalFanSys->TempControlType(1) = HVAC::SetptType::DualHeatCool;
state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1);
Expand Down Expand Up @@ -2962,7 +3005,14 @@ TEST_F(EnergyPlusFixture, VSSeriesPIUCool)
Fans::GetFanInput(*state);
state->dataFans->GetFanInputFlag = false;
PoweredInductionUnits::GetPIUs(*state);
EXPECT_TRUE(compare_err_stream(""));
std::string error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSOFF",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = ALWAYSON",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated."});
EXPECT_TRUE(compare_err_stream(error_string));
state->dataHeatBalFanSys->TempControlType.allocate(1);
state->dataHeatBalFanSys->TempControlType(1) = HVAC::SetptType::DualHeatCool;
state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1);
Expand Down
8 changes: 7 additions & 1 deletion tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,13 @@ TEST_F(EnergyPlusFixture, RoomAirInternalGains_InternalHeatGains_Check)
EXPECT_TRUE(ErrorsFound);

std::string const error_string =
delimited_string({" ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 PEOPLE",
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = SCH_ACT",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Warning ** ProcessScheduleInput: Schedule:Constant = SCH",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 PEOPLE",
" ** ~~~ ** Entered in RoomAir:Node:AirflowNetwork:InternalGains = NODE1_GAIN",
" ** ~~~ ** Internal gain did not match correctly",
" ** Severe ** GetRoomAirflowNetworkData: Invalid Internal Gain Object Name = LIVING_UNIT1 LIGHTS",
Expand Down
Loading

0 comments on commit 4243a37

Please sign in to comment.