Skip to content

Commit

Permalink
Merge pull request #5124 from NREL/4695_hpwh_equip_seq_num
Browse files Browse the repository at this point in the history
HPWH Equipment Sequence Number Error to Warning
  • Loading branch information
mjwitte committed Sep 9, 2015
2 parents eaf41b4 + adc9167 commit 4ecbf49
Show file tree
Hide file tree
Showing 6 changed files with 297 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/DataZoneEquipment.hh
Expand Up @@ -484,7 +484,7 @@ namespace DataZoneEquipment {
extern Array1D< ReturnAir > ReturnAirPath;

// Functions
// Clears the global data in DataZoneEquipment.
// Clears the global data in DataZoneEquipment.
// Needed for unit tests, should not be normally called.
void
clear_state();
Expand Down
37 changes: 33 additions & 4 deletions src/EnergyPlus/WaterThermalTanks.cc
Expand Up @@ -745,7 +745,7 @@ namespace WaterThermalTanks {

}

void
bool
GetWaterThermalTankInput()
{

Expand Down Expand Up @@ -3702,9 +3702,9 @@ namespace WaterThermalTanks {
}
} // EquipmentTypeNum
if ( TankNotLowestPriority && FoundTankInList ) {
ShowSevereError( cCurrentModuleObject + " = " + HPWH.Name + ':' );
ShowContinueError( "Heat pump water heaters must have lower priorities than all other equipment types in a ZoneHVAC:EquipmentList." );
ErrorsFound = true;
ShowWarningError( cCurrentModuleObject + " = " + HPWH.Name + ':' );
ShowContinueError( "Heat pump water heaters should be simulated first, before other space conditioning equipment." );
ShowContinueError( "Poor temperature control may result if the Heating/Cooling sequence number is not 1 in the ZoneHVAC:EquipmentList." );
}
break;
} // ZoneEquipConfigNum .LE. NumOfZoneEquipLists
Expand Down Expand Up @@ -4240,6 +4240,7 @@ namespace WaterThermalTanks {

} // get input flag

return ErrorsFound;
}

void
Expand Down Expand Up @@ -10403,6 +10404,34 @@ namespace WaterThermalTanks {
}
}

void
clear_state()
{
ValidSourceType.deallocate();
MyHPSizeFlag.deallocate();
CheckWTTEquipName.deallocate();
CheckHPWHEquipName.deallocate();

NumChilledWaterMixed = 0;
NumChilledWaterStratified = 0;
NumWaterHeaterMixed = 0;
NumWaterHeaterStratified = 0;
NumWaterThermalTank = 0;
NumWaterHeaterDesuperheater = 0;
NumHeatPumpWaterHeater = 0;

HPPartLoadRatio = 0.0;
GetWaterThermalTankInputFlag = true;
MixerInletAirSchedule = 0.0;
MdotAir = 0.0;
NumWaterHeaterSizing = 0;
AlreadyRated.deallocate();

WaterThermalTank.deallocate();
HPWaterHeater.deallocate();
WaterHeaterDesuperheater.deallocate();
}


// NOTICE

Expand Down
4 changes: 3 additions & 1 deletion src/EnergyPlus/WaterThermalTanks.hh
Expand Up @@ -1405,7 +1405,7 @@ namespace WaterThermalTanks {
void
CalcWaterThermalTankZoneGains();

void
bool
GetWaterThermalTankInput();

void
Expand Down Expand Up @@ -1603,6 +1603,8 @@ namespace WaterThermalTanks {
bool const FirstHVACIteration // TRUE if First iteration of simulation
);

void clear_state();

// NOTICE

// Copyright (c) 1996-2015 The Board of Trustees of the University of Illinois
Expand Down
2 changes: 2 additions & 0 deletions tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc
Expand Up @@ -65,6 +65,7 @@
#include <EnergyPlus/SplitterComponent.hh>
#include <EnergyPlus/VariableSpeedCoils.hh>
#include <EnergyPlus/WaterCoils.hh>
#include <EnergyPlus/WaterThermalTanks.hh>
#include <EnergyPlus/WeatherManager.hh>
#include <EnergyPlus/ZoneAirLoopEquipmentManager.hh>
#include <EnergyPlus/ZoneEquipmentManager.hh>
Expand Down Expand Up @@ -148,6 +149,7 @@ namespace EnergyPlus {
SplitterComponent::clear_state();
VariableSpeedCoils::clear_state();
WaterCoils::clear_state();
WaterThermalTanks::clear_state();
WeatherManager::clear_state();
ZoneAirLoopEquipmentManager::clear_state();
ZoneEquipmentManager::clear_state();
Expand Down
29 changes: 29 additions & 0 deletions tst/EnergyPlus/unit/Fixtures/HVACFixture.hh
Expand Up @@ -6,6 +6,20 @@

// EnergyPlus Headers
#include "EnergyPlusFixture.hh"
#include <EnergyPlus/DataAirLoop.hh>
#include <EnergyPlus/DataBranchNodeConnections.hh>
#include <EnergyPlus/DataHVACGlobals.hh>
#include <EnergyPlus/DataLoopNode.hh>
#include <EnergyPlus/DataSizing.hh>
#include <EnergyPlus/DXCoils.hh>
#include <EnergyPlus/ExteriorEnergyUse.hh>
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/GlobalNames.hh>
#include <EnergyPlus/Humidifiers.hh>
#include <EnergyPlus/HVACVariableRefrigerantFlow.hh>
#include <EnergyPlus/MixedAir.hh>
#include <EnergyPlus/NodeInputManager.hh>
#include <EnergyPlus/OutAirNodeManager.hh>
#include <EnergyPlus/Psychrometrics.hh>

namespace EnergyPlus {
Expand All @@ -26,6 +40,21 @@ namespace EnergyPlus {
Psychrometrics::cached_Twb.deallocate();
Psychrometrics::cached_Psat.deallocate();

DataAirLoop::clear_state();
DataBranchNodeConnections::clear_state();
DataHVACGlobals::clear_state();
DataLoopNode::clear_state();
DataSizing::clear_state();
DXCoils::clear_state();
ExteriorEnergyUse::clear_state();
Fans::clear_state();
GlobalNames::clear_state();
Humidifiers::clear_state();
HVACVariableRefrigerantFlow::clear_state();
MixedAir::clear_state();
NodeInputManager::clear_state();
OutAirNodeManager::clear_state();

EnergyPlusFixture::TearDown(); // Remember to tear down the base fixture after cleaning up derived fixture!
}
};
Expand Down
230 changes: 229 additions & 1 deletion tst/EnergyPlus/unit/WaterThermalTanks.unit.cc
Expand Up @@ -6,6 +6,7 @@
// EnergyPlus Headers
#include <WaterThermalTanks.hh>
#include <EnergyPlus/UtilityRoutines.hh>
#include <EnergyPlus/HeatBalanceManager.hh>
#include "Fixtures/HVACFixture.hh"

using namespace EnergyPlus;
Expand Down Expand Up @@ -86,8 +87,235 @@ TEST( WaterThermalTankData, GetDeadBandTemp )

}

TEST_F( HVACFixture, HPWHWrappedDummyNodeConfig ) {
TEST_F( HVACFixture, HPWHZoneEquipSeqenceNumberWarning )
{
std::string const idf_objects = delimited_string({
" Schedule:Constant, DummySch, , 1.0;",
" WaterHeater:HeatPump:PumpedCondenser,",
" Zone4HeatPumpWaterHeater,!- Name",
" , !- Availability Schedule Name",
" DummySch, !- Compressor Setpoint Temperature Schedule Name",
" 2.0, !- Dead Band Temperature Difference {deltaC}",
" Zone4WaterInletNode, !- Condenser Water Inlet Node Name",
" Zone4WaterOutletNode, !- Condenser Water Outlet Node Name",
" autocalculate, !- Condenser Water Flow Rate {m3/s}",
" autocalculate, !- Evaporator Air Flow Rate {m3/s}",
" ZoneAirOnly, !- Inlet Air Configuration",
" Zone4AirOutletNode, !- Air Inlet Node Name",
" Zone4AirInletNode, !- Air Outlet Node Name",
" , !- Outdoor Air Node Name",
" , !- Exhaust Air Node Name",
" , !- Inlet Air Temperature Schedule Name",
" , !- Inlet Air Humidity Schedule Name",
" SPACE4-1, !- Inlet Air Zone Name",
" WaterHeater:Mixed, !- Tank Object Type",
" Zone4HPWHTank, !- Tank Name",
" , !- Tank Use Side Inlet Node Name",
" , !- Tank Use Side Outlet Node Name",
" Coil:WaterHeating:AirToWaterHeatPump:Pumped, !- DX Coil Object Type",
" Zone4HPWHDXCoil, !- DX Coil Name",
" 5.0, !- Minimum Inlet Air Temperature for Compressor Operation {C}",
" , !- Maximum Inlet Air Temperature for Compressor Operation {C}",
" Zone, !- Compressor Location",
" , !- Compressor Ambient Temperature Schedule Name",
" Fan:OnOff, !- Fan Object Type",
" Zone4HPWHFan, !- Fan Name",
" DrawThrough, !- Fan Placement",
" 15.0, !- On Cycle Parasitic Electric Load {W}",
" 5.0, !- Off Cycle Parasitic Electric Load {W}",
" Zone; !- Parasitic Heat Rejection Location",
" WaterHeater:Mixed,",
" Zone4HPWHTank, !- Name",
" 0.3785, !- Tank Volume {m3}",
" DummySch, !- Setpoint Temperature Schedule Name",
" 2.0, !- Deadband Temperature Difference {deltaC}",
" 82.2222, !- Maximum Temperature Limit {C}",
" CYCLE, !- Heater Control Type",
" 5000, !- Heater Maximum Capacity {W}",
" 0, !- Heater Minimum Capacity {W}",
" , !- Heater Ignition Minimum Flow Rate {m3/s}",
" , !- Heater Ignition Delay {s}",
" ELECTRICITY, !- Heater Fuel Type",
" 0.95, !- Heater Thermal Efficiency",
" , !- Part Load Factor Curve Name",
" 10, !- Off Cycle Parasitic Fuel Consumption Rate {W}",
" ELECTRICITY, !- Off Cycle Parasitic Fuel Type",
" 0, !- Off Cycle Parasitic Heat Fraction to Tank",
" 30, !- On Cycle Parasitic Fuel Consumption Rate {W}",
" ELECTRICITY, !- On Cycle Parasitic Fuel Type",
" 0, !- On Cycle Parasitic Heat Fraction to Tank",
" Schedule, !- Ambient Temperature Indicator",
" DummySch, !- Ambient Temperature Schedule Name",
" , !- Ambient Temperature Zone Name",
" , !- Ambient Temperature Outdoor Air Node Name",
" 2.0, !- Off Cycle Loss Coefficient to Ambient Temperature {W/K}",
" 1.0, !- Off Cycle Loss Fraction to Zone",
" 2.0, !- On Cycle Loss Coefficient to Ambient Temperature {W/K}",
" 1.0, !- On Cycle Loss Fraction to Zone",
" 0.00379, !- Peak Use Flow Rate {m3/s}",
" DummySch, !- Use Flow Rate Fraction Schedule Name",
" , !- Cold Water Supply Temperature Schedule Name",
" , !- Use Side Inlet Node Name",
" , !- Use Side Outlet Node Name",
" , !- Use Side Effectiveness",
" Zone4WaterOutletNode, !- Source Side Inlet Node Name",
" Zone4WaterInletNode, !- Source Side Outlet Node Name",
" 0.95; !- Source Side Effectiveness",
" Coil:WaterHeating:AirToWaterHeatPump:Pumped,",
" Zone4HPWHDXCoil, !- Name",
" 4000.0, !- Rated Heating Capacity {W}",
" 3.2, !- Rated COP {W/W}",
" 0.6956, !- Rated Sensible Heat Ratio",
" 29.44, !- Rated Evaporator Inlet Air Dry-Bulb Temperature {C}",
" 22.22, !- Rated Evaporator Inlet Air Wet-Bulb Temperature {C}",
" 55.72, !- Rated Condenser Inlet Water Temperature {C}",
" autocalculate, !- Rated Evaporator Air Flow Rate {m3/s}",
" autocalculate, !- Rated Condenser Water Flow Rate {m3/s}",
" No, !- Evaporator Fan Power Included in Rated COP",
" No, !- Condenser Pump Power Included in Rated COP",
" No, !- Condenser Pump Heat Included in Rated Heating Capacity and Rated COP",
" 150.0, !- Condenser Water Pump Power {W}",
" 0.1, !- Fraction of Condenser Pump Heat to Water",
" Zone4AirOutletNode, !- Evaporator Air Inlet Node Name",
" Zone4DXCoilAirOutletNode,!- Evaporator Air Outlet Node Name",
" Zone4WaterInletNode, !- Condenser Water Inlet Node Name",
" Zone4WaterOutletNode, !- Condenser Water Outlet Node Name",
" 100.0, !- Crankcase Heater Capacity {W}",
" 5.0, !- Maximum Ambient Temperature for Crankcase Heater Operation {C}",
" WetBulbTemperature, !- Evaporator Air Temperature Type for Curve Objects",
" HPWHHeatingCapFTemp, !- Heating Capacity Function of Temperature Curve Name",
" , !- Heating Capacity Function of Air Flow Fraction Curve Name",
" , !- Heating Capacity Function of Water Flow Fraction Curve Name",
" HPWHHeatingCOPFTemp, !- Heating COP Function of Temperature Curve Name",
" , !- Heating COP Function of Air Flow Fraction Curve Name",
" , !- Heating COP Function of Water Flow Fraction Curve Name",
" HPWHPLFFPLR; !- Part Load Fraction Correlation Curve Name",
" Fan:OnOff,",
" Zone4HPWHFan, !- Name",
" , !- Availability Schedule Name",
" 0.7, !- Fan Total Efficiency",
" 100.0, !- Pressure Rise {Pa}",
" 0.2685, !- Maximum Flow Rate {m3/s}",
" 0.9, !- Motor Efficiency",
" 1.0, !- Motor In Airstream Fraction",
" Zone4DXCoilAirOutletNode,!- Air Inlet Node Name",
" Zone4AirInletNode; !- Air Outlet Node Name",
" Curve:Biquadratic,",
" HPWHHeatingCapFTemp, !- Name",
" 0.369827, !- Coefficient1 Constant",
" 0.043341, !- Coefficient2 x",
" -0.00023, !- Coefficient3 x**2",
" 0.000466, !- Coefficient4 y",
" 0.000026, !- Coefficient5 y**2",
" -0.00027, !- Coefficient6 x*y",
" 0.0, !- Minimum Value of x",
" 40.0, !- Maximum Value of x",
" 20.0, !- Minimum Value of y",
" 90.0, !- 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,",
" HPWHHeatingCOPFTemp, !- Name",
" 1.19713, !- Coefficient1 Constant",
" 0.077849, !- Coefficient2 x",
" -0.0000016, !- Coefficient3 x**2",
" -0.02675, !- Coefficient4 y",
" 0.000296, !- Coefficient5 y**2",
" -0.00112, !- Coefficient6 x*y",
" 0.0, !- Minimum Value of x",
" 40.0, !- Maximum Value of x",
" 20.0, !- Minimum Value of y",
" 90.0, !- 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,",
" HPWHPLFFPLR, !- Name",
" 0.75, !- Coefficient1 Constant",
" 0.25, !- Coefficient2 x",
" 0.0, !- Coefficient3 x**2",
" 0.0, !- Minimum Value of x",
" 1.0; !- Maximum Value of x",
" Zone,",
" SPACE4-1, !- Name",
" 0, !- Direction of Relative North {deg}",
" 0, !- X Origin {m}",
" 0, !- Y Origin {m}",
" 0, !- Z Origin {m}",
" 1, !- Type",
" 1, !- Multiplier",
" 2.438400269, !- Ceiling Height {m}",
" 103.311355591; !- Volume {m3}",
" ZoneHVAC:IdealLoadsAirSystem,",
" SPACE4-1 AirSys, !- Name",
" , !- Availability Schedule Name",
" IdealLoadInNode, !- Zone Supply Air Node Name",
" IdealLoadOutNode, !- Zone Exhaust Air Node Name",
" 50, !- Maximum Heating Supply Air Temperature {C}",
" 13, !- Minimum Cooling Supply Air Temperature {C}",
" 0.015, !- Maximum Heating Supply Air Humidity Ratio {kgWater/kgDryAir}",
" 0.009, !- Minimum Cooling Supply Air Humidity Ratio {kgWater/kgDryAir}",
" NoLimit, !- Heating Limit",
" autosize, !- Maximum Heating Air Flow Rate {m3/s}",
" , !- Maximum Sensible Heating Capacity {W}",
" NoLimit, !- Cooling Limit",
" autosize, !- Maximum Cooling Air Flow Rate {m3/s}",
" , !- Maximum Total Cooling Capacity {W}",
" , !- Heating Availability Schedule Name",
" , !- Cooling Availability Schedule Name",
" ConstantSupplyHumidityRatio, !- Dehumidification Control Type",
" , !- Cooling Sensible Heat Ratio {dimensionless}",
" ConstantSupplyHumidityRatio, !- Humidification Control Type",
" , !- Design Specification Outdoor Air Object Name",
" , !- Outdoor Air Inlet Node Name",
" , !- Demand Controlled Ventilation Type",
" , !- Outdoor Air Economizer Type",
" , !- Heat Recovery Type",
" , !- Sensible Heat Recovery Effectiveness {dimensionless}",
" ; !- Latent Heat Recovery Effectiveness {dimensionless}",
" ZoneHVAC:EquipmentConnections,",
" SPACE4-1, !- Zone Name",
" SPACE4-1 Eq, !- Zone Conditioning Equipment List Name",
" SPACE4-1 In Nodes, !- Zone Air Inlet Node or NodeList Name",
" SPACE4-1 Out Nodes, !- Zone Air Exhaust Node or NodeList Name",
" SPACE4-1 Node, !- Zone Air Node Name",
" SPACE4-1 Out Node; !- Zone Return Air Node Name",
" ZoneHVAC:EquipmentList,",
" SPACE4-1 Eq, !- Name",
" ZoneHVAC:IdealLoadsAirSystem, !- Zone Equipment 1 Object Type",
" SPACE4-1 AirSys, !- Zone Equipment 1 Name",
" 1, !- Zone Equipment 1 Cooling Sequence",
" 1, !- Zone Equipment 1 Heating or No-Load Sequence",
" WaterHeater:HeatPump:PumpedCondenser, !- Zone Equipment 2 Object Type",
" Zone4HeatPumpWaterHeater,!- Zone Equipment 2 Name",
" 2, !- Zone Equipment 2 Cooling Sequence",
" 2; !- Zone Equipment 2 Heating or No-Load Sequence",
" NodeList,",
" SPACE4-1 In Nodes, !- Name",
" SPACE4-1 In Node, !- Node 1 Name",
" Zone4AirInletNode, !- Node 2 Name",
" IdealLoadInNode; !- Node 2 Name",
" NodeList,",
" SPACE4-1 Out Nodes, !- Name",
" Zone4AirOutletNode, !- Node 1 Name",
" IdealLoadOutNode; !- Node 1 Name",
});

ASSERT_FALSE( process_idf( idf_objects ) );

bool ErrorsFound = false;
HeatBalanceManager::GetZoneData( ErrorsFound );
ASSERT_FALSE( ErrorsFound );
EXPECT_FALSE( WaterThermalTanks::GetWaterThermalTankInput() );
}

TEST_F( HVACFixture, HPWHWrappedDummyNodeConfig )
{
// Unit test for #5127

std::vector<std::string> idf_lines({
Expand Down

10 comments on commit 4ecbf49

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (mjwitte) - x86_64-MacOS-10.9-clang: OK (1306 of 1306 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (mjwitte) - Win64-Windows-7-VisualStudio-12: OK (1309 of 1309 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4402-VRF-outputs-and-multiplied-floor (mjwitte) - i386-Windows-7-VisualStudio-12: OK (1840 of 1840 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4402-VRF-outputs-and-multiplied-floor (mjwitte) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (1830 of 1840 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4402-VRF-outputs-and-multiplied-floor (mjwitte) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4402-VRF-outputs-and-multiplied-floor (mjwitte) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (776 of 776 tests passed)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4402-VRF-outputs-and-multiplied-floor (mjwitte) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: OK (1309 of 1309 tests passed)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4402-VRF-outputs-and-multiplied-floor (mjwitte) - x86_64-MacOS-10.9-clang: OK (1306 of 1306 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4402-VRF-outputs-and-multiplied-floor (mjwitte) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.67: OK (0 of 0 tests passed)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4402-VRF-outputs-and-multiplied-floor (mjwitte) - Win64-Windows-7-VisualStudio-12: OK (1309 of 1309 tests passed)

Build Badge Test Badge

Please sign in to comment.