Class: ECMS

Inherits:
NECB2011 show all
Defined in:
lib/openstudio-standards/standards/necb/ECMS/nv.rb,
lib/openstudio-standards/standards/necb/ECMS/erv.rb,
lib/openstudio-standards/standards/necb/ECMS/ecms.rb,
lib/openstudio-standards/standards/necb/ECMS/loads.rb,
lib/openstudio-standards/standards/necb/ECMS/pv_ground.rb,
lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb

Constant Summary

Constants inherited from Standard

Standard::STANDARDS_LIST

Instance Attribute Summary

Attributes inherited from NECB2011

#qaqc_data, #space_multiplier_map, #space_type_map, #standards_data, #template

Attributes inherited from Standard

#space_multiplier_map, #standards_data, #template

Instance Method Summary collapse

Methods inherited from NECB2011

#add_all_spacetypes_to_model, #add_onespeed_DX_coil, #add_ptac_dx_cooling, #add_sys1_unitary_ac_baseboard_heating, #add_sys1_unitary_ac_baseboard_heating_multi_speed, #add_sys1_unitary_ac_baseboard_heating_single_speed, #add_sys2_FPFC_sys5_TPFC, #add_sys3_and_8_zone_equip, #add_sys3and8_single_zone_packaged_rooftop_unit_with_baseboard_heating, #add_sys3and8_single_zone_packaged_rooftop_unit_with_baseboard_heating_multi_speed, #add_sys3and8_single_zone_packaged_rooftop_unit_with_baseboard_heating_single_speed, #add_sys4_single_zone_make_up_air_unit_with_baseboard_heating, #add_sys6_multi_zone_built_up_system_with_baseboard_heating, #add_system_3_and_8_airloop, #add_system_3_and_8_airloop_multi_speed, #add_zone_baseboards, #adjust_wildcard_spacetype_schedule, #air_loop_hvac_apply_economizer_integration, #air_loop_hvac_apply_energy_recovery_ventilator, #air_loop_hvac_apply_multizone_vav_outdoor_air_sizing, #air_loop_hvac_apply_single_zone_controls, #air_loop_hvac_apply_vav_damper_action, #air_loop_hvac_demand_control_ventilation_required?, #air_loop_hvac_economizer_required?, #air_loop_hvac_enable_unoccupied_fan_shutoff, #air_loop_hvac_energy_recovery_ventilator_required?, #air_loop_hvac_motorized_oa_damper_limits, #air_loop_hvac_static_pressure_reset_required?, #apply_auto_zoning, #apply_building_default_constructionset, #apply_default_constructionsets_to_spacetypes, #apply_economizers, #apply_envelope, #apply_fdwr_srr_daylighting, #apply_limit_fdwr, #apply_loads, #apply_loop_pump_power, #apply_max_fdwr_nrcan, #apply_max_srr_nrcan, #apply_standard_construction_properties, #apply_standard_efficiencies, #apply_standard_lights, #apply_standard_skylight_to_roof_ratio, #apply_standard_window_to_wall_ratio, #apply_systems, #apply_systems_and_efficiencies, #apply_weather_data, #are_space_loads_similar?, #are_zone_loads_similar?, #assign_base_sys_name, #assign_contruction_to_adiabatic_surfaces, #auto_size_shw_capacity, #auto_size_shw_pump_head, #auto_system_all_other_spaces, #auto_system_dwelling_units, #auto_system_storage_spaces, #auto_system_wet_spaces, #auto_system_wild_spaces, #auto_zone_all_other_spaces, #auto_zone_dwelling_units, #auto_zone_wet_spaces, #auto_zone_wild_spaces, #boiler_hot_water_apply_efficiency_and_curves, #check_boolean_value, #chiller_electric_eir_apply_efficiency_and_curves, #clean_and_scale_model, #coil_cooling_dx_multi_speed_apply_efficiency_and_curves, #coil_heating_gas_apply_efficiency_and_curves, #coil_heating_gas_find_capacity, #coil_heating_gas_find_search_criteria, #coil_heating_gas_multi_stage_apply_efficiency_and_curves, #coil_heating_gas_standard_minimum_thermal_efficiency, #common_air_loop, #convert_arg_to_f, #corrupt_standards_database, #create_base_data, #create_ems_to_turn_on_AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_for_night_cycle, #create_heating_cooling_on_off_availability_schedule, #create_hw_loop_if_required, #create_necb_system, #daylighting_controls_settings, #determine_control_zone, #determine_dominant_necb_schedule_type, #determine_dominant_schedule, #determine_necb_schedule_type, #determine_spacetype_vintage, #distance, #fan_baseline_impeller_efficiency, #fan_constant_volume_apply_prototype_fan_pressure_rise, #fan_standard_minimum_motor_efficiency_and_size, #fan_variable_volume_apply_prototype_fan_pressure_rise, #fan_variable_volume_part_load_fan_power_limitation?, #find_mech_room, #friction_factor, #get_all_spacetype_names, #get_any_number_ppm, #get_climate_zone_index, #get_climate_zone_name, #get_max_space_height_for_space_type, #get_necb_hdd18, #get_necb_spacetype_system_selection, #get_necb_thermal_zone_system_selection, #get_parameters_sidelighting, #get_parameters_skylight, #get_qaqc_table, #get_sql_table_to_json, #get_sql_tables_to_json, #get_standard_constant_value, #get_standards_constant, #get_standards_formula, #get_standards_table, #group_similar_zones_together, #heat_exchanger_air_to_air_sensible_and_latent_apply_effectiveness, #init_qaqc, #is_a_necb_dwelling_unit?, #is_an_necb_storage_space?, #is_an_necb_wet_space?, #is_an_necb_wildcard_space?, #load_building_type_from_library, #load_qaqc_database_new, #look_up_csv_data, #max_fwdr, #merge_recursively, #model_add_construction_set_from_osm, #model_add_constructions, #model_add_daylighting_controls, #model_add_hvac, #model_add_loads, #model_add_schedule, #model_add_swh, #model_add_swh_end_uses_by_spaceonly, #model_apply_sizing_parameters, #model_apply_standard, #model_attach_water_fixtures_to_spaces?, #model_create_prototype_model, #model_create_thermal_zones, #model_enable_demand_controlled_ventilation, #model_find_climate_zone_set, #necb_design_supply_temp_compliance, #necb_economizer_compliance, #necb_envelope_compliance, #necb_exterior_fenestration_compliance, #necb_exterior_ground_surfaces_compliance, #necb_exterior_opaque_compliance, #necb_hrv_compliance, #necb_hrv_compliance_for_single_airloop, #necb_hrv_compliance_inc_murb, #necb_infiltration_compliance, #necb_plantloop_sanity, #necb_qaqc, #necb_section_test, #necb_space_compliance, #necb_vav_fan_power_compliance, #necb_zone_sizing_compliance, #new_add_sys6_multi_zone_built_up_system_with_baseboard_heating, #percentage_difference, #pump_standard_minimum_motor_efficiency_and_size, #pump_variable_speed_control_type, #qaqc_only, #sanity_check, #scale_model_geometry, #set_lighting_per_area, #set_lighting_per_area_led_lighting, #set_necb_external_subsurface_conductance, #set_necb_external_surface_conductance, #set_occ_sensor_spacetypes, #set_output_meters, #set_output_variables, #set_random_rendering_color, #set_wildcard_schedules_to_dominant_building_schedule, #set_zones_thermostat_schedule_based_on_space_type_schedules, #setup_chw_loop_with_components, #setup_cw_loop_with_components, #setup_hw_loop_with_components, #space_apply_infiltration_rate, #space_surface_report, #space_type_apply_internal_loads, #store_space_sizing_loads, #stored_space_cooling_load, #stored_space_heating_load, #stored_zone_cooling_load, #stored_zone_heating_load, #thermal_zone_demand_control_ventilation_required?, #thermal_zone_get_centroid_per_floor, #update_sys_name, #validate_and_upate_space_types, #water_heater_mixed_apply_efficiency, #zone_hvac_component_occupancy_ventilation_control

Methods inherited from Standard

#adjust_infiltration_to_lower_pressure, #adjust_infiltration_to_prototype_building_conditions, #adjust_sizing_system, #afue_to_thermal_eff, #air_loop_hvac_add_motorized_oa_damper, #air_loop_hvac_adjust_minimum_vav_damper_positions, #air_loop_hvac_adjust_minimum_vav_damper_positions_outpatient, #air_loop_hvac_allowable_system_brake_horsepower, #air_loop_hvac_apply_baseline_fan_pressure_rise, #air_loop_hvac_apply_economizer_integration, #air_loop_hvac_apply_economizer_limits, #air_loop_hvac_apply_energy_recovery_ventilator, #air_loop_hvac_apply_energy_recovery_ventilator_efficiency, #air_loop_hvac_apply_maximum_reheat_temperature, #air_loop_hvac_apply_minimum_vav_damper_positions, #air_loop_hvac_apply_multizone_vav_outdoor_air_sizing, #air_loop_hvac_apply_prm_baseline_controls, #air_loop_hvac_apply_prm_baseline_economizer, #air_loop_hvac_apply_prm_baseline_fan_power, #air_loop_hvac_apply_prm_sizing_temperatures, #air_loop_hvac_apply_single_zone_controls, #air_loop_hvac_apply_standard_controls, #air_loop_hvac_apply_vav_damper_action, #air_loop_hvac_data_center_area_served, #air_loop_hvac_dcv_required_when_erv, #air_loop_hvac_demand_control_ventilation_limits, #air_loop_hvac_demand_control_ventilation_required?, #air_loop_hvac_disable_multizone_vav_optimization, #air_loop_hvac_dx_cooling?, #air_loop_hvac_economizer?, #air_loop_hvac_economizer_limits, #air_loop_hvac_economizer_required?, #air_loop_hvac_economizer_type_allowable?, #air_loop_hvac_enable_demand_control_ventilation, #air_loop_hvac_enable_multizone_vav_optimization, #air_loop_hvac_enable_optimum_start, #air_loop_hvac_enable_supply_air_temperature_reset_delta, #air_loop_hvac_enable_supply_air_temperature_reset_outdoor_temperature, #air_loop_hvac_enable_supply_air_temperature_reset_warmest_zone, #air_loop_hvac_enable_unoccupied_fan_shutoff, #air_loop_hvac_energy_recovery?, #air_loop_hvac_energy_recovery_ventilator_flow_limit, #air_loop_hvac_energy_recovery_ventilator_heat_exchanger_type, #air_loop_hvac_energy_recovery_ventilator_required?, #air_loop_hvac_energy_recovery_ventilator_type, #air_loop_hvac_fan_power_limitation_pressure_drop_adjustment_brake_horsepower, #air_loop_hvac_find_design_supply_air_flow_rate, #air_loop_hvac_floor_area_served, #air_loop_hvac_floor_area_served_exterior_zones, #air_loop_hvac_floor_area_served_interior_zones, #air_loop_hvac_get_occupancy_schedule, #air_loop_hvac_has_simple_transfer_air?, #air_loop_hvac_humidifier_count, #air_loop_hvac_include_hydronic_cooling_coil?, #air_loop_hvac_include_unitary_system?, #air_loop_hvac_include_wshp?, #air_loop_hvac_integrated_economizer_required?, #air_loop_hvac_motorized_oa_damper_limits, #air_loop_hvac_motorized_oa_damper_required?, #air_loop_hvac_multi_stage_dx_cooling?, #air_loop_hvac_multizone_vav_optimization_required?, #air_loop_hvac_multizone_vav_system?, #air_loop_hvac_optimum_start_required?, #air_loop_hvac_prm_baseline_economizer_required?, #air_loop_hvac_prm_economizer_type_and_limits, #air_loop_hvac_remove_erv, #air_loop_hvac_remove_motorized_oa_damper, #air_loop_hvac_residential_area_served, #air_loop_hvac_set_minimum_damper_position, #air_loop_hvac_single_zone_controls_num_stages, #air_loop_hvac_standby_mode_occupancy_control, #air_loop_hvac_static_pressure_reset_required?, #air_loop_hvac_supply_air_temperature_reset_required?, #air_loop_hvac_supply_return_exhaust_relief_fans, #air_loop_hvac_system_fan_brake_horsepower, #air_loop_hvac_system_multiplier, #air_loop_hvac_terminal_reheat?, #air_loop_hvac_total_cooling_capacity, #air_loop_hvac_unitary_system?, #air_loop_hvac_unoccupied_fan_shutoff_required?, #air_loop_hvac_unoccupied_threshold, #air_loop_hvac_vav_damper_action, #air_loop_hvac_vav_system?, #air_terminal_single_duct_parallel_piu_reheat_apply_prm_baseline_fan_power, #air_terminal_single_duct_vav_reheat_apply_initial_prototype_damper_position, #air_terminal_single_duct_vav_reheat_apply_minimum_damper_position, #air_terminal_single_duct_vav_reheat_minimum_damper_position, #air_terminal_single_duct_vav_reheat_reheat_type, #air_terminal_single_duct_vav_reheat_set_heating_cap, #apply_changes_to_surface_construction, #apply_lighting_schedule, #apply_limit_to_subsurface_ratio, #boiler_hot_water_apply_efficiency_and_curves, #boiler_hot_water_find_capacity, #boiler_hot_water_find_search_criteria, #boiler_hot_water_standard_minimum_thermal_efficiency, build, #building_story_floor_multiplier, #building_story_minimum_z_value, #change_construction_properties_in_model, #chiller_electric_eir_apply_efficiency_and_curves, #chiller_electric_eir_find_capacity, #chiller_electric_eir_find_search_criteria, #chiller_electric_eir_standard_minimum_full_load_efficiency, #coil_cooling_dx_multi_speed_apply_efficiency_and_curves, #coil_cooling_dx_multi_speed_find_capacity, #coil_cooling_dx_multi_speed_standard_minimum_cop, #coil_cooling_dx_single_speed_find_capacity, #coil_cooling_dx_two_speed_apply_efficiency_and_curves, #coil_cooling_dx_two_speed_find_capacity, #coil_cooling_dx_two_speed_standard_minimum_cop, #coil_cooling_water_to_air_heat_pump_apply_efficiency_and_curves, #coil_cooling_water_to_air_heat_pump_find_capacity, #coil_cooling_water_to_air_heat_pump_standard_minimum_cop, #coil_heating_dx_multi_speed_apply_efficiency_and_curves, #coil_heating_dx_single_speed_apply_defrost_eir_curve_limits, #coil_heating_dx_single_speed_find_capacity, #coil_heating_gas_apply_efficiency_and_curves, #coil_heating_gas_apply_prototype_efficiency, #coil_heating_gas_find_capacity, #coil_heating_gas_multi_stage_apply_efficiency_and_curves, #coil_heating_gas_multi_stage_find_capacity, #coil_heating_gas_multi_stage_find_search_criteria, #coil_heating_water_to_air_heat_pump_apply_efficiency_and_curves, #coil_heating_water_to_air_heat_pump_find_capacity, #coil_heating_water_to_air_heat_pump_standard_minimum_cop, #combustion_eff_to_thermal_eff, #construction_calculated_solar_heat_gain_coefficient, #construction_calculated_u_factor, #construction_calculated_visible_transmittance, #construction_deep_copy, #construction_set_glazing_shgc, #construction_set_glazing_tvis, #construction_set_glazing_u_value, #construction_set_slab_f_factor, #construction_set_u_value, #construction_set_underground_wall_c_factor, #construction_simple_glazing?, #controller_water_coil_set_convergence_limits, #convert_curve_biquadratic, #cooling_tower_single_speed_apply_efficiency_and_curves, #cooling_tower_two_speed_apply_efficiency_and_curves, #cooling_tower_variable_speed_apply_efficiency_and_curves, #cop_heating_to_cop_heating_no_fan, #cop_to_eer, #cop_to_kw_per_ton, #cop_to_seer_cooling_no_fan, #cop_to_seer_cooling_with_fan, #create_air_conditioner_variable_refrigerant_flow, #create_boiler_hot_water, #create_central_air_source_heat_pump, #create_coil_cooling_dx_single_speed, #create_coil_cooling_dx_two_speed, #create_coil_cooling_water, #create_coil_cooling_water_to_air_heat_pump_equation_fit, #create_coil_heating_dx_single_speed, #create_coil_heating_electric, #create_coil_heating_gas, #create_coil_heating_water, #create_coil_heating_water_to_air_heat_pump_equation_fit, #create_curve_bicubic, #create_curve_biquadratic, #create_curve_cubic, #create_curve_exponent, #create_curve_quadratic, #create_fan_constant_volume, #create_fan_constant_volume_from_json, #create_fan_on_off, #create_fan_on_off_from_json, #create_fan_variable_volume, #create_fan_variable_volume_from_json, #create_fan_zone_exhaust, #create_fan_zone_exhaust_from_json, #day_schedule_equivalent_full_load_hrs, #define_space_multiplier, #eer_to_cop, #enthalpy_recovery_ratio_design_to_typical_adjustment, #fan_constant_volume_airloop_fan_pressure_rise, #fan_constant_volume_apply_prototype_fan_pressure_rise, #fan_on_off_airloop_or_unitary_fan_pressure_rise, #fan_on_off_apply_prototype_fan_pressure_rise, #fan_variable_volume_airloop_fan_pressure_rise, #fan_variable_volume_apply_prototype_fan_pressure_rise, #fan_variable_volume_cooling_system_type, #fan_variable_volume_part_load_fan_power_limitation?, #fan_variable_volume_part_load_fan_power_limitation_capacity_limit, #fan_variable_volume_part_load_fan_power_limitation_hp_limit, #fan_variable_volume_set_control_type, #fan_zone_exhaust_apply_prototype_fan_pressure_rise, #film_coefficients_r_value, #find_and_set_insulation_layer, #find_exposed_conditioned_roof_surfaces, #find_exposed_conditioned_vertical_surfaces, #find_highest_roof_centre, #fluid_cooler_apply_minimum_power_per_flow, #get_outdoor_subsurface_ratio, #headered_pumps_variable_speed_set_control_type, #heat_exchanger_air_to_air_sensible_and_latent_apply_effectiveness, #heat_exchanger_air_to_air_sensible_and_latent_apply_prototype_efficiency, #heat_exchanger_air_to_air_sensible_and_latent_apply_prototype_efficiency_enthalpy_recovery_ratio, #heat_exchanger_air_to_air_sensible_and_latent_apply_prototype_nominal_electric_power, #heat_exchanger_air_to_air_sensible_and_latent_enthalpy_recovery_ratio_to_effectiveness, #heat_exchanger_air_to_air_sensible_and_latent_minimum_effectiveness, #heat_exchanger_air_to_air_sensible_and_latent_prototype_default_fan_efficiency, #hspf_to_cop_heating_no_fan, #hspf_to_cop_heating_with_fan, #intialize, #kw_per_ton_to_cop, #load_hvac_map, #load_initial_osm, #load_standards_database, #model_add_baseboard, #model_add_booster_swh_end_uses, #model_add_cav, #model_add_central_air_source_heat_pump, #model_add_chw_loop, #model_add_constant_schedule_ruleset, #model_add_construction, #model_add_construction_set, #model_add_crac, #model_add_crah, #model_add_curve, #model_add_cw_loop, #model_add_data_center_hvac, #model_add_data_center_load, #model_add_daylighting_controls, #model_add_design_days_and_weather_file, #model_add_district_ambient_loop, #model_add_doas, #model_add_doas_cold_supply, #model_add_elevator, #model_add_elevators, #model_add_evap_cooler, #model_add_exhaust_fan, #model_add_four_pipe_fan_coil, #model_add_furnace_central_ac, #model_add_ground_hx_loop, #model_add_ground_temperatures, #model_add_heatpump_water_heater, #model_add_high_temp_radiant, #model_add_hp_loop, #model_add_hvac, #model_add_hvac_system, #model_add_hw_loop, #model_add_ideal_air_loads, #model_add_low_temp_radiant, #model_add_material, #model_add_minisplit_hp, #model_add_piping_losses_to_swh_system, #model_add_prm_baseline_system, #model_add_psz_ac, #model_add_psz_vav, #model_add_ptac, #model_add_pthp, #model_add_pvav, #model_add_pvav_pfp_boxes, #model_add_radiant_proportional_controls, #model_add_refrigeration_case, #model_add_refrigeration_compressor, #model_add_refrigeration_system, #model_add_refrigeration_walkin, #model_add_residential_erv, #model_add_schedule, #model_add_schedule_type_limits, #model_add_split_ac, #model_add_swh, #model_add_swh_booster, #model_add_swh_end_uses, #model_add_swh_end_uses_by_space, #model_add_swh_loop, #model_add_transformer, #model_add_typical_exterior_lights, #model_add_typical_refrigeration, #model_add_typical_swh, #model_add_unitheater, #model_add_vav_pfp_boxes, #model_add_vav_reheat, #model_add_vrf, #model_add_water_heater, #model_add_water_source_hp, #model_add_waterside_economizer, #model_add_window_ac, #model_add_zone_erv, #model_add_zone_ventilation, #model_apply_hvac_efficiency_standard, #model_apply_infiltration_standard, #model_apply_multizone_vav_outdoor_air_sizing, #model_apply_parametric_schedules, #model_apply_prm_baseline_skylight_to_roof_ratio, #model_apply_prm_baseline_window_to_wall_ratio, #model_apply_prm_construction_types, #model_apply_prm_sizing_parameters, #model_apply_standard_constructions, #model_assign_spaces_to_stories, #model_attach_water_fixtures_to_spaces?, #model_baseline_system_vav_fan_type, #model_create_exterior_lighting_area_length_count_hash, #model_create_prm_baseline_building, #model_create_prm_baseline_building_requires_vlt_sizing_run, #model_create_space_type_hash, #model_create_story_hash, #model_cw_loop_cooling_tower_fan_type, #model_differentiate_primary_secondary_thermal_zones, #model_effective_num_stories, #model_elevator_fan_pwr, #model_elevator_lift_power, #model_elevator_lighting_pct_incandescent, #model_eliminate_outlier_zones, #model_find_and_add_construction, #model_find_ashrae_hot_water_demand, #model_find_climate_zone_set, #model_find_constructions, #model_find_icc_iecc_2015_hot_water_demand, #model_find_icc_iecc_2015_internal_loads, #model_find_object, #model_find_objects, #model_find_prototype_floor_area, #model_find_target_eui, #model_find_target_eui_by_end_use, #model_find_water_heater_capacity_volume_and_parasitic, #model_get_baseline_system_type_by_zone, #model_get_building_climate_zone_and_building_type, #model_get_climate_zone_set_from_list, #model_get_climate_zone_weather_file_map, #model_get_construction_properties, #model_get_construction_set, #model_get_full_weather_file_path, #model_get_heating_design_outdoor_temperatures, #model_get_lookup_name, #model_get_monthly_ground_temps_from_stat_file, #model_get_or_add_ambient_water_loop, #model_get_or_add_chilled_water_loop, #model_get_or_add_ground_hx_loop, #model_get_or_add_heat_pump_loop, #model_get_or_add_hot_water_loop, #model_get_story_for_nominal_z_coordinate, #model_group_zones_by_story, #model_infer_hours_of_operation_building, #model_legacy_results_by_end_use_and_fuel_type, #model_make_name, #model_num_stories_spanned, #model_prm_baseline_system_change_fuel_type, #model_prm_baseline_system_group_minimum_area, #model_prm_baseline_system_groups, #model_prm_baseline_system_number, #model_prm_baseline_system_type, #model_prm_skylight_to_roof_ratio_limit, #model_process_results_for_datapoint, #model_remap_office, #model_remove_external_shading_devices, #model_remove_prm_ems_objects, #model_remove_prm_hvac, #model_remove_unused_resource_objects, #model_residential_and_nonresidential_floor_areas, #model_set_climate_zone, #model_set_vav_terminals_to_control_for_outdoor_air, #model_setup_parametric_schedules, #model_standards_climate_zone, #model_system_outdoor_air_sizing_vrp_method, #model_typical_display_case_zone, #model_typical_hvac_system_type, #model_typical_walkin_zone, #model_validate_standards_spacetypes_in_model, #model_ventilation_method, #model_walkin_freezer_latent_case_credit_curve, #model_zones_with_occ_and_fuel_type, #planar_surface_apply_standard_construction, #plant_loop_apply_prm_baseline_chilled_water_pumping_type, #plant_loop_apply_prm_baseline_chilled_water_temperatures, #plant_loop_apply_prm_baseline_condenser_water_pumping_type, #plant_loop_apply_prm_baseline_condenser_water_temperatures, #plant_loop_apply_prm_baseline_hot_water_pumping_type, #plant_loop_apply_prm_baseline_hot_water_temperatures, #plant_loop_apply_prm_baseline_pump_power, #plant_loop_apply_prm_baseline_pumping_type, #plant_loop_apply_prm_baseline_temperatures, #plant_loop_apply_prm_number_of_boilers, #plant_loop_apply_prm_number_of_chillers, #plant_loop_apply_prm_number_of_cooling_towers, #plant_loop_apply_standard_controls, #plant_loop_capacity_w_by_maxflow_and_delta_t_forwater, #plant_loop_enable_supply_water_temperature_reset, #plant_loop_find_maximum_loop_flow_rate, #plant_loop_prm_baseline_condenser_water_temperatures, #plant_loop_supply_water_temperature_reset_required?, #plant_loop_swh_loop?, #plant_loop_swh_system_type, #plant_loop_total_cooling_capacity, #plant_loop_total_floor_area_served, #plant_loop_total_heating_capacity, #plant_loop_total_rated_w_per_gpm, #plant_loop_variable_flow_system?, #prototype_apply_condenser_water_temperatures, #prototype_condenser_water_temperatures, #pump_variable_speed_control_type, #pump_variable_speed_get_control_type, #pump_variable_speed_set_control_type, register_standard, #remove_all_hvac, #remove_all_plant_loops, #remove_all_subsurfaces, #remove_all_zone_equipment, #remove_hvac, #remove_plant_loops, #remove_unused_curves, #remove_vrf, #remove_zone_equipment, #rename_air_loop_nodes, #rename_plant_loop_nodes, #safe_load_model, #safe_load_sql, #schedule_apply_parametric_inputs, #schedule_compact_annual_min_max_value, #schedule_constant_annual_equivalent_full_load_hrs, #schedule_constant_annual_min_max_value, #schedule_ruleset_annual_equivalent_full_load_hrs, #schedule_ruleset_annual_hourly_values, #schedule_ruleset_annual_hours_above_value, #schedule_ruleset_annual_min_max_value, #schedule_ruleset_cleanup_profiles, #schedule_ruleset_set_hours_of_operation, #seer_to_cop_cooling_no_fan, #seer_to_cop_cooling_with_fan, #set_maximum_fraction_outdoor_air_schedule, #set_window_to_wall_ratio_set_name, #space_add_daylighting_controls, #space_apply_infiltration_rate, #space_conditioning_category, #space_cooled?, #space_daylighted_area_window_width, #space_daylighted_areas, #space_daylighting_control_required?, #space_daylighting_fractions_and_windows, #space_design_internal_load, #space_exterior_wall_and_roof_and_subsurface_area, #space_exterior_wall_and_window_area, #space_get_adjacent_space_with_most_shared_wall_area, #space_get_adjacent_spaces_with_shared_wall_areas, #space_heated?, #space_hours_of_operation, #space_infiltration_rate_75_pa, #space_plenum?, #space_residential?, #space_sidelighting_effective_aperture, #space_skylight_effective_aperture, #space_type_apply_internal_load_schedules, #space_type_apply_internal_loads, #space_type_apply_rendering_color, #space_type_get_construction_properties, #space_type_get_standards_data, #spaces_get_occupancy_schedule, #spaces_hours_of_operation, #standard_design_sizing_temperatures, #standards_lookup_table_first, #standards_lookup_table_many, #strip_model, #sub_surface_component_infiltration_rate, #sub_surface_create_centered_subsurface_from_scaled_surface, #sub_surface_create_scaled_subsurfaces_from_surface, #sub_surface_reduce_area_by_percent_by_raising_sill, #sub_surface_reduce_area_by_percent_by_shrinking_toward_centroid, #sub_surface_vertical_rectangle?, #surface_absolute_azimuth, #surface_cardinal_direction, #surface_component_infiltration_rate, #surface_replace_existing_subsurfaces_with_centered_subsurface, #thermal_eff_to_afue, #thermal_eff_to_comb_eff, #thermal_zone_add_exhaust, #thermal_zone_add_exhaust_fan_dcv, #thermal_zone_add_unconditioned_thermostat, #thermal_zone_apply_prm_baseline_supply_temperatures, #thermal_zone_building_type, #thermal_zone_conditioning_category, #thermal_zone_convert_oa_req_to_per_area, #thermal_zone_cooled?, #thermal_zone_demand_control_ventilation_limits, #thermal_zone_demand_control_ventilation_required?, #thermal_zone_design_internal_load, #thermal_zone_exhaust_fan_dcv_required?, #thermal_zone_floor_area, #thermal_zone_floor_area_with_zone_multipliers, #thermal_zone_fossil_hybrid_or_purchased_heat?, #thermal_zone_fossil_or_electric_type, #thermal_zone_get_adjacent_zones_with_shared_wall_areas, #thermal_zone_get_occupancy_schedule, #thermal_zone_heated?, #thermal_zone_infer_system_type, #thermal_zone_majority_space_type, #thermal_zone_mixed_heating_fuel?, #thermal_zone_occupancy_type, #thermal_zone_outdoor_airflow_rate, #thermal_zone_outdoor_airflow_rate_per_area, #thermal_zone_plenum?, #thermal_zone_prm_baseline_cooling_design_supply_temperature, #thermal_zone_prm_baseline_heating_design_supply_temperature, #thermal_zone_residential?, #thermal_zone_vestibule?, #thermal_zones_get_occupancy_schedule, #true?, #validate_initial_model, #water_heater_mixed_apply_efficiency, #water_heater_mixed_apply_prm_baseline_fuel_type, #water_heater_mixed_find_capacity, #zone_hvac_component_apply_prm_baseline_fan_power, #zone_hvac_component_apply_standard_controls, #zone_hvac_component_apply_vestibule_heating_control, #zone_hvac_component_occupancy_ventilation_control, #zone_hvac_component_prm_baseline_fan_efficacy, #zone_hvac_component_vestibule_heating_control_required?, #zone_hvac_model_standby_mode_occupancy_control, #zone_hvac_unoccupied_threshold

Methods included from PrototypeFan

apply_base_fan_variables, #create_fan_by_name, #get_fan_from_standards, #prototype_fan_apply_prototype_fan_efficiency

Methods included from CoilDX

#coil_dx_find_search_criteria, #coil_dx_heat_pump?, #coil_dx_heating_type, #coil_dx_subcategory

Methods included from CoolingTower

#cooling_tower_apply_minimum_power_per_flow, #cooling_tower_apply_minimum_power_per_flow_gpm_limit

Methods included from Pump

#pump_apply_prm_pressure_rise_and_motor_efficiency, #pump_apply_standard_minimum_motor_efficiency, #pump_brake_horsepower, #pump_motor_horsepower, #pump_pumppower, #pump_rated_w_per_gpm, #pump_standard_minimum_motor_efficiency_and_size

Methods included from Fan

#fan_adjust_pressure_rise_to_meet_fan_power, #fan_apply_standard_minimum_motor_efficiency, #fan_baseline_impeller_efficiency, #fan_brake_horsepower, #fan_change_impeller_efficiency, #fan_change_motor_efficiency, #fan_fanpower, #fan_motor_horsepower, #fan_rated_w_per_cfm, #fan_small_fan?, #fan_standard_minimum_motor_efficiency_and_size

Constructor Details

#initializeECMS



36
37
38
39
40
# File 'lib/openstudio-standards/standards/necb/ECMS/ecms.rb', line 36

def initialize
  super()
  @standards_data = load_standards_database_new
  @standards_data['curves'] = standards_data['tables']['curves']['table']
end

Instance Method Details

#add_air_system(model:, zones:, sys_abbr:, sys_vent_type:, sys_heat_rec_type:, sys_htg_eqpt_type:, sys_supp_htg_eqpt_type:, sys_clg_eqpt_type:, sys_supp_fan_type:, sys_ret_fan_type:, sys_setpoint_mgr_type:) ⇒ Object

add air system with all its components



736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 736

def add_air_system(
  model:,
  zones:,
  sys_abbr:,
  sys_vent_type:,
  sys_heat_rec_type:,
  sys_htg_eqpt_type:,
  sys_supp_htg_eqpt_type:,
  sys_clg_eqpt_type:,
  sys_supp_fan_type:,
  sys_ret_fan_type:,
  sys_setpoint_mgr_type:
)

  # create all the needed components and the air loop

  airloop = create_airloop(model, sys_vent_type)
  setpoint_mgr = create_air_sys_spm(model, sys_setpoint_mgr_type, zones)
  supply_fan = create_air_sys_fan(model, sys_supp_fan_type)
  supply_fan.setName('Supply Fan') if supply_fan
  return_fan = create_air_sys_fan(model, sys_ret_fan_type)
  return_fan.setName('Return Fan') if return_fan
  htg_eqpt = create_air_sys_htg_eqpt(model, sys_htg_eqpt_type)
  supp_htg_eqpt = create_air_sys_htg_eqpt(model, sys_supp_htg_eqpt_type)
  clg_eqpt = create_air_sys_clg_eqpt(model, sys_clg_eqpt_type)
  # add components to the air loop

  clg_eqpt.addToNode(airloop.supplyOutletNode) if clg_eqpt
  htg_eqpt.addToNode(airloop.supplyOutletNode) if htg_eqpt
  supp_htg_eqpt.addToNode(airloop.supplyOutletNode) if supp_htg_eqpt
  supply_fan.addToNode(airloop.supplyOutletNode) if supply_fan
  setpoint_mgr.addToNode(airloop.supplyOutletNode) if setpoint_mgr

  # OA controller

  oa_controller = OpenStudio::Model::ControllerOutdoorAir.new(model)
  oa_controller.autosizeMinimumOutdoorAirFlowRate
  oa_system = OpenStudio::Model::AirLoopHVACOutdoorAirSystem.new(model, oa_controller)
  oa_system.addToNode(airloop.supplyInletNode)

  # Set airloop name

  sys_name_pars = {}
  sys_name_pars['sys_hr'] = 'none'
  sys_name_pars['sys_clg'] = sys_clg_eqpt_type
  sys_name_pars['sys_htg'] = sys_htg_eqpt_type
  sys_name_pars['sys_sf'] = 'cv' if sys_supp_fan_type == 'constant_volume'
  sys_name_pars['sys_sf'] = 'vv' if sys_supp_fan_type == 'variable_volume'
  sys_name_pars['zone_htg'] = 'none'
  sys_name_pars['zone_clg'] = 'none'
  sys_name_pars['sys_rf'] = 'none'
  sys_name_pars['sys_rf'] = 'cv' if sys_ret_fan_type == 'constant_volume'
  sys_name_pars['sys_rf'] = 'vv' if sys_ret_fan_type == 'variable_volume'
  assign_base_sys_name(airloop, sys_abbr: sys_abbr, sys_oa: sys_vent_type, sys_name_pars: sys_name_pars)
  return airloop, return_fan
end

#add_airloop_economizer(model:, airloop_economizer_type:) ⇒ Object

Add air side economizer for each airloop



3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 3061

def add_airloop_economizer(model:, airloop_economizer_type:)
  return if airloop_economizer_type.nil? || (airloop_economizer_type.to_s == 'NECB_Default')

  if airloop_economizer_type.downcase == "differentialenthalpy"
    economizer_type = 'DifferentialEnthalpy'
  elsif airloop_economizer_type.downcase == "differentialdrybulb"
    economizer_type = 'DifferentialDryBulb'
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.airLoopHVACOutdoorAirSystem', "The air loop economizer type #{airloop_economizer_type} is not recognized.  Please make sure that the economizer being applied by the ECM is either a DifferentialEnthalpy or DifferentialDryBulb type.  No economizer will be applied.")
    return
  end

  model.getAirLoopHVACs.sort.each do |air_loop|
    oa_sys = air_loop.airLoopHVACOutdoorAirSystem
    if oa_sys.is_initialized
      oa_sys = oa_sys.get
      oa_control = oa_sys.getControllerOutdoorAir
      oa_control.setEconomizerControlType(economizer_type)
    end
  end
end

#add_ecm_hs08_ccashp_vrf(model:, system_zones_map:, system_doas_flags:, ecm_system_zones_map_option:, heating_fuel:, standard:, air_sys_eqpt_type: 'ccashp') ⇒ Object

Add equipment for ECM ‘hs08_ccashp_vrf’:

-Constant-volume DOAS with air-source heat pump for heating and cooling and electric backup
-Zonal terminal VRF units connected to an outdoor VRF condenser unit
-Zonal electric backup


471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 471

def add_ecm_hs08_ccashp_vrf(
  model:,
  system_zones_map:,
  system_doas_flags:,
  ecm_system_zones_map_option:,
  heating_fuel:,
  standard:,
  air_sys_eqpt_type: 'ccashp')

  # Update system zones map if needed

  if ecm_system_zones_map_option != 'NECB_Default'
    system_zones_map = update_system_zones_map(model,system_zones_map,ecm_system_zones_map_option,'sys_1')
  else
    updated_system_zones_map = {}
    system_zones_map.each {|sname,zones| updated_system_zones_map["sys_1#{sname[5..-1]}"] = zones}  # doas unit is an NECB sys_1 

    system_zones_map = updated_system_zones_map
  end
  # Add outdoor VRF unit

  outdoor_vrf_unit = add_outdoor_vrf_unit(model: model, ecm_name: 'hs08_ccashp_vrf')
  # Update system doas flags

  system_doas_flags = {}
  system_zones_map.keys.each { |sname| system_doas_flags[sname] = true }
  # Set heating fuel

  updated_heating_fuel = heating_fuel
  if heating_fuel == 'DefaultFuel'
    epw = BTAP::Environment::WeatherFile.new(model.weatherFile.get.path.get)
    updated_heating_fuel = standard.standards_data['regional_fuel_use'].detect { |fuel_sources| fuel_sources['state_province_regions'].include?(epw.state_province_region) }['fueltype_set']
  end
  raise("Heating fuel for ECM 'HS08_CCASHP_VRF' is neither Electricity nor NaturalGas") if ((updated_heating_fuel != 'Electricity') && (updated_heating_fuel != 'NaturalGas'))
  # use system zones map and generate new air system and zonal equipment

  system_zones_map.sort.each do |sys_name, zones|
    sys_info = air_sys_comps_assumptions(sys_name: sys_name,
                                         zones: zones,
                                         system_doas_flags: system_doas_flags)
    sys_supp_htg_eqpt_type = 'coil_electric'
    sys_supp_htg_eqpt_type = 'coil_gas' if updated_heating_fuel == 'NaturalGas'
    airloop, return_fan = add_air_system(model: model,
                                         zones: zones,
                                         sys_abbr: sys_info['sys_abbr'],
                                         sys_vent_type: sys_info['sys_vent_type'],
                                         sys_heat_rec_type: sys_info['sys_heat_rec_type'],
                                         sys_htg_eqpt_type: air_sys_eqpt_type,
                                         sys_supp_htg_eqpt_type: sys_supp_htg_eqpt_type,
                                         sys_clg_eqpt_type: air_sys_eqpt_type,
                                         sys_supp_fan_type: sys_info['sys_supp_fan_type'],
                                         sys_ret_fan_type: sys_info['sys_ret_fan_type'],
                                         sys_setpoint_mgr_type: sys_info['sys_setpoint_mgr_type'])
    # get and assign defrost curve

    dx_htg_coil = nil
    airloop.supplyComponents.sort.each do |comp|
      if comp.to_CoilHeatingDXSingleSpeed.is_initialized
        dx_htg_coil = comp.to_CoilHeatingDXSingleSpeed.get
      elsif comp.to_CoilHeatingDXVariableSpeed.is_initialized
        dx_htg_coil = comp.to_CoilHeatingDXVariableSpeed.get
      end
    end
    search_criteria = {}
    if air_sys_eqpt_type == 'ccashp'
      search_criteria['name'] = 'Mitsubishi_Hyper_Heating_VRF_Outdoor_Unit RTU'
    elsif air_sys_eqpt_type == 'ashp'
      search_criteria['name'] = 'NECB2015_ASHP'
    end
    props = model_find_object(standards_data['tables']['heat_pump_heating_ecm']['table'], search_criteria, 1.0)
    heat_defrost_eir_ft = model_add_curve(model, props['heat_defrost_eir_ft'])
    if heat_defrost_eir_ft
      dx_htg_coil.setDefrostEnergyInputRatioFunctionofTemperatureCurve(heat_defrost_eir_ft)
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDX', "For #{dx_htg_coil.name}, cannot find heat_defrost_eir_ft curve, will not be set.")
    end
    # add zone equipment and diffuser

    # add terminal VRF units

    add_zone_eqpt(model: model,
                  airloop: airloop,
                  zones: zones,
                  outdoor_unit: outdoor_vrf_unit,
                  zone_diffuser_type: sys_info['zone_diffuser_type'],
                  zone_htg_eqpt_type: 'vrf',
                  zone_supp_htg_eqpt_type: 'none',
                  zone_clg_eqpt_type: 'vrf',
                  zone_fan_type: 'On_Off')
    # add electric baseboards for backup

    add_zone_eqpt(model: model,
                  airloop: airloop,
                  zones: zones,
                  outdoor_unit: nil,
                  zone_diffuser_type: nil,
                  zone_htg_eqpt_type: 'baseboard_electric',
                  zone_supp_htg_eqpt_type: 'none',
                  zone_clg_eqpt_type: 'none',
                  zone_fan_type: 'none')
    # Now we can find and apply maximum horizontal and vertical distances between outdoor vrf unit and zones with vrf terminal units

    max_hor_pipe_length, max_vert_pipe_length = get_max_vrf_pipe_lengths(model)
    outdoor_vrf_unit.setEquivalentPipingLengthusedforPipingCorrectionFactorinCoolingMode(max_hor_pipe_length)
    outdoor_vrf_unit.setEquivalentPipingLengthusedforPipingCorrectionFactorinHeatingMode(max_hor_pipe_length)
    outdoor_vrf_unit.setVerticalHeightusedforPipingCorrectionFactor(max_vert_pipe_length)
  end
end

#add_ecm_hs09_ccashp_baseboard(model:, system_zones_map:, system_doas_flags:, ecm_system_zones_map_option:, heating_fuel:, standard:) ⇒ Object

Add equipment for ecm “hs09_ccashp_baseboard”:

-Constant-volume reheat system for single zone systems
-VAV system with reheat for non DOAS multi-zone systems
-Cold-climate air-source heat pump for heating and cooling with electric backup
-Electric baseboards


1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1006

def add_ecm_hs09_ccashp_baseboard(model:,
                                  system_zones_map:,    # hash of ailoop names as keys and array of zones as values

                                  system_doas_flags:,   # hash of system names as keys and flag for DOAS as values

                                  ecm_system_zones_map_option:,
                                  heating_fuel:,
                                  standard:)

  # Set heating fuel

  updated_heating_fuel = heating_fuel
  if heating_fuel == 'DefaultFuel'
    epw = BTAP::Environment::WeatherFile.new(model.weatherFile.get.path.get)
    updated_heating_fuel = standard.standards_data['regional_fuel_use'].detect { |fuel_sources| fuel_sources['state_province_regions'].include?(epw.state_province_region)}['fueltype_set']
  end
  raise("Heating fuel for ECM 'HS09_CCASHP_Baseboard' is neither Electricity nor NaturalGas") if ((updated_heating_fuel != 'Electricity') && (updated_heating_fuel != 'NaturalGas'))
  # Set supplemental heating for air loop

  sys_supp_htg_eqpt_type = 'coil_electric'
  sys_supp_htg_eqpt_type = 'coil_gas' if updated_heating_fuel == 'NaturalGas'
  systems = []
  system_zones_map.sort.each do |sys_name, zones|
    sys_info = air_sys_comps_assumptions(sys_name: sys_name,
                                         zones: zones,
                                         system_doas_flags: system_doas_flags)
    # add airloop and its equipment

    airloop, return_fan = add_air_system(
      model: model,
      zones: zones,
      sys_abbr: sys_info['sys_abbr'],
      sys_vent_type: sys_info['sys_vent_type'],
      sys_heat_rec_type: sys_info['sys_heat_rec_type'],
      sys_htg_eqpt_type: 'ccashp',
      sys_supp_htg_eqpt_type: sys_supp_htg_eqpt_type,
      sys_clg_eqpt_type: 'ccashp',
      sys_supp_fan_type: sys_info['sys_supp_fan_type'],
      sys_ret_fan_type: sys_info['sys_ret_fan_type'],
      sys_setpoint_mgr_type: sys_info['sys_setpoint_mgr_type']
    )
    htg_dx_coils = model.getCoilHeatingDXVariableSpeeds
    search_criteria = {}
    search_criteria['name'] = 'Mitsubishi_Hyper_Heating_VRF_Outdoor_Unit RTU',
                              props = model_find_object(standards_data['tables']['heat_pump_heating_ecm']['table'], search_criteria, 1.0)
    heat_defrost_eir_ft = model_add_curve(model, props['heat_defrost_eir_ft'])
    # This defrost curve has to be assigned here before sizing

    if heat_defrost_eir_ft
      htg_dx_coils.sort.each { |dxcoil| dxcoil.setDefrostEnergyInputRatioFunctionofTemperatureCurve(heat_defrost_eir_ft) }
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{htg_dx_coils[0].name}, cannot find heat_defrost_eir_ft curve, will not be set.")
    end
    # add zone equipment and diffuser

    zone_htg_eqpt_type = 'baseboard_electric'
    zone_htg_eqpt_type = 'ptac_electric_off' if sys_info['sys_vent_type'] == 'doas'
    zone_clg_eqpt_type = 'none'
    zone_clg_eqpt_type = 'ptac_electric_off' if sys_info['sys_vent_type'] == 'doas'
    zone_fan_type = 'none'
    zone_fan_type = 'constant_volume' if sys_info['sys_vent_type'] == 'doas'
    add_zone_eqpt(model: model,
                  airloop: airloop,
                  zones: zones,
                  outdoor_unit: nil,
                  zone_diffuser_type: sys_info['zone_diffuser_type'],
                  zone_htg_eqpt_type: zone_htg_eqpt_type,
                  zone_supp_htg_eqpt_type: 'none',
                  zone_clg_eqpt_type: zone_clg_eqpt_type,
                  zone_fan_type: zone_fan_type)
    # for doas use baseboard electric as backup for PTAC units

    if sys_info['sys_vent_type'] == 'doas'
      add_zone_eqpt(model: model,
                    airloop: airloop,
                    zones: zones,
                    outdoor_unit: nil,
                    zone_diffuser_type: nil,
                    zone_htg_eqpt_type: 'baseboard_electric',
                    zone_supp_htg_eqpt_type: 'none',
                    zone_clg_eqpt_type: 'none',
                    zone_fan_type: 'none')
    end
    return_fan.addToNode(airloop.returnAirNode.get) if return_fan
    systems << airloop
  end

  return systems
end

#add_ecm_hs11_ashp_pthp(model:, system_zones_map:, system_doas_flags:, ecm_system_zones_map_option:, standard:, heating_fuel:) ⇒ Object

Add equipment for ECM “hs11_ashp_pthp”

-Constant volume DOAS with air-source heat pump for heating and cooling and electric backup
-Packaged-Terminal air-source heat pumps with electric backup


1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1177

def add_ecm_hs11_ashp_pthp(model:,
                           system_zones_map:,
                           system_doas_flags:,
                           ecm_system_zones_map_option:,
                           standard:,
                           heating_fuel:)

  # Set heating fuel

  updated_heating_fuel = heating_fuel
  if heating_fuel == 'DefaultFuel'
    epw = BTAP::Environment::WeatherFile.new(model.weatherFile.get.path.get)
    updated_heating_fuel = standard.standards_data['regional_fuel_use'].detect { |fuel_sources| fuel_sources['state_province_regions'].include?(epw.state_province_region)}['fueltype_set']
  end
  raise("Heating fuel for ECM 'HS11_ASHP_PTHP' is neither Electricity nor NaturalGas") if ((updated_heating_fuel != 'Electricity') && (updated_heating_fuel != 'NaturalGas'))
  # Set supplemental heaing for airloop

  sys_supp_htg_eqpt_type = 'coil_electric'
  sys_supp_htg_eqpt_type = 'coil_gas' if updated_heating_fuel == 'NaturalGas'
  # Update system zones map if needed

  if ecm_system_zones_map_option != 'NECB_Default'
    system_zones_map = update_system_zones_map(model,system_zones_map,ecm_system_zones_map_option,'sys_1')
  else
    updated_system_zones_map = {}
    system_zones_map.each {|sname,zones| updated_system_zones_map["sys_1#{sname[5..-1]}"] = zones}
    system_zones_map = updated_system_zones_map
  end
  # Update system doas flags

  system_doas_flags = {}
  system_zones_map.keys.each { |sname| system_doas_flags[sname] = true }
  # use system zones map and generate new air system and zonal equipment

  systems = []
  system_zones_map.sort.each do |sys_name, zones|
    sys_info = air_sys_comps_assumptions(sys_name: sys_name,
                                         zones: zones,
                                         system_doas_flags: system_doas_flags)
    airloop, return_fan = add_air_system(model: model,
                                         zones: zones,
                                         sys_abbr: sys_info['sys_abbr'],
                                         sys_vent_type: sys_info['sys_vent_type'],
                                         sys_heat_rec_type: sys_info['sys_heat_rec_type'],
                                         sys_htg_eqpt_type: 'ashp',
                                         sys_supp_htg_eqpt_type: sys_supp_htg_eqpt_type,
                                         sys_clg_eqpt_type: 'ashp',
                                         sys_supp_fan_type: sys_info['sys_supp_fan_type'],
                                         sys_ret_fan_type: sys_info['sys_ret_fan_type'],
                                         sys_setpoint_mgr_type: sys_info['sys_setpoint_mgr_type'])
    # Get and assign defrost performance curve

    search_criteria = {}
    search_criteria['name'] = 'HS11_PTHP'
    props = model_find_object(standards_data['tables']['heat_pump_heating_ecm']['table'], search_criteria, 1.0)
    heat_defrost_eir_ft = model_add_curve(model, props['heat_defrost_eir_ft'])
    if !heat_defrost_eir_ft
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXConstantSpeed', 'Cannot find heat_defrost_eir_ft curve, will not be set.')
    end
    airloop.supplyComponents.each do |comp|
      if comp.to_CoilHeatingDXSingleSpeed.is_initialized
        htg_coil = comp.to_CoilHeatingDXSingleSpeed.get
        htg_coil.setDefrostEnergyInputRatioFunctionofTemperatureCurve(heat_defrost_eir_ft)
      end
    end
    # add zone equipment and diffuser

    zone_htg_eqpt_type = 'pthp'
    zone_clg_eqpt_type = 'pthp'
    zone_supp_htg_eqpt_type = 'coil_electric'
    zone_fan_type = 'on_off'
    add_zone_eqpt(model: model,
                  airloop: airloop,
                  zones: zones,
                  outdoor_unit: nil,
                  zone_diffuser_type: sys_info['zone_diffuser_type'],
                  zone_htg_eqpt_type: zone_htg_eqpt_type,
                  zone_supp_htg_eqpt_type: zone_supp_htg_eqpt_type,
                  zone_clg_eqpt_type: zone_clg_eqpt_type,
                  zone_fan_type: zone_fan_type)
    zones.each do |zone|
      zone.equipment.each do |comp|
        if comp.to_ZoneHVACPackagedTerminalHeatPump.is_initialized
          if comp.to_ZoneHVACPackagedTerminalHeatPump.get.heatingCoil.to_CoilHeatingDXSingleSpeed.is_initialized
            htg_coil = comp.to_ZoneHVACPackagedTerminalHeatPump.get.heatingCoil.to_CoilHeatingDXSingleSpeed.get
            htg_coil.setDefrostEnergyInputRatioFunctionofTemperatureCurve(heat_defrost_eir_ft)
          end
        end
      end
    end
    return_fan.addToNode(airloop.returnAirNode.get) if return_fan
    systems << airloop
  end

  return systems
end

#add_ecm_hs12_ashp_baseboard(model:, system_zones_map:, system_doas_flags:, ecm_system_zones_map_option:, standard:, heating_fuel:) ⇒ Object

Add equipment for ecm “hs12_ashp_baseboard”:

-Constant-volume reheat system for single zone systems
-VAV system with reheat for non DOAS multi-zone systems
-Air-source heat pump for heating and cooling with electric backup
-Electric baseboards


1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1337

def add_ecm_hs12_ashp_baseboard(model:,
                                system_zones_map:,
                                system_doas_flags:,
                                ecm_system_zones_map_option:,
                                standard:,
                                heating_fuel:)

  # Set heating fuel

  updated_heating_fuel = heating_fuel
  if heating_fuel == 'DefaultFuel'
    epw = BTAP::Environment::WeatherFile.new(model.weatherFile.get.path.get)
    updated_heating_fuel = standard.standards_data['regional_fuel_use'].detect { |fuel_sources| fuel_sources['state_province_regions'].include?(epw.state_province_region)}['fueltype_set']
  end
  raise("Heating fuel for ECM 'HS12_ASHP_Baseboard' is neither Electricity nor NaturalGas") if ((updated_heating_fuel != 'Electricity') && (updated_heating_fuel != 'NaturalGas'))
  # Set supplemental heating fuel for airloop

  sys_supp_htg_eqpt_type = 'coil_electric'
  sys_supp_htg_eqpt_type = 'coil_gas' if updated_heating_fuel == 'NaturalGas'
  systems = []
  system_zones_map.sort.each do |sys_name, zones|
    sys_info = air_sys_comps_assumptions(sys_name: sys_name,
                                         zones: zones,
                                         system_doas_flags: system_doas_flags)
    # add air loop and its equipment

    airloop, return_fan = add_air_system(model: model,
                                         zones: zones,
                                         sys_abbr: sys_info['sys_abbr'],
                                         sys_vent_type: sys_info['sys_vent_type'],
                                         sys_heat_rec_type: sys_info['sys_heat_rec_type'],
                                         sys_htg_eqpt_type: 'ashp',
                                         sys_supp_htg_eqpt_type: sys_supp_htg_eqpt_type,
                                         sys_clg_eqpt_type: 'ashp',
                                         sys_supp_fan_type: sys_info['sys_supp_fan_type'],
                                         sys_ret_fan_type: sys_info['sys_ret_fan_type'],
                                         sys_setpoint_mgr_type: sys_info['sys_setpoint_mgr_type'])
    # get and assign defrost curve

    htg_dx_coils = model.getCoilHeatingDXSingleSpeeds
    search_criteria = {}
    search_criteria['name'] = 'NECB2015_ASHP'
    props = model_find_object(standards_data['tables']['heat_pump_heating_ecm']['table'], search_criteria, 1.0)
    heat_defrost_eir_ft = model_add_curve(model, props['heat_defrost_eir_ft'])
    if heat_defrost_eir_ft
      htg_dx_coils.sort.each { |dxcoil| dxcoil.setDefrostEnergyInputRatioFunctionofTemperatureCurve(heat_defrost_eir_ft) }
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{htg_dx_coils[0].name}, cannot find heat_defrost_eir_ft curve, will not be set.")
    end
    # add zone equipment and diffuser

    zone_htg_eqpt_type = 'baseboard_electric'
    zone_htg_eqpt_type = 'ptac_electric_off' if sys_info['sys_vent_type'] == 'doas'
    zone_clg_eqpt_type = 'none'
    zone_clg_eqpt_type = 'ptac_electric_off' if sys_info['sys_vent_type'] == 'doas'
    zone_fan_type = 'none'
    zone_fan_type = 'constant_volume' if sys_info['sys_vent_type'] == 'doas'
    add_zone_eqpt(model: model,
                  airloop: airloop,
                  zones: zones,
                  outdoor_unit: nil,
                  zone_diffuser_type: sys_info['zone_diffuser_type'],
                  zone_htg_eqpt_type: zone_htg_eqpt_type,
                  zone_supp_htg_eqpt_type: 'none',
                  zone_clg_eqpt_type: zone_clg_eqpt_type,
                  zone_fan_type: zone_fan_type)
    # for doas use baseboard electric as backup for PTAC units

    if sys_info['sys_vent_type'] == 'doas'
      add_zone_eqpt(model: model,
                    airloop: airloop,
                    zones: zones,
                    outdoor_unit: nil,
                    zone_diffuser_type: nil,
                    zone_htg_eqpt_type: 'baseboard_electric',
                    zone_supp_htg_eqpt_type: 'none',
                    zone_clg_eqpt_type: 'none',
                    zone_fan_type: 'none')
    end
    return_fan.addToNode(airloop.returnAirNode.get) if return_fan
    systems << airloop
  end

  return systems
end

#add_ecm_hs13_ashp_vrf(model:, system_zones_map:, system_doas_flags:, ecm_system_zones_map_option:, standard:, heating_fuel:) ⇒ Object

Add equipment for ecm “hs13_ashp_vrf”:

-Constant-volume dedicated-outside air system
-Air-source heat pump for heating and cooling with electric backup
-Zonal VRF terminal units for heating and cooling with electric baseboards


1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1490

def add_ecm_hs13_ashp_vrf(model:,
                          system_zones_map:,
                          system_doas_flags:,
                          ecm_system_zones_map_option:,
                          standard:,
                          heating_fuel:)
  # call method for ECM hs08 with ASHP in the air system

  add_ecm_hs08_ccashp_vrf(model: model,
                          system_zones_map: system_zones_map,
                          system_doas_flags: system_doas_flags,
                          ecm_system_zones_map_option: ecm_system_zones_map_option,
                          standard: standard,
                          heating_fuel: heating_fuel,
                          air_sys_eqpt_type: 'ashp')
end

#add_ecm_remove_airloops_add_zone_baseboards(model:, system_zones_map:, system_doas_flags: nil, ecm_system_zones_map_option:, standard:, heating_fuel:) ⇒ Object

Despite the name, this method does not actually remove any air loops. All air loops, hot water loops, cooling and any existing baseboard heaters should already be gone. The name is an artifact of the way ECM methods are named and used. With everything gone, this method adds a hot water loop (if required) and baseboard heating back in to all zones requiring heating. Originally, code was included in the ‘apply_systems’ method which would prevent the air loops and other stuff from being created if someone did not want them. But others felt that that was not a clear way of doing things and did not feel the performance penalty of creating objects, then removing them, then creating them again was significant.



2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2901

def add_ecm_remove_airloops_add_zone_baseboards(model:,
                                                system_zones_map:,
                                                system_doas_flags: nil,
                                                ecm_system_zones_map_option:,
                                                standard:,
                                                heating_fuel:)
  # Set the primary fuel set to default to to specific fuel type.

  standards_info = standard.standards_data

  if heating_fuel == 'DefaultFuel'
    epw = BTAP::Environment::WeatherFile.new(model.weatherFile.get.path.get)
    heating_fuel = standards_info['regional_fuel_use'].detect { |fuel_sources| fuel_sources['state_province_regions'].include?(epw.state_province_region) }['fueltype_set']
  end
  # Get fuelset.

  system_fuel_defaults = standards_info['fuel_type_sets'].detect { |fuel_type_set| fuel_type_set['name'] == heating_fuel }
  raise("fuel_type_sets named #{heating_fuel} not found in fuel_type_sets table.") if system_fuel_defaults.nil?

  # Assign fuel sources.

  boiler_fueltype = system_fuel_defaults['boiler_fueltype']
  baseboard_type = system_fuel_defaults['baseboard_type']
  mau_heating_coil_type = 'none'

  # Create the hot water loop if necessary.

  hw_loop = standard.create_hw_loop_if_required(
    baseboard_type,
    boiler_fueltype,
    mau_heating_coil_type,
    model
  )

  # Add baseboard heaters to each heated zone.

  system_zones_map.sort.each do |sname, zones|
    zones.each do |zone|
      standard.add_zone_baseboards(baseboard_type: baseboard_type,
                                   hw_loop: hw_loop,
                                   model: model,
                                   zone: zone)
    end
  end
end

#add_outdoor_vrf_unit(model:, ecm_name: nil, condenser_type: 'AirCooled') ⇒ Object

Add an outdoor VRF unit



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 265

def add_outdoor_vrf_unit(model:,
                         ecm_name: nil,
                         condenser_type: 'AirCooled')
  outdoor_vrf_unit = OpenStudio::Model::AirConditionerVariableRefrigerantFlow.new(model)
  outdoor_vrf_unit.setName('VRF Outdoor Unit')
  outdoor_vrf_unit.setHeatPumpWasteHeatRecovery(true)
  outdoor_vrf_unit.setRatedHeatingCOP(4.0)
  outdoor_vrf_unit.setRatedCoolingCOP(4.0)
  outdoor_vrf_unit.setMinimumOutdoorTemperatureinHeatingMode(-25.0)
  outdoor_vrf_unit.setHeatingPerformanceCurveOutdoorTemperatureType('WetBulbTemperature')
  outdoor_vrf_unit.setMasterThermostatPriorityControlType('ThermostatOffsetPriority')
  outdoor_vrf_unit.setDefrostControl('OnDemand')
  outdoor_vrf_unit.setDefrostStrategy('ReverseCycle')
  outdoor_vrf_unit.autosizeResistiveDefrostHeaterCapacity
  outdoor_vrf_unit.setPipingCorrectionFactorforHeightinHeatingModeCoefficient(-0.00019231)
  outdoor_vrf_unit.setPipingCorrectionFactorforHeightinCoolingModeCoefficient(-0.00019231)
  outdoor_vrf_unit.setMinimumOutdoorTemperatureinHeatRecoveryMode(-5.0)
  outdoor_vrf_unit.setMaximumOutdoorTemperatureinHeatRecoveryMode(26.2)
  outdoor_vrf_unit.setInitialHeatRecoveryCoolingCapacityFraction(0.5)
  outdoor_vrf_unit.setHeatRecoveryCoolingCapacityTimeConstant(0.15)
  outdoor_vrf_unit.setInitialHeatRecoveryCoolingEnergyFraction(1.0)
  outdoor_vrf_unit.setHeatRecoveryCoolingEnergyTimeConstant(0.0)
  outdoor_vrf_unit.setInitialHeatRecoveryHeatingCapacityFraction(1.0)
  outdoor_vrf_unit.setHeatRecoveryHeatingCapacityTimeConstant(0.15)
  outdoor_vrf_unit.setInitialHeatRecoveryHeatingEnergyFraction(1.0)
  outdoor_vrf_unit.setHeatRecoveryCoolingEnergyTimeConstant(0.0)
  outdoor_vrf_unit.setMinimumHeatPumpPartLoadRatio(0.5)
  outdoor_vrf_unit.setCondenserType(condenser_type)
  outdoor_vrf_unit.setCrankcaseHeaterPowerperCompressor(1.0e-6)
  heat_defrost_eir_ft = nil
  if ecm_name
    search_criteria = {}
    search_criteria['name'] = 'Mitsubishi_Hyper_Heating_VRF_Outdoor_Unit'
    props = model_find_object(standards_data['tables']['heat_pump_heating_ecm']['table'], search_criteria, 1.0)
    heat_defrost_eir_ft = model_add_curve(model, props['heat_defrost_eir_ft'])
  end
  if heat_defrost_eir_ft
    outdoor_vrf_unit.setDefrostEnergyInputRatioModifierFunctionofTemperatureCurve(heat_defrost_eir_ft)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{outdoor_vrf_unit.name}, cannot find heat_defrost_eir_ft curve, will not be set.")
  end

  return outdoor_vrf_unit
end

#add_zone_eqpt(model:, airloop:, zones:, outdoor_unit:, zone_diffuser_type:, zone_htg_eqpt_type:, zone_supp_htg_eqpt_type:, zone_clg_eqpt_type:, zone_fan_type:) ⇒ Object

add zonal heating and cooling equipment



910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 910

def add_zone_eqpt(model:,
                  airloop:,
                  zones:,
                  outdoor_unit:,
                  zone_diffuser_type:,
                  zone_htg_eqpt_type:,
                  zone_supp_htg_eqpt_type:,
                  zone_clg_eqpt_type:,
                  zone_fan_type:)

  always_on = model.alwaysOnDiscreteSchedule
  zones.sort.each do |zone|
    # during the first call to this method for a zone, the diffuser type has to be specified if there is an air loop serving the zone

    if zone_diffuser_type
      zone.sizingZone.setZoneCoolingDesignSupplyAirTemperature(13.0)
      zone.sizingZone.setZoneHeatingDesignSupplyAirTemperature(43.0)
      zone.sizingZone.setZoneCoolingSizingFactor(1.1)
      zone.sizingZone.setZoneHeatingSizingFactor(1.3)
      diffuser = create_zone_diffuser(model, zone_diffuser_type, zone)
      airloop.removeBranchForZone(zone)
      airloop.addBranchForZone(zone, diffuser.to_StraightComponent)
    end
    clg_eqpt = create_zone_clg_eqpt(model, zone_clg_eqpt_type)
    htg_eqpt = create_zone_htg_eqpt(model, zone_htg_eqpt_type)
    supp_htg_eqpt = create_zone_htg_eqpt(model, zone_supp_htg_eqpt_type)
    fan = create_air_sys_fan(model, zone_fan_type)
    # for container zonal equipment call method "create_zone_container_equipment"

    this_is_container_comp = false
    if (zone_htg_eqpt_type == 'pthp') || (zone_htg_eqpt_type == 'vrf') ||
       (zone_htg_eqpt_type.include? 'unitheater') || (zone_htg_eqpt_type.include? 'ptac')
      this_is_container_comp = true
      zone_cont_eqpt = create_zone_container_eqpt(model: model,
                                                  zone_cont_eqpt_type: zone_htg_eqpt_type,
                                                  zone_htg_eqpt: htg_eqpt,
                                                  zone_supp_htg_eqpt: supp_htg_eqpt,
                                                  zone_clg_eqpt: clg_eqpt,
                                                  zone_fan: fan)
    end
    if zone_cont_eqpt
      zone_cont_eqpt.addToThermalZone(zone)
      outdoor_unit.addTerminal(zone_cont_eqpt) if outdoor_unit
    elsif htg_eqpt && !this_is_container_comp
      htg_eqpt.addToThermalZone(zone)
    end
  end
  sys_name_zone_htg_eqpt_type = zone_htg_eqpt_type
  sys_name_zone_htg_eqpt_type = 'b-e' if zone_htg_eqpt_type == 'baseboard_electric' || zone_htg_eqpt_type == 'ptac_electric_off'
  sys_name_zone_clg_eqpt_type = zone_clg_eqpt_type
  sys_name_zone_clg_eqpt_type = 'ptac' if zone_clg_eqpt_type == 'ptac_electric_off'
  update_sys_name(airloop, zone_htg: sys_name_zone_htg_eqpt_type, zone_clg: sys_name_zone_clg_eqpt_type) if zone_diffuser_type
end

#air_sys_comps_assumptions(sys_name:, zones:, system_doas_flags:) ⇒ Object

Set assumptions for type of components for air system based on the number of zones served by the system and whether it’s a mixed or doas.



965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 965

def air_sys_comps_assumptions(sys_name:,
                              zones:,
                              system_doas_flags:)

  sys_info = {}
  sys_info['sys_abbr'] = sys_name.split('|')[0]
  sys_info['sys_vent_type'] = 'mixed'
  sys_info['sys_vent_type'] = 'doas' if system_doas_flags[sys_name.to_s]
  sys_info['sys_heat_rec_type'] = 'none'
  sys_info['sys_htg_eqpt_type'] = 'coil_electric'
  sys_info['sys_supp_htg_eqpt_type'] = 'none'
  sys_info['sys_clg_eqpt_type'] = 'coil_dx'
  if zones.size == 1
    sys_info['sys_setpoint_mgr_type'] = 'single_zone_reheat'
    sys_info['sys_setpoint_mgr_type'] = 'scheduled' if system_doas_flags[sys_name.to_s]
    sys_info['sys_supp_fan_type'] = 'constant_volume'
    sys_info['sys_ret_fan_type'] = 'none'
    sys_info['zone_diffuser_type'] = 'single_duct_uncontrolled'
  elsif zones.size > 1
    if system_doas_flags[sys_name.to_s]
      sys_info['sys_setpoint_mgr_type'] = 'scheduled'
      sys_info['sys_supp_fan_type'] = 'constant_volume'
      sys_info['sys_ret_fan_type'] = 'none'
      sys_info['zone_diffuser_type'] = 'single_duct_uncontrolled'
    else
      sys_info['sys_setpoint_mgr_type'] = 'warmest'
      sys_info['sys_supp_fan_type'] = 'variable_volume'
      sys_info['sys_ret_fan_type'] = 'variable_volume'
      sys_info['zone_diffuser_type'] = 'single_duct_vav_reheat'
    end
  end

  return sys_info
end

#airconditioner_variablerefrigerantflow_cooling_apply_efficiency_and_curves(airconditioner_variablerefrigerantflow, eqpt_name) ⇒ Object

Applies the standard cooling efficiency ratings and typical performance curves to “AirConditionerVariableRefrigerantFlow” object.



1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1812

def airconditioner_variablerefrigerantflow_cooling_apply_efficiency_and_curves(airconditioner_variablerefrigerantflow, eqpt_name)
  successfully_set_all_properties = true

  search_criteria = {}
  search_criteria['name'] = eqpt_name

  # Get the capacity

  capacity_w = airconditioner_variablerefrigerantflow_cooling_find_capacity(airconditioner_variablerefrigerantflow)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Lookup efficiencies

  props = model_find_object(standards_data['tables']['heat_pump_cooling_ecm']['table'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CAP-FT Low curve

  cool_cap_ft_low = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_cap_ft_low'])
  if cool_cap_ft_low
    airconditioner_variablerefrigerantflow.setCoolingCapacityRatioModifierFunctionofLowTemperatureCurve(cool_cap_ft_low)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_cap_ft_low curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CAP-FT boundary curve

  cool_cap_ft_boundary = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_cap_ft_boundary'])
  if cool_cap_ft_boundary
    airconditioner_variablerefrigerantflow.setCoolingCapacityRatioBoundaryCurve(cool_cap_ft_boundary)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_cap_ft_boundary curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CAP-FT high curve

  cool_cap_ft_high = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_cap_ft_high'])
  if cool_cap_ft_high
    airconditioner_variablerefrigerantflow.setCoolingCapacityRatioModifierFunctionofHighTemperatureCurve(cool_cap_ft_high)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_cap_ft_high curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FT low curve

  cool_eir_ft_low = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_eir_ft_low'])
  if cool_eir_ft_low
    airconditioner_variablerefrigerantflow.setCoolingEnergyInputRatioModifierFunctionofLowTemperatureCurve(cool_eir_ft_low)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_eir_ft_low curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FT boundary curve

  cool_eir_ft_boundary = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_eir_ft_boundary'])
  if cool_eir_ft_boundary
    airconditioner_variablerefrigerantflow.setCoolingEnergyInputRatioBoundaryCurve(cool_eir_ft_boundary)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_eir_ft_boundary curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FT high curve

  cool_eir_ft_high = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_eir_ft_high'])
  if cool_eir_ft_high
    airconditioner_variablerefrigerantflow.setCoolingEnergyInputRatioModifierFunctionofHighTemperatureCurve(cool_eir_ft_high)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_eir_ft_high curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FPLR low curve

  cool_eir_fplr_low = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_eir_fplr_low'])
  if cool_eir_fplr_low
    airconditioner_variablerefrigerantflow.setCoolingEnergyInputRatioModifierFunctionofLowPartLoadRatioCurve(cool_eir_fplr_low)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_eir_fplr_low curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FPLR high curve

  cool_eir_fplr_high = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_eir_fplr_high'])
  if cool_eir_fplr_high
    airconditioner_variablerefrigerantflow.setCoolingEnergyInputRatioModifierFunctionofHighPartLoadRatioCurve(cool_eir_fplr_high)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_eir_fplr_high curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CCR curve

  cool_ccr = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_ccr'])
  if cool_ccr
    airconditioner_variablerefrigerantflow.setCoolingCombinationRatioCorrectionFactorCurve(cool_ccr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_ccr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-PLF-FPLR curve

  cool_plf_fplr = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_plf_fplr'])
  if cool_plf_fplr
    airconditioner_variablerefrigerantflow.setCoolingPartLoadFractionCorrelationCurve(cool_plf_fplr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-PLF-FPLR curve

  cool_plf_fplr = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_plf_fplr'])
  if cool_plf_fplr
    airconditioner_variablerefrigerantflow.setCoolingPartLoadFractionCorrelationCurve(cool_plf_fplr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CAP-FPL curve

  cool_cap_fpl = model_add_curve(airconditioner_variablerefrigerantflow.model, props['cool_cap_fpl'])
  if cool_cap_fpl
    airconditioner_variablerefrigerantflow.setPipingCorrectionFactorforLengthinCoolingModeCurve(cool_cap_fpl)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_cap_fpl curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Find the minimum COP

  cop = airconditioner_variablerefrigerantflow_cooling_standard_minimum_cop(airconditioner_variablerefrigerantflow, search_criteria, false)

  # Set the efficiency values

  airconditioner_variablerefrigerantflow.setRatedCoolingCOP(cop.to_f) unless cop.nil?
end

#airconditioner_variablerefrigerantflow_cooling_find_capacity(airconditioner_variablerefrigerantflow) ⇒ Object

Find cooling capacity for “AirConditionerVariableRefrigerantFlow” object



2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2497

def airconditioner_variablerefrigerantflow_cooling_find_capacity(airconditioner_variablerefrigerantflow)
  capacity_w = nil
  if airconditioner_variablerefrigerantflow.ratedTotalCoolingCapacity.is_initialized
    capacity_w = airconditioner_variablerefrigerantflow.ratedTotalCoolingCapacity.get
  elsif airconditioner_variablerefrigerantflow.autosizedRatedTotalCoolingCapacity.is_initialized
    capacity_w = airconditioner_variablerefrigerantflow.autosizedRatedTotalCoolingCapacity.get
    airconditioner_variablerefrigerantflow.setRatedTotalCoolingCapacity(capacity_w)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name} cooling capacity is not available, cannot apply efficiency standard.")
    return 0.0
  end

  return capacity_w
end

#airconditioner_variablerefrigerantflow_cooling_standard_minimum_cop(airconditioner_variablerefrigerantflow, search_criteria, rename = false) ⇒ Object

Find minimum cooling efficiency for “AirConditionerVariableRefrigerantFlow” object



2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2341

def airconditioner_variablerefrigerantflow_cooling_standard_minimum_cop(airconditioner_variablerefrigerantflow,
                                                                        search_criteria,
                                                                        rename = false)

  capacity_w = airconditioner_variablerefrigerantflow_cooling_find_capacity(airconditioner_variablerefrigerantflow)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Look up the efficiency characteristics

  props = model_find_object(standards_data['tables']['heat_pump_cooling_ecm'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Get the minimum efficiency standards

  cop = nil

  # If specified as EER

  unless props['minimum_energy_efficiency_ratio'].nil?
    min_eer = props['minimum_energy_efficiency_ratio']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{airconditioner_variablerefrigerantflow.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # if specified as HSPF (heat pump)

  unless props['minimum_heating_seasonal_performance_factor'].nil?
    min_hspf = props['minimum_heating_seasonal_performance_factor']
    cop = hspf_to_cop_heating_with_fan(min_hspf)
    new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}HSPF"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER (heat pump)

  unless props['minimum_full_load_efficiency'].nil?
    min_eer = props['minimum_full_load_efficiency']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{airconditioner_variablerefrigerantflow.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # If specified as COP

  unless props['minimum_coefficient_of_performance_cooling'].nil?
    cop = props['minimum_coefficient_of_performance_cooling']
    new_comp_name = "#{airconditioner_variablerefrigerantflow.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{cop}COP"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # Rename

  if rename
    airconditioner_variablerefrigerantflow.setName(new_comp_name)
  end

  return cop
end

#airconditioner_variablerefrigerantflow_heating_apply_efficiency_and_curves(airconditioner_variablerefrigerantflow, eqpt_name) ⇒ Object

Applies the standard heating efficiency ratings and typical performance curves to “AirConditionerVariableRefrigerantFlow” object.



1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1949

def airconditioner_variablerefrigerantflow_heating_apply_efficiency_and_curves(airconditioner_variablerefrigerantflow, eqpt_name)
  successfully_set_all_properties = true

  search_criteria = {}
  search_criteria['name'] = eqpt_name

  # Get the capacity

  capacity_w = airconditioner_variablerefrigerantflow_heating_find_capacity(airconditioner_variablerefrigerantflow)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Lookup efficiencies

  props = model_find_object(standards_data['tables']['heat_pump_heating_ecm']['table'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heating efficiency info using #{search_criteria}, cannot apply efficiency.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FT Low curve

  heat_cap_ft_low = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_cap_ft_low'])
  if heat_cap_ft_low
    airconditioner_variablerefrigerantflow.setHeatingCapacityRatioModifierFunctionofLowTemperatureCurve(heat_cap_ft_low)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_cap_ft_low curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FT boundary curve

  heat_cap_ft_boundary = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_cap_ft_boundary'])
  if heat_cap_ft_boundary
    airconditioner_variablerefrigerantflow.setHeatingCapacityRatioBoundaryCurve(heat_cap_ft_boundary)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_cap_ft_boundary curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FT high curve

  heat_cap_ft_high = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_cap_ft_high'])
  if heat_cap_ft_high
    airconditioner_variablerefrigerantflow.setHeatingCapacityRatioModifierFunctionofHighTemperatureCurve(heat_cap_ft_high)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_cap_ft_high curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FT low curve

  heat_eir_ft_low = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_eir_ft_low'])
  if heat_eir_ft_low
    airconditioner_variablerefrigerantflow.setHeatingEnergyInputRatioModifierFunctionofLowTemperatureCurve(heat_eir_ft_low)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_eir_ft_low curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FT boundary curve

  heat_eir_ft_boundary = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_eir_ft_boundary'])
  if heat_eir_ft_boundary
    airconditioner_variablerefrigerantflow.setHeatingEnergyInputRatioBoundaryCurve(heat_eir_ft_boundary)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_eir_ft_boundary curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FT high curve

  heat_eir_ft_high = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_eir_ft_high'])
  if heat_eir_ft_high
    airconditioner_variablerefrigerantflow.setHeatingEnergyInputRatioModifierFunctionofHighTemperatureCurve(heat_eir_ft_high)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_eir_ft_high curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FPLR low curve

  heat_eir_fplr_low = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_eir_fplr_low'])
  if heat_eir_fplr_low
    airconditioner_variablerefrigerantflow.setHeatingEnergyInputRatioModifierFunctionofLowPartLoadRatioCurve(heat_eir_fplr_low)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_eir_fplr_low curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FPLR high curve

  heat_eir_fplr_high = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_eir_fplr_high'])
  if heat_eir_fplr_high
    airconditioner_variablerefrigerantflow.setHeatingEnergyInputRatioModifierFunctionofHighPartLoadRatioCurve(heat_eir_fplr_high)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_eir_fplr_high curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-HCR curve

  heat_hcr = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_hcr'])
  if heat_hcr
    airconditioner_variablerefrigerantflow.setHeatingCombinationRatioCorrectionFactorCurve(heat_hcr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_hcr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-PLF-FPLR curve

  heat_plf_fplr = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_plf_fplr'])
  if heat_plf_fplr
    airconditioner_variablerefrigerantflow.setHeatingPartLoadFractionCorrelationCurve(heat_plf_fplr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find cool_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FPL curve

  heat_cap_fpl = model_add_curve(airconditioner_variablerefrigerantflow.model, props['heat_cap_fpl'])
  if heat_cap_fpl
    airconditioner_variablerefrigerantflow.setPipingCorrectionFactorforLengthinHeatingModeCurve(heat_cap_fpl)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heat_cap_fpl curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Find the minimum COP and rename with efficiency rating

  cop = airconditioner_variablerefrigerantflow_heating_standard_minimum_cop(airconditioner_variablerefrigerantflow, search_criteria, false)

  # Set the efficiency values

  airconditioner_variablerefrigerantflow.setRatedHeatingCOP(cop.to_f) unless cop.nil?
end

#airconditioner_variablerefrigerantflow_heating_find_capacity(airconditioner_variablerefrigerantflow) ⇒ Object

Find heating capacity for “AirConditionerVariableRefrigerantFlow” object



2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2514

def airconditioner_variablerefrigerantflow_heating_find_capacity(airconditioner_variablerefrigerantflow)
  capacity_w = nil
  if airconditioner_variablerefrigerantflow.ratedTotalHeatingCapacity.is_initialized
    capacity_w = airconditioner_variablerefrigerantflow.ratedTotalHeatingCapacity.get
  elsif airconditioner_variablerefrigerantflow.autosizedRatedTotalHeatingCapacity.is_initialized
    capacity_w = airconditioner_variablerefrigerantflow.autosizedRatedTotalHeatingCapacity.get
    airconditioner_variablerefrigerantflow.setRatedTotalHeatingCapacity(capacity_w)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name} heating capacity is not available, cannot apply efficiency standard.")
    return 0.0
  end

  return capacity_w
end

#airconditioner_variablerefrigerantflow_heating_standard_minimum_cop(airconditioner_variablerefrigerantflow, search_criteria, rename = false) ⇒ Object

Find minimum heating efficiency for “AirConditionerVariableRefrigerantFlow” object



2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2403

def airconditioner_variablerefrigerantflow_heating_standard_minimum_cop(airconditioner_variablerefrigerantflow,
                                                                        search_criteria,
                                                                        rename = false)

  capacity_w = airconditioner_variablerefrigerantflow_heating_find_capacity(airconditioner_variablerefrigerantflow)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Look up the efficiency characteristics

  props = model_find_object(standards_data['tables']['heat_pump_heating_ecm'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{airconditioner_variablerefrigerantflow.name}, cannot find heating efficiency info using #{search_criteria}, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Get the minimum efficiency standards

  cop = nil

  # If specified as EER

  unless props['minimum_energy_efficiency_ratio'].nil?
    min_eer = props['minimum_energy_efficiency_ratio']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{airconditioner_variablerefrigerantflow.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # if specified as HSPF (heat pump)

  unless props['minimum_heating_seasonal_performance_factor'].nil?
    min_hspf = props['minimum_heating_seasonal_performance_factor']
    cop = hspf_to_cop_heating_with_fan(min_hspf)
    new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}HSPF"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER (heat pump)

  unless props['minimum_full_load_efficiency'].nil?
    min_eer = props['minimum_full_load_efficiency']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{airconditioner_variablerefrigerantflow.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # If specified as COP

  unless props['minimum_coefficient_of_performance_heating'].nil?
    cop = props['minimum_coefficient_of_performance_heating']
    new_comp_name = "#{airconditioner_variablerefrigerantflow.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{cop}COP"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # Rename

  if rename
    airconditioner_variablerefrigerantflow.setName(new_comp_name)
  end

  return cop
end

#apply_efficiency_ecm_hs08_ccashp_vrf(model, air_sys_eqpt_type: 'ccashp') ⇒ Object

Apply efficiencies and performance curves for ECM ‘hs08_ccashp_vrf’



571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 571

def apply_efficiency_ecm_hs08_ccashp_vrf(model, air_sys_eqpt_type: 'ccashp')
  # Use same performance data as ECM 'hs09_ccashpsys' for air system

  if air_sys_eqpt_type == 'ccashp'
    apply_efficiency_ecm_hs09_ccashp_baseboard(model)
  elsif air_sys_eqpt_type == 'ashp'
    apply_efficiency_ecm_hs12_ashp_baseboard(model)
  end
  # Apply efficiency and curves for VRF units

  eqpt_name = 'Mitsubishi_Hyper_Heating_VRF_Outdoor_Unit'
  model.getAirConditionerVariableRefrigerantFlows.sort.each do |vrf_unit|
    airconditioner_variablerefrigerantflow_cooling_apply_efficiency_and_curves(vrf_unit, eqpt_name)
    airconditioner_variablerefrigerantflow_heating_apply_efficiency_and_curves(vrf_unit, eqpt_name)
  end
  # Set fan size of VRF terminal units

  fan_power_per_flow_rate = 150.0 # based on Mitsubishi data: 100 low and 200 high (W-s/m3)

  model.getZoneHVACTerminalUnitVariableRefrigerantFlows.each do |iunit|
    fan = iunit.supplyAirFan.to_FanOnOff.get
    fan_pr_rise = fan_power_per_flow_rate * (fan.fanEfficiency * fan.motorEfficiency)
    fan.setPressureRise(fan_pr_rise)
  end
  # Set fan size of unit heaters

  model.getZoneHVACUnitHeaters.each do |iunit|
    fan = iunit.supplyAirFan.to_FanConstantVolume.get
    fan_pr_rise = fan_power_per_flow_rate * (fan.fanEfficiency * fan.motorEfficiency)
    fan.setPressureRise(fan_pr_rise)
  end
end

#apply_efficiency_ecm_hs09_ccashp_baseboard(model) ⇒ Object

Apply efficiencies and performance curves for ECM “hs09_ccashp_baseboard”



1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1090

def apply_efficiency_ecm_hs09_ccashp_baseboard(model)
  # fraction of electric backup heating coil capacity assigned to dx heating coil

  fr_backup_coil_cap_as_dx_coil_cap = 0.5
  model.getAirLoopHVACs.sort.each do |isys|
    clg_dx_coil = nil
    htg_dx_coil = nil
    backup_coil = nil
    fans = []
    # Find the components on the air loop

    isys.supplyComponents.sort.each do |icomp|
      if icomp.to_CoilCoolingDXVariableSpeed.is_initialized
        clg_dx_coil = icomp.to_CoilCoolingDXVariableSpeed.get
      elsif icomp.to_CoilHeatingDXVariableSpeed.is_initialized
        htg_dx_coil = icomp.to_CoilHeatingDXVariableSpeed.get
      elsif icomp.to_CoilHeatingElectric.is_initialized
        backup_coil = icomp.to_CoilHeatingElectric.get
      elsif icomp.to_CoilHeatingGas.is_initialized
        backup_coil = icomp.to_CoilHeatingGas.get
      elsif icomp.to_FanConstantVolume.is_initialized
        fans << icomp.to_FanConstantVolume.get
      elsif icomp.to_FanVariableVolume.is_initialized
        fans << icomp.to_FanVariableVolume.get
      end
    end
    if clg_dx_coil && htg_dx_coil && backup_coil
      clg_dx_coil_init_name = get_hvac_comp_init_name(clg_dx_coil, false)
      clg_dx_coil.setName(clg_dx_coil_init_name)
      if clg_dx_coil.autosizedGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.is_initialized
        max_pd = 0.0
        supply_fan = nil
        fans.each do |fan|
          if fan.pressureRise.to_f > max_pd
            max_pd = fan.pressureRise.to_f
            supply_fan = fan # assume supply fan has higher pressure drop

          end
        end
        # There is an error in EnergyPlus in the estimated capacity of the coil "CoilCoolingDXVariableSpeed".

        # Here the capacity reported by OS is adjusted to estimate an appropriate capacity for the cooling coil.

        # The autosized capacity is corrected for the actual fan flow rate and fan power.

        if supply_fan.autosizedMaximumFlowRate.is_initialized 
          fan_max_afr = supply_fan.autosizedMaximumFlowRate.to_f
        elsif supply_fan.maximumFlowRate.is_initialized
          fan_max_afr = supply_fan.maximumFlowRate.to_f
        else
          raise "Fan flow rate is undefined for fan #{supply_fan.name.to_s}"
        end
        if clg_dx_coil.autosizedRatedAirFlowRateAtSelectedNominalSpeedLevel.is_initialized
          clg_dx_coil_afr = clg_dx_coil.autosizedRatedAirFlowRateAtSelectedNominalSpeedLevel.to_f
        elsif clg_dx_coil.ratedAirFlowRateAtSelectedNominalSpeedLevel.is_initialized
           clg_dx_coil_afr = clg_dx_coil.ratedAirFlowRateAtSelectedNominalSpeedLevel.to_f
        else
          raise "Rated air flow rate at selected nominal speed level is undefined for coil #{clg_dx_coil.name.to_s}"
        end
        fan_power = fan_max_afr * max_pd / supply_fan.fanTotalEfficiency.to_f
        clg_dx_coil_cap = clg_dx_coil.autosizedGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.to_f *
                          fan_max_afr / clg_dx_coil_afr + fan_power / clg_dx_coil.speeds.last.referenceUnitGrossRatedSensibleHeatRatio.to_f
      elsif clg_dx_coil.grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.is_initialized
        clg_dx_coil_cap = clg_dx_coil.grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.to_f
      else
        raise "Rated total cooling capacity at selected nominal speed is undefined for coil #{clg_dx_coil.name.to_s}"
      end
      htg_dx_coil_init_name = get_hvac_comp_init_name(htg_dx_coil, false)
      htg_dx_coil.setName(htg_dx_coil_init_name)
      if backup_coil.autosizedNominalCapacity.is_initialized
         backup_coil_cap = backup_coil.autosizedNominalCapacity.to_f
      elsif backup_coil.nominalCapacity.is_initialized
         backup_coil_cap = backup_coil.nominalCapacity.to_f
      else
        raise "Nominal capacity is undefiled for coil #{backup_coil.name.to_s}"
      end
      # Set the DX capacities to the maximum of the fraction of the backup coil capacity or the cooling capacity needed

      dx_cap = fr_backup_coil_cap_as_dx_coil_cap * backup_coil_cap
      if dx_cap < clg_dx_coil_cap then dx_cap = clg_dx_coil_cap end
      clg_dx_coil.setGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel(dx_cap)
      htg_dx_coil.setRatedHeatingCapacityAtSelectedNominalSpeedLevel(dx_cap)
      # Assign performance curves and COPs

      eqpt_name = 'Mitsubishi_Hyper_Heating_VRF_Outdoor_Unit RTU'
      coil_cooling_dx_variable_speed_apply_efficiency_and_curves(clg_dx_coil, eqpt_name)
      coil_heating_dx_variable_speed_apply_efficiency_and_curves(htg_dx_coil, eqpt_name)
    end
  end
end

#apply_efficiency_ecm_hs11_ashp_pthp(model) ⇒ Object

Apply efficiencies and performance curves for ECM “hs11_ashp_pthp”



1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1269

def apply_efficiency_ecm_hs11_ashp_pthp(model)
  fr_backup_coil_cap_as_dx_coil_cap = 0.5 # fraction of electric backup heating coil capacity assigned to dx heating coil

  apply_efficiency_ecm_hs12_ashp_baseboard(model)
  pthp_eqpt_name = 'HS11_PTHP'
  model.getAirLoopHVACs.sort.each do |isys|
    isys.thermalZones.each do |zone|
      clg_dx_coil = nil
      htg_dx_coil = nil
      backup_coil = nil
      fan = nil
      zone.equipment.sort.each do |icomp|
        if icomp.to_ZoneHVACPackagedTerminalHeatPump.is_initialized
          if icomp.to_ZoneHVACPackagedTerminalHeatPump.get.coolingCoil.to_CoilCoolingDXSingleSpeed.is_initialized
            clg_dx_coil = icomp.to_ZoneHVACPackagedTerminalHeatPump.get.coolingCoil.to_CoilCoolingDXSingleSpeed.get
          end
          if icomp.to_ZoneHVACPackagedTerminalHeatPump.get.heatingCoil.to_CoilHeatingDXSingleSpeed.is_initialized
            htg_dx_coil = icomp.to_ZoneHVACPackagedTerminalHeatPump.get.heatingCoil.to_CoilHeatingDXSingleSpeed.get
          end
          if icomp.to_ZoneHVACPackagedTerminalHeatPump.get.supplementalHeatingCoil.to_CoilHeatingElectric.is_initialized
            backup_coil = icomp.to_ZoneHVACPackagedTerminalHeatPump.get.supplementalHeatingCoil.to_CoilHeatingElectric.get
          end
          if icomp.to_ZoneHVACPackagedTerminalHeatPump.get.supplyAirFan.to_FanOnOff.is_initialized
            fan = icomp.to_ZoneHVACPackagedTerminalHeatPump.get.supplyAirFan.to_FanOnOff.get
          end
        end
        if clg_dx_coil && htg_dx_coil && backup_coil && fan
          clg_dx_coil_init_name = get_hvac_comp_init_name(clg_dx_coil, false)
          clg_dx_coil.setName(clg_dx_coil_init_name)
          if clg_dx_coil.autosizedRatedTotalCoolingCapacity.is_initialized
            clg_dx_coil_cap = clg_dx_coil.autosizedRatedTotalCoolingCapacity.to_f
          elsif clg_dx_coil.ratedTotalCoolingCapacity.is_initialized
            clg_dx_coil_cap = clg_dx_coil.ratedTotalCoolingCapacity.to_f
          else
            raise "The total cooling capacity is undefined for coil #{clg_dx_coil_cap.name.to_s}"
          end
          htg_dx_coil_init_name = get_hvac_comp_init_name(htg_dx_coil, true)
          htg_dx_coil.setName(htg_dx_coil_init_name)
          if backup_coil.autosizedNominalCapacity.is_initialized
            backup_coil_cap = backup_coil.autosizedNominalCapacity.to_f
          elsif backup_coil.nominalCapacity.is_initialized
            backup_coil_cap = backup_coil.nominalCapacity.to_f
          else
            raise "The nominal capacity is undefined for coil #{backup_coil.name.to_s}"
          end
          # Set the DX capacities to the maximum of the fraction of the backup coil capacity or the cooling capacity needed

          dx_cap = fr_backup_coil_cap_as_dx_coil_cap * backup_coil_cap
          if dx_cap < clg_dx_coil_cap then dx_cap = clg_dx_coil_cap end
          # clg_dx_coil.setRatedTotalCoolingCapacity(dx_cap)

          # htg_dx_coil.setRatedTotalHeatingCapacity(dx_cap)

          # assign performance curves and COPs

          coil_cooling_dx_single_speed_apply_efficiency_and_curves(clg_dx_coil, pthp_eqpt_name)
          coil_heating_dx_single_speed_apply_efficiency_and_curves(htg_dx_coil, pthp_eqpt_name)
          # Set fan power

          fan_power_per_flow_rate = 150.0 # based on Mitsubishi data: 100 low and 200 high (W-s/m3)

          fan_pr_rise = fan_power_per_flow_rate * (fan.fanEfficiency * fan.motorEfficiency)
          fan.setPressureRise(fan_pr_rise)
        end
      end
    end
  end
end

#apply_efficiency_ecm_hs12_ashp_baseboard(model) ⇒ Object

Apply efficiencies and performance curves for ECM “hs12_ashp_baseboard”



1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1434

def apply_efficiency_ecm_hs12_ashp_baseboard(model)
  fr_backup_coil_cap_as_dx_coil_cap = 0.5 # fraction of electric backup heating coil capacity assigned to dx heating coil

  ashp_eqpt_name = 'NECB2015_ASHP'
  model.getAirLoopHVACs.sort.each do |isys|
    clg_dx_coil = nil
    htg_dx_coil = nil
    backup_coil = nil
    # Find the coils on the air loop

    isys.supplyComponents.sort.each do |icomp|
      if icomp.to_CoilCoolingDXSingleSpeed.is_initialized
        clg_dx_coil = icomp.to_CoilCoolingDXSingleSpeed.get
      elsif icomp.to_CoilHeatingDXSingleSpeed.is_initialized
        htg_dx_coil = icomp.to_CoilHeatingDXSingleSpeed.get
      elsif icomp.to_CoilHeatingElectric.is_initialized
        backup_coil = icomp.to_CoilHeatingElectric.get
      elsif icomp.to_CoilHeatingGas.is_initialized
        backup_coil = icomp.to_CoilHeatingGas.get
      end
    end
    if clg_dx_coil && htg_dx_coil && backup_coil
      # update names of dx coils

      clg_dx_coil_init_name = get_hvac_comp_init_name(clg_dx_coil, false)
      clg_dx_coil.setName(clg_dx_coil_init_name)
      if clg_dx_coil.autosizedRatedTotalCoolingCapacity.is_initialized
        clg_dx_coil_cap = clg_dx_coil.autosizedRatedTotalCoolingCapacity.to_f
      elsif clg_dx_coil.ratedTotalCoolingCapacity.is_initialized
        clg_dx_coil_cap = clg_dx_coil.ratedTotalCoolingCapacity.to_f
      else
        raise "Rated total cooling capacity is undefined for coil #{clg_dx_coil.name.to_s}"
      end
      htg_dx_coil_init_name = get_hvac_comp_init_name(htg_dx_coil, true)
      htg_dx_coil.setName(htg_dx_coil_init_name)
      if backup_coil.autosizedNominalCapacity.is_initialized
        backup_coil_cap = backup_coil.autosizedNominalCapacity.to_f
      elsif backup_coil.nominalCapacity.is_initialized
        backup_coil_cap = backup_coil.nominalCapacity.to_f
      else
        raise "Nominal capacity is undefined for coil #{backup_coil.name.to_s}"
      end
      # set the DX capacities to the maximum of the fraction of the backup coil capacity or the cooling capacity needed

      dx_cap = fr_backup_coil_cap_as_dx_coil_cap * backup_coil_cap
      if dx_cap < clg_dx_coil_cap then dx_cap = clg_dx_coil_cap end
      clg_dx_coil.setRatedTotalCoolingCapacity(dx_cap)
      htg_dx_coil.setRatedTotalHeatingCapacity(dx_cap)
      # assign performance curves and COPs

      coil_cooling_dx_single_speed_apply_efficiency_and_curves(clg_dx_coil, ashp_eqpt_name)
      coil_heating_dx_single_speed_apply_efficiency_and_curves(htg_dx_coil, ashp_eqpt_name)
    end
  end
end

#apply_efficiency_ecm_hs13_ashp_vrf(model) ⇒ Object

Apply efficiencies and performance curves for ECM “hs12_ashp_vrf”



1508
1509
1510
1511
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1508

def apply_efficiency_ecm_hs13_ashp_vrf(model)
  # call method for ECM hs08 with ASHP in air system

  apply_efficiency_ecm_hs08_ccashp_vrf(model, air_sys_eqpt_type: 'ashp')
end

#apply_erv_ecm(model:, erv_package: nil) ⇒ Object

This method will add a skeleton erv to all air loops if requested.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/openstudio-standards/standards/necb/ECMS/erv.rb', line 3

def apply_erv_ecm(model:, erv_package: nil)
  # If erv is nil.. do nothing.

  return if erv_package.nil? || erv_package == 'none' || erv_package == 'NECB_Default'

  erv_info = @standards_data['tables']['erv']['table'].detect { |item| item['erv_name'] == erv_package }
  # Check if we were able to get data.

  if erv_info.nil?
    # Get name of ERVs in erv.json.

    valid = @standards_data['tables']['erv']['table'].map { |x| x['erv_name'] }
    # tell user.

    raise("ERV package name #{erv_package} does not exist. must be #{valid} /n Stopping.")
  end

  # remove all existing ERVs

  model.getHeatExchangerAirToAirSensibleAndLatents.each(&:remove) if erv_info['application'] == 'Add_ERVs_To_All_Airloops'
  # add ervs

  # Adds default erv to all air_loops. This will be changed in the set efficiency methods.

  model.getAirLoopHVACs.each { |air_loop| air_loop_hvac_apply_energy_recovery_ventilator(air_loop, nil) } if erv_info['application'] == 'Add_ERVs_To_All_Airloops'
end

#apply_erv_ecm_efficiency(model:, erv_package: nil) ⇒ Object

This method will set the properties of the ERV that was added above. Must be run after the standard efficiency is complete as this will overwrite those values. See data/erv.json to view/add different erv packages.



25
26
27
28
29
30
31
# File 'lib/openstudio-standards/standards/necb/ECMS/erv.rb', line 25

def apply_erv_ecm_efficiency(model:, erv_package: nil)
  # If erv is nil.. do nothing.

  return if erv_package.nil? || erv_package == 'none' || erv_package == 'NECB_Default'

  # This calls the NECB2011 implementation of the method.

  model.getHeatExchangerAirToAirSensibleAndLatents.each { |erv| heat_exchanger_air_to_air_sensible_and_latent_apply_effectiveness(erv, erv_package) }
end

#apply_nv(model:, nv_type:, nv_opening_fraction:, nv_temp_out_min:, nv_delta_temp_in_out:) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/openstudio-standards/standards/necb/ECMS/nv.rb', line 2

def apply_nv(model:, nv_type:, nv_opening_fraction:, nv_temp_out_min:, nv_delta_temp_in_out:)
  ##### If any of users' inputs are nil/false/none, do nothing.

  ##### If users' input for 'nv_type' is 'NECB_Default', do nothing.

  ##### If any of users' inputs for nv_opening_fraction/nv_temp_out_min/nv_delta_temp_in_out is 'NECB_Default', use default values as defined here.

  return if nv_type.nil? || nv_type == false || nv_type == 'none' || nv_type == 'NECB_Default'
  return if nv_opening_fraction.nil? || nv_opening_fraction == false || nv_opening_fraction == 'none'
  return if nv_temp_out_min.nil? || nv_temp_out_min == false || nv_temp_out_min == 'none'
  return if nv_delta_temp_in_out.nil? || nv_delta_temp_in_out == false || nv_delta_temp_in_out == 'none'

  ##### Convert a string to a float (except for nv_type)

  if nv_opening_fraction.instance_of?(String) && nv_opening_fraction != 'NECB_Default'
    nv_opening_fraction = nv_opening_fraction.to_f
  end
  if nv_temp_out_min.instance_of?(String) && nv_temp_out_min != 'NECB_Default'
    nv_temp_out_min = nv_temp_out_min.to_f
  end
  if nv_delta_temp_in_out.instance_of?(String) && nv_delta_temp_in_out != 'NECB_Default'
    nv_delta_temp_in_out = nv_delta_temp_in_out.to_f
  end

  ##### Set default nv_opening_fraction as 0.1

  if nv_opening_fraction == 'NECB_Default'
    nv_opening_fraction = 0.1
  end
  ##### Set default nv_temp_out_min as 13.0

  if nv_temp_out_min == 'NECB_Default'
    nv_temp_out_min = 13.0 # Note: 13.0 is based on inputs from Michel Tardif re a real school in QC

  end
  ##### Set default nv_delta_temp_in_out as 1.0

  if nv_delta_temp_in_out == 'NECB_Default'
    nv_delta_temp_in_out = 1.0 # Note: 1.0 is based on inputs from Michel Tardif re a real school in QC

  end

  setpoint_adjustment_for_nv = 2.0 # This is to adjust heating and cooling setpoint temperature as min and max indoor temperature to have NV


  model.getZoneHVACEquipmentLists.sort.each do |zone_hvac_equipment_list|
    thermal_zone = zone_hvac_equipment_list.thermalZone

    thermal_zone.spaces.sort.each do |space|
      number_of_windows = 0.0

      ##### Gather OA per person and floor area of the space from the osm file

      outdoor_air = space.designSpecificationOutdoorAir.get
      outdoor_air_flow_per_person = outdoor_air.outdoorAirFlowperPerson
      outdoor_air_flow_per_floor_area = outdoor_air.outdoorAirFlowperFloorArea

      ##### Get heating/cooling setpoint temperature schedules from the osm file

      # These schedules are used for min/max Tin schedules under the objects of "ZoneVentilation:DesignFlowRate" and "ZoneVentilation:WindandStackOpenArea".

      # Note: as per E+ I/O Ref.: "If the user enters a valid schedule name, the minimum/maximum temperature values specified in this schedule will override the constant value specified in the Minimum/Maximum Indoor Temperature field." under the objects of "ZoneVentilation:DesignFlowRate" and "ZoneVentilation:WindandStackOpenArea".

      if thermal_zone.thermostat.is_initialized
        if thermal_zone.thermostat.get.to_ThermostatSetpointDualSetpoint.is_initialized
          if thermal_zone.thermostat.get.to_ThermostatSetpointDualSetpoint.get.heatingSetpointTemperatureSchedule.is_initialized ||
             thermal_zone.thermostat.get.to_ThermostatSetpointDualSetpoint.get.coolingSetpointTemperatureSchedule.is_initialized
            zone_thermostat = thermal_zone.thermostatSetpointDualSetpoint.get
            zone_clg_thermostat_sch = zone_thermostat.coolingSetpointTemperatureSchedule.get
            zone_htg_thermostat_sch = zone_thermostat.heatingSetpointTemperatureSchedule.get

            ##### Create schedule for max Tin to have NV on the basis of cooling setpoint temperature for default day

            zone_clg_thermostat_sch_name = zone_clg_thermostat_sch.name
            zone_clg_sp_schedule = zone_clg_thermostat_sch.to_ScheduleRuleset.get

            max_Tin_schedule = zone_clg_sp_schedule.clone(model).to_ScheduleRuleset.get
            max_Tin_schedule.setName('natural_ventilation_max_Tin_schedule')
            ## default days/weekdays

            max_Tin_schedule_defaultDay = max_Tin_schedule.defaultDaySchedule
            max_Tin_schedule_defaultDay.setName('natural_ventilation_max_Tin_schedule_defaultDay')
            max_Tin_schedule_defaultDay_times = max_Tin_schedule_defaultDay.times
            max_Tin_schedule_defaultDay_values = max_Tin_schedule_defaultDay.values
            max_Tin_schedule_defaultDay_values_adjusted = max_Tin_schedule_defaultDay_values.map { |i| i + setpoint_adjustment_for_nv }
            i = 0.0
            max_Tin_schedule_defaultDay_times.each do |time|
              max_Tin_schedule_defaultDay.addValue(time, max_Tin_schedule_defaultDay_values_adjusted[i])
              i += 1.0
            end

            ##### Create schedule for min Tin to have NV on the basis of cooling setpoint temperature for default day

            zone_htg_thermostat_sch_name = zone_htg_thermostat_sch.name
            zone_htg_sp_schedule = zone_htg_thermostat_sch.to_ScheduleRuleset.get
            min_Tin_schedule = zone_htg_sp_schedule.clone(model).to_ScheduleRuleset.get
            min_Tin_schedule.setName('natural_ventilation_min_Tin_schedule')
            ## default days/weekdays

            min_Tin_schedule_defaultDay = min_Tin_schedule.defaultDaySchedule
            min_Tin_schedule_defaultDay.setName('natural_ventilation_min_Tin_schedule_defaultDay')
            min_Tin_schedule_defaultDay_times = min_Tin_schedule_defaultDay.times
            min_Tin_schedule_defaultDay_values = min_Tin_schedule_defaultDay.values
            min_Tin_schedule_defaultDay_values_adjusted = min_Tin_schedule_defaultDay_values.map { |index| index - setpoint_adjustment_for_nv }
            i = 0.0
            min_Tin_schedule_defaultDay_times.each do |time|
              min_Tin_schedule_defaultDay.addValue(time, min_Tin_schedule_defaultDay_values_adjusted[i])
              i += 1.0
            end
          end
        end
      end

      ##### Calculate how many windows a space has.

      # The total number of windows is used to divide OA/person and OA/FloorArea of the space by it (i.e. number of windows).

      # In this way, NV-driven OA in each space would be avoided to be more than required.

      space.surfaces.sort.each do |surface|
        surface.subSurfaces.sort.each do |subsurface|
          if (subsurface.subSurfaceType == 'OperableWindow' || subsurface.subSurfaceType == 'FixedWindow') && subsurface.outsideBoundaryCondition == 'Outdoors'
            number_of_windows += 1.0
          end
        end
      end
      oa_per_person_normalized_by_number_of_windows = outdoor_air_flow_per_person / number_of_windows
      oa_per_floor_area_normalized_by_number_of_windows = outdoor_air_flow_per_floor_area / number_of_windows

      ##### Add NV in each space that has window(s) using two objects: "ZoneVentilation:DesignFlowRate" and "ZoneVentilation:WindandStackOpenArea"

      space.surfaces.sort.each do |surface|
        surface.subSurfaces.sort.each do |subsurface|
          if (subsurface.subSurfaceType == 'OperableWindow' || subsurface.subSurfaceType == 'FixedWindow') && subsurface.outsideBoundaryCondition == 'Outdoors'
            window_azimuth_deg = OpenStudio.convert(subsurface.azimuth, 'rad', 'deg').get
            window_area = subsurface.netArea

            ##### Define a constant schedule for operable windows

            operable_window_schedule = OpenStudio::Model::ScheduleConstant.new(model)
            operable_window_schedule.setName('operable_window_schedule_constant')
            operable_window_schedule.setScheduleTypeLimits(BTAP::Resources::Schedules::StandardScheduleTypeLimits.get_on_off(model))

            ##### Add a "ZoneVentilation:DesignFlowRate" object for NV to set OA per person.

            zn_vent_design_flow_rate_1 = OpenStudio::Model::ZoneVentilationDesignFlowRate.new(model)
            zn_vent_design_flow_rate_1.setDesignFlowRateCalculationMethod('Flow/Person')
            zn_vent_design_flow_rate_1.setFlowRateperPerson(oa_per_person_normalized_by_number_of_windows)
            zn_vent_design_flow_rate_1.setVentilationType('Natural')
            zn_vent_design_flow_rate_1.setMinimumIndoorTemperatureSchedule(min_Tin_schedule)
            zn_vent_design_flow_rate_1.setMaximumIndoorTemperatureSchedule(max_Tin_schedule)
            zn_vent_design_flow_rate_1.setMinimumOutdoorTemperature(nv_temp_out_min)
            zn_vent_design_flow_rate_1.setMaximumOutdoorTemperatureSchedule(max_Tin_schedule)
            zn_vent_design_flow_rate_1.setDeltaTemperature(nv_delta_temp_in_out) # E+ I/O Ref.: "This is the temperature difference between the indoor and outdoor air dry-bulb temperatures below which ventilation is shutoff."

            zone_hvac_equipment_list.addEquipment(zn_vent_design_flow_rate_1)

            ##### Add another "ZoneVentilation:DesignFlowRate" object for NV to set OA per floor area.

            zn_vent_design_flow_rate_2 = OpenStudio::Model::ZoneVentilationDesignFlowRate.new(model)
            zn_vent_design_flow_rate_2.setDesignFlowRateCalculationMethod('Flow/Area')
            zn_vent_design_flow_rate_2.setFlowRateperZoneFloorArea(oa_per_floor_area_normalized_by_number_of_windows)
            zn_vent_design_flow_rate_2.setVentilationType('Natural')
            zn_vent_design_flow_rate_2.setMinimumIndoorTemperatureSchedule(min_Tin_schedule)
            zn_vent_design_flow_rate_2.setMaximumIndoorTemperatureSchedule(max_Tin_schedule)
            zn_vent_design_flow_rate_2.setMinimumOutdoorTemperature(nv_temp_out_min)
            zn_vent_design_flow_rate_2.setMaximumOutdoorTemperatureSchedule(max_Tin_schedule)
            zn_vent_design_flow_rate_2.setDeltaTemperature(nv_delta_temp_in_out)
            zone_hvac_equipment_list.addEquipment(zn_vent_design_flow_rate_2)

            ##### Add the "ZoneVentilation:WindandStackOpenArea" for NV.

            # Note: it has been assumed that 'Opening Effectiveness' and 'Discharge Coefficient for Opening' are autocalculated (which are the default assumptions).

            zn_vent_wind_and_stack = OpenStudio::Model::ZoneVentilationWindandStackOpenArea.new(model)
            zn_vent_wind_and_stack.setOpeningArea(window_area * nv_opening_fraction)
            zn_vent_wind_and_stack.setOpeningAreaFractionSchedule(operable_window_schedule)
            # (Ref: E+ I/O) The Effective Angle value "is used to calculate the angle between the wind direction and the opening outward normal to determine the opening effectiveness values when the input field Opening Effectiveness = Autocalculate."

            # (Ref: E+ I/O) "Effective Angle is the angle in degrees counting from the North clockwise to the opening outward normal."

            zn_vent_wind_and_stack.setEffectiveAngle(window_azimuth_deg)
            zn_vent_wind_and_stack.setMinimumIndoorTemperatureSchedule(min_Tin_schedule)
            zn_vent_wind_and_stack.setMaximumIndoorTemperatureSchedule(max_Tin_schedule)
            zn_vent_wind_and_stack.setMinimumOutdoorTemperature(nv_temp_out_min)
            zn_vent_wind_and_stack.setMaximumOutdoorTemperatureSchedule(max_Tin_schedule)
            zn_vent_wind_and_stack.setDeltaTemperature(nv_delta_temp_in_out)
            zone_hvac_equipment_list.addEquipment(zn_vent_wind_and_stack)
            # if (subsurface.subSurfaceType == 'OperableWindow' || subsurface.subSurfaceType == 'FixedWindow') && subsurface.outsideBoundaryCondition == 'Outdoors'

          end
          # surface.subSurfaces.sort.each do |subsurface|

        end
        # space.surfaces.sort.each do |surface|

      end
      # thermal_zone.spaces.sort.each do |space|

    end
    # model.getZoneHVACEquipmentLists.sort.each do |zone_hvac_equipment_list|

  end
  ##### Add AvailabilityManagerHybridVentilation to "prevents simultaneous natural ventilation and HVAC system operation" (Ref: E+ I/O)

  model.getAirLoopHVACs.sort.each do |air_loop|
    air_loop.availabilityManagers.sort.each do |avail_mgr|
      if avail_mgr.to_AvailabilityManagerHybridVentilation.empty?
        avail_mgr_hybr_vent = OpenStudio::Model::AvailabilityManagerHybridVentilation.new(model)
        avail_mgr_hybr_vent.setMinimumOutdoorTemperature(nv_temp_out_min) # Note: since "Ventilation Control Mode" is by default set to "Temperature (i.e. 1)", only min and max Tout are needed. (see E+ I/O Ref.)  #Note: Tout_min is to avoid overcooling (see E+ I/O Ref).

        avail_mgr_hybr_vent.setMaximumOutdoorTemperature(30.0) # Note: the AvailabilityManagerHybridVentilation obj does not have a schedule field for Tout, so it has been set to a fixed value of 30C.

        air_loop.addAvailabilityManager(avail_mgr_hybr_vent)
      end
    end
  end
end

#apply_pv_ground(model:, pv_ground_type:, pv_ground_total_area_pv_panels_m2:, pv_ground_tilt_angle:, pv_ground_azimuth_angle:, pv_ground_module_description:) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/openstudio-standards/standards/necb/ECMS/pv_ground.rb', line 2

def apply_pv_ground(model:, pv_ground_type:, pv_ground_total_area_pv_panels_m2:, pv_ground_tilt_angle:, pv_ground_azimuth_angle:, pv_ground_module_description:)
  ##### Remove leading or trailing whitespace in case users add them in inputs

  if pv_ground_total_area_pv_panels_m2.instance_of?(String)
    pv_ground_total_area_pv_panels_m2 = pv_ground_total_area_pv_panels_m2.strip
  end
  if pv_ground_tilt_angle.instance_of?(String)
    pv_ground_tilt_angle = pv_ground_tilt_angle.strip
  end
  if pv_ground_azimuth_angle.instance_of?(String)
    pv_ground_azimuth_angle = pv_ground_azimuth_angle.strip
  end

  ##### If any of users' inputs are nil/false do nothing.

  return if pv_ground_type.nil? || pv_ground_type == false || pv_ground_type == 'none' || pv_ground_type == 'NECB_Default'
  return if pv_ground_total_area_pv_panels_m2 == nil? || pv_ground_total_area_pv_panels_m2 == false || pv_ground_total_area_pv_panels_m2 == 'none'
  return if pv_ground_tilt_angle == nil? || pv_ground_tilt_angle == false || pv_ground_tilt_angle == 'none'
  return if pv_ground_azimuth_angle == nil? || pv_ground_azimuth_angle == false || pv_ground_azimuth_angle == 'none'
  return if pv_ground_module_description == nil? || pv_ground_module_description == false || pv_ground_module_description == 'none'

  ##### Convert a string to a float (except for pv_ground_type and pv_ground_module_description)

  if pv_ground_total_area_pv_panels_m2.instance_of?(String) && pv_ground_total_area_pv_panels_m2 != 'NECB_Default'
    pv_ground_total_area_pv_panels_m2 = pv_ground_total_area_pv_panels_m2.to_f
  end
  if pv_ground_tilt_angle.instance_of?(String) && pv_ground_tilt_angle != 'NECB_Default'
    pv_ground_tilt_angle = pv_ground_tilt_angle.to_f
  end
  if pv_ground_azimuth_angle.instance_of?(String) && pv_ground_azimuth_angle != 'NECB_Default'
    pv_ground_azimuth_angle = pv_ground_azimuth_angle.to_f
  end

  ##### Calculate footprint of the building model (this is used as default value for pv_ground_total_area_pv_panels_m2)

  building_footprint_m2 = calculate_building_footprint(model: model)
  # puts "building_footprint_m2 is #{building_footprint_m2}"

  ##### Set default PV panels' total area as the building footprint

  if pv_ground_total_area_pv_panels_m2 == 'NECB_Default'
    pv_ground_total_area_pv_panels_m2 = building_footprint_m2
  end

  ##### Set default PV panels' tilt angle as the latitude

  if pv_ground_tilt_angle == 'NECB_Default'
    epw = BTAP::Environment::WeatherFile.new(model.weatherFile.get.path.get)
    pv_ground_tilt_angle = epw.latitude.to_f
  end

  ##### Set default PV panels' azimuth angle as south-facing arrays

  if pv_ground_azimuth_angle == 'NECB_Default'
    pv_ground_azimuth_angle = 180 # EnergyPlus I/O Reference: "An azimuth angle of 180deg is for a south-facing array, and an azimuth angle of 0deg is for a north-facing array."

  end

  ##### Set default PV module type as the the below one

  if pv_ground_module_description == 'NECB_Default'
    pv_ground_module_description = 'HES-160-36PV 26.6  x 58.3 x 1.38' # Note: As per Mike Lubun's comment, assuming a typical panel is 5 ft x 2 ft, the closest standard type PV panel in the spreadsheet would be the 160W HES.

  end

  ##### Calculate number of PV panels

  # Note: assuming 5 ft x 2 ft as PV panel's size since it seems to fit the racking system used for ground mounts as per Mike Lubun's comment.

  pv_area_each_ft2 = 5.0 * 2.0
  pv_area_each_m2 = OpenStudio.convert(pv_area_each_ft2, 'ft^2', 'm^2').get # convert pv_area_each_ft2 to m2

  pv_number_panels = pv_ground_total_area_pv_panels_m2 / pv_area_each_m2

  ##### Get data of the PV panel from the json file

  pv_info = @standards_data['tables']['pv']['table'].detect { |item| item['pv_module_description'] == pv_ground_module_description }
  pv_ground_module_type = pv_info['pv_module_type']
  pv_watt = pv_info['pv_module_wattage']

  ##### Create the generator

  # Assuming one PVWatts generator in E+ as per Mike Lubun's comment for simplification, however exact number of PVWatts generators (and inverters) are calculated for costing.

  dc_system_capacity = pv_number_panels * pv_watt
  generator = OpenStudio::Model::GeneratorPVWatts.new(model, dc_system_capacity)
  generator.setModuleType(pv_ground_module_type)
  # generator.setArrayType('OneAxis') # Note: "tilt and azimuth are fixed" for this array type (see E+ I/O Reference). This array type has been chosen as per Mike Lubun's costing spec.

  generator.setArrayType('FixedOpenRack') # Note: The 'FixedOpenRack' array type has been used instead of 'OneAxis' since the 'OneAxis' array type did not allow to have a non-zero tilt angle in OpenStudio 3.2.1.

  # (As per E+ I/O Reference: 'FixedOpenRack' is used for ground mounted arrays, assumes air flows freely around the array.)

  generator.setTiltAngle(pv_ground_tilt_angle)
  generator.setAzimuthAngle(pv_ground_azimuth_angle)

  ##### Create the inverter

  inverter = OpenStudio::Model::ElectricLoadCenterInverterPVWatts.new(model)
  inverter.setDCToACSizeRatio(1.1) # Note: This is EnergyPlus' default value; This default value has been chosen for ground-mounted PV, assuming no storage as per Mike Lubun's costing spec.

  inverter.setInverterEfficiency(0.96) # Note: This is EnergyPlus' default value; This default value has been chosen as per Mike Lubun's costing spec.


  ##### Add distribution systems, set relevant parameters, and add created generator to it

  elc_distribution = OpenStudio::Model::ElectricLoadCenterDistribution.new(model)
  elc_distribution.setInverter(inverter)
  elc_distribution.setGeneratorOperationSchemeType('Baseload') # E+ I/O Reference: "The Baseload scheme requests all generators scheduled ON (available) to operate, even if the amount of electric power generated exceeds the total facility electric power demand." This scheme type has been chosen as per Mike Lubun's costing spec.

  elc_distribution.addGenerator(generator)
end

#apply_system_ecm(model:, ecm_system_name: nil, template_standard:, runner: nil, primary_heating_fuel: nil, ecm_system_zones_map_option: 'NECB_Default') ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/openstudio-standards/standards/necb/ECMS/ecms.rb', line 42

def apply_system_ecm(model:, ecm_system_name: nil, template_standard:, runner: nil, primary_heating_fuel: nil, ecm_system_zones_map_option: 'NECB_Default')
  # Do nothing if nil or other usual suspects.. covering all bases for now.

  return if ecm_system_name.nil? || ecm_system_name == 'none' || ecm_system_name == 'NECB_Default'
  ecm_system_zones_map_option = 'NECB_Default' if ecm_system_zones_map_option.nil? || ecm_system_zones_map_option == 'none'

  ecm_std = Standard.build('ECMS')
  systems = model.getAirLoopHVACs
  map_system_to_zones, system_doas_flags = ecm_std.get_map_systems_to_zones(systems)
  ecm_add_method_name = "add_ecm_#{ecm_system_name.downcase}"

  raise("the method #{ecm_add_method_name} does not exist in the ECM class. Please verify that this should be called.") unless ecm_std.respond_to? ecm_add_method_name

  # when the ecm is associated with adding a new HVAC system, then remove existing system components and loops

  ecm_std.remove_all_zone_eqpt(systems)
  ecm_std.remove_air_loops(model)
  ecm_std.remove_hw_loops(model)
  ecm_std.remove_chw_loops(model)
  ecm_std.remove_cw_loops(model)

  ecm_std.send(ecm_add_method_name,
               model: model,
               system_zones_map: map_system_to_zones,
               system_doas_flags: system_doas_flags,
               ecm_system_zones_map_option: ecm_system_zones_map_option,
               standard: template_standard,
               heating_fuel: primary_heating_fuel)
end

#apply_system_efficiencies_ecm(model:, ecm_system_name: nil) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/openstudio-standards/standards/necb/ECMS/ecms.rb', line 70

def apply_system_efficiencies_ecm(model:, ecm_system_name: nil)
  # Do nothing if nil.

  return if ecm_system_name.nil? || ecm_system_name == 'none' || ecm_system_name == 'NECB_Default' || ecm_system_name.to_s.downcase == 'remove_airloops_add_zone_baseboards'

  ecm_std = Standard.build('ECMS')
  # Get method name that should be present in the ECM class.

  ecm_apply_eff_method_name = "apply_efficiency_ecm_#{ecm_system_name.downcase}"
  # Raise exception if method does not exists.

  raise("the method #{ecm_apply_eff_method_name} does not exist in the ECM class. Please verify that this should be called.") unless ecm_std.respond_to?(ecm_apply_eff_method_name)

  # apply system eff method.

  ecm_std.send(ecm_apply_eff_method_name, model)
end

#calculate_building_footprint(model:) ⇒ Object

Method for calculating footprint of the building model



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/openstudio-standards/standards/necb/ECMS/pv_ground.rb', line 91

def calculate_building_footprint(model:)
  building_footprint_m2_array = []
  lowest_floor = 10000000000.0 # dummy number as initialization to find the lowest floor among spaces #TODO: Question:it it fine that it has been assumed that the floor of all lowest spaces are at the same level?

  model.getSpaces.sort.each do |space|
    space.surfaces.sort.select { |surface| (surface.surfaceType == 'Floor') && (surface.outsideBoundaryCondition != 'Surface') && (surface.outsideBoundaryCondition != 'Adiabatic') }.each do |surface|
      floor_vertices = surface.vertices
      floor_z = floor_vertices[0].z.round(1)
      if floor_z <= lowest_floor
        lowest_floor = floor_z
        building_footprint_m2_array << surface.netArea
      end
    end
  end
  building_footprint_m2 = building_footprint_m2_array.sum
  return building_footprint_m2
end

#coil_cooling_dx_single_speed_apply_efficiency_and_curves(coil_cooling_dx_single_speed, eqpt_name) ⇒ Object

Applies the standard efficiency ratings and typical performance curves “CoilCoolingDXSingleSpeed” object.



1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1515

def coil_cooling_dx_single_speed_apply_efficiency_and_curves(coil_cooling_dx_single_speed, eqpt_name)
  successfully_set_all_properties = true

  search_criteria = {}
  search_criteria['name'] = eqpt_name

  # Get the capacity

  capacity_w = coil_cooling_dx_single_speed_find_capacity(coil_cooling_dx_single_speed)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get

  # Lookup efficiencies

  ac_props = model_find_object(standards_data['tables']['heat_pump_cooling_ecm']['table'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if ac_props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.CoilCoolingDXSingleSpeed', "For #{coil_cooling_dx_single_speed.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CAP-FT curve

  cool_cap_ft = model_add_curve(coil_cooling_dx_single_speed.model, ac_props['cool_cap_ft'])

  if cool_cap_ft
    coil_cooling_dx_single_speed.setTotalCoolingCapacityFunctionOfTemperatureCurve(cool_cap_ft)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.CoilCoolingDXSingleSpeed', "For #{coil_cooling_dx_single_speed.name}, cannot find cool_cap_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CAP-FFLOW curve

  cool_cap_fflow = model_add_curve(coil_cooling_dx_single_speed.model, ac_props['cool_cap_fflow'])
  if cool_cap_fflow
    coil_cooling_dx_single_speed.setTotalCoolingCapacityFunctionOfFlowFractionCurve(cool_cap_fflow)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.CoilCoolingDXSingleSpeed', "For #{coil_cooling_dx_single_speed.name}, cannot find cool_cap_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FT curve

  cool_eir_ft = model_add_curve(coil_cooling_dx_single_speed.model, ac_props['cool_eir_ft'])
  if cool_eir_ft
    coil_cooling_dx_single_speed.setEnergyInputRatioFunctionOfTemperatureCurve(cool_eir_ft)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{coil_cooling_dx_single_speed.name}, cannot find cool_eir_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FFLOW curve

  cool_eir_fflow = model_add_curve(coil_cooling_dx_single_speed.model, ac_props['cool_eir_fflow'])
  if cool_eir_fflow
    coil_cooling_dx_single_speed.setEnergyInputRatioFunctionOfFlowFractionCurve(cool_eir_fflow)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{coil_cooling_dx_single_speed.name}, cannot find cool_eir_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-PLF-FPLR curve

  cool_plf_fplr = model_add_curve(coil_cooling_dx_single_speed.model, ac_props['cool_plf_fplr'])
  if cool_plf_fplr
    coil_cooling_dx_single_speed.setPartLoadFractionCorrelationCurve(cool_plf_fplr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{coil_cooling_dx_Single_speed.name}, cannot find cool_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Find the minimum COP and rename with efficiency rating

  cop = coil_cooling_dx_single_speed_standard_minimum_cop(coil_cooling_dx_single_speed, search_criteria, false)

  # Set the efficiency values

  coil_cooling_dx_single_speed.setRatedCOP(cop.to_f) unless cop.nil?
end

#coil_cooling_dx_single_speed_standard_minimum_cop(coil_cooling_dx_single_speed, search_criteria, rename = false) ⇒ Object

Find minimum efficiency for “CoilCoolingDXSingleSpeed” object



2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2077

def coil_cooling_dx_single_speed_standard_minimum_cop(coil_cooling_dx_single_speed,
                                                      search_criteria,
                                                      rename = false)

  capacity_w = coil_cooling_dx_single_speed_find_capacity(coil_cooling_dx_single_speed)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Look up the efficiency characteristics

  ac_props = model_find_object(standards_data['tables']['heat_pump_cooling_ecm']['table'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if ac_props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{coil_cooling_dx_single_speed.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Get the minimum efficiency standards

  cop = nil

  # If specified as SEER

  unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
    min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
    cop = seer_to_cop_cooling_with_fan(min_seer)
    new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER

  unless ac_props['minimum_energy_efficiency_ratio'].nil?
    min_eer = ac_props['minimum_energy_efficiency_ratio']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # if specified as SEER (heat pump)

  unless ac_props['minimum_seasonal_efficiency'].nil?
    min_seer = ac_props['minimum_seasonal_efficiency']
    cop = seer_to_cop_cooling_with_fan(min_seer)
    new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER (heat pump)

  unless ac_props['minimum_full_load_efficiency'].nil?
    min_eer = ac_props['minimum_full_load_efficiency']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # If specified as COP

  unless ac_props['minimum_coefficient_of_performance_cooling'].nil?
    cop = ac_props['minimum_coefficient_of_performance_cooling']
    new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{cop}COP"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; COP = #{cop}")
  end

  # Rename

  if rename
    coil_cooling_dx_single_speed.setName(new_comp_name)
  end

  return cop
end

#coil_cooling_dx_variable_speed_apply_efficiency_and_curves(coil_cooling_dx_variable_speed, eqpt_name) ⇒ Object

Applies the standard efficiency ratings and typical performance curves “CoilCoolingDXVariableSpeed” object.



1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1664

def coil_cooling_dx_variable_speed_apply_efficiency_and_curves(coil_cooling_dx_variable_speed, eqpt_name)
  successfully_set_all_properties = true

  # Get the capacity

  capacity_w = coil_cooling_dx_variable_speed_find_capacity(coil_cooling_dx_variable_speed)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Lookup efficiencies depending on whether it is a unitary AC or a heat pump

  search_criteria = {}
  search_criteria['name'] = eqpt_name
  ac_props = model_find_object(standards_data['tables']['heat_pump_cooling_ecm']['table'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if ac_props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.CoilCoolingDXVariableSpeed', "For #{coil_cooling_dx_single_speed.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CAP-FT curve

  cool_cap_ft = model_add_curve(coil_cooling_dx_variable_speed.model, ac_props['cool_cap_ft'])
  if cool_cap_ft
    coil_cooling_dx_variable_speed.speeds.each { |speed| speed.setTotalCoolingCapacityFunctionofTemperatureCurve(cool_cap_ft) }
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.CoilCoolingDXVariableSpeed', "For #{coil_cooling_dx_variable_speed.name}, cannot find cool_cap_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-CAP-FFLOW curve

  cool_cap_fflow = model_add_curve(coil_cooling_dx_variable_speed.model, ac_props['cool_cap_fflow'])
  if cool_cap_fflow
    coil_cooling_dx_variable_speed.speeds.each { |speed| speed.setTotalCoolingCapacityFunctionofAirFlowFractionCurve(cool_cap_fflow) }
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standard.CoilCoolingDXVariableSpeed', "For #{coil_cooling_dx_variable_speed.name}, cannot find cool_cap_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FT curve

  cool_eir_ft = model_add_curve(coil_cooling_dx_variable_speed.model, ac_props['cool_eir_ft'])
  if cool_eir_ft
    coil_cooling_dx_variable_speed.speeds.each { |speed| speed.setEnergyInputRatioFunctionofTemperatureCurve(cool_eir_ft) }
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{coil_cooling_dx_variable_speed.name}, cannot find cool_eir_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-EIR-FFLOW curve

  cool_eir_fflow = model_add_curve(coil_cooling_dx_variable_speed.model, ac_props['cool_eir_fflow'])
  if cool_eir_fflow
    coil_cooling_dx_variable_speed.speeds.each { |speed| speed.setEnergyInputRatioFunctionofAirFlowFractionCurve(cool_eir_fflow) }
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{coil_cooling_dx_variable_speed.name}, cannot find cool_eir_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the COOL-PLF-FPLR curve

  cool_plf_fplr = model_add_curve(coil_cooling_dx_variable_speed.model, ac_props['cool_plf_fplr'])
  if cool_plf_fplr
    coil_cooling_dx_variable_speed.setEnergyPartLoadFractionCurve(cool_plf_fplr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{coil_cooling_dx_variable_speed.name}, cannot find cool_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Find the minimum COP and rename with efficiency rating

  cop = coil_cooling_dx_variable_speed_standard_minimum_cop(coil_cooling_dx_variable_speed, search_criteria, false)

  # Set the efficiency values

  coil_cooling_dx_variable_speed.speeds.each { |speed| speed.setReferenceUnitGrossRatedCoolingCOP(cop.to_f) } unless cop.nil?
end

#coil_cooling_dx_variable_speed_find_capacity(coil_cooling_dx_variable_speed) ⇒ Object

Find cooling capacity for “CoilCoolingDXVariableSpeed” object



2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2465

def coil_cooling_dx_variable_speed_find_capacity(coil_cooling_dx_variable_speed)
  capacity_w = nil
  if coil_cooling_dx_variable_speed.grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.is_initialized
    capacity_w = coil_cooling_dx_variable_speed.grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.get
  elsif coil_cooling_dx_variable_speed.autosizedGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.is_initialized
    capacity_w = coil_cooling_dx_variable_speed.autosizedGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.get
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{coil_cooling_dx_variable_speed.name} capacity is not available, cannot apply efficiency standard.")
    return 0.0
  end

  return capacity_w
end

#coil_cooling_dx_variable_speed_standard_minimum_cop(coil_cooling_dx_variable_speed, search_criteria, rename = false) ⇒ Object

Find minimum efficiency for “CoilCoolingDXVariableSpeed” object



2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2209

def coil_cooling_dx_variable_speed_standard_minimum_cop(coil_cooling_dx_variable_speed,
                                                        search_criteria,
                                                        rename = false)

  capacity_w = coil_cooling_dx_variable_speed_find_capacity(coil_cooling_dx_variable_speed)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Look up the efficiency characteristics

  ac_props = model_find_object(standards_data['tables']['heat_pump_cooling_ecm']['table'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if ac_props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{coil_cooling_dx_variable_speed.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Get the minimum efficiency standards

  cop = nil

  # If specified as SEER

  unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
    min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
    cop = seer_to_cop_cooling_with_fan(min_seer)
    new_comp_name = "#{coil_cooling_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{template}: #{coil_cooling_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER

  unless ac_props['minimum_energy_efficiency_ratio'].nil?
    min_eer = ac_props['minimum_energy_efficiency_ratio']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{template}: #{coil_cooling_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # if specified as SEER (heat pump)

  unless ac_props['minimum_seasonal_efficiency'].nil?
    min_seer = ac_props['minimum_seasonal_efficiency']
    cop = seer_to_cop_cooling_with_fan(min_seer)
    new_comp_name = "#{coil_cooling_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{template}: #{coil_cooling_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER (heat pump)

  unless ac_props['minimum_full_load_efficiency'].nil?
    min_eer = ac_props['minimum_full_load_efficiency']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{coil_cooling_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{template}: #{coil_cooling_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # If specified as COP

  unless ac_props['minimum_coefficient_of_performance_cooling'].nil?
    cop = ac_props['minimum_coefficient_of_performance_cooling']
    new_comp_name = "#{coil_cooling_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{cop}COP"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{template}: #{coil_cooling_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; COP = #{cop}")
  end

  # Rename

  if rename
    coil_cooling_dx_variable_speed.setName(new_comp_name)
  end

  return cop
end

#coil_heating_dx_single_speed_apply_efficiency_and_curves(coil_heating_dx_single_speed, eqpt_name) ⇒ Object

Applies the standard efficiency ratings and typical performance curves to “CoilHeatingSingleSpeed” object.



1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1589

def coil_heating_dx_single_speed_apply_efficiency_and_curves(coil_heating_dx_single_speed, eqpt_name)
  successfully_set_all_properties = true

  # Get the search criteria

  search_criteria = {}
  search_criteria['name'] = eqpt_name

  # Get the capacity

  capacity_w = coil_heating_dx_single_speed_find_capacity(coil_heating_dx_single_speed)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Lookup efficiencies

  props = model_find_object(standards_data['tables']['heat_pump_heating_ecm']['table'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{coil_heating_dx_single_speed.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency standard.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FT curve

  heat_cap_ft = model_add_curve(coil_heating_dx_single_speed.model, props['heat_cap_ft'])
  if heat_cap_ft
    coil_heating_dx_single_speed.setTotalHeatingCapacityFunctionofTemperatureCurve(heat_cap_ft)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{coil_heating_dx_single_speed.name}, cannot find heat_cap_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FFLOW curve

  heat_cap_fflow = model_add_curve(coil_heating_dx_single_speed.model, props['heat_cap_fflow'])
  if heat_cap_fflow
    coil_heating_dx_single_speed.setTotalHeatingCapacityFunctionofFlowFractionCurve(heat_cap_fflow)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{coil_heating_dx_single_speed.name}, cannot find heat_cap_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FT curve

  heat_eir_ft = model_add_curve(coil_heating_dx_single_speed.model, props['heat_eir_ft'])
  if heat_eir_ft
    coil_heating_dx_single_speed.setEnergyInputRatioFunctionofTemperatureCurve(heat_eir_ft)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{coil_heating_dx_single_speed.name}, cannot find heat_eir_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FFLOW curve

  heat_eir_fflow = model_add_curve(coil_heating_dx_single_speed.model, props['heat_eir_fflow'])
  if heat_eir_fflow
    coil_heating_dx_single_speed.setEnergyInputRatioFunctionofFlowFractionCurve(heat_eir_fflow)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{coil_heating_dx_single_speed.name}, cannot find heat_eir_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-PLF-FPLR curve

  heat_plf_fplr = model_add_curve(coil_heating_dx_single_speed.model, props['heat_plf_fplr'])
  if heat_plf_fplr
    coil_heating_dx_single_speed.setPartLoadFractionCorrelationCurve(heat_plf_fplr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{coil_heating_dx_single_speed.name}, cannot find heat_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Find the minimum COP and rename with efficiency rating

  cop = coil_heating_dx_single_speed_standard_minimum_cop(coil_heating_dx_single_speed, search_criteria, false)

  # Set the efficiency values

  coil_heating_dx_single_speed.setRatedCOP(cop.to_f) unless cop.nil?
end

#coil_heating_dx_single_speed_standard_minimum_cop(coil_heating_dx_single_speed, search_criteria, rename = false) ⇒ Object

Find minimum efficiency for “CoilHeatingDXSingleSpeed” object



2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2147

def coil_heating_dx_single_speed_standard_minimum_cop(coil_heating_dx_single_speed,
                                                      search_criteria,
                                                      rename = false)

  capacity_w = coil_heating_dx_single_speed_find_capacity(coil_heating_dx_single_speed)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Look up the efficiency characteristics

  props = model_find_object(standards_data['tables']['heat_pump_heating_ecm'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{coil_heating_dx_single_speed.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Get the minimum efficiency standards

  cop = nil

  # If specified as EER

  unless props['minimum_energy_efficiency_ratio'].nil?
    min_eer = props['minimum_energy_efficiency_ratio']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{coil_heating_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{template}: #{coil_heating_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # if specified as HSPF (heat pump)

  unless props['minimum_heating_seasonal_performance_factor'].nil?
    min_hspf = props['minimum_heating_seasonal_performance_factor']
    cop = hspf_to_cop_heating_with_fan(min_hspf)
    new_comp_name = "#{coil_heating_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}HSPF"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{template}: #{coil_heating_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER (heat pump)

  unless props['minimum_full_load_efficiency'].nil?
    min_eer = props['minimum_full_load_efficiency']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{coil_heating_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{template}: #{coil_heating_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # If specified as COP

  unless props['minimum_coefficient_of_performance_heating'].nil?
    cop = props['minimum_coefficient_of_performance_heating']
    new_comp_name = "#{coil_heating_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{cop}COP"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{template}: #{coil_heating_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # Rename

  if rename
    coil_heating_dx_single_speed.setName(new_comp_name)
  end

  return cop
end

#coil_heating_dx_variable_speed_apply_efficiency_and_curves(coil_heating_dx_variable_speed, eqpt_name) ⇒ Object

Applies the standard efficiency ratings and typical performance curves to “CoilHeatingVariableSpeed” object.



1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1737

def coil_heating_dx_variable_speed_apply_efficiency_and_curves(coil_heating_dx_variable_speed, eqpt_name)
  successfully_set_all_properties = true

  # Get the search criteria

  search_criteria = {}
  search_criteria['name'] = eqpt_name

  # Get the capacity

  capacity_w = coil_heating_dx_variable_speed_find_capacity(coil_heating_dx_variable_speed)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Lookup efficiencies

  props = model_find_object(standards_data['tables']['heat_pump_heating_ecm']['table'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{coil_heating_dx_variable_speed.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency standard.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FT curve

  heat_cap_ft = model_add_curve(coil_heating_dx_variable_speed.model, props['heat_cap_ft'])
  if heat_cap_ft
    coil_heating_dx_variable_speed.speeds.each { |speed| speed.setHeatingCapacityFunctionofTemperatureCurve(heat_cap_ft) }
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{coil_heating_dx_variable_speed.name}, cannot find heat_cap_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-CAP-FFLOW curve

  heat_cap_fflow = model_add_curve(coil_heating_dx_variable_speed.model, props['heat_cap_fflow'])
  if heat_cap_fflow
    coil_heating_dx_variable_speed.speeds.each { |speed| speed.setTotalHeatingCapacityFunctionofAirFlowFractionCurve(heat_cap_fflow) }
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{coil_heating_dx_variable_speed.name}, cannot find heat_cap_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FT curve

  heat_eir_ft = model_add_curve(coil_heating_dx_variable_speed.model, props['heat_eir_ft'])
  if heat_eir_ft
    coil_heating_dx_variable_speed.speeds.each { |speed| speed.setEnergyInputRatioFunctionofTemperatureCurve(heat_eir_ft) }
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSingleSpeed', "For #{coil_heating_dx_variable_speed.name}, cannot find heat_eir_ft curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-EIR-FFLOW curve

  heat_eir_fflow = model_add_curve(coil_heating_dx_variable_speed.model, props['heat_eir_fflow'])
  if heat_eir_fflow
    coil_heating_dx_variable_speed.speeds.each { |speed| speed.setEnergyInputRatioFunctionofAirFlowFractionCurve(heat_eir_fflow) }
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{coil_heating_dx_variable_speed.name}, cannot find heat_eir_fflow curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Make the HEAT-PLF-FPLR curve

  heat_plf_fplr = model_add_curve(coil_heating_dx_variable_speed.model, props['heat_plf_fplr'])
  if heat_plf_fplr
    coil_heating_dx_variable_speed.setEnergyPartLoadFractionCurve(heat_plf_fplr)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{coil_heating_dx_variable_speed.name}, cannot find heat_plf_fplr curve, will not be set.")
    successfully_set_all_properties = false
  end

  # Find the minimum COP and rename with efficiency rating

  cop = coil_heating_dx_variable_speed_standard_minimum_cop(coil_heating_dx_variable_speed, search_criteria, false)

  # Set the efficiency values

  coil_heating_dx_variable_speed.speeds.each { |speed| speed.setReferenceUnitGrossRatedHeatingCOP(cop.to_f) } unless cop.nil?
end

#coil_heating_dx_variable_speed_find_capacity(coil_heating_dx_variable_speed) ⇒ Object

Find heating capacity for “CoilHeatingDXVariableSpeed” object



2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2481

def coil_heating_dx_variable_speed_find_capacity(coil_heating_dx_variable_speed)
  capacity_w = nil
  if coil_heating_dx_variable_speed.ratedHeatingCapacityAtSelectedNominalSpeedLevel.is_initialized
    capacity_w = coil_heating_dx_variable_speed.ratedHeatingCapacityAtSelectedNominalSpeedLevel.get
  elsif coil_heating_dx_variable_speed.autosizedRatedHeatingCapacityAtSelectedNominalSpeedLevel.is_initialized
    capacity_w = coil_heating_dx_variable_speed.autosizedRatedHeatingCapacityAtSelectedNominalSpeedLevel.get
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{coil_heating_dx_variable_speed.name} capacity is not available, cannot apply efficiency standard.")
    return 0.0
  end

  return capacity_w
end

#coil_heating_dx_variable_speed_standard_minimum_cop(coil_heating_dx_variable_speed, search_criteria, rename = false) ⇒ Object

Find minimum efficiency for “CoilHeatingDXVariableSpeed” object



2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2279

def coil_heating_dx_variable_speed_standard_minimum_cop(coil_heating_dx_variable_speed,
                                                        search_criteria,
                                                        rename = false)

  capacity_w = coil_heating_dx_variable_speed_find_capacity(coil_heating_dx_variable_speed)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Look up the efficiency characteristics

  props = model_find_object(standards_data['tables']['heat_pump_heating_ecm'], search_criteria, capacity_btu_per_hr)

  # Check to make sure properties were found

  if props.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{coil_heating_dx_variable_speed.name}, cannot find efficiency info using #{search_criteria}, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Get the minimum efficiency standards

  cop = nil

  # If specified as EER

  unless props['minimum_energy_efficiency_ratio'].nil?
    min_eer = props['minimum_energy_efficiency_ratio']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{template}: #{coil_heating_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # if specified as HSPF (heat pump)

  unless props['minimum_heating_seasonal_performance_factor'].nil?
    min_hspf = props['minimum_heating_seasonal_performance_factor']
    cop = hspf_to_cop_heating_with_fan(min_hspf)
    new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}HSPF"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{template}: #{coil_heating_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
  end

  # If specified as EER (heat pump)

  unless props['minimum_full_load_efficiency'].nil?
    min_eer = props['minimum_full_load_efficiency']
    cop = eer_to_cop(min_eer)
    new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_eer}EER"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{template}: #{coil_heating_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # If specified as COP

  unless props['minimum_coefficient_of_performance_heating'].nil?
    cop = props['minimum_coefficient_of_performance_heating']
    new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{cop}COP"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{template}: #{coil_heating_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; EER = #{min_eer}")
  end

  # Rename

  if rename
    coil_heating_dx_variable_speed.setName(new_comp_name)
  end

  return cop
end

#create_air_sys_clg_eqpt(model, clg_eqpt_type) ⇒ Object

create air system cooling equipment



679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 679

def create_air_sys_clg_eqpt(model, clg_eqpt_type)
  clg_eqpt = nil
  case clg_eqpt_type.downcase
  when 'ashp'
    clg_eqpt = OpenStudio::Model::CoilCoolingDXSingleSpeed.new(model)
    clg_eqpt.setName('CoilCoolingDxSingleSpeed_ASHP')
    clg_eqpt.setCrankcaseHeaterCapacity(1.0e-6)
  when 'ccashp'
    clg_eqpt = OpenStudio::Model::CoilCoolingDXVariableSpeed.new(model)
    clg_eqpt.setName('CoilCoolingDXVariableSpeed_CCASHP')
    clg_eqpt_speed1 = OpenStudio::Model::CoilCoolingDXVariableSpeedSpeedData.new(model)
    clg_eqpt.addSpeed(clg_eqpt_speed1)
    clg_eqpt.setNominalSpeedLevel(1)
    clg_eqpt.setCrankcaseHeaterCapacity(1.0e-6)
  when 'vrf'
    clg_eqpt = OpenStudio::Model::CoilCoolingDXVariableRefrigerantFlow.new(model)
    clg_eqpt.setName('CoilCoolingDXVariableRefrigerantFlow')
  end

  return clg_eqpt
end

#create_air_sys_fan(model, fan_type) ⇒ Object

create air system fan



660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 660

def create_air_sys_fan(model, fan_type)
  fan = nil
  case fan_type.downcase
  when 'constant_volume'
    fan = OpenStudio::Model::FanConstantVolume.new(model)
    fan.setName('FanConstantVolume')
  when 'variable_volume'
    fan = OpenStudio::Model::FanVariableVolume.new(model)
    fan.setName('FanVariableVolume')
  when 'on_off'
    fan = OpenStudio::Model::FanOnOff.new(model)
    fan.setName('FanOnOff')
  end

  return fan
end

#create_air_sys_htg_eqpt(model, htg_eqpt_type) ⇒ Object

create air system heating equipment



703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 703

def create_air_sys_htg_eqpt(model, htg_eqpt_type)
  always_on = model.alwaysOnDiscreteSchedule
  htg_eqpt = nil
  case htg_eqpt_type.downcase
  when 'coil_electric'
    htg_eqpt = OpenStudio::Model::CoilHeatingElectric.new(model, always_on)
    htg_eqpt.setName('CoilHeatingElectric')
  when 'coil_gas'
    htg_eqpt = OpenStudio::Model::CoilHeatingGas.new(model, always_on)
    htg_eqpt.setName('CoilHeatingGas')
  when 'ashp'
    htg_eqpt = OpenStudio::Model::CoilHeatingDXSingleSpeed.new(model)
    htg_eqpt.setName('CoilHeatingDXSingleSpeed_ASHP')
    htg_eqpt.setDefrostStrategy('ReverseCycle')
    htg_eqpt.setDefrostControl('OnDemand')
    htg_eqpt.setCrankcaseHeaterCapacity(1.0e-6)
  when 'ccashp'
    htg_eqpt = OpenStudio::Model::CoilHeatingDXVariableSpeed.new(model)
    htg_eqpt.setName('CoilHeatingDXVariableSpeed_CCASHP')
    htg_eqpt_speed1 = OpenStudio::Model::CoilHeatingDXVariableSpeedSpeedData.new(model)
    htg_eqpt.addSpeed(htg_eqpt_speed1)
    htg_eqpt.setNominalSpeedLevel(1)
    htg_eqpt.setMinimumOutdoorDryBulbTemperatureforCompressorOperation(-25.0)
    htg_eqpt.setDefrostStrategy('ReverseCycle')
    htg_eqpt.setDefrostControl('OnDemand')
    htg_eqpt.setCrankcaseHeaterCapacity(1.0e-6)
  end

  return htg_eqpt
end

#create_air_sys_spm(model, setpoint_mgr_type, zones) ⇒ Object

create air system setpoint manager



636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 636

def create_air_sys_spm(model, setpoint_mgr_type, zones)
  spm = nil
  case setpoint_mgr_type.downcase
  when 'scheduled'
    sat = 20.0
    sat_sch = OpenStudio::Model::ScheduleRuleset.new(model)
    sat_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0, 24, 0, 0), sat)
    spm = OpenStudio::Model::SetpointManagerScheduled.new(model, sat_sch)
  when 'single_zone_reheat'
    spm = OpenStudio::Model::SetpointManagerSingleZoneReheat.new(model)
    spm.setControlZone(zones[0])
    spm.setMinimumSupplyAirTemperature(13.0)
    spm.setMaximumSupplyAirTemperature(43.0)
  when 'warmest'
    spm = OpenStudio::Model::SetpointManagerWarmest.new(model)
    spm.setMinimumSetpointTemperature(13.0)
    spm.setMaximumSetpointTemperature(43.0)
  end

  return spm
end

#create_airloop(model, sys_vent_type) ⇒ Object

create air loop



601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 601

def create_airloop(model, sys_vent_type)
  airloop = OpenStudio::Model::AirLoopHVAC.new(model)
  airloop.sizingSystem.setPreheatDesignTemperature(7.0)
  airloop.sizingSystem.setPreheatDesignHumidityRatio(0.008)
  airloop.sizingSystem.setPrecoolDesignTemperature(13.0)
  airloop.sizingSystem.setPrecoolDesignHumidityRatio(0.008)
  airloop.sizingSystem.setSizingOption('NonCoincident')
  airloop.sizingSystem.setCoolingDesignAirFlowMethod('DesignDay')
  airloop.sizingSystem.setCoolingDesignAirFlowRate(0.0)
  airloop.sizingSystem.setHeatingDesignAirFlowMethod('DesignDay')
  airloop.sizingSystem.setHeatingDesignAirFlowRate(0.0)
  airloop.sizingSystem.setSystemOutdoorAirMethod('ZoneSum')
  airloop.sizingSystem.setCentralCoolingDesignSupplyAirHumidityRatio(0.0085)
  airloop.sizingSystem.setCentralHeatingDesignSupplyAirHumidityRatio(0.0080)
  airloop.sizingSystem.setMinimumSystemAirFlowRatio(1.0)
  case sys_vent_type.downcase
  when 'doas'
    airloop.sizingSystem.setAllOutdoorAirinCooling(true)
    airloop.sizingSystem.setAllOutdoorAirinHeating(true)
    airloop.sizingSystem.setTypeofLoadtoSizeOn('VentilationRequirement')
    airloop.sizingSystem.setCentralCoolingDesignSupplyAirTemperature(19.9)
    airloop.sizingSystem.setCentralHeatingDesignSupplyAirTemperature(20.0)
  when 'mixed'
    airloop.sizingSystem.setAllOutdoorAirinCooling(false)
    airloop.sizingSystem.setAllOutdoorAirinHeating(false)
    airloop.sizingSystem.setTypeofLoadtoSizeOn('Sensible')
    airloop.sizingSystem.setCentralCoolingDesignSupplyAirTemperature(13.0)
    airloop.sizingSystem.setCentralHeatingDesignSupplyAirTemperature(43.0)
  end

  return airloop
end

#create_zone_clg_eqpt(model, zone_clg_eqpt_type) ⇒ Object

create zonal cooling equipment



838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 838

def create_zone_clg_eqpt(model, zone_clg_eqpt_type)
  always_on = model.alwaysOnDiscreteSchedule
  clg_eqpt = nil
  case zone_clg_eqpt_type.downcase
  when 'ptac_electric_off', 'pthp'
    clg_eqpt = OpenStudio::Model::CoilCoolingDXSingleSpeed.new(model)
    clg_eqpt.setName('CoilCoolingDXSingleSpeed_PTHP') if zone_clg_eqpt_type.downcase == 'pthp'
    clg_eqpt.setName('CoilCoolingDXSingleSpeed_PTAC') if zone_clg_eqpt_type.downcase == 'ptac_electric_off'
    clg_eqpt.setCrankcaseHeaterCapacity(1.0e-6)
  when 'vrf'
    clg_eqpt = OpenStudio::Model::CoilCoolingDXVariableRefrigerantFlow.new(model)
    clg_eqpt.setName('CoilCoolingDXVariableRefrigerantFlow')
  end

  return clg_eqpt
end

#create_zone_container_eqpt(model:, zone_cont_eqpt_type:, zone_htg_eqpt:, zone_supp_htg_eqpt:, zone_clg_eqpt:, zone_fan:, zone_vent_off: true) ⇒ Object

create zpne container eqpt



857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 857

def create_zone_container_eqpt(
  model:,
  zone_cont_eqpt_type:,
  zone_htg_eqpt:,
  zone_supp_htg_eqpt:,
  zone_clg_eqpt:,
  zone_fan:,
  zone_vent_off: true
)

  always_on = model.alwaysOnDiscreteSchedule
  always_off = model.alwaysOffDiscreteSchedule
  zone_eqpt = nil
  case zone_cont_eqpt_type.downcase
  when 'ptac_electric_off'
    zone_eqpt = OpenStudio::Model::ZoneHVACPackagedTerminalAirConditioner.new(model, always_on, zone_fan, zone_htg_eqpt, zone_clg_eqpt)
    zone_eqpt.setName('ZoneHVACPackagedTerminalAirConditioner')
    if zone_vent_off
      zone_eqpt.setOutdoorAirFlowRateDuringCoolingOperation(1.0e-6)
      zone_eqpt.setOutdoorAirFlowRateDuringHeatingOperation(1.0e-6)
      zone_eqpt.setOutdoorAirFlowRateWhenNoCoolingorHeatingisNeeded(1.0e-6)
    end
  when 'pthp'
    zone_eqpt = OpenStudio::Model::ZoneHVACPackagedTerminalHeatPump.new(model, always_on, zone_fan, zone_htg_eqpt, zone_clg_eqpt, zone_supp_htg_eqpt)
    zone_eqpt.setName('ZoneHVACPackagedTerminalHeatPump')
    if zone_vent_off
      zone_eqpt.setOutdoorAirFlowRateDuringCoolingOperation(1.0e-6)
      zone_eqpt.setOutdoorAirFlowRateDuringHeatingOperation(1.0e-6)
      zone_eqpt.setOutdoorAirFlowRateWhenNoCoolingorHeatingisNeeded(1.0e-6)
      zone_eqpt.setSupplyAirFanOperatingModeSchedule(always_off)
    end
  when 'unitheater_electric'
    zone_eqpt = OpenStudio::Model::ZoneHVACUnitHeater.new(model, always_on, zone_fan, zone_htg_eqpt)
    zone_eqpt.setName('ZoneHVACUnitHeater')
    zone_eqpt.setFanControlType('OnOff')
  when 'vrf'
    zone_eqpt = OpenStudio::Model::ZoneHVACTerminalUnitVariableRefrigerantFlow.new(model, zone_clg_eqpt, zone_htg_eqpt, zone_fan)
    zone_eqpt.setName('ZoneHVACTerminalUnitVariableRefrigerantFlow')
    zone_eqpt.setSupplyAirFanOperatingModeSchedule(always_off)
    if zone_vent_off
      zone_eqpt.setOutdoorAirFlowRateDuringCoolingOperation(1.0e-6)
      zone_eqpt.setOutdoorAirFlowRateDuringHeatingOperation(1.0e-6)
      zone_eqpt.setOutdoorAirFlowRateWhenNoCoolingorHeatingisNeeded(1.0e-6)
      zone_eqpt.setZoneTerminalUnitOffParasiticElectricEnergyUse(1.0e-6)
      zone_eqpt.setZoneTerminalUnitOnParasiticElectricEnergyUse(1.0e-6)
    end
  end

  return zone_eqpt
end

#create_zone_diffuser(model, zone_diffuser_type, zone) ⇒ Object

create zone diffuser



791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 791

def create_zone_diffuser(model, zone_diffuser_type, zone)
  always_on = model.alwaysOnDiscreteSchedule
  diffuser = nil
  case zone_diffuser_type.downcase
  when 'single_duct_uncontrolled'
    diffuser = OpenStudio::Model::AirTerminalSingleDuctUncontrolled.new(model, always_on)
  when 'single_duct_vav_reheat'
    reheat_coil = OpenStudio::Model::CoilHeatingElectric.new(model, always_on)
    diffuser = OpenStudio::Model::AirTerminalSingleDuctVAVReheat.new(model, always_on, reheat_coil)
    # diffuser.setFixedMinimumAirFlowRate(0.002 * zone.floorArea )

    diffuser.setMaximumReheatAirTemperature(43.0)
    diffuser.setDamperHeatingAction('Normal')
  end

  return diffuser
end

#create_zone_htg_eqpt(model, zone_htg_eqpt_type) ⇒ Object

create zonal heating equipment



810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 810

def create_zone_htg_eqpt(model, zone_htg_eqpt_type)
  always_on = model.alwaysOnDiscreteSchedule
  always_off = model.alwaysOffDiscreteSchedule
  htg_eqpt = nil
  case zone_htg_eqpt_type.downcase
  when 'baseboard_electric'
    htg_eqpt = OpenStudio::Model::ZoneHVACBaseboardConvectiveElectric.new(model)
    htg_eqpt.setName('Zone HVAC Baseboard Convective Electric')
  when 'coil_electric', 'ptac_electric_off', 'unitheater_electric'
    htg_eqpt = OpenStudio::Model::CoilHeatingElectric.new(model, always_on)
    htg_eqpt.setName('CoilHeatingElectric')
    htg_eqpt.setAvailabilitySchedule(always_off) if zone_htg_eqpt_type == 'ptac_electric_off'
  when 'pthp'
    htg_eqpt = OpenStudio::Model::CoilHeatingDXSingleSpeed.new(model)
    htg_eqpt.setName('CoilHeatingDXSingleSpeed_PTHP')
    htg_eqpt.setDefrostStrategy('ReverseCycle')
    htg_eqpt.setDefrostControl('OnDemand')
    htg_eqpt.setCrankcaseHeaterCapacity(1.0e-6)
  when 'vrf'
    htg_eqpt = OpenStudio::Model::CoilHeatingDXVariableRefrigerantFlow.new(model)
    htg_eqpt.setName('CoilHeatingDXVariableRefrigerantFlow')
  end

  return htg_eqpt
end

#find_chiller_set(chiller_type:, ref_capacity_w:) ⇒ Object



2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2964

def find_chiller_set(chiller_type:, ref_capacity_w:)
  if chiller_type.is_a?(String)
    ##### Find the chiller that has the required capacity

    search_criteria = {}
    search_criteria['name'] = chiller_type
    capacity_w = ref_capacity_w
    chiller_packages = model_find_object(@standards_data['tables']['chiller_eff_ecm'], search_criteria, capacity_w)
    chiller_name = chiller_packages['notes']
    ecm_name = chiller_name
    chiller_set = {
      'notes' => ecm_name,
      'capacity_w' => chiller_packages['capacity_w'],
      'cop_w_by_w' => chiller_packages['cop_w_by_w'],
      'ref_leaving_chilled_water_temp_c' => chiller_packages['ref_leaving_chilled_water_temp_c'],
      'ref_entering_condenser_fluid_temp_c' => chiller_packages['ref_entering_condenser_fluid_temp_c'],
      'ref_chilled_water_flow_rate_m3_s' => chiller_packages['ref_chilled_water_flow_rate_m3_s'],
      'ref_condenser_fluid_flow_rate_m3_s' => chiller_packages['ref_condenser_fluid_flow_rate_m3_s'],
      'capft_curve' => chiller_packages['capft_curve'],
      'eirft_curve' => chiller_packages['eirft_curve'],
      'eirfplr_curve' => chiller_packages['eirfplr_curve'],
      'min_part_load_ratio' => chiller_packages['min_part_load_ratio'],
      'max_part_load_ratio' => chiller_packages['max_part_load_ratio'],
      'opt_part_load_ratio' => chiller_packages['opt_part_load_ratio'],
      'min_unloading_ratio' => chiller_packages['min_unloading_ratio'],
      'condenser_type' => chiller_packages['condenser_type'],
      'fraction_of_compressor_electric_consumption_rejected_by_condenser' => chiller_packages['fraction_of_compressor_electric_consumption_rejected_by_condenser'],
      'leaving_chilled_water_lower_temperature_limit_c' => chiller_packages['leaving_chilled_water_lower_temperature_limit_c'],
      'chiller_flow_mode' => chiller_packages['chiller_flow_mode'],
      'design_heat_recovery_water_flow_rate_m3_s' => chiller_packages['design_heat_recovery_water_flow_rate_m3_s']
    }
    chiller_min_cap = chiller_packages['minimum_capacity']
    chiller_max_cap = chiller_packages['maximum_capacity']
  end
  return chiller_set, chiller_min_cap, chiller_max_cap
end

#get_hvac_comp_init_name(obj, htg_flag) ⇒ Object

Name of HVAC component might have been updated by standards methods for setting efficiency. Here original name of the component is restored.



1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 1420

def get_hvac_comp_init_name(obj, htg_flag)
  return obj.name.to_s if obj.name.to_s.split.size <= 2

  init_name = obj.name.to_s.split[0]
  range = obj.name.to_s.split.size - 3
  range = obj.name.to_s.split.size - 5 if htg_flag
  for i in 1..range
    init_name += " #{obj.name.to_s.split[i]}"
  end
  return init_name
end

#get_lowest_floor_ext_wall_centroid_coords(storeys_clg_zcoords) ⇒ Object

Return x,y,z coordinates of exterior wall with largest area on the lowest floor



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 136

def get_lowest_floor_ext_wall_centroid_coords(storeys_clg_zcoords)
  ext_wall = nil
  ext_wall_x = nil
  ext_wall_y = nil
  ext_wall_z = nil
  storeys_clg_zcoords.keys.each do |storey|
    max_area = 0.0
    sorted_spaces = storey.spaces.sort_by { |space| space.name.to_s }
    sorted_spaces.each do |space|
      ext_walls = space.surfaces.select { |surf| (surf.surfaceType.to_s.upcase == 'WALL') && (surf.outsideBoundaryCondition.to_s.upcase == 'OUTDOORS') }
      ext_walls = ext_walls.sort_by { |wall| wall.grossArea.to_f }
      if !ext_walls.empty?
        if ext_walls.last.grossArea.to_f > max_area
          max_area = ext_walls.last.grossArea.to_f
          ext_wall_x = ext_walls.last.centroid.x.to_f + space.xOrigin.to_f
          ext_wall_y = ext_walls.last.centroid.y.to_f + space.yOrigin.to_f
          ext_wall_z = ext_walls.last.centroid.z.to_f + space.zOrigin.to_f
          ext_wall = ext_walls.last
        end
      end
    end
    break unless !ext_wall
  end
  if !ext_wall
    OpenStudio.logFree(OpenStudio::Info, 'openstudiostandards.get_lowest_floor_ext_wall_centroid_coords', 'Did not find an exteior wall in the building!')
  end

  return ext_wall_x, ext_wall_y, ext_wall_z
end

#get_map_systems_to_zones(systems) ⇒ Object

Return map of systems to zones and set flag for dedicated outdoor air unit for each system



67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 67

def get_map_systems_to_zones(systems)
  map_systems_to_zones = {}
  system_doas_flags = {}
  systems.each do |system|
    zones = system.thermalZones
    map_systems_to_zones[system.name.to_s] = zones
    if system.sizingSystem.typeofLoadtoSizeOn.to_s == 'VentilationRequirement'
      system_doas_flags[system.name.to_s] = true
    else
      system_doas_flags[system.name.to_s] = false
    end
  end
  return map_systems_to_zones, system_doas_flags
end

#get_max_vrf_pipe_lengths(model) ⇒ Object

Determine maximum equivalent and net vertical pipe runs for VRF model



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 218

def get_max_vrf_pipe_lengths(model)
  # Get and sort floors average ceilings z-coordinates hash

  storeys_clg_zcoords = get_storey_avg_clg_zcoords(model)
  storeys_clg_zcoords = storeys_clg_zcoords.sort_by { |key, value| value[1] }.to_h # sort storeys hash based on ceiling/roof z-coordinate

  if storeys_clg_zcoords.values.last[0]
    # If the top floor is conditioned, then assume the top floor is not an attic floor and place the VRF outdoor unit at the roof centroid

    location_cent_x, location_cent_y, location_cent_z = get_roof_centroid_coords(storeys_clg_zcoords.keys.last)
  else
    # If the top floor is not conditioned, then assume it's an attic floor. In this case place the VRF outdoor unit next to the centroid

    # of the exterior wall with the largest area on the lowest floor.

    location_cent_x, location_cent_y, location_cent_z = get_lowest_floor_ext_wall_centroid_coords(storeys_clg_zcoords)
  end
  # Initialize distances

  max_equiv_distance = 0.0
  max_vert_distance = 0.0
  min_vert_distance = 0.0
  storeys_clg_zcoords.keys.each do |storey|
    next unless storeys_clg_zcoords[storey][0]

    storey.spaces.each do |space|
      # Is there a VRF terminal unit in the space/zone?

      vrf_term_units = []
      if space.thermalZone.is_initialized
        vrf_term_units = space.thermalZone.get.equipment.select { |eqpt| eqpt.to_ZoneHVACTerminalUnitVariableRefrigerantFlow.is_initialized }
      end
      next if vrf_term_units.empty?

      space_centroid_x, space_centroid_y, space_centroid_z = get_space_centroid_coords(space)
      # Update max horizontal and vertical distances if needed

      equiv_distance = (location_cent_x.to_f - space_centroid_x.to_f).abs +
                       (location_cent_y.to_f - space_centroid_y.to_f).abs +
                       (location_cent_z.to_f - space_centroid_z.to_f).abs
      if equiv_distance > max_equiv_distance then max_equiv_distance = equiv_distance end
      pos_vert_distance = [space_centroid_z.to_f - location_cent_z.to_f, 0.0].max
      if pos_vert_distance > max_vert_distance then max_vert_distance = pos_vert_distance end
      neg_vert_distance = [space_centroid_z.to_f - location_cent_z.to_f, 0.0].min
      if neg_vert_distance < min_vert_distance then min_vert_distance = neg_vert_distance end
    end
  end
  max_net_vert_distance = max_vert_distance + min_vert_distance
  max_net_vert_distance = [max_net_vert_distance, 0.000001].max

  return max_equiv_distance, max_net_vert_distance
end

#get_roof_centroid_coords(storey) ⇒ Object

Return x,y,z coordinates of the centroid of the roof of the storey



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 188

def get_roof_centroid_coords(storey)
  sum_x = 0.0
  sum_y = 0.0
  sum_z = 0.0
  total_area = 0.0
  cent_x = nil
  cent_y = nil
  cent_z = nil
  storey.spaces.each do |space|
    roof_surfaces = space.surfaces.select { |surf| (surf.surfaceType.to_s.upcase == 'ROOFCEILING') && (surf.outsideBoundaryCondition.to_s.upcase == 'OUTDOORS') }
    roof_surfaces.each do |surf|
      sum_x += (surf.centroid.x.to_f + space.xOrigin.to_f) * surf.grossArea.to_f
      sum_y += (surf.centroid.y.to_f + space.yOrigin.to_f) * surf.grossArea.to_f
      sum_z += (surf.centroid.z.to_f + space.zOrigin.to_f) * surf.grossArea.to_f
      total_area += surf.grossArea.to_f
    end
  end
  if total_area > 0.0
    cent_x = sum_x / total_area
    cent_y = sum_y / total_area
    cent_z = sum_z / total_area
  else
    OpenStudio.logFree(OpenStudio::Info, 'openstudiostandards.get_roof_centroid_coords', 'Did not find a roof on the top floor!')
  end

  return cent_x, cent_y, cent_z
end

#get_space_centroid_coords(space) ⇒ Object

Return x,y,z coordinates of space centroid



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 168

def get_space_centroid_coords(space)
  total_area = 0.0
  sum_x = 0.0
  sum_y = 0.0
  sum_z = 0.0
  space.surfaces.each do |surf|
    total_area += surf.grossArea.to_f
    sum_x += (surf.centroid.x.to_f + space.xOrigin.to_f) * surf.grossArea.to_f
    sum_y += (surf.centroid.y.to_f + space.yOrigin.to_f) * surf.grossArea.to_f
    sum_z += (surf.centroid.z.to_f + space.zOrigin.to_f) * surf.grossArea.to_f
  end
  space_centroid_x = sum_x / total_area
  space_centroid_y = sum_y / total_area
  space_centroid_z = sum_z / total_area

  return space_centroid_x, space_centroid_y, space_centroid_z
end

#get_storey_avg_clg_zcoords(model) ⇒ Object

Return hash of flags for whether storey is conditioned and average ceiling z-coordinates of building storeys.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 99

def get_storey_avg_clg_zcoords(model)
  storey_avg_clg_zcoords = {}
  model.getBuildingStorys.each do |storey|
    storey_avg_clg_zcoords[storey] = []
    storey_cond = false
    total_area = 0.0
    sum = 0.0
    storey.spaces.each do |space|
      # Determine if any of the spaces/zones of the storey are conditioned? If yes then the floor is considered to be conditioned

      if space.thermalZone.is_initialized
        zone = space.thermalZone.get
        if zone.thermostat.is_initialized
          if zone.thermostat.get.to_ThermostatSetpointDualSetpoint.is_initialized
            if zone.thermostat.get.to_ThermostatSetpointDualSetpoint.get.heatingSetpointTemperatureSchedule.is_initialized ||
               zone.thermostat.get.to_ThermostatSetpointDualSetpoint.get.coolingSetpointTemperatureSchedule.is_initialized
              storey_cond = true
            end
          end
        end
      end
      # Find average height of z-coordinates of ceiling/roof of floor

      space.surfaces.each do |surf|
        if surf.surfaceType.to_s.upcase == 'ROOFCEILING'
          sum += (surf.centroid.z.to_f + space.zOrigin.to_f) * surf.grossArea.to_f
          total_area += surf.grossArea.to_f
        end
      end
    end
    storey_avg_clg_zcoords[storey] << storey_cond
    storey_avg_clg_zcoords[storey] << (sum / total_area)
  end

  return storey_avg_clg_zcoords
end

#get_storey_zones_map(system_zones_map) ⇒ Object

Get a map of bldg storeys and zones



434
435
436
437
438
439
440
441
442
443
444
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 434

def get_storey_zones_map(system_zones_map)
  storey_zones_map = {}
  system_zones_map.each do |sys,zones|
    zones.each do |zone|
      storey = get_zone_storey(zone)
      storey_zones_map[storey.name.to_s] = [] if !storey_zones_map.has_key? storey.name.to_s
      storey_zones_map[storey.name.to_s] << zone
    end
  end
  return storey_zones_map
end

#get_zone_clg_eqpt_type(model) ⇒ Object

Return hash of zone and cooling equipment type in the zone



84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 84

def get_zone_clg_eqpt_type(model)
  zone_clg_eqpt_type = {}
  model.getThermalZones.each do |zone|
    zone.equipment.each do |eqpt|
      if eqpt.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
        zone_clg_eqpt_type[zone.name.to_s] = 'ZoneHVACPackagedTerminalAirConditioner'
        break
      end
    end
  end
  return zone_clg_eqpt_type
end

#get_zone_storey(zone) ⇒ Object

Get building storey for a zone



418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 418

def get_zone_storey(zone)
  zone_storey = nil
  zone.model.getBuildingStorys.each do |storey|
    storey.spaces.each do |space|
      if space.thermalZone.get.name.to_s == zone.name.to_s
        zone_storey = storey
        break
      end
    end
    break if !zone_storey.nil?
  end
  return zone_storey
end

#load_standards_database_newObject

Combine the data from the JSON files into a single hash Load JSON files differently depending on whether loading from the OpenStudio CLI embedded filesystem or from typical gem installation



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/openstudio-standards/standards/necb/ECMS/ecms.rb', line 8

def load_standards_database_new
  @standards_data = {}
  @standards_data['tables'] = {}

  if __dir__[0] == ':' # Running from OpenStudio CLI

    embedded_files_relative('data/', /.*\.json/).each do |file|
      data = JSON.parse(EmbeddedScripting.getFileAsString(file))
      if !data['tables'].nil? && data['tables'].first['data_type'] == 'table'
        @standards_data['tables'] << data['tables'].first
      else
        @standards_data[data.keys.first] = data[data.keys.first]
      end
    end
  else
    files = Dir.glob("#{File.dirname(__FILE__)}/data/*.json").select { |e| File.file? e }
    files.each do |file|
      data = JSON.parse(File.read(file))
      if !data['tables'].nil?
        @standards_data['tables'] = [*@standards_data['tables'], *data['tables']].to_h
      else
        @standards_data[data.keys.first] = data[data.keys.first]
      end
    end
  end

  return @standards_data
end

#modify_boiler_efficiency(model:, boiler_eff: nil) ⇒ Object

Apply boiler efficiency This model takes an OS model and a boiler efficiency string or hash sent to it with the following form:

"boiler_eff": {
    "name" => "NECB 88% Efficient Condensing Boiler",
    "efficiency" => 0.88,
    "part_load_curve" => "BOILER-EFFPLR-COND-NECB2011",
    "notes" => "From NECB 2011."
}

If boiler_eff is nill then it does nothing. If both “efficiency” and “part_load_curve” are nil then it does nothing. If a boiler_eff is passed as a string and not a hash then it looks for a “name” field in the boiler_set.json file that matches boiler_eff and gets the associated boiler performance details from the file. If an efficiency is set but is not between 0.01 and 1.0 it returns an error. Otherwise, it looks for plant loop supply components that match the “OS_BoilerHotWater” type. If it finds one it then calls the “reset_boiler_efficiency method which resets the the boiler efficiency and looks for the part load efficiency curve in the curves.json file. If it finds a curve it sets the part load curve to that, otherwise it returns an error. It also renames the boiler to include the ”boiler_eff“.



2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2546

def modify_boiler_efficiency(model:, boiler_eff: nil)
  return if boiler_eff.nil?

  # If boiler_eff is a string rather than a hash then assume it is the name of a boiler efficiency package and look

  # for a package with that name in boiler_set.json.

  if boiler_eff.is_a?(String)
    eff_packages = @standards_data['tables']['boiler_eff_ecm']['table']
    eff_package = eff_packages.select { |eff_pack_info| eff_pack_info['name'] == boiler_eff }

    raise "Cannot not find #{boiler_eff} in the ECMS boiler_set.json file.  Please check that the name is correctly spelled in the ECMS class boiler_set.json and in the code calling (directly or through another method) the ECMS class modify_boiler_efficiency method." if eff_package.empty?
    raise "More than one boiler efficiency package with the name #{boiler_eff} was found.  Please check the ECMS class boiler_set.json file and make sure that each boiler efficiency package has a unique name." if eff_package.size > 1

    ecm_name = boiler_eff
    boiler_eff = {
      'name' => ecm_name,
      'efficiency' => eff_package[0]['efficiency'],
      'part_load_curve' => eff_package[0]['part_load_curve']
    }
  end
  # If nothing is passed in the boiler_eff hash then assume this was not supposed to be used and return without doing

  # anything.

  return if boiler_eff['name'].nil? && boiler_eff['efficiency'].nil? && boiler_eff['part_load_curve'].nil?
  # If no efficiency or partload curve are found (either passed directly or via the boiler_set.json file) then assume

  # that the current SHW setting should not be changed.  Return without changing anything.

  return if boiler_eff['efficiency'].nil? && boiler_eff['part_load_curve'].nil?
  raise 'You attempted to set the efficiency of boilers in this model to nil. Please check the ECMS class boiler_set.json and make sure the efficiency is properly set' if boiler_eff['efficiency'].nil?
  raise "You attempted to set the efficiency of boilers in this model to: #{boiler_eff['efficiency']}. Please check the ECMS class boiler_set.json and make sure the efficiency you set is between 0.01 and 1.0." if boiler_eff['efficiency'] < 0.01 || boiler_eff['efficiency'] > 1.0
  raise 'You attempted to set the part load curve of boilers in this model to nil.  Please check the ECMS class boiler_set.json file and ensure that both the efficiency and part load curve are set.' if boiler_eff['part_load_curve'].nil?

  model.getBoilerHotWaters.sort.each do |mod_boiler|
    reset_boiler_efficiency(model: model, component: mod_boiler.to_BoilerHotWater.get, eff: boiler_eff)
  end
end

#modify_chiller_efficiency(model:, chiller_type:) ⇒ Object

Apply advanced chiller measure



2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2944

def modify_chiller_efficiency(model:, chiller_type:)
  return if chiller_type.nil? || chiller_type == false || chiller_type == 'none' || chiller_type == 'NECB_Default'

  model.getChillerElectricEIRs.sort.each do |mod_chiller|
    ref_capacity_w = mod_chiller.referenceCapacity
    ref_capacity_w = ref_capacity_w.to_f

    ##### Look for a chiller set in chiller_set.json (with a capacity close to that of the existing chiller)

    chiller_set, chiller_min_cap, chiller_max_cap = find_chiller_set(chiller_type: chiller_type, ref_capacity_w: ref_capacity_w)

    ##### No need to replace any chillers with capacity = 0.001 W as per Kamel Haddad's comment

    if ref_capacity_w > 0.0011
      reset_chiller_efficiency(model: model, component: mod_chiller.to_ChillerElectricEIR.get, cop: chiller_set)
    end
  end

  ##### Change fan power of single-speed Cooling towers from 'Hard Sized' to Autosized (Otherwise, E+ gives the fatal error 'Autosizing of cooling tower UA failed for tower')

  model.getCoolingTowerSingleSpeeds.sort.each(&:autosizeFanPoweratDesignAirFlowRate)
end

#modify_furnace_efficiency(model:, furnace_eff: nil) ⇒ Object

Apply Furnace efficiency This model takes an OS model and a furnace efficiency string or hash sent to it with the following form:

"furnace_eff": {
    "name" => "NECB 85% Efficient Condensing Furnace",
    "efficiency" => 0.85,
    "part_load_curve" => "FURNACE-EFFPLR-COND-NECB2011",
    "notes" => "From NECB 2011."
}

If furnace_eff is nil then it does nothing. If both “efficiency” and “part_load_curve” are nil then it does nothing. If a furnace_eff is a string it looks for furnace_eff as a “name” in the furnace_set.json file to find the performance details. If an efficiency is set but is not between 0.01 and 1.0 it returns an error. Otherwise, it looks for air loop supply components that match the “OS_CoilHeatingGas” type. If it finds one it then calls the reset_furnace_efficiency method which resets the the furnace efficiency and looks for the part load efficiency curve in the curves.json file. If it finds a curve it sets the part load curve to that, otherwise it returns an error. It also renames the furnace to include the “furnace_eff“.



2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2646

def modify_furnace_efficiency(model:, furnace_eff: nil)
  return if furnace_eff.nil?

  # If furnace_eff is a string rather than a hash then assume it is the name of a furnace efficiency package and look

  # for a package with that name in furnace_set.json.

  if furnace_eff.is_a?(String)
    eff_packages = @standards_data['tables']['furnace_eff_ecm']['table']
    eff_package = eff_packages.select { |eff_pack_info| eff_pack_info['name'] == furnace_eff }

    raise "Cannot not find #{furnace_eff} in the ECMS furnace_set.json file.  Please check that the name is correctly spelled in the ECMS class furnace_set.json and in the code calling (directly or through another method) the ECMS class modify_furnace_efficiency method." if eff_package.empty?
    raise "More than one furnace efficiency package with the name #{furnace_eff} was found.  Please check the ECMS class furnace_set.json file and make sure that each furnace efficiency package has a unique name." if eff_package.size > 1

    ecm_name = furnace_eff
    furnace_eff = {
      'name' => ecm_name,
      'efficiency' => eff_package[0]['efficiency'],
      'part_load_curve' => eff_package[0]['part_load_curve']
    }
  end
  # If nothing is passed in the furnace_eff hash then assume this was not supposed to be used and return without doing

  # anything.

  return if furnace_eff['name'].nil? && furnace_eff['efficiency'].nil? && furnace_eff['part_load_curve'].nil?
  # If no efficiency or partload curve are found (either passed directly or via the furnace_set.json file) then assume

  # that the current furance performance settings should not be changed.  Return without changing anything.

  return if furnace_eff['efficiency'].nil? && furnace_eff['part_load_curve'].nil?
  raise 'You attempted to set the efficiency of furnaces in this model to nil.  Please check the ECMS class furnace_set.json file and make sure the efficiency is set' if furnace_eff['efficiency'].nil?
  raise "You attempted to set the efficiency of furnaces in this model to: #{furnace_eff['efficiency']}. Please check the ECMS class furnace_set.json file and make sure the efficiency you set is between 0.01 and 1.0." if furnace_eff['efficiency'] < 0.01 || furnace_eff['efficiency'] > 1.0
  raise 'You attempted to set the part load curve of furnaces in this model to nil.  Please check the ECMS class furnace_set.json file and ensure that both the efficiency and part load curve are set.' if furnace_eff['part_load_curve'].nil?

  model.getCoilHeatingGass.sort.each do |mod_furnace|
    reset_furnace_efficiency(model: model, component: mod_furnace.to_CoilHeatingGas.get, eff: furnace_eff)
  end
end

#modify_shw_efficiency(model:, shw_eff: nil) ⇒ Object

Apply shw efficiency This model takes an OS model and a shw efficiency string or hash sent to it with the following form:

"shw_eff": {
    "name" => "Natural Gas Power Vent with Electric Ignition",
    "efficiency" => 0.94,
    "part_load_curve" => "SWH-EFFFPLR-NECB2011"
    "notes" => "From NECB 2011."
}

If shw_eff is nil then it does nothing. If both “efficiency” and “part_load_curve” are nil then it does nothing. If shw_eff is a string then it looks for shw_eff as a “name” in the shw_set.json file for the details on the tank. If an efficiency is set but is not between 0.01 and 1.0 it returns an error. Otherwise, it looks for mixed water heaters. If it finds any it then calls the reset_shw_efficiency method which resets the the shw efficiency and the part load curve. It also renames the shw tank with the following pattern: valumeGal eff_name Water Heater - CapacitykBtu/hr efficiency Therm Eff



2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2726

def modify_shw_efficiency(model:, shw_eff: nil)
  return if shw_eff.nil?

  # If shw_eff is a string rather than a hash then assume it is the name of a shw efficiency package and look

  # for a package with that name in shw_set.json.

  if shw_eff.is_a?(String)
    eff_packages = @standards_data['tables']['shw_eff_ecm']['table']
    eff_package = eff_packages.select { |eff_pack_info| eff_pack_info['name'] == shw_eff }

    raise "Cannot not find #{shw_eff} in the ECMS shw_set.json file.  Please check that the name is correctly spelled in the ECMS class shw_set.json and in the code calling (directly or through another method) the ECMS class modify_shw_efficiency method." if eff_package.empty?
    raise "More than one shw tank efficiency package with the name #{shw_eff} was found.  Please check the ECMS class shw_set.json file and make sure that each shw tank efficiency package has a unique name." if eff_package.size > 1

    ecm_name = shw_eff
    shw_eff = {
      'name' => ecm_name,
      'efficiency' => eff_package[0]['efficiency'],
      'part_load_curve' => eff_package[0]['part_load_curve']
    }
  end
  # If nothing is passed in the shw_eff hash then assume this was not supposed to be used and return without doing

  # anything.

  return if shw_eff['name'].nil? && shw_eff['efficiency'].nil? && shw_eff['part_load_curve'].nil?
  # If no efficiency or partload curve are found (either passed directly or via the shw_set.json file) then assume

  # that the current shw performance settings should not be changed.  Return without changing anything.

  return if shw_eff['efficiency'].nil? && shw_eff['part_load_curve'].nil?
  raise 'You attempted to set the efficiency of shw tanks in this model to nil.  Please check the ECMS class shw_set.json file and make sure the efficiency is set' if shw_eff['efficiency'].nil?
  raise "You attempted to set the efficiency of shw tanks in this model to: #{shw_eff['efficiency']}. Please check the ECMS class shw_set.json and make sure the efficiency you set is between 0.01 and 1.0." if shw_eff['efficiency'] < 0.01 || shw_eff['efficiency'] > 1.0
  raise 'You attempted to set the part load curve of shw tanks in this model to nil.  Please check the ECMS class shw_set.json file and ensure that both the efficiency and part load curve are set.' if shw_eff['part_load_curve'].nil?

  model.getWaterHeaterMixeds.sort.each do |shw_mod|
    reset_shw_efficiency(model: model, component: shw_mod, eff: shw_eff)
  end
end

#modify_unitary_cop(model:, unitary_cop:, sql_db_vars_map:) ⇒ Object

Method to update the cop and/or the performance curves of unitary dx coils. The method input ‘unitary_cop’ can either be a string or a hash. When it’s a string it’s used to find a hash in the json table ‘unitary_cop_ecm’. When it’s a hash it holds the parameters needed to update the cop and/or the performance curves of the unitary coil.



2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2812

def modify_unitary_cop(model:, unitary_cop:, sql_db_vars_map:)
  return if unitary_cop.nil? || (unitary_cop.to_s == 'NECB_Default')

  coils = model.getCoilCoolingDXSingleSpeeds + model.getCoilCoolingDXMultiSpeeds
  unitary_cop_copy = unitary_cop.dup
  coils.sort.each do |coil|
    coil_type = 'SingleSpeed'
    coil_type = 'MultiSpeed' if coil.class.name.to_s.include? 'CoilCoolingDXMultiSpeed'
    # if the parameter 'unitary_cop' is a string then get the information on the new parameters for the coils from

    # the json table 'unitary_cop_ecm'

    if unitary_cop_copy.is_a?(String)
      search_criteria = {}
      search_criteria['name'] = unitary_cop_copy
      coil_name = coil.name.to_s
      if sql_db_vars_map.has_key? coil_name then coil.setName(sql_db_vars_map[coil_name])  end
      if coil_type == 'SingleSpeed'
        capacity_w = coil_cooling_dx_single_speed_find_capacity(coil)
      elsif coil_type == 'MultiSpeed'
        capacity_w = coil_cooling_dx_multi_speed_find_capacity(coil)
      end
      coil.setName(coil_name)
      cop_package = model_find_object(@standards_data['tables']['unitary_cop_ecm'], search_criteria, capacity_w)
      raise "Cannot not find #{unitary_cop_ecm} in the ECMS unitary_acs.json file.  Please check that the name is correctly spelled in the ECMS class unitary_acs.json file and in the code calling (directly or through another method) the ECMS class modify_unitary_eff method." if cop_package.empty?

      ecm_name = unitary_cop_copy
      unitary_cop = {
        'name' => ecm_name,
        'minimum_energy_efficiency_ratio' => cop_package['minimum_energy_efficiency_ratio'],
        'minimum_seasonal_energy_efficiency_ratio' => cop_package['minimum_seasonal_energy_efficiency_ratio'],
        'cool_cap_ft' => cop_package['cool_cap_ft'],
        'cool_cap_fflow' => cop_package['cool_cap_fflow'],
        'cool_eir_ft' => cop_package['cool_eir_ft'],
        'cool_eir_fflow' => cop_package['cool_eir_fflow'],
        'cool_plf_fplr' => cop_package['cool_eir_fplr']
      }
    end
    next if unitary_cop['minimum_energy_efficiency_ratio'].nil? && unitary_cop['minimum_seasonal_energy_efficiency_ratio'].nil? && unitary_cop['cool_cap_ft'].nil? &&
            unitary_cop['cool_cap_fflow'].nil? && unitary_cop['cool_eir_ft'].nil? && unitary_cop['cool_eir_fflow'].nil? && unitary_cop['cool_plf_fplr'].nil?

    # If the dx coil is on an air loop then update its cop and the performance curves when these are specified in the ecm data

    if (coil_type == 'SingleSpeed' && coil.airLoopHVAC.is_initialized && (!coil.name.to_s.include? "_ASHP")) ||
       (coil_type == 'MultiSpeed' && coil.containingHVACComponent.get.airLoopHVAC.is_initialized)
      cop = nil
      if unitary_cop['minimum_energy_efficiency_ratio']
        cop = eer_to_cop(unitary_cop['minimum_energy_efficiency_ratio'].to_f)
      elsif unitary_cop['minimum_seasonal_energy_efficiency_ratio']
        cop = seer_to_cop_cooling_with_fan(unitary_cop['minimum_seasonal_energy_efficiency_ratio'].to_f)
      end
      cool_cap_ft = nil
      cool_cap_ft = @standards_data['curves'].select { |curve| curve['name'] == unitary_cop['cool_cap_ft'] } if unitary_cop['cool_cap_ft']
      cool_cap_fflow = nil
      cool_cap_fflow = @standards_data['curves'].select { |curve| curve['name'] == unitary_cop['cool_cap_fflow'] } if unitary_cop['cool_cap_fflow']
      cool_eir_ft = nil
      cool_eir_ft = @standards_data['curves'].select { |curve| curve['name'] == unitary_cop['cool_eir_ft'] } if unitary_cop['cool_eir_ft']
      cool_eir_fflow = nil
      cool_eir_fflow = @standards_data['curves'].select { |curve| curve['name'] == unitary_cop['cool_eir_fflow'] } if unitary_cop['cool_eir_fflow']
      cool_plf_fplr = nil
      cool_plf_fplr = @standards_data['curves'].select { |curve| curve['name'] == unitary_cop['cool_plf_fplr'] } if unitary_cop['cool_plf_fplr']
      if coil_type == 'SingleSpeed'
        coil.setRatedCOP(cop) if cop
        coil.setTotalCoolingCapacityFunctionOfTemperatureCurve(cool_cap_ft) if cool_cap_ft
        coil.setTotalCoolingCapacityFunctionOfFlowFractionCurve(cool_cap_fflow) if cool_cap_fflow
        coil.setEnergyInputRatioFunctionOfTemperatureCurve(cool_eir_ft) if cool_eir_ft
        coil.setEnergyInputRatioFunctionOfFlowFractionCurve(cool_eir_fflow) if cool_eir_fflow
        coil.setPartLoadFractionCorrelationCurve(cool_plf_fplr) if cool_plf_fplr
      elsif coil_type == 'MultiSpeed'
        coil.stages.sort.each do |stage|
          stage.setGrossRatedCoolingCOP(cop) if cop
          stage.setTotalCoolingCapacityFunctionofTemperatureCurve(cool_cap_ft) if cool_cap_ft
          stage.setTotalCoolingCapacityFunctionofFlowFractionCurve(cool_cap_fflow) if cool_cap_fflow
          stage.setEnergyInputRatioFunctionofTemperatureCurve(cool_eir_ft) if cool_eir_ft
          stage.setEnergyInputRatioFunctionofFlowFractionCurve(cool_eir_fflow) if cool_eir_fflow
          stage.setPartLoadFractionCorrelationCurve(cool_plf_fplr) if cool_plf_fplr
        end
      end
      coil.setName('CoilCoolingDXSingleSpeed_dx-adv') if cop && coil_type == 'SingleSpeed'
      coil.setName('CoilCoolingDXMultiSpeed_dx-adv') if cop && coil_type == 'MultiSpeed'
    end
  end
end

#remove_air_loops(model) ⇒ Object

Remove air loops



60
61
62
63
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 60

def remove_air_loops(model)
  # remove air loops

  model.getAirLoopHVACs.each(&:remove)
end

#remove_all_zone_eqpt(sys_objs) ⇒ Object

Remove existing zone equipment



4
5
6
7
8
9
10
11
12
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 4

def remove_all_zone_eqpt(sys_objs)
  sys_objs.each do |isys|
    isys.thermalZones.each do |izone|
      if izone.equipment.empty? then next end

      izone.equipment.each(&:remove)
    end
  end
end

#remove_chw_loops(model) ⇒ Object

Remove chilled-water plant loops



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 31

def remove_chw_loops(model)
  model.getPlantLoops.each do |iloop|
    chw_loop = false
    iloop.supplyComponents.each do |icomp|
      if icomp.to_ChillerElectricEIR.is_initialized
        chw_loop = true
        break
      end
    end
    if chw_loop then iloop.remove end
  end
end

#remove_cw_loops(model) ⇒ Object

Remove condenser-water plant loops



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 46

def remove_cw_loops(model)
  model.getPlantLoops.each do |iloop|
    cw_loop = false
    iloop.supplyComponents.each do |icomp|
      if icomp.to_CoolingTowerSingleSpeed.is_initialized
        cw_loop = true
      end
    end
    if cw_loop then iloop.remove end
  end
end

#remove_hw_loops(model) ⇒ Object

Remove hot-water plant loops



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 16

def remove_hw_loops(model)
  model.getPlantLoops.each do |iloop|
    hw_loop = false
    iloop.supplyComponents.each do |icomp|
      if icomp.to_BoilerHotWater.is_initialized
        hw_loop = true
        break
      end
    end
    if hw_loop then iloop.remove end
  end
end

#reset_boiler_efficiency(model:, component:, eff:) ⇒ Object

This method takes an OS model, a “OS_BoilerHotWater” type compenent, condensing efficiency limit and an efficiency hash which looks like:

"eff": {
    "name": "NECB 88% Efficient Condensing Boiler",
    "efficiency" => 0.88,
    "part_load_curve" => "BOILER-EFFPLR-COND-NECB2011",
    "notes" => "From NECB 2011."
}

This method sets efficiency of the boiler to whatever is entered in eff. It then looks for the “part_load_curve” value in the curves.json file. If it does not find one it returns an error. If it finds one it reset the part load curve to whatever was found. It then determines the nominal capacity of the boiler. If the nominal capacity is greater than 1W the boiler is considered a primary boiler (for the name only) if the capacity is less than 1W the boiler is considered a secondary boiler (for the name only). It then renames the boiler according to the following pattern: “Primary/Secondary eff capacity kBtu/hr”.



2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2595

def reset_boiler_efficiency(model:, component:, eff:)
  component.setNominalThermalEfficiency(eff['efficiency'])
  part_load_curve_name = eff['part_load_curve'].to_s
  existing_curve = @standards_data['curves'].select { |curve| curve['name'] == part_load_curve_name }
  raise "No boiler with the name #{part_load_curve_name} could be found in the ECMS class curves.json file.  Please check both the ECMS class boiler_set.json and class curves.json files to ensure the curve is entered and referenced correctly." if existing_curve.empty?

  part_load_curve_data = (@standards_data['curves'].select { |curve| curve['name'] == part_load_curve_name })[0]
  if part_load_curve_data['independent_variable_1'].to_s.upcase == 'TEnteringBoiler'.upcase || part_load_curve_data['independent_variable_2'].to_s.upcase == 'TEnteringBoiler'.upcase
    component.setEfficiencyCurveTemperatureEvaluationVariable('EnteringBoiler')
  elsif part_load_curve_data['independent_variable_1'].to_s.upcase == 'TLeavingBoiler'.upcase || part_load_curve_data['independent_variable_2'].to_s.upcase == 'TLeavingBoiler'.upcase
    component.setEfficiencyCurveTemperatureEvaluationVariable('LeavingBoiler')
  end
  part_load_curve = model_add_curve(model, part_load_curve_name)
  raise "There was a problem setting the boiler part load curve named #{part_load_curve_name} for #{component.name}.  Please ensure that the curve is entered and referenced correctly in the ECMS class curves.json and boiler_set.json files." unless part_load_curve

  component.setNormalizedBoilerEfficiencyCurve(part_load_curve)
  if component.isNominalCapacityAutosized
    boiler_size_W = model.getAutosizedValue(component, 'Design Size Nominal Capacity', 'W').to_f
  else
    boiler_size_W = component.nominalCapacity.to_f
  end
  boiler_size_kbtu_per_hour = OpenStudio.convert(boiler_size_W, 'W', 'kBtu/h').get
  boiler_primacy = 'Primary '
  if boiler_size_W < 1.0
    boiler_primacy = 'Secondary '
  end
  if eff['name'].nil?
    eff_measure_name = 'Revised Performance Boiler'
  else
    eff_measure_name = eff['name']
  end
  new_boiler_name = (boiler_primacy + eff_measure_name + " #{boiler_size_kbtu_per_hour.round(0)}kBtu/hr #{component.nominalThermalEfficiency} Thermal Eff").strip
  component.setName(new_boiler_name)
end

#reset_chiller_efficiency(model:, component:, cop:) ⇒ Object



3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 3001

def reset_chiller_efficiency(model:, component:, cop:)
  # Note that all parameters (except for the capacity) of an existing chiller are replaced with the ones of the VSD chiller, as per Kamel Haddad's comment.

  component.setName('ChillerElectricEIR_VSDCentrifugalWaterChiller')
  component.setReferenceCOP(cop['cop_w_by_w'])
  component.setReferenceLeavingChilledWaterTemperature(cop['ref_leaving_chilled_water_temp_c'])
  component.setReferenceEnteringCondenserFluidTemperature(cop['ref_entering_condenser_fluid_temp_c'])
  component.isReferenceChilledWaterFlowRateAutosized
  component.isReferenceCondenserFluidFlowRateAutosized
  component.setMinimumPartLoadRatio(cop['min_part_load_ratio'])
  component.setMaximumPartLoadRatio(cop['max_part_load_ratio'])
  component.setOptimumPartLoadRatio(cop['opt_part_load_ratio'])
  component.setMinimumUnloadingRatio(cop['min_unloading_ratio'])
  component.setCondenserType(cop['condenser_type'])
  component.setFractionofCompressorElectricConsumptionRejectedbyCondenser(cop['fraction_of_compressor_electric_consumption_rejected_by_condenser'])
  component.setLeavingChilledWaterLowerTemperatureLimit(cop['leaving_chilled_water_lower_temperature_limit_c'])
  component.setChillerFlowMode(cop['chiller_flow_mode'])
  component.setDesignHeatRecoveryWaterFlowRate(cop['design_heat_recovery_water_flow_rate_m3_s'])

  # set other fields of this object to nothing #Note that this could not be done for the 'Condenser Heat Recovery Relative Capacity Fraction' field as there is no 'reset' for this field.

  component.resetCondenserFanPowerRatio
  component.resetSizingFactor
  component.resetBasinHeaterCapacity
  component.resetBasinHeaterSetpointTemperature
  component.resetBasinHeaterSchedule
  component.resetHeatRecoveryInletHighTemperatureLimitSchedule
  component.resetHeatRecoveryLeavingTemperatureSetpointNode

  ##### Replace cooling_capacity_function_of_temperature (CAPFT) curve

  capft_curve_name = cop['capft_curve'].to_s
  existing_curve = @standards_data['curves'].select { |curve| curve['name'] == capft_curve_name }
  raise "No chiller with the name #{capft_curve_name} could be found in the ECMS class curves.json file.  Please check both the ECMS class chiller_set.json and curves.json files to ensure the curve is entered and referenced correctly." if existing_curve.empty?

  capft_curve_data = (@standards_data['curves'].select { |curve| curve['name'] == capft_curve_name })[0]
  capft_curve = model_add_curve(model, capft_curve_name)
  component.setCoolingCapacityFunctionOfTemperature(capft_curve) if capft_curve
  raise "There was a problem setting the CoolingCapacityFunctionOfTemperature curve named #{capft_curve_name} for #{component.name}.  Please ensure that the curve is entered and referenced correctly in the ECMS class curves.json and chiller_set.json files." if !capft_curve

  ##### Replace electric_input_to_cooling_output_ratio_function_of_temperature (EIRFT) curve

  eirft_curve_name = cop['eirft_curve'].to_s
  existing_curve = @standards_data['curves'].select { |curve| curve['name'] == eirft_curve_name }
  raise "No chiller with the name #{eirft_curve_name} could be found in the ECMS class curves.json file.  Please check both the ECMS class chiller_set.json and curves.json files to ensure the curve is entered and referenced correctly." if existing_curve.empty?

  eirft_curve_data = (@standards_data['curves'].select { |curve| curve['name'] == eirft_curve_name })[0]
  eirft_curve = model_add_curve(model, eirft_curve_name)
  component.setElectricInputToCoolingOutputRatioFunctionOfTemperature(eirft_curve) if eirft_curve
  raise "There was a problem setting the ElectricInputToCoolingOutputRatioFunctionOfTemperature curve named #{eirft_curve_name} for #{component.name}.  Please ensure that the curve is entered and referenced correctly in the ECMS class curves.json and chiller_set.json files." if !eirft_curve

  ##### Replace electric_input_to_cooling_output_ratio_function_of_part_load_ratio (EIRFPLR) curve

  eirfplr_curve_name = cop['eirfplr_curve'].to_s
  existing_curve = @standards_data['curves'].select { |curve| curve['name'] == eirfplr_curve_name }
  raise "No chiller with the name #{eirfplr_curve_name} could be found in the ECMS class curves.json file.  Please check both the ECMS class chiller_set.json and curves.json files to ensure the curve is entered and referenced correctly." if existing_curve.empty?

  eirfplr_curve_data = (@standards_data['curves'].select { |curve| curve['name'] == eirfplr_curve_name })[0]
  eirfplr_curve = model_add_curve(model, eirfplr_curve_name)
  component.setElectricInputToCoolingOutputRatioFunctionOfPLR(eirfplr_curve) if eirfplr_curve
  raise "There was a problem setting the ElectricInputToCoolingOutputRatioFunctionOfPLR curve named #{eirfplr_curve_name} for #{component.name}.  Please ensure that the curve is entered and referenced correctly in the ECMS class curves.json and chiller_set.json files." if !eirfplr_curve
end

#reset_furnace_efficiency(model:, component:, eff:) ⇒ Object

This method takes an OS model, a “OS_CoilHeatingGas” type compenent, and an efficiency hash which looks like:

"eff": {
    "name": "NECB 85% Efficient Condensing Furnace",
    "efficiency" => 0.85,
    "part_load_curve" => "FURNACE-EFFPLR-COND-NECB2011",
    "notes" => "From NECB 2011."
}

This method sets the efficiency of the furnace to whatever is entered in eff. It then looks for the “part_load_curve” value in the curves.json file. If it does not find one it returns an error. If it finds one it reset the part load curve to whatever was found. It then renames the furnace according to the following pattern: “eff + <furnace number (whatever was there before)>”.



2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2691

def reset_furnace_efficiency(model:, component:, eff:)
  component.setGasBurnerEfficiency(eff['efficiency'])
  part_load_curve_name = eff['part_load_curve'].to_s
  existing_curve = @standards_data['curves'].select { |curve| curve['name'] == part_load_curve_name }
  raise "No furnace part load curve with the name #{part_load_curve_name} could be found in the ECMS class curves.json file.  Please check both the ECMS class curves.json and the measure furnace_set.json files to ensure the curve is entered and referenced correctly." if existing_curve.empty?

  part_load_curve = model_add_curve(model, part_load_curve_name)
  raise "There was a problem setting the furnace part load curve named #{part_load_curve_name} for #{component.name}.  Please ensure that the curve is entered and referenced correctly in the ECMS class curves.json or measure furnace_set.json files." unless part_load_curve

  component.setPartLoadFractionCorrelationCurve(part_load_curve)
  if eff['name'].nil?
    ecm_package_name = 'Revised Performance Furnace'
  else
    ecm_package_name = eff['name']
  end
  furnace_num = component.name.to_s.gsub(/[^0-9]/, '')
  new_furnace_name = (ecm_package_name + " #{furnace_num}").strip
  component.setName(new_furnace_name)
end

#reset_shw_efficiency(model:, component:, eff:) ⇒ Object

This method takes an OS model, a “OS_WaterHeaterMixed” type compenent, and an efficiency hash which looks like:

"eff": {
    "name": "Natural Gas Power Vent with Electric Ignition",
    "efficiency" => 0.94,
    "part_load_curve" => "SWH-EFFFPLR-NECB2011",
    "notes" => "From NECB 2011."
}

This method sets the efficiency of the shw heater to whatever is entered in eff. It then looks for the “part_load_curve” value in the curves.json file. If it does not find one it returns an error. If it finds one it resets the part load curve to whatever was found. It then renames the shw tank according to the following pattern: valumeGal eff_name Water Heater - CapacitykBtu/hr efficiency Therm Eff



2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 2771

def reset_shw_efficiency(model:, component:, eff:)
  return if component.heaterFuelType.to_s.upcase == 'ELECTRICITY'

  eff_result = component.setHeaterThermalEfficiency(eff['efficiency'].to_f)
  raise "There was a problem setting the efficiency of the SHW #{component.name}.  Please check the ECMS class shw_set.json file or the model." unless eff_result

  part_load_curve_name = eff['part_load_curve'].to_s
  existing_curve = @standards_data['curves'].select { |curve| curve['name'] == part_load_curve_name }
  raise "No shw tank part load curve with the name #{part_load_curve_name} could be found in the ECMS class curves.json file.  Please check both the ECMS class curves.json and the measure shw_set.json files to ensure the curve is entered and referenced correctly." if existing_curve.empty?

  part_load_curve = model_add_curve(model, part_load_curve_name)
  raise "There was a problem setting the shw tank part load curve named #{part_load_curve_name} for #{component.name}.  Please ensure that the curve is entered and referenced correctly in the ECMS class curves.json and shw_set.json files." unless part_load_curve

  component.setPartLoadFactorCurve(part_load_curve)
  # Get the volume and capacity of the SHW tank.

  if component.isTankVolumeAutosized
    shw_vol_gal = 'auto_size'
  else
    shw_vol_m3 = component.tankVolume.to_f
    shw_vol_gal = OpenStudio.convert(shw_vol_m3, 'm^3', 'gal').get.to_f.round(0)
  end
  if component.isHeaterMaximumCapacityAutosized
    shw_capacity_kBtu_hr = 'auto_cap'
  else
    shw_capacity_W = component.heaterMaximumCapacity.to_f
    shw_capacity_kBtu_hr = OpenStudio.convert(shw_capacity_W, 'W', 'kBtu/h').get.to_f.round(0)
  end
  # Set a default revised shw tank name if no name is present in the eff hash.

  if eff['name'].nil?
    shw_ecm_package_name = 'Revised'
  else
    shw_ecm_package_name = eff['name']
  end
  shw_name = ("#{shw_vol_gal} Gal #{shw_ecm_package_name} Water Heater - #{shw_capacity_kBtu_hr}kBtu/hr #{eff['efficiency']} Therm Eff").strip
  component.setName(shw_name)
end

#scale_electrical_loads(model:, scale: 'NECB_Default') ⇒ Object

Electrical



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/openstudio-standards/standards/necb/ECMS/loads.rb', line 25

def scale_electrical_loads(model:, scale: 'NECB_Default')
  ##### Remove leading or trailing whitespace in case users add them in inputs

  if scale.instance_of?(String)
    scale = scale.strip
  end
  return model if (scale == 'NECB_Default') || scale.nil?

  ##### Convert a string to a float

  if scale.instance_of?(String)
    scale = scale.to_f
  end
  if scale == 0.0
    model.getElectricEquipments.sort.each(&:remove)
    model.getElectricEquipmentDefinitions.sort.each(&:remove)
  else
    model.getElectricEquipments.sort.each do |item|
      item.setMultiplier(item.multiplier * scale)
    end
  end
end

#scale_infiltration_loads(model:, scale: 'NECB_Default') ⇒ Object

Infiltration



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/openstudio-standards/standards/necb/ECMS/loads.rb', line 71

def scale_infiltration_loads(model:, scale: 'NECB_Default')
  ##### Remove leading or trailing whitespace in case users add them in inputs

  if scale.instance_of?(String)
    scale = scale.strip
  end
  return model if (scale == 'NECB_Default') || scale.nil?

  ##### Convert a string to a float

  if scale.instance_of?(String)
    scale = scale.to_f
  end
  if scale == 0.0
    model.getSpaceInfiltrationDesignFlowRates.sort.each(&:remove)
  else
    model.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load|
      infiltration_load.setDesignFlowRate(infiltration_load.designFlowRate.get * scale) unless infiltration_load.designFlowRate.empty?
      infiltration_load.setFlowperSpaceFloorArea(infiltration_load.flowperSpaceFloorArea.get * scale) unless infiltration_load.flowperSpaceFloorArea.empty?
      infiltration_load.setFlowperExteriorSurfaceArea(infiltration_load.flowperExteriorSurfaceArea.get * scale) unless infiltration_load.flowperExteriorSurfaceArea.empty?
      infiltration_load.setAirChangesperHour(infiltration_load.airChangesperHour.get * scale) unless infiltration_load.airChangesperHour.empty?
    end
  end
end

#scale_oa_loads(model:, scale: 'NECB_Default') ⇒ Object

Outdoor Air



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/openstudio-standards/standards/necb/ECMS/loads.rb', line 47

def scale_oa_loads(model:, scale: 'NECB_Default')
  ##### Remove leading or trailing whitespace in case users add them in inputs

  if scale.instance_of?(String)
    scale = scale.strip
  end
  return model if (scale == 'NECB_Default') || scale.nil?

  ##### Convert a string to a float

  if scale.instance_of?(String)
    scale = scale.to_f
  end
  if scale == 0.0
    model.getDesignSpecificationOutdoorAirs.sort.each(&:remove)
  else
    model.getDesignSpecificationOutdoorAirs.sort.each do |oa_def|
      oa_def.setOutdoorAirFlowperPerson(oa_def.outdoorAirFlowperPerson * scale) unless oa_def.isOutdoorAirFlowperPersonDefaulted
      oa_def.setOutdoorAirFlowperFloorArea(oa_def.outdoorAirFlowperFloorArea * scale) unless oa_def.isOutdoorAirFlowperFloorAreaDefaulted
      oa_def.setOutdoorAirFlowRate(oa_def.outdoorAirFlowRate * scale) unless oa_def.isOutdoorAirFlowRateDefaulted
      oa_def.setOutdoorAirFlowAirChangesperHour(oa_def.outdoorAirFlowAirChangesperHour * scale) unless oa_def.isOutdoorAirFlowAirChangesperHourDefaulted
    end
  end
end

#scale_occupancy_loads(model:, scale: 'NECB_Default') ⇒ Object

Occupancy



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/openstudio-standards/standards/necb/ECMS/loads.rb', line 3

def scale_occupancy_loads(model:, scale: 'NECB_Default')
  ##### Remove leading or trailing whitespace in case users add them in inputs

  if scale.instance_of?(String)
    scale = scale.strip
  end
  return model if (scale == 'NECB_Default') || scale.nil?

  ##### Convert a string to a float

  if scale.instance_of?(String)
    scale = scale.to_f
  end
  if scale == 0.0
    model.getPeoples.sort.each(&:remove)
    model.getPeopleDefinitions.sort.each(&:remove)
  else
    model.getPeoples.sort.each do |item|
      item.setMultiplier(item.multiplier * scale)
    end
  end
end

#update_system_zones_map(model, system_zones_map, system_zones_map_option, system_key) ⇒ Object

Update the map between systems and zones



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 448

def update_system_zones_map(model,system_zones_map,system_zones_map_option,system_key)
  updated_system_zones_map = {}
  if system_zones_map_option == 'one_sys_per_bldg'
    system_zones_map.each do |sname,zones|
      updated_system_zones_map[system_key] = [] if !updated_system_zones_map.has_key? system_key
      updated_system_zones_map[system_key] += zones
    end
  elsif system_zones_map_option == 'one_sys_per_floor'
    storey_zones_map = get_storey_zones_map(system_zones_map)
    storey_zones_map.each do |storey_name,zones|
      sys_name = "#{system_key}_#{storey_name.gsub(' ','_')}"
      updated_system_zones_map[sys_name] = [] if !updated_system_zones_map.has_key? sys_name
      updated_system_zones_map[sys_name] += zones
    end
  end
  return updated_system_zones_map
end

#zone_with_no_vrf_eqpt?(zone) ⇒ Boolean

Method to determine whether zone can have terminal vrf equipment. Zones with no vrf terminal equipment are characterized by transient occupancy such is the case for corridors, stairwells, storage, …



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb', line 313

def zone_with_no_vrf_eqpt?(zone)
  space_types_to_skip = {}
  space_types_to_skip['NECB2011'] = ['Atrium - H < 13m',
                                     'Atrium - H > 13m',
                                     'Audience - auditorium',
                                     'Corr. < 2.4m wide',
                                     'Corr. >= 2.4m wide',
                                     'Electrical/Mechanical',
                                     'Hospital corr. < 2.4m',
                                     'Hospital corr. >= 2.4m',
                                     'Mfg - corr. < 2.4m',
                                     'Mfg - corr. >= 2.4m',
                                     'Lobby - elevator',
                                     'Lobby - hotel',
                                     'Lobby - motion picture',
                                     'Lobby - other',
                                     'Lobby - performance arts',
                                     'Locker room',
                                     'Parking garage space',
                                     'Stairway',
                                     'Storage area',
                                     'Storage area - occsens',
                                     'Storage area - refrigerated',
                                     'Storage area - refrigerated - occsens',
                                     'Washroom',
                                     'Warehouse - fine',
                                     'Warehouse - fine - refrigerated',
                                     'Warehouse - med/blk',
                                     'Warehouse - med/blk - refrigerated',
                                     'Warehouse - med/blk2',
                                     'Warehouse - med/blk2 - refrigerated',
                                     'Hotel/Motel - lobby']

  space_types_to_skip['NECB2015'] = ['Atrium (height < 6m)',
                                     'Atrium (6 =< height <= 12m)',
                                     'Atrium (height > 12m)',
                                     'Computer/Server room-sch-A',
                                     'Copy/Print room',
                                     'Corridor/Transition area - hospital',
                                     'Corridor/Transition area - manufacturing facility',
                                     'Corridor/Transition area - space designed to ANSI/IES RP-28',
                                     'Corridor/Transition area other',
                                     'Electrical/Mechanical room',
                                     'Emergency vehicle garage',
                                     'Lobby - elevator',
                                     'Lobby - hotel',
                                     'Lobby - motion picture theatre',
                                     'Lobby - performing arts theatre',
                                     'Lobby - space designed to ANSI/IES RP-28',
                                     'Lobby - other',
                                     'Locker room',
                                     'Storage garage interior',
                                     'Storage room < 5 m2',
                                     'Storage room <= 5 m2 <= 100 m2',
                                     'Storage room > 100 m2',
                                     'Washroom - space designed to ANSI/IES RP-28',
                                     'Washroom - other',
                                     'Warehouse storage area medium to bulky palletized items',
                                     'Warehouse storage area small hand-carried items(4)']

  space_types_to_skip['NECB2017'] = ['Atrium (height < 6m)',
                                     'Atrium (6 =< height <= 12m)',
                                     'Atrium (height > 12m)',
                                     'Computer/Server room',
                                     'Copy/Print room',
                                     'Corridor/Transition area - hospital',
                                     'Corridor/Transition area - manufacturing facility',
                                     'Corridor/Transition area - space designed to ANSI/IES RP-28',
                                     'Corridor/Transition area other',
                                     'Electrical/Mechanical room',
                                     'Emergency vehicle garage',
                                     'Lobby - elevator',
                                     'Lobby - hotel',
                                     'Lobby - motion picture theatre',
                                     'Lobby - performing arts theatre',
                                     'Lobby - space designed to ANSI/IES RP-28',
                                     'Lobby - other',
                                     'Locker room',
                                     'Stairway/Stairwell',
                                     'Storage garage interior',
                                     'Storage room < 5 m2',
                                     'Storage room <= 5 m2 <= 100 m2',
                                     'Storage room > 100 m2',
                                     'Washroom - space designed to ANSI/IES RP-28',
                                     'Washroom - other',
                                     'Warehouse storage area medium to bulky palletized items',
                                     'Warehouse storage area small hand-carried items(4)']

  zone_does_not_have_vrf_eqpt = false
  zone.spaces.each do |space|
    space_types_to_skip.each do |std, spfs|
      spfs.each do |spf|
        if space.spaceType.get.name.to_s.downcase.include? spf.downcase
          zone_does_not_have_vrf_eqpt = true
          break
        end
      end
      break if zone_does_not_have_vrf_eqpt
    end
    break if zone_does_not_have_vrf_eqpt
  end
end