openstudio-standards 0.3.1.rc1 → 0.3.1.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/data/geometry/ASHRAELargeOffice.json +4 -4
  3. data/data/standards/test_performance_expected_dd_results.csv +1890 -2016
  4. data/lib/openstudio-standards/btap/fileio.rb +1 -0
  5. data/lib/openstudio-standards/hvac_sizing/Siz.ThermalZone.rb +8 -3
  6. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Pump.rb +6 -6
  7. data/lib/openstudio-standards/prototypes/common/buildings/Prototype.LargeOffice.rb +7 -5
  8. data/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb +1 -1
  9. data/lib/openstudio-standards/prototypes/common/objects/Prototype.PumpVariableSpeed.rb +3 -3
  10. data/lib/openstudio-standards/prototypes/common/objects/Prototype.ServiceWaterHeating.rb +5 -5
  11. data/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +4 -4
  12. data/lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb +23 -23
  13. data/lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctParallelPIUReheat.rb +3 -3
  14. data/lib/openstudio-standards/standards/Standards.Fan.rb +6 -6
  15. data/lib/openstudio-standards/standards/Standards.Model.rb +20 -14
  16. data/lib/openstudio-standards/standards/Standards.Pump.rb +21 -19
  17. data/lib/openstudio-standards/standards/Standards.Space.rb +25 -18
  18. data/lib/openstudio-standards/standards/Standards.SpaceType.rb +2 -2
  19. data/lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb +3 -3
  20. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.AirLoopHVAC.rb +3 -3
  21. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.Model.rb +3 -3
  22. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.ZoneHVACComponent.rb +6 -6
  23. data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +45 -45
  24. data/lib/openstudio-standards/version.rb +1 -1
  25. metadata +2 -2
@@ -833,6 +833,7 @@ module BTAP
833
833
 
834
834
  # Move to the next field if no difference was found
835
835
  next if true_value == compare_value
836
+ next if true_value.to_f.zero? && compare_value.to_f.zero?
836
837
 
837
838
  # Check numeric values if numeric
838
839
  if (compare_value.is_a? Numeric) && (true_value.is_a? Numeric)
@@ -166,11 +166,16 @@ class OpenStudio::Model::ThermalZone
166
166
  sql = sql.get
167
167
 
168
168
  table_name = 'Zone Sizing Information'
169
+ if self.model.version < OpenStudio::VersionString.new('3.5.0')
170
+ report_name = 'Initialization Summary'
171
+ else
172
+ report_name = 'InitializationSummary'
173
+ end
169
174
 
170
175
  # Get zone row name
171
176
  query = "SELECT RowName
172
177
  FROM tabulardatawithstrings
173
- WHERE ReportName='Initialization Summary'
178
+ WHERE ReportName='#{report_name}'
174
179
  AND ReportForString='Entire Facility'
175
180
  AND TableName='#{table_name}'
176
181
  AND ColumnName='Zone Name'
@@ -193,7 +198,7 @@ class OpenStudio::Model::ThermalZone
193
198
  # Get zone cooling design flow rate
194
199
  query = "SELECT Value
195
200
  FROM tabulardatawithstrings
196
- WHERE ReportName='Initialization Summary'
201
+ WHERE ReportName='#{report_name}'
197
202
  AND ReportForString='Entire Facility'
198
203
  AND TableName='#{table_name}'
199
204
  AND ColumnName='User Des Air Flow Rate {m3/s}'
@@ -208,7 +213,7 @@ class OpenStudio::Model::ThermalZone
208
213
  # Get zone heating design flow rate
209
214
  query = "SELECT Value
210
215
  FROM tabulardatawithstrings
211
- WHERE ReportName='Initialization Summary'
216
+ WHERE ReportName='#{report_name}'
212
217
  AND ReportForString='Entire Facility'
213
218
  AND TableName='#{table_name}'
214
219
  AND ColumnName='User Des Air Flow Rate {m3/s}'
@@ -56,16 +56,16 @@ class ASHRAE9012019 < ASHRAE901
56
56
  # Get flow rate (whether autosized or hard-sized)
57
57
  flow_m3_per_s = 0
58
58
  flow_m3_per_s = if pump.to_PumpVariableSpeed.is_initialized || pump.to_PumpConstantSpeed.is_initialized
59
- if pump.autosizedRatedFlowRate.is_initialized
60
- pump.autosizedRatedFlowRate.get
61
- else
59
+ if pump.ratedFlowRate.is_initialized
62
60
  pump.ratedFlowRate.get
61
+ elsif pump.autosizedRatedFlowRate.is_initialized
62
+ pump.autosizedRatedFlowRate.get
63
63
  end
64
64
  elsif pump.to_HeaderedPumpsVariableSpeed.is_initialized || pump.to_HeaderedPumpsConstantSpeed.is_initialized
65
- if pump.autosizedTotalRatedFlowRate.is_initialized
66
- pump.autosizedTotalRatedFlowRate.get / pump.numberofPumpsinBank
67
- else
65
+ if pump.totalRatedFlowRate.is_initialized
68
66
  pump.totalRatedFlowRate.get / pump.numberofPumpsinBank
67
+ elsif pump.autosizedTotalRatedFlowRate.is_initialized
68
+ pump.autosizedTotalRatedFlowRate.get / pump.numberofPumpsinBank
69
69
  end
70
70
  end
71
71
  flow_gpm = OpenStudio.convert(flow_m3_per_s, 'm^3/s', 'gal/min').get
@@ -100,11 +100,13 @@ module LargeOffice
100
100
  end
101
101
  end
102
102
 
103
- model.getPlantLoops.sort.each do |plant_loop|
104
- if plant_loop.name.to_s == 'Heat Pump Loop'
105
- plant_loop.setFluidType('EthyleneGlycol')
106
- plant_loop.setGlycolConcentration(40)
107
- end
103
+ hp_loop = model.getPlantLoopByName('Heat Pump Loop')
104
+ if hp_loop.is_initialized
105
+ hp_loop = hp_loop.get
106
+
107
+ # set working fluid to ethylene glycol
108
+ hp_loop.setFluidType('EthyleneGlycol')
109
+ hp_loop.setGlycolConcentration(40)
108
110
  end
109
111
 
110
112
  return true
@@ -507,7 +507,7 @@ Standard.class_eval do
507
507
 
508
508
  # loop through ceiling surfaces and assign the plenum acoustical tile construction if the adjacent surface is a plenum floor
509
509
  model.getSurfaces.each do |surface|
510
- next unless surface.surfaceType == 'RoofCeiling' && surface.outsideBoundaryCondition == 'Surface'
510
+ next unless surface.surfaceType == 'RoofCeiling' && surface.outsideBoundaryCondition == 'Surface' && surface.adjacentSurface.is_initialized
511
511
 
512
512
  adj_surface = surface.adjacentSurface.get
513
513
  adj_space = adj_surface.space.get
@@ -15,10 +15,10 @@ class Standard
15
15
  return false unless plant_loop_type == 'Heating' || plant_loop_type == 'Cooling'
16
16
 
17
17
  # Get rated pump power
18
- if pump.autosizedRatedPowerConsumption.is_initialized
19
- pump_rated_power_w = pump.autosizedRatedPowerConsumption.get
20
- elsif pump.ratedPowerConsumption.is_initialized
18
+ if pump.ratedPowerConsumption.is_initialized
21
19
  pump_rated_power_w = pump.ratedPowerConsumption.get
20
+ elsif pump.autosizedRatedPowerConsumption.is_initialized
21
+ pump_rated_power_w = pump.autosizedRatedPowerConsumption.get
22
22
  else
23
23
  OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Pump', "For #{pump.name}, could not find rated pump power consumption, cannot determine w per gpm correctly.")
24
24
  return false
@@ -624,15 +624,15 @@ class Standard
624
624
  OpenStudio.logFree(OpenStudio::Error, 'openstudio.Prototype.ServiceWaterHeating', "Unsupported schedule type for HPWH setpoint schedule #{swh_temp_sch.name}.")
625
625
  return false
626
626
  end
627
- hpwhschedoverride_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(swh_temp_sch,schedule_type,'Schedule Value')
627
+ hpwhschedoverride_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(swh_temp_sch,schedule_type, 'Schedule Value')
628
628
  hpwhschedoverride_actuator.setName("#{hpwh_name_ems_friendly}_HPWHSchedOverride")
629
629
 
630
630
  # create actuator for lower heating element in water tank
631
- leschedoverride_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(hpwh_bottom_element_sp,'Schedule:Constant','Schedule Value')
631
+ leschedoverride_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(hpwh_bottom_element_sp, 'Schedule:Constant', 'Schedule Value')
632
632
  leschedoverride_actuator.setName("#{hpwh_name_ems_friendly}_LESchedOverride")
633
633
 
634
634
  # create actuator for upper heating element in water tank
635
- ueschedoverride_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(hpwh_top_element_sp,'Schedule:Constant','Schedule Value')
635
+ ueschedoverride_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(hpwh_top_element_sp, 'Schedule:Constant', 'Schedule Value')
636
636
  ueschedoverride_actuator.setName("#{hpwh_name_ems_friendly}_UESchedOverride")
637
637
 
638
638
  # create sensor for heat pump compressor
@@ -640,7 +640,7 @@ class Standard
640
640
  t_set_sensor.setName("#{hpwh_name_ems_friendly}_T_set")
641
641
  t_set_sensor.setKeyName(swh_temp_sch.name.to_s)
642
642
 
643
- # define control configuration
643
+ # define control configuration
644
644
  t_offset = 9.0 # deg-C
645
645
 
646
646
  # get tank specifications
@@ -663,7 +663,7 @@ class Standard
663
663
  hpwh_ctrl_program.addLine("SET #{leschedoverride_actuator.name} = 0")
664
664
  # lower element disabled
665
665
  hpwh_ctrl_program.addLine("SET #{leschedoverride_actuator.name}_cut_in = 0")
666
- hpwh_ctrl_program.addLine('ENDIF')
666
+ hpwh_ctrl_program.addLine('ENDIF')
667
667
 
668
668
  # create a program calling manager
669
669
  program_calling_manager = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(model)
@@ -1777,7 +1777,7 @@ class Standard
1777
1777
  avail_mgr = avail_mgr.get
1778
1778
  else
1779
1779
  avail_mgr = nil
1780
- end
1780
+ end
1781
1781
  else
1782
1782
  avail_mgr = air_loop.availabilityManagers[0]
1783
1783
  end
@@ -2141,7 +2141,7 @@ class Standard
2141
2141
  avail_mgr = avail_mgr.get
2142
2142
  else
2143
2143
  avail_mgr = nil
2144
- end
2144
+ end
2145
2145
  else
2146
2146
  avail_mgr = air_loop.availabilityManagers[0]
2147
2147
  end
@@ -2763,7 +2763,7 @@ class Standard
2763
2763
  avail_mgr = avail_mgr.get
2764
2764
  else
2765
2765
  avail_mgr = nil
2766
- end
2766
+ end
2767
2767
  else
2768
2768
  avail_mgr = air_loop.availabilityManagers[0]
2769
2769
  end
@@ -4529,7 +4529,7 @@ class Standard
4529
4529
  # Ending hour of building occupancy.
4530
4530
  # @param control_strategy [String] name of control strategy. Options are 'proportional_control' and 'none'.
4531
4531
  # If control strategy is 'proportional_control', the method will apply the CBE radiant control sequences
4532
- # detailed in Raftery et al. (2017), A new control strategy for high thermal mass radiant systems”.
4532
+ # detailed in Raftery et al. (2017), 'A new control strategy for high thermal mass radiant systems'.
4533
4533
  # Otherwise no control strategy will be applied and the radiant system will assume the EnergyPlus default controls.
4534
4534
  # @param proportional_gain [Double] (Optional) Only applies if control_strategy is 'proportional_control'.
4535
4535
  # Proportional gain constant (recommended 0.3 or less).
@@ -244,14 +244,14 @@ class Standard
244
244
  # Get design supply air flow rate (whether autosized or hard-sized)
245
245
  dsn_air_flow_m3_per_s = 0
246
246
  dsn_air_flow_cfm = 0
247
- if air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
248
- dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
249
- dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
250
- OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
251
- else
247
+ if air_loop_hvac.designSupplyAirFlowRate.is_initialized
252
248
  dsn_air_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
253
249
  dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
254
250
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Hard sized Design Supply Air Flow Rate.")
251
+ elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
252
+ dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
253
+ dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
254
+ OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
255
255
  end
256
256
  # Optimum start per 6.4.3.3.3, only required if > 10,000 cfm
257
257
  cfm_limit = 10_000
@@ -434,14 +434,14 @@ class Standard
434
434
  # Get design supply air flow rate (whether autosized or hard-sized)
435
435
  dsn_air_flow_m3_per_s = 0
436
436
  dsn_air_flow_cfm = 0
437
- if air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
438
- dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
439
- dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
440
- OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
441
- else
437
+ if air_loop_hvac.designSupplyAirFlowRate.is_initialized
442
438
  dsn_air_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
443
439
  dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
444
440
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Hard sized Design Supply Air Flow Rate.")
441
+ elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
442
+ dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
443
+ dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
444
+ OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
445
445
  end
446
446
 
447
447
  # @todo determine the presence of MERV filters and other stuff
@@ -492,14 +492,14 @@ class Standard
492
492
  # Get design supply air flow rate (whether autosized or hard-sized)
493
493
  dsn_air_flow_m3_per_s = 0
494
494
  dsn_air_flow_cfm = 0
495
- if air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
496
- dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
497
- dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
498
- OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
499
- else
495
+ if air_loop_hvac.designSupplyAirFlowRate.is_initialized
500
496
  dsn_air_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
501
497
  dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
502
498
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Hard sized Design Supply Air Flow Rate.")
499
+ elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
500
+ dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
501
+ dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
502
+ OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
503
503
  end
504
504
 
505
505
  # Get the fan limitation pressure drop adjustment bhp
@@ -720,14 +720,14 @@ class Standard
720
720
 
721
721
  # Get design supply air flow rate (whether autosized or hard-sized)
722
722
  dsn_air_flow_m3_per_s = 0
723
- if fan.autosizedDesignSupplyAirFlowRate.is_initialized
724
- dsn_air_flow_m3_per_s = fan.autosizedDesignSupplyAirFlowRate.get
725
- dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
726
- OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
727
- else
723
+ if fan.designSupplyAirFlowRate.is_initialized
728
724
  dsn_air_flow_m3_per_s = fan.designSupplyAirFlowRate.get
729
725
  dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
730
726
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = User entered Design Supply Air Flow Rate.")
727
+ elsif fan.autosizedDesignSupplyAirFlowRate.is_initialized
728
+ dsn_air_flow_m3_per_s = fan.autosizedDesignSupplyAirFlowRate.get
729
+ dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
730
+ OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
731
731
  end
732
732
 
733
733
  # Determine the fan pressure rise that will result in the target bhp
@@ -2006,10 +2006,10 @@ class Standard
2006
2006
  # System primary airflow rate (whether autosized or hard-sized)
2007
2007
  v_ps = 0.0
2008
2008
 
2009
- v_ps = if air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
2010
- air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
2011
- else
2009
+ v_ps = if air_loop_hvac.designSupplyAirFlowRate.is_initialized
2012
2010
  air_loop_hvac.designSupplyAirFlowRate.get
2011
+ elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
2012
+ air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
2013
2013
  end
2014
2014
  v_ps_cfm = OpenStudio.convert(v_ps, 'm^3/s', 'cfm').get
2015
2015
 
@@ -25,10 +25,10 @@ class Standard
25
25
 
26
26
  # Get the maximum flow rate through the terminal
27
27
  max_primary_air_flow_rate = nil
28
- if air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.is_initialized
29
- max_primary_air_flow_rate = air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.get
30
- elsif air_terminal_single_duct_parallel_piu_reheat.maximumPrimaryAirFlowRate.is_initialized
28
+ if air_terminal_single_duct_parallel_piu_reheat.maximumPrimaryAirFlowRate.is_initialized
31
29
  max_primary_air_flow_rate = air_terminal_single_duct_parallel_piu_reheat.maximumPrimaryAirFlowRate.get
30
+ elsif air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.is_initialized
31
+ max_primary_air_flow_rate = air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.get
32
32
  end
33
33
 
34
34
  # Set the max secondary air flow rate
@@ -43,10 +43,10 @@ module Fan
43
43
  def fan_adjust_pressure_rise_to_meet_fan_power(fan, target_fan_power)
44
44
  # Get design supply air flow rate (whether autosized or hard-sized)
45
45
  dsn_air_flow_m3_per_s = 0
46
- dsn_air_flow_m3_per_s = if fan.autosizedMaximumFlowRate.is_initialized
47
- fan.autosizedMaximumFlowRate.get
48
- else
46
+ dsn_air_flow_m3_per_s = if fan.maximumFlowRate.is_initialized
49
47
  fan.maximumFlowRate.get
48
+ elsif fan.autosizedMaximumFlowRate.is_initialized
49
+ fan.autosizedMaximumFlowRate.get
50
50
  end
51
51
 
52
52
  # Get the current fan power
@@ -356,10 +356,10 @@ module Fan
356
356
  OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Fan', "For #{fan.name}, could not find rated fan power from Equipment Summary. Will calculate it based on current pressure rise and total fan efficiency")
357
357
  end
358
358
 
359
- if fan.autosizedMaximumFlowRate.is_initialized
360
- max_m3_per_s = fan.autosizedMaximumFlowRate.get
361
- elsif fan.maximumFlowRate.is_initialized
359
+ if fan.maximumFlowRate.is_initialized
362
360
  max_m3_per_s = fan.ratedFlowRate.get
361
+ elsif fan.autosizedMaximumFlowRate.is_initialized
362
+ max_m3_per_s = fan.autosizedMaximumFlowRate.get
363
363
  else
364
364
  OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Fan', "For #{fan.name}, could not find fan Maximum Flow Rate, cannot determine w per cfm correctly.")
365
365
  return false
@@ -75,8 +75,8 @@ class Standard
75
75
  raise "Proposed model unmet load hours exceed 300. Baseline model(s) won't be created."
76
76
  end
77
77
  else
78
- OpenStudio.logFree(OpenStudio::Error, 'prm.log', "Simulation failed. Check the model to make sure no severe errors.")
79
- raise "Simulation on proposed model failed. Baseline generation is stopped."
78
+ OpenStudio.logFree(OpenStudio::Error, 'prm.log', 'Simulation failed. Check the model to make sure no severe errors.')
79
+ raise 'Simulation on proposed model failed. Baseline generation is stopped.'
80
80
  end
81
81
  end
82
82
 
@@ -3237,16 +3237,19 @@ class Standard
3237
3237
  skylights_frame_added = 0
3238
3238
  model.getSubSurfaces.each do |sub_surface|
3239
3239
  next unless sub_surface.outsideBoundaryCondition == 'Outdoors' && sub_surface.subSurfaceType == 'Skylight'
3240
-
3241
- # @todo enable proper window frame setting after https://github.com/NREL/OpenStudio/issues/2895 is fixed
3242
- sub_surface.setString(8, frame.name.get.to_s)
3243
- skylights_frame_added += 1
3244
- # if sub_surface.allowWindowPropertyFrameAndDivider
3245
- # sub_surface.setWindowPropertyFrameAndDivider(frame)
3246
- # skylights_frame_added += 1
3247
- # else
3248
- # OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Model', "For #{sub_surface.name}: cannot add a frame to this skylight.")
3249
- # end
3240
+
3241
+ if model.version < OpenStudio::VersionString.new('3.1.0')
3242
+ # window frame setting before https://github.com/NREL/OpenStudio/issues/2895 was fixed
3243
+ sub_surface.setString(8, frame.name.get.to_s)
3244
+ skylights_frame_added += 1
3245
+ else
3246
+ if sub_surface.allowWindowPropertyFrameAndDivider
3247
+ sub_surface.setWindowPropertyFrameAndDivider(frame)
3248
+ skylights_frame_added += 1
3249
+ else
3250
+ OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Model', "For #{sub_surface.name}: cannot add a frame to this skylight.")
3251
+ end
3252
+ end
3250
3253
  end
3251
3254
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.Model', "Adding #{frame.name} to #{skylights_frame_added} skylights.") if skylights_frame_added > 0
3252
3255
  else
@@ -4674,8 +4677,11 @@ class Standard
4674
4677
  vals['wwr_res'] *= vals['mult_res_red']
4675
4678
  vals['wwr_sh'] *= vals['mult_sh_red']
4676
4679
  wwrs = [vals['wwr_nr'], vals['wwr_res'], vals['wwr_sh']]
4677
- wwrs = wwrs.reject! &:nan?
4678
- base_wwr[bat] = wwrs.max
4680
+ max_wwrs = []
4681
+ wwrs.each do |w|
4682
+ max_wwrs << w unless w.nan?
4683
+ end
4684
+ base_wwr[bat] = max_wwrs.max
4679
4685
 
4680
4686
  # Reduce the window area if any of the categories necessary
4681
4687
  model.getSpaces.sort.each do |space|
@@ -22,16 +22,16 @@ module Pump
22
22
  # Get flow rate (whether autosized or hard-sized)
23
23
  flow_m3_per_s = 0
24
24
  flow_m3_per_s = if pump.to_PumpVariableSpeed.is_initialized || pump.to_PumpConstantSpeed.is_initialized
25
- if pump.autosizedRatedFlowRate.is_initialized
26
- pump.autosizedRatedFlowRate.get
27
- else
25
+ if pump.ratedFlowRate.is_initialized
28
26
  pump.ratedFlowRate.get
27
+ elsif pump.autosizedRatedFlowRate.is_initialized
28
+ pump.autosizedRatedFlowRate.get
29
29
  end
30
30
  elsif pump.to_HeaderedPumpsVariableSpeed.is_initialized || pump.to_HeaderedPumpsConstantSpeed.is_initialized
31
- if pump.autosizedTotalRatedFlowRate.is_initialized
32
- pump.autosizedTotalRatedFlowRate.get / pump.numberofPumpsinBank
33
- else
31
+ if pump.totalRatedFlowRate.is_initialized
34
32
  pump.totalRatedFlowRate.get / pump.numberofPumpsinBank
33
+ elsif pump.autosizedTotalRatedFlowRate.is_initialized
34
+ pump.autosizedTotalRatedFlowRate.get / pump.numberofPumpsinBank
35
35
  end
36
36
  end
37
37
 
@@ -178,16 +178,18 @@ module Pump
178
178
  # Get flow rate (whether autosized or hard-sized)
179
179
  flow_m3_per_s = 0
180
180
  flow_m3_per_s = if pump.to_PumpVariableSpeed.is_initialized || pump.to_PumpConstantSpeed.is_initialized
181
- if pump.autosizedRatedFlowRate.is_initialized
181
+ if pump.ratedFlowRate.is_initialized
182
+ pump.ratedFlowRate.get
183
+ elsif pump.autosizedRatedFlowRate.is_initialized
182
184
  pump.autosizedRatedFlowRate.get
183
185
  else
184
186
  pump.ratedFlowRate.get
185
187
  end
186
188
  elsif pump.to_HeaderedPumpsVariableSpeed.is_initialized || pump.to_HeaderedPumpsConstantSpeed.is_initialized
187
- if pump.autosizedTotalRatedFlowRate.is_initialized
188
- pump.autosizedTotalRatedFlowRate.get
189
- else
189
+ if pump.totalRatedFlowRate.is_initialized
190
190
  pump.totalRatedFlowRate.get
191
+ elsif pump.autosizedTotalRatedFlowRate.is_initialized
192
+ pump.autosizedTotalRatedFlowRate.get
191
193
  end
192
194
  end
193
195
 
@@ -223,16 +225,16 @@ module Pump
223
225
  # Get flow rate (whether autosized or hard-sized)
224
226
  flow_m3_per_s = 0
225
227
  flow_m3_per_s = if pump.to_PumpVariableSpeed.is_initialized || pump.to_PumpConstantSpeed.is_initialized
226
- if pump.autosizedRatedFlowRate.is_initialized
227
- pump.autosizedRatedFlowRate.get
228
- else
228
+ if pump.ratedFlowRate.is_initialized
229
229
  pump.ratedFlowRate.get
230
+ elsif pump.autosizedRatedFlowRate.is_initialized
231
+ pump.autosizedRatedFlowRate.get
230
232
  end
231
233
  elsif pump.to_HeaderedPumpsVariableSpeed.is_initialized || pump.to_HeaderedPumpsConstantSpeed.is_initialized
232
- if pump.autosizedTotalRatedFlowRate.is_initialized
233
- pump.autosizedTotalRatedFlowRate.get
234
- else
234
+ if pump.totalRatedFlowRate.is_initialized
235
235
  pump.totalRatedFlowRate.get
236
+ elsif pump.autosizedTotalRatedFlowRate.is_initialized
237
+ pump.autosizedTotalRatedFlowRate.get
236
238
  end
237
239
  end
238
240
 
@@ -275,10 +277,10 @@ module Pump
275
277
  def pump_rated_w_per_gpm(pump)
276
278
  # Get design power (whether autosized or hard-sized)
277
279
  rated_power_w = 0
278
- if pump.autosizedRatedPowerConsumption.is_initialized
279
- rated_power_w = pump.autosizedRatedPowerConsumption.get
280
- elsif pump.ratedPowerConsumption.is_initialized
280
+ if pump.ratedPowerConsumption.is_initialized
281
281
  rated_power_w = pump.ratedPowerConsumption.get
282
+ elsif pump.autosizedRatedPowerConsumption.is_initialized
283
+ rated_power_w = pump.autosizedRatedPowerConsumption.get
282
284
  else
283
285
  OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Pump', "For #{pump.name}, could not find rated pump power consumption, cannot determine w per gpm correctly.")
284
286
  return 0.0
@@ -1002,24 +1002,31 @@ class Standard
1002
1002
  OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Space', "Space #{space_type} is an unknown space type, assuming #{daylight_stpt_lux} Lux daylight setpoint")
1003
1003
  else
1004
1004
  space_type = space_type.get
1005
- standards_building_type = if space_type.standardsBuildingType.is_initialized
1006
- space_type.standardsBuildingType.get
1007
- end
1008
- standards_space_type = if space_type.standardsSpaceType.is_initialized
1009
- space_type.standardsSpaceType.get
1010
- end
1011
-
1012
- # use the building type (standards_building_type) and space type (standards_space_type)
1013
- # as well as template to locate the space type data
1014
- search_criteria = {
1015
- 'template' => template,
1016
- 'building_type' => standards_building_type,
1017
- 'space_type' => standards_space_type
1018
- }
1019
-
1020
- data = model_find_object(standards_data['space_types'], search_criteria)
1021
- if data.nil?
1022
- OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Space', "No data available for #{space_type.name}: #{standards_space_type} of #{standards_building_type} at #{template}, assuming a #{daylight_stpt_lux} Lux daylight setpoint!")
1005
+ standards_building_type = nil
1006
+ standards_space_type = nil
1007
+ data = nil
1008
+ if space_type.standardsBuildingType.is_initialized
1009
+ standards_building_type = space_type.standardsBuildingType.get
1010
+ end
1011
+ if space_type.standardsSpaceType.is_initialized
1012
+ standards_space_type = space_type.standardsSpaceType.get
1013
+ end
1014
+
1015
+ unless standards_building_type.nil? || standards_space_type.nil?
1016
+ # use the building type (standards_building_type) and space type (standards_space_type)
1017
+ # as well as template to locate the space type data
1018
+ search_criteria = {
1019
+ 'template' => template,
1020
+ 'building_type' => standards_building_type,
1021
+ 'space_type' => standards_space_type
1022
+ }
1023
+ data = model_find_object(standards_data['space_types'], search_criteria)
1024
+ end
1025
+
1026
+ if standards_building_type.nil? || standards_space_type.nil?
1027
+ OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Space', "Unable to determine standards building type and standards space type for space '#{space.name}' with space type '#{space_type.name}'. Assign a standards building type and standards space type to the space type object. Defaulting to a #{daylight_stpt_lux} Lux daylight setpoint.")
1028
+ elsif data.nil?
1029
+ OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Space', "Unable to find target illuminance setpoint data for space type '#{space_type.name}' with #{template} space type '#{standards_space_type}' in building type '#{standards_building_type}'. Defaulting to a #{daylight_stpt_lux} Lux daylight setpoint.")
1023
1030
  else
1024
1031
  # Read the illuminance setpoint value
1025
1032
  # If 'na', daylighting is not appropriate for this space type for some reason
@@ -437,7 +437,6 @@ class Standard
437
437
  end
438
438
 
439
439
  if set_infiltration && infiltration_have_info
440
-
441
440
  # Remove all but the first instance
442
441
  instances = space_type.spaceInfiltrationDesignFlowRates.sort
443
442
  if instances.size.zero?
@@ -470,8 +469,9 @@ class Standard
470
469
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{space_type.name} set infiltration to #{ventilation_ach} ACH.")
471
470
  end
472
471
  end
473
-
474
472
  end
473
+
474
+ return true
475
475
  end
476
476
 
477
477
  # Sets the internal loads for Appendix G PRM for 2016 and later
@@ -58,10 +58,10 @@ class Standard
58
58
 
59
59
  # Get the maximum flow rate through the fan
60
60
  max_air_flow_rate = nil
61
- if fan.autosizedMaximumFlowRate.is_initialized
62
- max_air_flow_rate = fan.autosizedMaximumFlowRate.get
63
- elsif fan.maximumFlowRate.is_initialized
61
+ if fan.maximumFlowRate.is_initialized
64
62
  max_air_flow_rate = fan.maximumFlowRate.get
63
+ elsif fan.autosizedMaximumFlowRate.is_initialized
64
+ max_air_flow_rate = fan.autosizedMaximumFlowRate.get
65
65
  end
66
66
  max_air_flow_rate_cfm = OpenStudio.convert(max_air_flow_rate, 'm^3/s', 'ft^3/min').get
67
67
 
@@ -303,10 +303,10 @@ class ASHRAE901PRM < Standard
303
303
  if supply_fan.nil?
304
304
  OpenStudio.logFree(OpenStudio::Error, 'openstudio.ashrae_90_1_prm.AirLoopHVAC', "Supply not found on #{airloop.name}.")
305
305
  end
306
- supply_fan_max_flow = if supply_fan.autosizedMaximumFlowRate.is_initialized
307
- supply_fan.autosizedMaximumFlowRate.get
308
- else
306
+ supply_fan_max_flow = if supply_fan.maximumFlowRate.is_initialized
309
307
  supply_fan.maximumFlowRate.get
308
+ elsif supply_fan.autosizedMaximumFlowRate.is_initialized
309
+ supply_fan.autosizedMaximumFlowRate.get
310
310
  end
311
311
 
312
312
  # Check that baseline system has the same
@@ -3032,10 +3032,10 @@ class ASHRAE901PRM < Standard
3032
3032
 
3033
3033
  # Get the maximum flow rate through the terminal
3034
3034
  max_primary_air_flow_rate = nil
3035
- if pfp_term.autosizedMaximumPrimaryAirFlowRate.is_initialized
3036
- max_primary_air_flow_rate = pfp_term.autosizedMaximumPrimaryAirFlowRate.get
3037
- elsif pfp_term.maximumPrimaryAirFlowRate.is_initialized
3035
+ if pfp_term.maximumPrimaryAirFlowRate.is_initialized
3038
3036
  max_primary_air_flow_rate = pfp_term.maximumPrimaryAirFlowRate.get
3037
+ elsif pfp_term.autosizedMaximumPrimaryAirFlowRate.is_initialized
3038
+ max_primary_air_flow_rate = pfp_term.autosizedMaximumPrimaryAirFlowRate.get
3039
3039
  end
3040
3040
 
3041
3041
  max_sec_flow_rate_m3_per_s = max_primary_air_flow_rate * sec_flow_frac
@@ -56,10 +56,10 @@ class ASHRAE901PRM < Standard
56
56
  # Get design supply air flow rate (whether autosized or hard-sized)
57
57
  dsn_air_flow_m3_per_s = 0
58
58
  dsn_air_flow_cfm = 0
59
- if fan.isMaximumFlowRateAutosized
60
- dsn_air_flow_m3_per_s = fan.autosizedMaximumFlowRate.get
61
- else
59
+ if fan.maximumFlowRate.is_initialized
62
60
  dsn_air_flow_m3_per_s = fan.maximumFlowRate.get
61
+ elsif fan.isMaximumFlowRateAutosized
62
+ dsn_air_flow_m3_per_s = fan.autosizedMaximumFlowRate.get
63
63
  end
64
64
  dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
65
65
 
@@ -91,10 +91,10 @@ class ASHRAE901PRM < Standard
91
91
 
92
92
  # Get the maximum flow rate through the fan
93
93
  max_air_flow_rate = nil
94
- if fan.autosizedMaximumFlowRate.is_initialized
95
- max_air_flow_rate = fan.autosizedMaximumFlowRate.get
96
- elsif fan.maximumFlowRate.is_initialized
94
+ if fan.maximumFlowRate.is_initialized
97
95
  max_air_flow_rate = fan.maximumFlowRate.get
96
+ elsif fan.autosizedMaximumFlowRate.is_initialized
97
+ max_air_flow_rate = fan.autosizedMaximumFlowRate.get
98
98
  end
99
99
  max_air_flow_rate_cfm = OpenStudio.convert(max_air_flow_rate, 'm^3/s', 'ft^3/min').get
100
100