Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new workflow to search constructions. #1255

Merged
merged 4 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,42 @@ def model_set_building_north_axis(model, north_axis)
return true
end

# Calculate a model's window or WWR
# Disregard space conditioning (assume all spaces are conditioned)
# which is true for most of not all prototypes
#
# @param model [OpenStudio::Model::Model] OpenStudio model object
# @param wwr [Boolean]
# @return [Numeric] Returns window to wall ratio (percentage) or window area.
def model_get_window_area_info(model, wwr = true)

window_area = 0
wall_area = 0

model.getSpaces.each do |space|
# Get zone multipler
multiplier = space.thermalZone.get.multiplier
space.surfaces.each do |surface|
next if surface.surfaceType != 'Wall'
next if surface.outsideBoundaryCondition != 'Outdoors'

# Get wall and window area
wall_area += surface.grossArea * multiplier
surface.subSurfaces.each do |subsurface|
subsurface_type = subsurface.subSurfaceType.to_s.downcase
# Do not count doors
next unless (subsurface_type.include? 'window') || (subsurface_type.include? 'glass')

window_area += subsurface.grossArea * subsurface.multiplier * multiplier
end
end
end
return window_area / wall_area * 100 if wwr

# else
return window_area
end

# Calculate a model's window or WWR for a specific orientation
# Disregard space conditioning (assume all spaces are conditioned)
# which is true for most of not all prototypes
Expand Down
33 changes: 27 additions & 6 deletions lib/openstudio-standards/standards/Standards.Model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2524,12 +2524,24 @@ def model_find_and_add_construction(model, climate_zone_set, intended_surface_ty
# which specifies properties by construction category by climate zone set.
# AKA the info in Tables 5.5-1-5.5-8

props = model_find_object(standards_data['construction_properties'],
'template' => template,
'climate_zone_set' => climate_zone_set,
'intended_surface_type' => intended_surface_type,
'standards_construction_type' => standards_construction_type,
'building_category' => building_category)
wwr = model_get_percent_of_surface_range(model, intended_surface_type)
if wwr['minimum_percent_of_surface'].nil? && wwr['maximum_percent_of_surface'].nil?
props = model_find_object(standards_data['construction_properties'],
'template' => template,
'climate_zone_set' => climate_zone_set,
'intended_surface_type' => intended_surface_type,
'standards_construction_type' => standards_construction_type,
'building_category' => building_category)
else
props = model_find_object(standards_data['construction_properties'],
'template' => template,
'climate_zone_set' => climate_zone_set,
'intended_surface_type' => intended_surface_type,
'standards_construction_type' => standards_construction_type,
'building_category' => building_category,
'minimum_percent_of_surface' => wwr['minimum_percent_of_surface'],
'maximum_percent_of_surface' => wwr['maximum_percent_of_surface'])
end

if !props
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Model', "Could not find construction properties for: #{template}-#{climate_zone_set}-#{intended_surface_type}-#{standards_construction_type}-#{building_category}.")
Expand Down Expand Up @@ -5779,6 +5791,15 @@ def gather_inputs_parametric_schedules(sch, load_inst, parametric_inputs, hours_
return parametric_inputs
end

# Determine the surface range of a baseline model.
# The method calculates the window to wall ratio (assuming all spaces are conditioned)
# and select the range based on the calculated window to wall ratio
# @param model [OpenStudio::Model::Model] OpenStudio model object
# @param intended_surface_type [String] surface type
def model_get_percent_of_surface_range(model, intended_surface_type)
return { 'minimum_percent_of_surface' => nil, 'maximum_percent_of_surface' => nil }
end

# Default SAT reset type
#
# @param air_loop_hvac [OpenStudio::Model::AirLoopHVAC] air loop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,40 @@ def model_get_climate_zone_set_from_list(model, possible_climate_zone_sets)
end
return climate_zone_set
end

# @!group Model
#
# Determine the surface range of a baseline model.
# The method calculates the window to wall ratio (assuming all spaces are conditioned)
# and select the range based on the calculated window to wall ratio
# @param model [OpenStudio::Model::Model] OpenStudio model object
# @param intended_surface_type [String] intended surface type
def model_get_percent_of_surface_range(model, intended_surface_type)
wwr_range = {}

# Do not process surfaces other than exterior windows and glass door for 2004 standard
if intended_surface_type != 'ExteriorWindow' && intended_surface_type != 'GlassDoor'
wwr_range['minimum_percent_of_surface'] = nil
wwr_range['maximum_percent_of_surface'] = nil
else
wwr = model_get_window_area_info(model, true)
if wwr <= 10
wwr_range['minimum_percent_of_surface'] = 0
wwr_range['maximum_percent_of_surface'] = 10
elsif wwr <= 20
wwr_range['minimum_percent_of_surface'] = 10.001
wwr_range['maximum_percent_of_surface'] = 20
elsif wwr <= 30
wwr_range['minimum_percent_of_surface'] = 20.001
wwr_range['maximum_percent_of_surface'] = 30
elsif wwr <= 40
wwr_range['minimum_percent_of_surface'] = 30.001
wwr_range['maximum_percent_of_surface'] = 40
else
wwr_range['minimum_percent_of_surface'] = 40.001
wwr_range['maximum_percent_of_surface'] = 100.0
end
end
return wwr_range
end
end
2 changes: 1 addition & 1 deletion test/doe_prototype/test_small_office.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class TestSmallOffice < CreateDOEPrototypeBuildingTest
building_types = ['SmallOffice']
templates = ['DOE Ref Pre-1980','DOE Ref 1980-2004','90.1-2007','90.1-2013','90.1-2016','90.1-2019']
templates = ['DOE Ref Pre-1980','DOE Ref 1980-2004','90.1-2004','90.1-2007','90.1-2013','90.1-2016','90.1-2019']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's maybe remove 90.1-2004 from the list so templates is consistent with the other building types.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

90.1-2004 is removed.

climate_zones = ['ASHRAE 169-2013-2A','ASHRAE 169-2013-3B','ASHRAE 169-2013-5A','ASHRAE 169-2013-8A']
epw_files = ['USA_FL_Miami.Intl.AP.722020_TMY3.epw'] # not used for ASHRAE/DOE archetypes, but required for call
create_models = true
Expand Down