openstudio-geb 0.0.2 → 0.0.3r

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@ class AverageVentilationForPeakHours < OpenStudio::Measure::ModelMeasure
19
19
  end
20
20
  # human readable description of modeling approach
21
21
  def modeler_description
22
- return "The outdoor air flow rate will be reduced by the percentage specified by the user during the peak hours specified by the user. Then the decreased air flow rate will be added to the hours after the peak time."
22
+ return "The outdoor air flow rate will be reduced by the percentage specified by the user during the peak hours specified by the user. Then the decreased air flow rate will be added to the same number of hours before the peak time."
23
23
  end
24
24
  # define the arguments that the user will input
25
25
  def arguments(model)
@@ -34,14 +34,14 @@ class AverageVentilationForPeakHours < OpenStudio::Measure::ModelMeasure
34
34
  start_time = OpenStudio::Measure::OSArgument.makeStringArgument('start_time', false)
35
35
  start_time.setDisplayName('Start Time for the Reduction')
36
36
  start_time.setDescription('In HH:MM:SS format')
37
- start_time.setDefaultValue('14:00:00')
37
+ start_time.setDefaultValue('12:00:00')
38
38
  args << start_time
39
39
 
40
40
  # make an argument for the end time of the reduction
41
41
  end_time = OpenStudio::Measure::OSArgument.makeStringArgument('end_time', false)
42
42
  end_time.setDisplayName('End Time for the Reduction')
43
43
  end_time.setDescription('In HH:MM:SS format')
44
- end_time.setDefaultValue('16:00:00')
44
+ end_time.setDefaultValue('14:00:00')
45
45
  args << end_time
46
46
 
47
47
  # make an argument for the start date of the reduction
@@ -55,7 +55,7 @@ class AverageVentilationForPeakHours < OpenStudio::Measure::ModelMeasure
55
55
  end_date1 = OpenStudio::Ruleset::OSArgument.makeStringArgument('end_date1', false)
56
56
  end_date1.setDisplayName('End Date for Average Ventilation')
57
57
  end_date1.setDescription('In MM-DD format')
58
- end_date1.setDefaultValue('08-01')
58
+ end_date1.setDefaultValue('08-31')
59
59
  args << end_date1
60
60
 
61
61
 
@@ -144,7 +144,8 @@ class AverageVentilationForPeakHours < OpenStudio::Measure::ModelMeasure
144
144
  if oa_sch.empty?
145
145
  new_oa_sch_name = "#{outdoor_air_object.name} fraction schedule"
146
146
  runner.registerInfo("#{outdoor_air_object.name} doesn't have a schedule. A new schedule '#{new_oa_sch_name}' will be added.")
147
- # The fraction schedule cannot have value > 1
147
+ # The fraction schedule cannot have value > 1,
148
+ # so in order to increase the ventilation rate before peak hours, the original base value need to be increased
148
149
  outdoor_air_object.setOutdoorAirFlowperPerson(outdoor_air_object.outdoorAirFlowperPerson * (1+vent_reduce_percent*0.01))
149
150
  outdoor_air_object.setOutdoorAirFlowperFloorArea(outdoor_air_object.outdoorAirFlowperFloorArea * (1+vent_reduce_percent*0.01))
150
151
  outdoor_air_object.setOutdoorAirFlowAirChangesperHour(outdoor_air_object.outdoorAirFlowAirChangesperHour * (1+vent_reduce_percent*0.01))
@@ -156,15 +157,25 @@ class AverageVentilationForPeakHours < OpenStudio::Measure::ModelMeasure
156
157
  h, m, s = end_time.split(':')
157
158
  end_hour = h.to_i + m.to_i/60
158
159
  time_span = end_hour - start_hour
159
- end_hour_2 = end_hour + time_span
160
- if end_hour_2 > 24.0
161
- end_hour_2 -= 24.0
160
+ increase_start_hour = start_hour - time_span
161
+ if increase_start_hour < 0
162
+ increase_start_hour += 24
162
163
  end
163
- if end_hour_2 < start_hour
164
- adjusted_day_data_pairs = [[end_hour_2, 1], [start_hour, percent_back], [end_hour, percent_reduce], [24, 1]]
164
+ if increase_start_hour < start_hour
165
+ adjusted_day_data_pairs = [[increase_start_hour, percent_back], [start_hour, 1], [end_hour, percent_reduce], [24, percent_back]]
165
166
  else
166
- adjusted_day_data_pairs = [[start_hour, percent_back], [end_hour, percent_reduce], [end_hour_2, 1], [24, percent_back]]
167
+ adjusted_day_data_pairs = [[start_hour, 1], [end_hour, percent_reduce], [increase_start_hour, percent_back], [24, 1]]
167
168
  end
169
+ # end_hour_2 = end_hour + time_span
170
+ # if end_hour_2 > 24.0
171
+ # end_hour_2 -= 24.0
172
+ # end
173
+ # if end_hour_2 < start_hour
174
+ # adjusted_day_data_pairs = [[end_hour_2, 1], [start_hour, percent_back], [end_hour, percent_reduce], [24, 1]]
175
+ # else
176
+ # adjusted_day_data_pairs = [[start_hour, percent_back], [end_hour, percent_reduce], [end_hour_2, 1], [24, percent_back]]
177
+ # end
178
+
168
179
  normal_day_data_pairs = [[24, percent_back]]
169
180
  options = { 'name' => new_oa_sch_name,
170
181
  'winter_design_day' => normal_day_data_pairs,