Measures/m_7_example_7_constant_volume_purchased_air_system/measure.rb
# define the arguments that the user will input
define the arguments that the user will input
define the arguments that the user will input
def arguments(model)
    args = OpenStudio::Measure::OSArgumentVector.new
	verbose_info_statements = OpenStudio::Ruleset::OSArgument::makeBoolArgument("verbose_info_statements", false)
	verbose_info_statements.setDisplayName("Check to allow measure to generate verbose runner.registerInfo statements.")
	verbose_info_statements.setDefaultValue(false)
	args << verbose_info_statements
    tz_handles = OpenStudio::StringVector.new
    tz_display_names = OpenStudio::StringVector.new
    tz_hash = {}
    model.getThermalZones.each do |tz|
      tz_hash[tz.name.to_s] = tz
    end
    tz_hash.sort.map do |tz_name, tz|
      if tz.thermostatSetpointDualSetpoint.is_initialized
        tstat = tz.thermostatSetpointDualSetpoint.get
        if tstat.heatingSetpointTemperatureSchedule.is_initialized || tstat.coolingSetpointTemperatureSchedule.is_initialized
          if tz.airLoopHVAC.empty?
            tz_handles << tz.handle.to_s
            tz_display_names << tz_name
          end
        end
      end
    end
    building = model.getBuilding
    tz_handles << building.handle.to_s
    tz_display_names << '*All Cond. Zones not served by Air Loops*'    
    zones = OpenStudio::Measure::OSArgument.makeChoiceArgument('zones', tz_handles, tz_display_names, true)
    zones.setDisplayName('Choose Conditioned Thermal Zone(s) to apply Ideal HVAC system changes to.')
    zones.setDefaultValue('*All Cond. Zones not served by Air Loops*') 
    args << zones
    heating_mdot_per_ft2 = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("heating_mdot_per_ft2",true)
    heating_mdot_per_ft2.setDisplayName("Htg Supply Airflow")
    heating_mdot_per_ft2.setDescription("Airflow of Zone Ideal HVAC system when in heating mode in cfm/ft^2.")
    heating_mdot_per_ft2.setDefaultValue(1.0)
    heating_mdot_per_ft2.setMinValue(0.0)
    heating_mdot_per_ft2.setMaxValue(3.0)
    args << heating_mdot_per_ft2
    cooling_mdot_per_ft2 = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("cooling_mdot_per_ft2",true)
    cooling_mdot_per_ft2.setDisplayName("Clg Supply Airflow")
    cooling_mdot_per_ft2.setDescription("Airflow of Zone Ideal HVAC system when in cooling mode in cfm/ft^2.")
    cooling_mdot_per_ft2.setDefaultValue(1.2)
    cooling_mdot_per_ft2.setMinValue(0.0)
    cooling_mdot_per_ft2.setMaxValue(3.0)
    args << cooling_mdot_per_ft2
    heating_LAT = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("heating_LAT",true)
    heating_LAT.setDisplayName("Htg LAT")
    heating_LAT.setDescription("Supply Air Temp of Zone Ideal HVAC system when in heating mode, Deg F.")
    heating_LAT.setDefaultValue(105)
    heating_LAT.setMinValue(90)
    heating_LAT.setMaxValue(120)
    args << heating_LAT
    cooling_LAT = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("cooling_LAT",true)
    cooling_LAT.setDisplayName("Clg LAT")
    cooling_LAT.setDescription("Supply Air Temp of Zone Ideal HVAC system when in cooling mode, Deg F.")
    cooling_LAT.setDefaultValue(55)
    cooling_LAT.setMinValue(42)
    cooling_LAT.setMaxValue(65)
    args << cooling_LAT
    heating_HumRat = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("heating_HumRat",true)
    heating_HumRat.setDisplayName("Htg HumRat")
    heating_HumRat.setDescription("Supply Air Humidity Ratio of Zone Ideal HVAC system when in heating mode, (lb H2O/lb dry air).")
    heating_HumRat.setDefaultValue(0.015)
    heating_HumRat.setMinValue(0.006)
    heating_HumRat.setMaxValue(0.017)
    args << heating_HumRat
    cooling_HumRat = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("cooling_HumRat",true)
    cooling_HumRat.setDisplayName("Clg HumRat")
    cooling_HumRat.setDescription("Supply Air Humidity Ratio of Zone Ideal HVAC system when in cooling mode, (lb H2O/lb dry air).")
    cooling_HumRat.setDefaultValue(0.009)
    cooling_HumRat.setMinValue(0.006)
    cooling_HumRat.setMaxValue(0.017)
    args << cooling_HumRat
    int_var_avail_dict_rep_chs = OpenStudio::StringVector.new
    int_var_avail_dict_rep_chs << 'None'
    int_var_avail_dict_rep_chs << 'NotByUniqueKeyNames'
    int_var_avail_dict_rep_chs << 'Verbose'
    internal_variable_availability_dictionary_reporting = OpenStudio::Measure::OSArgument.makeChoiceArgument('internal_variable_availability_dictionary_reporting', int_var_avail_dict_rep_chs, true)
    internal_variable_availability_dictionary_reporting.setDisplayName('Level of output reporting related to the EMS internal variables that are available.')
    internal_variable_availability_dictionary_reporting.setDefaultValue('None')
    args << internal_variable_availability_dictionary_reporting
    ems_runtime_language_debug_level_chs = OpenStudio::StringVector.new
    ems_runtime_language_debug_level_chs << 'None'
    ems_runtime_language_debug_level_chs << 'ErrorsOnly'
    ems_runtime_language_debug_level_chs << 'Verbose'
    ems_runtime_language_debug_output_level = OpenStudio::Measure::OSArgument.makeChoiceArgument('ems_runtime_language_debug_output_level', ems_runtime_language_debug_level_chs, true)
    ems_runtime_language_debug_output_level.setDisplayName('Level of output reporting related to the execution of EnergyPlus Runtime Language, written to .edd file.')
    ems_runtime_language_debug_output_level.setDefaultValue('None')
    args << ems_runtime_language_debug_output_level
    actuator_avail_dict_rep_chs = OpenStudio::StringVector.new
    actuator_avail_dict_rep_chs << 'None'
    actuator_avail_dict_rep_chs << 'NotByUniqueKeyNames'
    actuator_avail_dict_rep_chs << 'Verbose'
    actuator_availability_dictionary_reporting = OpenStudio::Measure::OSArgument.makeChoiceArgument('actuator_availability_dictionary_reporting', actuator_avail_dict_rep_chs, true)
    actuator_availability_dictionary_reporting.setDisplayName('Level of output reporting related to the EMS actuators that are available.')
    actuator_availability_dictionary_reporting.setDefaultValue('None')
    args << actuator_availability_dictionary_reporting
    return args
  end
def arguments ( model ) args = OpenStudio :: Measure :: OSArgumentVector . new verbose_info_statements = OpenStudio :: Ruleset :: OSArgument :: makeBoolArgument ( "verbose_info_statements" , false ) verbose_info_statements . setDisplayName ( "Check to allow measure to generate verbose runner.registerInfo statements." ) verbose_info_statements . setDefaultValue ( false ) args << verbose_info_statements tz_handles = OpenStudio :: StringVector . new tz_display_names = OpenStudio :: StringVector . new tz_hash = { } model . getThermalZones . each do | tz | tz_hash [ tz . name . to_s ] = tz end tz_hash . sort . map do | tz_name , tz | if tz . thermostatSetpointDualSetpoint . is_initialized tstat = tz . thermostatSetpointDualSetpoint . get if tstat . heatingSetpointTemperatureSchedule . is_initialized || tstat . coolingSetpointTemperatureSchedule . is_initialized if tz . airLoopHVAC . empty? tz_handles << tz . handle . to_s tz_display_names << tz_name end end end end building = model . getBuilding tz_handles << building . handle . to_s tz_display_names << '*All Cond. Zones not served by Air Loops*' zones = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'zones' , tz_handles , tz_display_names , true ) zones . setDisplayName ( 'Choose Conditioned Thermal Zone(s) to apply Ideal HVAC system changes to.' ) zones . setDefaultValue ( '*All Cond. Zones not served by Air Loops*' ) args << zones heating_mdot_per_ft2 = OpenStudio :: Ruleset :: OSArgument :: makeDoubleArgument ( "heating_mdot_per_ft2" , true ) heating_mdot_per_ft2 . setDisplayName ( "Htg Supply Airflow" ) heating_mdot_per_ft2 . setDescription ( "Airflow of Zone Ideal HVAC system when in heating mode in cfm/ft^2." ) heating_mdot_per_ft2 . setDefaultValue ( 1.0 ) heating_mdot_per_ft2 . setMinValue ( 0.0 ) heating_mdot_per_ft2 . setMaxValue ( 3.0 ) args << heating_mdot_per_ft2 cooling_mdot_per_ft2 = OpenStudio :: Ruleset :: OSArgument :: makeDoubleArgument ( "cooling_mdot_per_ft2" , true ) cooling_mdot_per_ft2 . setDisplayName ( "Clg Supply Airflow" ) cooling_mdot_per_ft2 . setDescription ( "Airflow of Zone Ideal HVAC system when in cooling mode in cfm/ft^2." ) cooling_mdot_per_ft2 . setDefaultValue ( 1.2 ) cooling_mdot_per_ft2 . setMinValue ( 0.0 ) cooling_mdot_per_ft2 . setMaxValue ( 3.0 ) args << cooling_mdot_per_ft2 heating_LAT = OpenStudio :: Ruleset :: OSArgument :: makeDoubleArgument ( "heating_LAT" , true ) heating_LAT . setDisplayName ( "Htg LAT" ) heating_LAT . setDescription ( "Supply Air Temp of Zone Ideal HVAC system when in heating mode, Deg F." ) heating_LAT . setDefaultValue ( 105 ) heating_LAT . setMinValue ( 90 ) heating_LAT . setMaxValue ( 120 ) args << heating_LAT cooling_LAT = OpenStudio :: Ruleset :: OSArgument :: makeDoubleArgument ( "cooling_LAT" , true ) cooling_LAT . setDisplayName ( "Clg LAT" ) cooling_LAT . setDescription ( "Supply Air Temp of Zone Ideal HVAC system when in cooling mode, Deg F." ) cooling_LAT . setDefaultValue ( 55 ) cooling_LAT . setMinValue ( 42 ) cooling_LAT . setMaxValue ( 65 ) args << cooling_LAT heating_HumRat = OpenStudio :: Ruleset :: OSArgument :: makeDoubleArgument ( "heating_HumRat" , true ) heating_HumRat . setDisplayName ( "Htg HumRat" ) heating_HumRat . setDescription ( "Supply Air Humidity Ratio of Zone Ideal HVAC system when in heating mode, (lb H2O/lb dry air)." ) heating_HumRat . setDefaultValue ( 0.015 ) heating_HumRat . setMinValue ( 0.006 ) heating_HumRat . setMaxValue ( 0.017 ) args << heating_HumRat cooling_HumRat = OpenStudio :: Ruleset :: OSArgument :: makeDoubleArgument ( "cooling_HumRat" , true ) cooling_HumRat . setDisplayName ( "Clg HumRat" ) cooling_HumRat . setDescription ( "Supply Air Humidity Ratio of Zone Ideal HVAC system when in cooling mode, (lb H2O/lb dry air)." ) cooling_HumRat . setDefaultValue ( 0.009 ) cooling_HumRat . setMinValue ( 0.006 ) cooling_HumRat . setMaxValue ( 0.017 ) args << cooling_HumRat int_var_avail_dict_rep_chs = OpenStudio :: StringVector . new int_var_avail_dict_rep_chs << 'None' int_var_avail_dict_rep_chs << 'NotByUniqueKeyNames' int_var_avail_dict_rep_chs << 'Verbose' internal_variable_availability_dictionary_reporting = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'internal_variable_availability_dictionary_reporting' , int_var_avail_dict_rep_chs , true ) internal_variable_availability_dictionary_reporting . setDisplayName ( 'Level of output reporting related to the EMS internal variables that are available.' ) internal_variable_availability_dictionary_reporting . setDefaultValue ( 'None' ) args << internal_variable_availability_dictionary_reporting ems_runtime_language_debug_level_chs = OpenStudio :: StringVector . new ems_runtime_language_debug_level_chs << 'None' ems_runtime_language_debug_level_chs << 'ErrorsOnly' ems_runtime_language_debug_level_chs << 'Verbose' ems_runtime_language_debug_output_level = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'ems_runtime_language_debug_output_level' , ems_runtime_language_debug_level_chs , true ) ems_runtime_language_debug_output_level . setDisplayName ( 'Level of output reporting related to the execution of EnergyPlus Runtime Language, written to .edd file.' ) ems_runtime_language_debug_output_level . setDefaultValue ( 'None' ) args << ems_runtime_language_debug_output_level actuator_avail_dict_rep_chs = OpenStudio :: StringVector . new actuator_avail_dict_rep_chs << 'None' actuator_avail_dict_rep_chs << 'NotByUniqueKeyNames' actuator_avail_dict_rep_chs << 'Verbose' actuator_availability_dictionary_reporting = OpenStudio :: Measure :: OSArgument . makeChoiceArgument ( 'actuator_availability_dictionary_reporting' , actuator_avail_dict_rep_chs , true ) actuator_availability_dictionary_reporting . setDisplayName ( 'Level of output reporting related to the EMS actuators that are available.' ) actuator_availability_dictionary_reporting . setDefaultValue ( 'None' ) args << actuator_availability_dictionary_reporting return args end
define the arguments that the user will input
define the arguments that the user will input
# Add a check box for specifying verbose info statements # Note: There does not seem to be a way to retrieve the linkage between  # existing ZoneHVACIdealLoadsAirSystemideal objects and their  # attached Thermal Zones (via the API). Therefore this measure will  # ask the user which existing conditioned thermal zones to  # convert to be served by (autosized) ZoneHVACIdealLoadsAirSystems from a choice list.  # initially, the choice list will only be populated by Thermal zones which are  # (1) conditioned and (2) served only by ZoneHVAC Equipment objetcs, which this  # measure will delete.   # 1) make an argument for <conditioned> thermal zone(s) served only by ZoneHVAC equipment  # to apply ZoneHVACIdealLoadsAirSystem assignments to  # put all thermal zone names into a hash # looping through a sorted hash of zones to place 'qualified' thermal zones within # must be conditioned and not attached to an airloop # add building to string vector with zones # if no zone is chosen this will run on all zones # Make a double precision argument for the Supply Mass Flow rate for Heating  # Make a double precision argument for the Supply Mass Flow rate for Cooling # Make a double precision argument for the Supply Air Dry Bulb Temperature for Heating  # Make a double precision argument for the Supply Air Dry Bulb Temperature for Cooling # Make a double precision argument for the Supply Air Humidity Ratio for Heating  # Make a double precision argument for the Supply Air Humidity Ratio for Cooling # make a choice argument for setting EMS InternalVariableAvailabilityDictionaryReporting value # make a choice argument for setting EMSRuntimeLanguageDebugOutputLevel value # make a choice argument for setting EMS ActuatorAvailabilityDictionaryReportingvalue
model
<not_specific>