lib/openstudio-standards/hvac_sizing/Siz.ThermalZone.rb in openstudio-standards-0.1.4 vs lib/openstudio-standards/hvac_sizing/Siz.ThermalZone.rb in openstudio-standards-0.1.5
- old
+ new
@@ -157,18 +157,21 @@
query = "SELECT Value
FROM tabulardatawithstrings
WHERE ReportName='HVACSizingSummary'
AND ReportForString='Entire Facility'
AND TableName='#{table_name}'
- AND ColumnName='User Design Load per Area'
+ AND ColumnName='User Design Load'
AND RowName='#{name}'
- AND Units='W/m2'"
+ AND Units='W'"
val = sql.execAndReturnFirstDouble(query)
if val.is_initialized
- result = OpenStudio::OptionalDouble.new(val.get)
+ floor_area_no_multiplier_m2 = self.floorArea
+ floor_area_m2 = floor_area_no_multiplier_m2 * self.multiplier
+ w_per_m2 = val.get/floor_area_m2
+ result = OpenStudio::OptionalDouble.new(w_per_m2)
else
#OpenStudio::logFree(OpenStudio::Warn, "openstudio.model.Model", "Data not found for query: #{query}")
end
else
@@ -202,18 +205,21 @@
query = "SELECT Value
FROM tabulardatawithstrings
WHERE ReportName='HVACSizingSummary'
AND ReportForString='Entire Facility'
AND TableName='#{table_name}'
- AND ColumnName='User Design Load per Area'
+ AND ColumnName='User Design Load'
AND RowName='#{name}'
- AND Units='W/m2'"
+ AND Units='W'"
val = sql.execAndReturnFirstDouble(query)
if val.is_initialized
- result = OpenStudio::OptionalDouble.new(val.get)
+ floor_area_no_multiplier_m2 = self.floorArea
+ floor_area_m2 = floor_area_no_multiplier_m2 * self.multiplier
+ w_per_m2 = val.get/floor_area_m2
+ result = OpenStudio::OptionalDouble.new(w_per_m2)
else
#OpenStudio::logFree(OpenStudio::Warn, "openstudio.model.Model", "Data not found for query: #{query}")
end
else
@@ -234,9 +240,26 @@
# Coal, Diesel, Gasoline, DistrictCooling, DistrictHeating,
# and SolarEnergy.
def heating_fuels
fuels = []
+
+ # Special logic for models imported from Sefaira.
+ # In this case, the fuels are listed as a comment
+ # above the Zone object.
+ if !self.comment == ''
+ m = self.comment.match /! *(.*)/
+ if m
+ all_fuels = m[1].split(',')
+ all_fuels.each do |fuel|
+ fuels += fuel.strip
+ end
+ end
+ if fuels.size > 0
+ OpenStudio::logFree(OpenStudio::Info, 'openstudio.model.Model', "For #{self.name}, fuel type #{fuels.join(', ')} pulled from Zone comment.")
+ fuels.uniq.sort
+ end
+ end
# Check the zone hvac heating fuels
fuels += self.model.zone_equipment_heating_fuels(self)
# Check the zone airloop heating fuels