lib/openstudio-standards/standards/necb/ECMS/ecms.rb in openstudio-standards-0.2.12 vs lib/openstudio-standards/standards/necb/ECMS/ecms.rb in openstudio-standards-0.2.13.rc3

- old
+ new

@@ -39,11 +39,11 @@ @template = self.class.name @standards_data = self.load_standards_database_new() @standards_data['curves'] = standards_data['tables']["curves"]['table'] end - def apply_system_ecm(model:, ecm_system_name: nil, template_standard:, runner: nil) + def apply_system_ecm(model:, ecm_system_name: nil, template_standard:, runner: nil, primary_heating_fuel: nil) # 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_std = Standard.build("ECMS") systems = model.getAirLoopHVACs @@ -57,22 +57,35 @@ 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, - zone_clg_eqpt_type: zone_clg_eqpt_type, - standard: template_standard) + + # Rather than go through every add_ecm class to add 'the primary_heating_fuel' argument I added this statement to + # only include it when it is used (for now in the add_ecm_remove_airloops_add_zone_baseboards method). + unless (ecm_add_method_name == "add_ecm_remove_airloops_add_zone_baseboards") + ecm_std.send(ecm_add_method_name, + model: model, + system_zones_map: map_system_to_zones, + system_doas_flags: system_doas_flags, + zone_clg_eqpt_type: zone_clg_eqpt_type, + standard: template_standard) + else + ecm_std.send(ecm_add_method_name, + model: model, + system_zones_map: map_system_to_zones, + system_doas_flags: system_doas_flags, + zone_clg_eqpt_type: zone_clg_eqpt_type, + standard: template_standard, + primary_heating_fuel: primary_heating_fuel) + end #ecm_std.add_ecm_hs09_ccashpsys(model:model,system_zones_map:,system_doas_flags:,zone_clg_eqpt_type: nil,standard:,baseboard_flag: true) end 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' + 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)