From 748a0e64ce98aaa87ca2605f78def2fc13da8809 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 14 Feb 2020 09:24:29 +0100 Subject: [PATCH 1/6] Start adding a unit test for #7771 --- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 241 ++++++++++++++++++++++ 1 file changed, 241 insertions(+) diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index c7076b723e1..67845e5e5ff 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -11688,3 +11688,244 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInputwithTradeOff) thisSys->getUnitarySystemInputData(compName, zoneEquipment, 0, ErrorsFound); // get UnitarySystem input from object above EXPECT_FALSE(ErrorsFound); // expect no errors } + +// This issue tests for GetInput with respect to Autosizing, especially for issue #7771 where +// 'Minimum Supply Air Temperature' == 'Autosize' produces a crash +TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput_Autosizing) +{ + + bool ErrorsFound(false); + bool FirstHVACIteration(false); + Real64 CpAir(0.0); // specific heat of air + Real64 Qsens_sys(0.0); // UnitarySystem delivered sensible capacity wrt zone + Real64 MinHumRatio(0.0); // track minimum of outlet node or zone humidity ratio + Real64 ZoneTemp(0.0); // control zone temperature + int InletNode(0); // UnitarySystem inlet node number + int OutletNode(0); // UnitarySystem outlet node number + int ControlZoneNum(0); // index to control zone + + std::string const idf_objects = delimited_string({ + "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 }", + " ", + "ZoneHVAC:EquipmentConnections,", + "EAST ZONE, !- Zone Name", + " Zone2Equipment, !- Zone Conditioning Equipment List Name", + " Zone 2 Inlet Node, !- Zone Air Inlet Node or NodeList Name", + " Zone Exhaust Node, !- 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", + " AirLoopHVAC:UnitarySystem, !- Zone Equipment 1 Object Type", + " Unitary System Model, !- Zone Equipment 1 Name", + " 1, !- Zone Equipment 1 Cooling Sequence", + " 1, !- Zone Equipment 1 Heating or No - Load Sequence", + " , !- Zone Equipment 1 Sequential Cooling Fraction", + " ; !- Zone Equipment 1 Sequential Heating Fraction", + " ", + "AirLoopHVAC:UnitarySystem,", + " Unitary System Model, !- Name", + " Load, !- Control Type", + " East Zone, !- Controlling Zone or Thermostat Location", + " None, !- Dehumidification Control Type", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " Zone Exhaust Node, !- Air Inlet Node Name", + " Zone 2 Inlet Node, !- Air Outlet Node Name", + " Fan:OnOff, !- Supply Fan Object Type", + " Supply Fan 1, !- Supply Fan Name", + " BlowThrough, !- Fan Placement", + " ContinuousFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", + " Coil:Heating:Fuel, !- Heating Coil Object Type", + " Furnace Heating Coil 1, !- Heating Coil Name", + " , !- DX Heating Coil Sizing Ratio", + " Coil:Cooling:DX:SingleSpeed, !- Cooling Coil Object Type", + " Furnace ACDXCoil 1, !- Cooling Coil Name", + " No, !- Use DOAS DX Cooling Coil", + " Autosize, !- Minimum Supply Air Temperature {C}", + " , !- Latent Load Control", + " Coil:Heating:Fuel, !- Supplemental Heating Coil Object Type", + " Humidistat Reheat Coil 1, !- Supplemental Heating Coil Name", + " SupplyAirFlowRate, !- Supply Air Flow Rate Method During Cooling Operation", + " Autosize, !- Supply Air Flow Rate During Cooling Operation{ m3/s }", + " , !- Supply Air Flow Rate Per Floor Area During Cooling Operation{ m3/s-m2 }", + " , !- Fraction of Autosized Design Cooling Supply Air Flow Rate", + " , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation{ m3/s-W }", + " SupplyAirFlowRate, !- Supply air Flow Rate Method During Heating Operation", + " Autosize, !- Supply Air Flow Rate During Heating Operation{ m3/s }", + " , !- Supply Air Flow Rate Per Floor Area during Heating Operation{ m3/s-m2 }", + " , !- Fraction of Autosized Design Heating Supply Air Flow Rate", + " , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation{ m3/s-W }", + " SupplyAirFlowRate, !- Supply Air Flow Rate Method When No Cooling or Heating is Required", + " Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required{ m3/s }", + " , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required{ m3/s-m2 }", + " , !- Fraction of Autosized Design Cooling Supply Air Flow Rate", + " , !- Fraction of Autosized Design Heating Supply Air Flow Rate", + " , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation{ m3/s-W }", + " , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation{ m3/s-W }", + " Autosize; !- Maximum Supply Air Temperature{ C }", + + "Fan:OnOff,", + " Supply Fan 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " 0.7, !- Fan Total Efficiency", + " 600.0, !- Pressure Rise{ Pa }", + " 1.6, !- Maximum Flow Rate{ m3 / s }", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Airstream Fraction", + " Zone Exhaust Node, !- Air Inlet Node Name", + " DX Cooling Coil Air Inlet Node; !- Air Outlet Node Name", + " ", + "Coil:Cooling:DX:SingleSpeed,", + " Furnace ACDXCoil 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " 32000, !- Gross Rated Total Cooling Capacity {W}", + " 0.75, !- Gross Rated Sensible Heat Ratio", + " 3.0, !- Gross Rated Cooling COP {W/W}", + " 1.6, !- Rated Air Flow Rate {m3/s}", + " , !- 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", + " WindACCoolCapFT, !- Total Cooling Capacity Function of Temperature Curve Name", + " WindACCoolCapFFF, !- Total Cooling Capacity Function of Flow Fraction Curve Name", + " WindACEIRFT, !- Energy Input Ratio Function of Temperature Curve Name", + " WindACEIRFFF, !- Energy Input Ratio Function of Flow Fraction Curve Name", + " WindACPLFFPLR, !- Part Load Fraction Correlation Curve Name", + " , !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C}", + " 1000, !- Nominal Time for Condensate Removal to Begin {s}", + " 0.4, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless}", + " 4, !- Maximum Cycling Rate {cycles/hr}", + " 45; !- Latent Capacity Time Constant {s}", + " ", + "Coil:Heating:Fuel,", + " Furnace Heating Coil 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " Gas, !- Fuel Type", + " 0.8, !- Gas Burner Efficiency", + " 32000, !- Nominal Capacity{ W }", + " Heating Coil Air Inlet Node, !- Air Inlet Node Name", + " Reheat Coil Air Inlet Node; !- Air Outlet Node Name", + " ", + "Coil:Heating:Fuel,", + " Humidistat Reheat Coil 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " Gas, !- Fuel Type", + " 0.8, !- Gas Burner Efficiency", + " 32000, !- Nominal Capacity{ W }", + " Reheat Coil Air Inlet Node, !- Air Inlet Node Name", + " Zone 2 Inlet Node; !- Air Outlet Node Name", + " ", + "ScheduleTypeLimits,", + " Any Number; !- Name", + " ", + "Schedule:Compact,", + " FanAndCoilAvailSched, !- Name", + " Any Number, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00, 1.0; !- Field 3", + " ", + "Schedule:Compact,", + " ContinuousFanSchedule, !- Name", + " Any Number, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00, 1.0; !- Field 3", + " ", + "Curve:Quadratic,", + " WindACCoolCapFFF, !- 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,", + " WindACEIRFFF, !- Name", + " 1.1552, !- Coefficient1 Constant", + " -0.1808, !- Coefficient2 x", + " 0.0256, !- Coefficient3 x**2", + " 0.5, !- Minimum Value of x", + " 1.5; !- Maximum Value of x", + " ", + "Curve:Quadratic,", + " WindACPLFFPLR, !- 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", + " ", + "Curve:Biquadratic,", + " WindACCoolCapFT, !- Name", + " 0.942587793, !- Coefficient1 Constant", + " 0.009543347, !- Coefficient2 x", + " 0.000683770, !- Coefficient3 x**2", + " -0.011042676, !- Coefficient4 y", + " 0.000005249, !- Coefficient5 y**2", + " -0.000009720, !- 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,", + " WindACEIRFT, !- Name", + " 0.342414409, !- Coefficient1 Constant", + " 0.034885008, !- Coefficient2 x", + " -0.000623700, !- Coefficient3 x**2", + " 0.004977216, !- Coefficient4 y", + " 0.000437951, !- Coefficient5 y**2", + " -0.000728028, !- 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", + }); + + ASSERT_TRUE(process_idf(idf_objects)); // read idf objects + + HeatBalanceManager::GetZoneData(ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); // expect no errors + + DataZoneEquipment::GetZoneEquipmentData1(); // read zone equipment configuration and list objects + + DataSizing::ZoneEqSizing.allocate(1); + DataZoneEquipment::ZoneEquipList(1).EquipIndex.allocate(1); + DataZoneEquipment::ZoneEquipList(1).EquipIndex(1) = 1; // initialize equipment index for ZoneHVAC + + std::string compName = "UNITARY SYSTEM MODEL"; + bool zoneEquipment = true; + int compTypeOfNum = DataHVACGlobals::UnitarySys_AnyCoilType; + FirstHVACIteration = true; + UnitarySystems::UnitarySys::factory(compTypeOfNum, compName, zoneEquipment, 0); + UnitarySystems::UnitarySys *thisSys = &UnitarySystems::unitarySys[0]; + + DataZoneEquipment::ZoneEquipInputsFilled = true; // indicate zone data is available + thisSys->getUnitarySystemInputData(compName, zoneEquipment, 0, ErrorsFound); // get UnitarySystem input from object above + EXPECT_FALSE(ErrorsFound); // expect no errors + + ASSERT_EQ(1, UnitarySystems::numUnitarySystems); // only 1 unitary system above so expect 1 as number of unitary system objects + EXPECT_EQ(thisSys->UnitType, DataHVACGlobals::cFurnaceTypes(compTypeOfNum)); // compare UnitarySystem type string to valid type + +} From 05bc1284ebbc6079fb120a9f00f928f270397863 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 14 Feb 2020 09:24:51 +0100 Subject: [PATCH 2/6] Use eppy to update to latest IDD field names (the UnitarySystem ones have been seriously revamped in terms of naming lately) --- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 362 +++++++++++----------- 1 file changed, 183 insertions(+), 179 deletions(-) diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 67845e5e5ff..f9fc487630e 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -11706,203 +11706,207 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput_Autosizing) std::string const idf_objects = delimited_string({ "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 }", - " ", + " EAST ZONE, !- Name", + " 0, !- Direction of Relative North", + " 0, !- X Origin", + " 0, !- Y Origin", + " 0, !- Z Origin", + " 1, !- Type", + " 1, !- Multiplier", + " autocalculate, !- Ceiling Height", + " autocalculate; !- Volume", + "ZoneHVAC:EquipmentConnections,", - "EAST ZONE, !- Zone Name", - " Zone2Equipment, !- Zone Conditioning Equipment List Name", - " Zone 2 Inlet Node, !- Zone Air Inlet Node or NodeList Name", - " Zone Exhaust Node, !- Zone Air Exhaust Node or NodeList Name", - " Zone 2 Node, !- Zone Air Node Name", - " Zone 2 Outlet Node; !- Zone Return Air Node Name", - " ", + " EAST ZONE, !- Zone Name", + " Zone2Equipment, !- Zone Conditioning Equipment List Name", + " Zone 2 Inlet Node, !- Zone Air Inlet Node or NodeList Name", + " Zone Exhaust Node, !- Zone Air Exhaust Node or NodeList Name", + " Zone 2 Node, !- Zone Air Node Name", + " Zone 2 Outlet Node; !- Zone Return Air Node or NodeList Name", + "ZoneHVAC:EquipmentList,", - " Zone2Equipment, !- Name", - " SequentialLoad, !- Load Distribution Scheme", - " AirLoopHVAC:UnitarySystem, !- Zone Equipment 1 Object Type", - " Unitary System Model, !- Zone Equipment 1 Name", - " 1, !- Zone Equipment 1 Cooling Sequence", - " 1, !- Zone Equipment 1 Heating or No - Load Sequence", - " , !- Zone Equipment 1 Sequential Cooling Fraction", - " ; !- Zone Equipment 1 Sequential Heating Fraction", - " ", + " Zone2Equipment, !- Name", + " SequentialLoad, !- Load Distribution Scheme", + " AirLoopHVAC:UnitarySystem, !- Zone Equipment 1 Object Type", + " Unitary System Model, !- Zone Equipment 1 Name", + " 1, !- Zone Equipment 1 Cooling Sequence", + " 1, !- Zone Equipment 1 Heating or NoLoad Sequence", + " , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name", + " ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name", + "AirLoopHVAC:UnitarySystem,", - " Unitary System Model, !- Name", - " Load, !- Control Type", - " East Zone, !- Controlling Zone or Thermostat Location", - " None, !- Dehumidification Control Type", - " FanAndCoilAvailSched, !- Availability Schedule Name", - " Zone Exhaust Node, !- Air Inlet Node Name", - " Zone 2 Inlet Node, !- Air Outlet Node Name", - " Fan:OnOff, !- Supply Fan Object Type", - " Supply Fan 1, !- Supply Fan Name", - " BlowThrough, !- Fan Placement", - " ContinuousFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", - " Coil:Heating:Fuel, !- Heating Coil Object Type", - " Furnace Heating Coil 1, !- Heating Coil Name", - " , !- DX Heating Coil Sizing Ratio", - " Coil:Cooling:DX:SingleSpeed, !- Cooling Coil Object Type", - " Furnace ACDXCoil 1, !- Cooling Coil Name", - " No, !- Use DOAS DX Cooling Coil", - " Autosize, !- Minimum Supply Air Temperature {C}", - " , !- Latent Load Control", - " Coil:Heating:Fuel, !- Supplemental Heating Coil Object Type", - " Humidistat Reheat Coil 1, !- Supplemental Heating Coil Name", - " SupplyAirFlowRate, !- Supply Air Flow Rate Method During Cooling Operation", - " Autosize, !- Supply Air Flow Rate During Cooling Operation{ m3/s }", - " , !- Supply Air Flow Rate Per Floor Area During Cooling Operation{ m3/s-m2 }", - " , !- Fraction of Autosized Design Cooling Supply Air Flow Rate", - " , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation{ m3/s-W }", - " SupplyAirFlowRate, !- Supply air Flow Rate Method During Heating Operation", - " Autosize, !- Supply Air Flow Rate During Heating Operation{ m3/s }", - " , !- Supply Air Flow Rate Per Floor Area during Heating Operation{ m3/s-m2 }", - " , !- Fraction of Autosized Design Heating Supply Air Flow Rate", - " , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation{ m3/s-W }", - " SupplyAirFlowRate, !- Supply Air Flow Rate Method When No Cooling or Heating is Required", - " Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required{ m3/s }", - " , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required{ m3/s-m2 }", - " , !- Fraction of Autosized Design Cooling Supply Air Flow Rate", - " , !- Fraction of Autosized Design Heating Supply Air Flow Rate", - " , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation{ m3/s-W }", - " , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation{ m3/s-W }", - " Autosize; !- Maximum Supply Air Temperature{ C }", + " Unitary System Model, !- Name", + " Load, !- Control Type", + " East Zone, !- Controlling Zone or Thermostat Location", + " None, !- Dehumidification Control Type", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " Zone Exhaust Node, !- Air Inlet Node Name", + " Zone 2 Inlet Node, !- Air Outlet Node Name", + " Fan:OnOff, !- Supply Fan Object Type", + " Supply Fan 1, !- Supply Fan Name", + " BlowThrough, !- Fan Placement", + " ContinuousFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", + " Coil:Heating:Fuel, !- Heating Coil Object Type", + " Furnace Heating Coil 1, !- Heating Coil Name", + " , !- DX Heating Coil Sizing Ratio", + " Coil:Cooling:DX:SingleSpeed, !- Cooling Coil Object Type", + " Furnace ACDXCoil 1, !- Cooling Coil Name", + " No, !- Use DOAS DX Cooling Coil", + " Autosize, !- Minimum Supply Air Temperature", + " , !- Latent Load Control", + " Coil:Heating:Fuel, !- Supplemental Heating Coil Object Type", + " Humidistat Reheat Coil 1, !- Supplemental Heating Coil Name", + " SupplyAirFlowRate, !- Cooling Supply Air Flow Rate Method", + " Autosize, !- Cooling Supply Air Flow Rate", + " , !- Cooling Supply Air Flow Rate Per Floor Area", + " , !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate", + " , !- Cooling Supply Air Flow Rate Per Unit of Capacity", + " SupplyAirFlowRate, !- Heating Supply Air Flow Rate Method", + " Autosize, !- Heating Supply Air Flow Rate", + " , !- Heating Supply Air Flow Rate Per Floor Area", + " , !- Heating Fraction of Autosized Heating Supply Air Flow Rate", + " , !- Heating Supply Air Flow Rate Per Unit of Capacity", + " SupplyAirFlowRate, !- No Load Supply Air Flow Rate Method", + " Autosize, !- No Load Supply Air Flow Rate", + " , !- No Load Supply Air Flow Rate Per Floor Area", + " , !- No Load Fraction of Autosized Cooling Supply Air Flow Rate", + " , !- No Load Fraction of Autosized Heating Supply Air Flow Rate", + " , !- No Load Supply Air Flow Rate Per Unit of Capacity During Cooling Operation", + " , !- No Load Supply Air Flow Rate Per Unit of Capacity During Heating Operation", + " Autosize; !- Maximum Supply Air Temperature", "Fan:OnOff,", - " Supply Fan 1, !- Name", - " FanAndCoilAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600.0, !- Pressure Rise{ Pa }", - " 1.6, !- Maximum Flow Rate{ m3 / s }", - " 0.9, !- Motor Efficiency", - " 1.0, !- Motor In Airstream Fraction", - " Zone Exhaust Node, !- Air Inlet Node Name", - " DX Cooling Coil Air Inlet Node; !- Air Outlet Node Name", - " ", + " Supply Fan 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " 0.7, !- Fan Total Efficiency", + " 600, !- Pressure Rise", + " 1.6, !- Maximum Flow Rate", + " 0.9, !- Motor Efficiency", + " 1, !- Motor In Airstream Fraction", + " Zone Exhaust Node, !- Air Inlet Node Name", + " DX Cooling Coil Air Inlet Node; !- Air Outlet Node Name", + "Coil:Cooling:DX:SingleSpeed,", - " Furnace ACDXCoil 1, !- Name", - " FanAndCoilAvailSched, !- Availability Schedule Name", - " 32000, !- Gross Rated Total Cooling Capacity {W}", - " 0.75, !- Gross Rated Sensible Heat Ratio", - " 3.0, !- Gross Rated Cooling COP {W/W}", - " 1.6, !- Rated Air Flow Rate {m3/s}", - " , !- 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", - " WindACCoolCapFT, !- Total Cooling Capacity Function of Temperature Curve Name", - " WindACCoolCapFFF, !- Total Cooling Capacity Function of Flow Fraction Curve Name", - " WindACEIRFT, !- Energy Input Ratio Function of Temperature Curve Name", - " WindACEIRFFF, !- Energy Input Ratio Function of Flow Fraction Curve Name", - " WindACPLFFPLR, !- Part Load Fraction Correlation Curve Name", - " , !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C}", - " 1000, !- Nominal Time for Condensate Removal to Begin {s}", - " 0.4, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless}", - " 4, !- Maximum Cycling Rate {cycles/hr}", - " 45; !- Latent Capacity Time Constant {s}", - " ", + " Furnace ACDXCoil 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " 32000, !- Gross Rated Total Cooling Capacity", + " 0.75, !- Gross Rated Sensible Heat Ratio", + " 3, !- Gross Rated Cooling COP", + " 1.6, !- Rated Air Flow Rate", + " , !- Rated Evaporator Fan Power Per Volume Flow Rate", + " DX Cooling Coil Air Inlet Node, !- Air Inlet Node Name", + " Heating Coil Air Inlet Node, !- Air Outlet Node Name", + " WindACCoolCapFT, !- Total Cooling Capacity Function of Temperature Curve Name", + " WindACCoolCapFFF, !- Total Cooling Capacity Function of Flow Fraction Curve Name", + " WindACEIRFT, !- Energy Input Ratio Function of Temperature Curve Name", + " WindACEIRFFF, !- Energy Input Ratio Function of Flow Fraction Curve Name", + " WindACPLFFPLR, !- Part Load Fraction Correlation Curve Name", + " , !- Minimum Outdoor DryBulb Temperature for Compressor Operation", + " 1000, !- Nominal Time for Condensate Removal to Begin", + " 0.4, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity", + " 4, !- Maximum Cycling Rate", + " 45; !- Latent Capacity Time Constant", + "Coil:Heating:Fuel,", - " Furnace Heating Coil 1, !- Name", - " FanAndCoilAvailSched, !- Availability Schedule Name", - " Gas, !- Fuel Type", - " 0.8, !- Gas Burner Efficiency", - " 32000, !- Nominal Capacity{ W }", - " Heating Coil Air Inlet Node, !- Air Inlet Node Name", - " Reheat Coil Air Inlet Node; !- Air Outlet Node Name", - " ", + " Furnace Heating Coil 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " Gas, !- Fuel Type", + " 0.8, !- Burner Efficiency", + " 32000, !- Nominal Capacity", + " Heating Coil Air Inlet Node, !- Air Inlet Node Name", + " Reheat Coil Air Inlet Node; !- Air Outlet Node Name", + "Coil:Heating:Fuel,", - " Humidistat Reheat Coil 1, !- Name", - " FanAndCoilAvailSched, !- Availability Schedule Name", - " Gas, !- Fuel Type", - " 0.8, !- Gas Burner Efficiency", - " 32000, !- Nominal Capacity{ W }", - " Reheat Coil Air Inlet Node, !- Air Inlet Node Name", - " Zone 2 Inlet Node; !- Air Outlet Node Name", - " ", + " Humidistat Reheat Coil 1, !- Name", + " FanAndCoilAvailSched, !- Availability Schedule Name", + " Gas, !- Fuel Type", + " 0.8, !- Burner Efficiency", + " 32000, !- Nominal Capacity", + " Reheat Coil Air Inlet Node, !- Air Inlet Node Name", + " Zone 2 Inlet Node; !- Air Outlet Node Name", + "ScheduleTypeLimits,", - " Any Number; !- Name", - " ", + " Any Number; !- Name", + "Schedule:Compact,", - " FanAndCoilAvailSched, !- Name", - " Any Number, !- Schedule Type Limits Name", - " Through: 12/31, !- Field 1", - " For: AllDays, !- Field 2", - " Until: 24:00, 1.0; !- Field 3", - " ", + " FanAndCoilAvailSched, !- Name", + " Any Number, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00, !- Field 3", + " 1.0; !- Field 4", + "Schedule:Compact,", - " ContinuousFanSchedule, !- Name", - " Any Number, !- Schedule Type Limits Name", - " Through: 12/31, !- Field 1", - " For: AllDays, !- Field 2", - " Until: 24:00, 1.0; !- Field 3", - " ", + " ContinuousFanSchedule, !- Name", + " Any Number, !- Schedule Type Limits Name", + " Through: 12/31, !- Field 1", + " For: AllDays, !- Field 2", + " Until: 24:00, !- Field 3", + " 1.0; !- Field 4", + "Curve:Quadratic,", - " WindACCoolCapFFF, !- 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", - " ", + " WindACCoolCapFFF, !- Name", + " 0.8, !- Coefficient1 Constant", + " 0.2, !- Coefficient2 x", + " 0, !- Coefficient3 x2", + " 0.5, !- Minimum Value of x", + " 1.5; !- Maximum Value of x", + "Curve:Quadratic,", - " WindACEIRFFF, !- Name", - " 1.1552, !- Coefficient1 Constant", - " -0.1808, !- Coefficient2 x", - " 0.0256, !- Coefficient3 x**2", - " 0.5, !- Minimum Value of x", - " 1.5; !- Maximum Value of x", - " ", + " WindACEIRFFF, !- Name", + " 1.1552, !- Coefficient1 Constant", + " -0.1808, !- Coefficient2 x", + " 0.0256, !- Coefficient3 x2", + " 0.5, !- Minimum Value of x", + " 1.5; !- Maximum Value of x", + "Curve:Quadratic,", - " WindACPLFFPLR, !- 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", - " ", + " WindACPLFFPLR, !- Name", + " 0.85, !- Coefficient1 Constant", + " 0.15, !- Coefficient2 x", + " 0, !- Coefficient3 x2", + " 0, !- Minimum Value of x", + " 1; !- Maximum Value of x", + "Curve:Biquadratic,", - " WindACCoolCapFT, !- Name", - " 0.942587793, !- Coefficient1 Constant", - " 0.009543347, !- Coefficient2 x", - " 0.000683770, !- Coefficient3 x**2", - " -0.011042676, !- Coefficient4 y", - " 0.000005249, !- Coefficient5 y**2", - " -0.000009720, !- 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", - " ", + " WindACCoolCapFT, !- Name", + " 0.942587793, !- Coefficient1 Constant", + " 0.009543347, !- Coefficient2 x", + " 0.00068377, !- Coefficient3 x2", + " -0.011042676, !- Coefficient4 y", + " 5.249e-06, !- Coefficient5 y2", + " -9.72e-06, !- Coefficient6 xy", + " 12.77778, !- Minimum Value of x", + " 23.88889, !- Maximum Value of x", + " 18, !- 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,", - " WindACEIRFT, !- Name", - " 0.342414409, !- Coefficient1 Constant", - " 0.034885008, !- Coefficient2 x", - " -0.000623700, !- Coefficient3 x**2", - " 0.004977216, !- Coefficient4 y", - " 0.000437951, !- Coefficient5 y**2", - " -0.000728028, !- 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", + " WindACEIRFT, !- Name", + " 0.342414409, !- Coefficient1 Constant", + " 0.034885008, !- Coefficient2 x", + " -0.0006237, !- Coefficient3 x2", + " 0.004977216, !- Coefficient4 y", + " 0.000437951, !- Coefficient5 y2", + " -0.000728028, !- Coefficient6 xy", + " 12.77778, !- Minimum Value of x", + " 23.88889, !- Maximum Value of x", + " 18, !- 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", }); + + ASSERT_TRUE(process_idf(idf_objects)); // read idf objects HeatBalanceManager::GetZoneData(ErrorsFound); // read zone data From 5e2babaa86d81b32687fe5c45d3473eb25f71426 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 14 Feb 2020 10:31:16 +0100 Subject: [PATCH 3/6] Update gtest --- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 35 ++++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index f9fc487630e..677795c9e5e 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -11694,16 +11694,6 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInputwithTradeOff) TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput_Autosizing) { - bool ErrorsFound(false); - bool FirstHVACIteration(false); - Real64 CpAir(0.0); // specific heat of air - Real64 Qsens_sys(0.0); // UnitarySystem delivered sensible capacity wrt zone - Real64 MinHumRatio(0.0); // track minimum of outlet node or zone humidity ratio - Real64 ZoneTemp(0.0); // control zone temperature - int InletNode(0); // UnitarySystem inlet node number - int OutletNode(0); // UnitarySystem outlet node number - int ControlZoneNum(0); // index to control zone - std::string const idf_objects = delimited_string({ "Zone,", " EAST ZONE, !- Name", @@ -11906,9 +11896,9 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput_Autosizing) }); - ASSERT_TRUE(process_idf(idf_objects)); // read idf objects + bool ErrorsFound(false); HeatBalanceManager::GetZoneData(ErrorsFound); // read zone data EXPECT_FALSE(ErrorsFound); // expect no errors @@ -11921,15 +11911,26 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput_Autosizing) std::string compName = "UNITARY SYSTEM MODEL"; bool zoneEquipment = true; int compTypeOfNum = DataHVACGlobals::UnitarySys_AnyCoilType; - FirstHVACIteration = true; + UnitarySystems::UnitarySys::factory(compTypeOfNum, compName, zoneEquipment, 0); + // only 1 unitary system above so expect 1 as number of unitary system objects + ASSERT_EQ(1, UnitarySystems::numUnitarySystems); + // Now retrieve it UnitarySystems::UnitarySys *thisSys = &UnitarySystems::unitarySys[0]; - DataZoneEquipment::ZoneEquipInputsFilled = true; // indicate zone data is available - thisSys->getUnitarySystemInputData(compName, zoneEquipment, 0, ErrorsFound); // get UnitarySystem input from object above - EXPECT_FALSE(ErrorsFound); // expect no errors + // indicate zone data is available + DataZoneEquipment::ZoneEquipInputsFilled = true; - ASSERT_EQ(1, UnitarySystems::numUnitarySystems); // only 1 unitary system above so expect 1 as number of unitary system objects - EXPECT_EQ(thisSys->UnitType, DataHVACGlobals::cFurnaceTypes(compTypeOfNum)); // compare UnitarySystem type string to valid type + // get UnitarySystem input from object above + // Before fix for #7771, it throws + // C++ exception with description "[json.exception.type_error.302] type must be number, but is string" thrown in the test body. + ASSERT_NO_THROW(thisSys->getUnitarySystemInputData(compName, zoneEquipment, 0, ErrorsFound)); + EXPECT_FALSE(ErrorsFound); + EXPECT_EQ(thisSys->DesignMinOutletTemp, DataSizing::AutoSize); + EXPECT_EQ(thisSys->m_MaxCoolAirVolFlow, DataSizing::AutoSize); + EXPECT_EQ(thisSys->m_MaxHeatAirVolFlow, DataSizing::AutoSize); + EXPECT_EQ(thisSys->m_MaxNoCoolHeatAirVolFlow, DataSizing::AutoSize); + EXPECT_EQ(thisSys->DesignMaxOutletTemp, DataSizing::AutoSize); + EXPECT_TRUE(thisSys->m_RequestAutoSize); } From b0a3644c0d6a17ad92d4358aed65ab17601d3f63 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 14 Feb 2020 10:31:59 +0100 Subject: [PATCH 4/6] DesignMinOutletTemp is autosizable ONLY if Control Type = SingleZoneVAV --- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 677795c9e5e..10b235517aa 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -11724,9 +11724,10 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput_Autosizing) " , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name", " ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name", + // Note: Control type MUST be SingleZoneVAV if you are autosizing 'Minimum Supply Air Temperature' "AirLoopHVAC:UnitarySystem,", " Unitary System Model, !- Name", - " Load, !- Control Type", + " SingleZoneVAV, !- Control Type", " East Zone, !- Controlling Zone or Thermostat Location", " None, !- Dehumidification Control Type", " FanAndCoilAvailSched, !- Availability Schedule Name", @@ -11927,6 +11928,9 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput_Autosizing) ASSERT_NO_THROW(thisSys->getUnitarySystemInputData(compName, zoneEquipment, 0, ErrorsFound)); EXPECT_FALSE(ErrorsFound); + // Like I said above in the IDF snippet section, control type has to be SingleZoneVAV or autosizing of + // 'Minimum Supply Air Temperature' (DesignMinOutletTemp) isn't allowed + EXPECT_EQ(thisSys->m_ControlType, EnergyPlus::UnitarySystems::UnitarySys::ControlType::CCMASHRAE); EXPECT_EQ(thisSys->DesignMinOutletTemp, DataSizing::AutoSize); EXPECT_EQ(thisSys->m_MaxCoolAirVolFlow, DataSizing::AutoSize); EXPECT_EQ(thisSys->m_MaxHeatAirVolFlow, DataSizing::AutoSize); From 2e43505f19a1ed1891438199814e35518670a8d0 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 14 Feb 2020 10:32:50 +0100 Subject: [PATCH 5/6] Fix #7771 - Allow AirLoopHVAC:UnitarySystem 'Minimum Supply Air Temperature' to be autosized --- src/EnergyPlus/UnitarySystem.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 3e6c0a34da6..32b14f61ce3 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -2810,8 +2810,13 @@ namespace UnitarySystems { } Real64 loc_DesignMinOutletTemp(2.0); - if (fields.find("minimum_supply_air_temperature") != fields.end()) { // not required field, has default - loc_DesignMinOutletTemp = fields.at("minimum_supply_air_temperature"); + if (fields.find("minimum_supply_air_temperature") != fields.end()) { // not required field, has default (2C), and autosizable + auto tempFieldVal = fields.at("minimum_supply_air_temperature"); + if (tempFieldVal == "Autosize") { + loc_DesignMinOutletTemp = DataSizing::AutoSize; + } else { + loc_DesignMinOutletTemp = fields.at("minimum_supply_air_temperature"); + } } std::string loc_latentControlFlag("SensibleOnlyLoadControl"); From e697d59f73ea5c38913092c3edc7953bb6edb7b0 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 28 Feb 2020 12:44:33 +0100 Subject: [PATCH 6/6] Following #7789, need to cahnge Fuel Type to "NaturalGas" in new test --- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 10b235517aa..1d5117cb532 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -11801,16 +11801,16 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput_Autosizing) "Coil:Heating:Fuel,", " Furnace Heating Coil 1, !- Name", " FanAndCoilAvailSched, !- Availability Schedule Name", - " Gas, !- Fuel Type", + " NaturalGas, !- Fuel Type", " 0.8, !- Burner Efficiency", " 32000, !- Nominal Capacity", " Heating Coil Air Inlet Node, !- Air Inlet Node Name", " Reheat Coil Air Inlet Node; !- Air Outlet Node Name", "Coil:Heating:Fuel,", - " Humidistat Reheat Coil 1, !- Name", + " Humidistat Reheat Coil 1, !- Name", " FanAndCoilAvailSched, !- Availability Schedule Name", - " Gas, !- Fuel Type", + " NaturalGas, !- Fuel Type", " 0.8, !- Burner Efficiency", " 32000, !- Nominal Capacity", " Reheat Coil Air Inlet Node, !- Air Inlet Node Name",