lib/openstudio-standards/standards/Standards.BoilerHotWater.rb in openstudio-standards-0.1.3 vs lib/openstudio-standards/standards/Standards.BoilerHotWater.rb in openstudio-standards-0.1.4

- old
+ new

@@ -108,11 +108,11 @@ end # Applies the standard efficiency ratings and typical performance curves to this object. # - # @param template [String] valid choices: 'DOE Ref Pre-1980', 'DOE Ref 1980-2004', '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013' + # @param template [String] valid choices: 'DOE Ref Pre-1980', 'DOE Ref 1980-2004', '90.1-2004', '90.1-2007', '90.1-2010', '90.1-2013', 'NECB2011' # @param standards [Hash] the OpenStudio_Standards spreadsheet in hash format # @return [Bool] true if successful, false if not def setStandardEfficiencyAndCurves(template) successfully_set_all_properties = false @@ -155,23 +155,51 @@ else OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.BoilerHotWater', "For #{self.name} capacity is not available, cannot apply efficiency standard.") successfully_set_all_properties = false return successfully_set_all_properties end - + + # for NECB, check if secondary and/or modulating boiler required + if (template == 'NECB 2011') + if (capacity_w/1000.0 >= 352.0) + if (self.name.to_s.include?("Primary Boiler")) + boiler_capacity = capacity_w + self.setBoilerFlowMode('LeavingSetpointModulated') + self.setMinimumPartLoadRatio(0.25) + elsif (self.name.to_s.include?("Secondary Boiler")) + boiler_capacity = 0.001 + end + elsif ((capacity_w/1000.0) >= 176.0) && ((capacity_w/1000.0) < 352.0) + boiler_capacity = capacity_w/2 + elsif ((capacity_w/1000.0) <= 176.0) + if (self.name.to_s.include?("Primary Boiler")) + boiler_capacity = capacity_w + elsif (self.name.to_s.include?("Secondary Boiler")) + boiler_capacity = 0.001 + end + end + self.setNominalCapacity(boiler_capacity) + end # NECB 2011 + # Convert capacity to Btu/hr - capacity_btu_per_hr = OpenStudio.convert(capacity_w, "W", "Btu/hr").get - capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, "W", "kBtu/hr").get + if template == 'NECB 2011' + capacity_btu_per_hr = OpenStudio.convert(boiler_capacity, "W", "Btu/hr").get + capacity_kbtu_per_hr = OpenStudio.convert(boiler_capacity, "W", "kBtu/hr").get + else + capacity_btu_per_hr = OpenStudio.convert(capacity_w, "W", "Btu/hr").get + capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, "W", "kBtu/hr").get + end + # Get the boiler properties blr_props = self.model.find_object(boilers, search_criteria, capacity_btu_per_hr) unless blr_props OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.BoilerHotWater', "For #{self.name}, cannot find boiler properties, cannot apply efficiency standard.") successfully_set_all_properties = false return successfully_set_all_properties end - + # Make the EFFFPLR curve eff_fplr = self.model.add_curve(blr_props['efffplr']) if eff_fplr self.setNormalizedBoilerEfficiencyCurve(eff_fplr) else @@ -179,11 +207,11 @@ successfully_set_all_properties = false end # Get the minimum efficiency standards thermal_eff = nil - + # If specified as AFUE unless blr_props['minimum_annual_fuel_utilization_efficiency'].nil? min_afue = blr_props['minimum_annual_fuel_utilization_efficiency'] thermal_eff = afue_to_thermal_eff(min_afue) self.setName("#{self.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_afue} AFUE") @@ -208,19 +236,9 @@ # Set the efficiency values unless thermal_eff.nil? self.setNominalThermalEfficiency(thermal_eff) end - #puts "capacity_w = #{capacity_w}" - - # for NECB, check if modulating boiler required - # TO DO: logic for 2 stage boilers when heating cap > 176 kW and < 352 kW - if template == 'NECB 2011' - if capacity_w >= 352000 - self.setBoilerFlowMode('LeavingSetpointModulated') - self.setMinimumPartLoadRatio(0.25) - end - end # NECB 2011 - return successfully_set_all_properties + return successfully_set_all_properties end end