11# dependencies
22require 'openstudio-standards'
33
4- class IdealAirLoadsZoneHVAC < OpenStudio ::Ruleset :: ModelUserScript
4+ class IdealAirLoadsZoneHVAC < OpenStudio ::Measure :: ModelMeasure
55
66 # human readable name
77 def name
@@ -36,19 +36,19 @@ def arguments(model)
3636 end
3737
3838 # argument for system availability schedule
39- availability_schedule = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'availability_schedule' , schedule_choices , true )
39+ availability_schedule = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'availability_schedule' , schedule_choices , true )
4040 availability_schedule . setDisplayName ( 'System Availability Schedule:' )
4141 availability_schedule . setDefaultValue ( 'Default Always On' )
4242 args << availability_schedule
4343
4444 # argument for heating availability schedule
45- heating_availability_schedule = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'heating_availability_schedule' , schedule_choices , true )
45+ heating_availability_schedule = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'heating_availability_schedule' , schedule_choices , true )
4646 heating_availability_schedule . setDisplayName ( 'Heating Availability Schedule:' )
4747 heating_availability_schedule . setDefaultValue ( 'Default Always On' )
4848 args << heating_availability_schedule
4949
5050 # argument for cooling availability schedule
51- cooling_availability_schedule = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'cooling_availability_schedule' , schedule_choices , true )
51+ cooling_availability_schedule = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'cooling_availability_schedule' , schedule_choices , true )
5252 cooling_availability_schedule . setDisplayName ( 'Cooling Availability Schedule:' )
5353 cooling_availability_schedule . setDefaultValue ( 'Default Always On' )
5454 args << cooling_availability_schedule
@@ -59,7 +59,7 @@ def arguments(model)
5959 choices << 'LimitFlowRate'
6060 choices << 'LimitCapacity'
6161 choices << 'LimitFlowRateAndCapacity'
62- heating_limit_type = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'heating_limit_type' , choices , true )
62+ heating_limit_type = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'heating_limit_type' , choices , true )
6363 heating_limit_type . setDisplayName ( 'Heating Limit Type:' )
6464 heating_limit_type . setDefaultValue ( 'NoLimit' )
6565 args << heating_limit_type
@@ -70,7 +70,7 @@ def arguments(model)
7070 choices << 'LimitFlowRate'
7171 choices << 'LimitCapacity'
7272 choices << 'LimitFlowRateAndCapacity'
73- cooling_limit_type = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'cooling_limit_type' , choices , true )
73+ cooling_limit_type = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'cooling_limit_type' , choices , true )
7474 cooling_limit_type . setDisplayName ( 'Cooling Limit Type:' )
7575 cooling_limit_type . setDefaultValue ( 'NoLimit' )
7676 args << cooling_limit_type
@@ -81,13 +81,13 @@ def arguments(model)
8181 choices << 'ConstantSensibleHeatRatio'
8282 choices << 'Humidistat'
8383 choices << 'ConstantSupplyHumidityRatio'
84- dehumid_type = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'dehumid_type' , choices , true )
84+ dehumid_type = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'dehumid_type' , choices , true )
8585 dehumid_type . setDisplayName ( 'Dehumidification Control:' )
8686 dehumid_type . setDefaultValue ( 'ConstantSensibleHeatRatio' )
8787 args << dehumid_type
8888
8989 # argument for Cooling Sensible Heat Ratio
90- cooling_sensible_heat_ratio = OpenStudio ::Ruleset ::OSArgument ::makeDoubleArgument ( 'cooling_sensible_heat_ratio' , true )
90+ cooling_sensible_heat_ratio = OpenStudio ::Measure ::OSArgument ::makeDoubleArgument ( 'cooling_sensible_heat_ratio' , true )
9191 cooling_sensible_heat_ratio . setDisplayName ( 'Cooling Sensible Heat Ratio' )
9292 cooling_sensible_heat_ratio . setDefaultValue ( 0.7 )
9393 args << cooling_sensible_heat_ratio
@@ -97,19 +97,19 @@ def arguments(model)
9797 choices << 'None'
9898 choices << 'Humidistat'
9999 choices << 'ConstantSupplyHumidityRatio'
100- humid_type = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'humid_type' , choices , true )
100+ humid_type = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'humid_type' , choices , true )
101101 humid_type . setDisplayName ( 'Humidification Control:' )
102102 humid_type . setDefaultValue ( 'None' )
103103 args << humid_type
104104
105105 # argument for Design Specification Outdoor Air
106- include_outdoor_air = OpenStudio ::Ruleset ::OSArgument ::makeBoolArgument ( 'include_outdoor_air' , true )
106+ include_outdoor_air = OpenStudio ::Measure ::OSArgument ::makeBoolArgument ( 'include_outdoor_air' , true )
107107 include_outdoor_air . setDisplayName ( 'Include Outdoor Air Ventilation?:' )
108108 include_outdoor_air . setDefaultValue ( true )
109109 args << include_outdoor_air
110110
111111 # argument for Demand Controlled Ventilation
112- enable_dcv = OpenStudio ::Ruleset ::OSArgument ::makeBoolArgument ( 'enable_dcv' , true )
112+ enable_dcv = OpenStudio ::Measure ::OSArgument ::makeBoolArgument ( 'enable_dcv' , true )
113113 enable_dcv . setDisplayName ( 'Enable Demand Controlled Ventilation?:' )
114114 enable_dcv . setDefaultValue ( false )
115115 args << enable_dcv
@@ -119,7 +119,7 @@ def arguments(model)
119119 choices << 'NoEconomizer'
120120 choices << 'DifferentialDryBulb'
121121 choices << 'DifferentialEnthalpy'
122- economizer_type = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'economizer_type' , choices , true )
122+ economizer_type = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'economizer_type' , choices , true )
123123 economizer_type . setDisplayName ( 'Economizer Type (Requires a Flow Rate Cooling Limit Type and Outdoor Air):' )
124124 economizer_type . setDefaultValue ( 'NoEconomizer' )
125125 args << economizer_type
@@ -129,25 +129,25 @@ def arguments(model)
129129 choices << 'None'
130130 choices << 'Sensible'
131131 choices << 'Enthalpy'
132- heat_recovery_type = OpenStudio ::Ruleset ::OSArgument ::makeChoiceArgument ( 'heat_recovery_type' , choices , true )
132+ heat_recovery_type = OpenStudio ::Measure ::OSArgument ::makeChoiceArgument ( 'heat_recovery_type' , choices , true )
133133 heat_recovery_type . setDisplayName ( 'Heat Recovery Type (Requires Outdoor Air):' )
134134 heat_recovery_type . setDefaultValue ( 'None' )
135135 args << heat_recovery_type
136136
137137 # argument for Heat Recovery Sensible Effectiveness
138- sensible_effectiveness = OpenStudio ::Ruleset ::OSArgument ::makeDoubleArgument ( 'sensible_effectiveness' , true )
138+ sensible_effectiveness = OpenStudio ::Measure ::OSArgument ::makeDoubleArgument ( 'sensible_effectiveness' , true )
139139 sensible_effectiveness . setDisplayName ( 'Heat Recovery Sensible Effectiveness' )
140140 sensible_effectiveness . setDefaultValue ( 0.7 )
141141 args << sensible_effectiveness
142142
143143 # argument for Heat Recovery Latent Effectiveness
144- latent_effectiveness = OpenStudio ::Ruleset ::OSArgument ::makeDoubleArgument ( 'latent_effectiveness' , true )
144+ latent_effectiveness = OpenStudio ::Measure ::OSArgument ::makeDoubleArgument ( 'latent_effectiveness' , true )
145145 latent_effectiveness . setDisplayName ( 'Heat Recovery Latent Effectiveness' )
146146 latent_effectiveness . setDefaultValue ( 0.65 )
147147 args << latent_effectiveness
148148
149149 # add output meter
150- add_meters = OpenStudio ::Ruleset ::OSArgument . makeBoolArgument ( 'add_meters' , true )
150+ add_meters = OpenStudio ::Measure ::OSArgument . makeBoolArgument ( 'add_meters' , true )
151151 add_meters . setDisplayName ( 'Add Meter:Custom and Output:Meter objects to sum ZoneHVAC:IdealLoadsAirSystem variables?' )
152152 add_meters . setDefaultValue ( true )
153153 args << add_meters
@@ -159,7 +159,7 @@ def arguments(model)
159159 def run ( model , runner , user_arguments )
160160 super ( model , runner , user_arguments )
161161
162- # use the built-in error checking
162+ # use the built-in error checking
163163 if not runner . validateUserArguments ( arguments ( model ) , user_arguments )
164164 return false
165165 end
@@ -184,7 +184,7 @@ def run(model, runner, user_arguments)
184184 latent_effectiveness = runner . getDoubleArgumentValue ( 'latent_effectiveness' , user_arguments )
185185 add_meters = runner . getBoolArgumentValue ( 'add_meters' , user_arguments )
186186
187- # check which zone already include ideal air loads
187+ # check which zone already include ideal air loads
188188 existing_ideal_loads = model . getZoneHVACIdealLoadsAirSystems
189189 runner . registerInitialCondition ( "The model has #{ existing_ideal_loads . size } ideal air loads objects." )
190190
@@ -193,13 +193,13 @@ def run(model, runner, user_arguments)
193193
194194 # remove existing HVAC
195195 runner . registerInfo ( 'Removing existing HVAC systems from the model' )
196- std . remove_HVAC ( model )
196+ std . remove_hvac ( model )
197197
198198 # add zone hvac ideal load air system objects
199199 conditioned_zones = [ ]
200200 model . getThermalZones . each do |zone |
201- next if std . thermal_zone_plenum? ( zone )
202- next if !std . thermal_zone_heated? ( zone ) && !std . thermal_zone_cooled? ( zone )
201+ next if OpenstudioStandards :: ThermalZone . thermal_zone_plenum? ( zone )
202+ next if !OpenstudioStandards :: ThermalZone . thermal_zone_heated? ( zone ) && !OpenstudioStandards :: ThermalZone . thermal_zone_cooled? ( zone )
203203 conditioned_zones << zone
204204 end
205205 ideal_loads_objects = std . model_add_ideal_air_loads ( model ,
0 commit comments