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

Feature/extension gem #1602

Merged
merged 10 commits into from
Sep 15, 2023
4 changes: 4 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ lib/openstudio-standards/prototypes/**/*.rb
lib/openstudio-standards/utilities/**/*.rb
lib/openstudio-standards/weather/**/*.rb
lib/openstudio-standards/refs/references.rb
lib/openstudio-standards/schedules/**/*.rb
lib/openstudio-standards/geometry/**/*.rb
lib/openstudio-standards/create_typical/**/*.rb

-
docs/Home.md
docs/UserQuickStartGuide.md
Expand Down
17 changes: 17 additions & 0 deletions lib/openstudio-standards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
module OpenstudioStandards
require 'json' # Used to load standards JSON files

# Load Modules

# Geometry Module
require_relative 'openstudio-standards/geometry/create'
require_relative 'openstudio-standards/geometry/modify'
require_relative 'openstudio-standards/geometry/information'

# Schedules Module
require_relative 'openstudio-standards/schedules/create'
require_relative 'openstudio-standards/schedules/modify'
require_relative 'openstudio-standards/schedules/information'

# CreateTypical Module
require_relative 'openstudio-standards/create_typical/enumerations'
require_relative 'openstudio-standards/create_typical/space_type_ratios'
require_relative 'openstudio-standards/create_typical/create_typical'

# Weather data
require_relative 'openstudio-standards/weather/Weather.Model'

Expand Down
999 changes: 999 additions & 0 deletions lib/openstudio-standards/create_typical/create_typical.rb

Large diffs are not rendered by default.

299 changes: 299 additions & 0 deletions lib/openstudio-standards/create_typical/enumerations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
# Methods to create available inputs for typical models
module OpenstudioStandards
module CreateTypical
# @!group CreateTypicalEnumerations

# Get DOE building types
#
# @param extended [Boolean] set to true to return additional building types
# @return [OpenStudio::StringVector] array of building type strings
def self.get_doe_building_types(extended = false)
# DOE Prototypes
array = OpenStudio::StringVector.new
array << 'SecondarySchool'
array << 'PrimarySchool'
array << 'SmallOffice'
array << 'MediumOffice'
array << 'LargeOffice'
array << 'SmallHotel'
array << 'LargeHotel'
array << 'Warehouse'
array << 'RetailStandalone'
array << 'RetailStripmall'
array << 'QuickServiceRestaurant'
array << 'FullServiceRestaurant'
array << 'MidriseApartment'
array << 'HighriseApartment'
array << 'Hospital'
array << 'Outpatient'
array << 'SuperMarket'
array << 'Laboratory'
array << 'LargeDataCenterLowITE'
array << 'LargeDataCenterHighITE'
array << 'SmallDataCenterLowITE'
array << 'SmallDataCenterHighITE'
array << 'Courthouse'
array << 'College'

return array
end

# Get DEER building types
#
# @param extended [Boolean] set to true to return additional building types
# @return [OpenStudio::StringVector] array of building type strings
def self.get_deer_building_types(extended = false)
# DOE Prototypes
array = OpenStudio::StringVector.new
array << 'Asm'
array << 'DMo'
array << 'ECC'
array << 'EPr'
array << 'ERC'
array << 'ESe'
array << 'EUn'
array << 'GHs'
array << 'Gro'
array << 'Hsp'
array << 'Htl'
array << 'MBT'
array << 'MFm'
array << 'MLI'
array << 'Mtl'
array << 'Nrs'
array << 'OfL'
array << 'OfS'
array << 'RFF'
array << 'RSD'
array << 'Rt3'
array << 'RtL'
array << 'RtS'
array << 'SCn'
array << 'SFm'
array << 'SUn'
array << 'WRf'

return array
end

# list of building types that are valid for get_space_types_from_building_type
#
# @param extended [Boolean] set to true to return additional building types
# @return [OpenStudio::StringVector] array of building type strings
def self.get_building_types(extended = false)
# get building_types
if extended
doe = get_doe_building_types(true)
deer = get_deer_building_types(true)
else
doe = get_doe_building_types
deer = get_deer_building_types
end

# combine building_types
array = OpenStudio::StringVector.new
temp_array = doe.to_a + deer.to_a
temp_array.each do |i|
array << i
end

return array
end

# Get DOE templates
#
# @param extended [Boolean] set to true to return additional templates
# @return [OpenStudio::StringVector] array of available standard templates as strings
def self.get_doe_templates(extended = false)
array = OpenStudio::StringVector.new
array << 'DOE Ref Pre-1980'
array << 'DOE Ref 1980-2004'
array << '90.1-2004'
array << '90.1-2007'
array << '90.1-2010'
array << '90.1-2013'
array << '90.1-2016'
array << '90.1-2019'
array << 'ComStock DOE Ref Pre-1980'
array << 'ComStock DOE Ref 1980-2004'
array << 'ComStock 90.1-2004'
array << 'ComStock 90.1-2007'
array << 'ComStock 90.1-2010'
array << 'ComStock 90.1-2013'
array << 'ComStock 90.1-2016'
array << 'ComStock 90.1-2019'
if extended
# array << '189.1-2009' # if turn this on need to update space_type_array for RetailStripmall
array << 'NREL ZNE Ready 2017'
end

return array
end

# Get DEER templates
#
# @param extended [Boolean] set to true to return additional templates
# @return [OpenStudio::StringVector] array of available standard templates as strings
def self.get_deer_templates(extended = false)
array = OpenStudio::StringVector.new
array << 'DEER Pre-1975'
array << 'DEER 1985'
array << 'DEER 1996'
array << 'DEER 2003'
array << 'DEER 2007'
array << 'DEER 2011'
array << 'DEER 2014'
array << 'DEER 2015'
array << 'DEER 2017'
array << 'DEER 2020'
if extended
array << 'DEER 2025'
array << 'DEER 2030'
array << 'DEER 2035'
array << 'DEER 2040'
array << 'DEER 2045'
array << 'DEER 2050'
array << 'DEER 2055'
array << 'DEER 2060'
array << 'DEER 2065'
array << 'DEER 2070'
array << 'DEER 2075'
end

array << 'ComStock DEER Pre-1975'
array << 'ComStock DEER 1985'
array << 'ComStock DEER 1996'
array << 'ComStock DEER 2003'
array << 'ComStock DEER 2007'
array << 'ComStock DEER 2011'
array << 'ComStock DEER 2014'
array << 'ComStock DEER 2015'
array << 'ComStock DEER 2017'
array << 'ComStock DEER 2020'

return array
end

# list of templates that are valid for get_space_types_from_building_type
#
# @param extended [Boolean] set to true to return additional templates
# @return [OpenStudio::StringVector] array of available standard templates as strings
def self.get_templates(extended = false)
# get templates
if extended
doe = get_doe_templates(true)
deer = get_deer_templates(true)
else
doe = get_doe_templates
deer = get_deer_templates
end

# combine templates
array = OpenStudio::StringVector.new
temp_array = doe.to_a + deer.to_a
temp_array.each do |i|
array << i
end

return array
end

# Get DOE climate zones
#
# @param extended [Boolean] set to true to return additional climate zones
# @param extra [String] extra climate zone to append to list
# @return [OpenStudio::StringVector] array of available climate zones as strings
def self.get_doe_climate_zones(extended = false, extra = nil)
# Lookup From Model should be added as an option where appropriate in the measure
cz_choices = OpenStudio::StringVector.new
if !extra.nil?
cz_choices << extra
end
cz_choices << 'ASHRAE 169-2013-1A'
cz_choices << 'ASHRAE 169-2013-1B'
cz_choices << 'ASHRAE 169-2013-2A'
cz_choices << 'ASHRAE 169-2013-2B'
cz_choices << 'ASHRAE 169-2013-3A'
cz_choices << 'ASHRAE 169-2013-3B'
cz_choices << 'ASHRAE 169-2013-3C'
cz_choices << 'ASHRAE 169-2013-4A'
cz_choices << 'ASHRAE 169-2013-4B'
cz_choices << 'ASHRAE 169-2013-4C'
cz_choices << 'ASHRAE 169-2013-5A'
cz_choices << 'ASHRAE 169-2013-5B'
cz_choices << 'ASHRAE 169-2013-5C'
cz_choices << 'ASHRAE 169-2013-6A'
cz_choices << 'ASHRAE 169-2013-6B'
cz_choices << 'ASHRAE 169-2013-7A'
cz_choices << 'ASHRAE 169-2013-8A'
if extended
cz_choices << 'ASHRAE 169-2013-0A'
cz_choices << 'ASHRAE 169-2013-0B'
end

return cz_choices
end

# Get DEER climate zones
#
# @param extended [Boolean] set to true to return additional climate zones
# @param extra [String] extra climate zone to append to list
# @return [OpenStudio::StringVector] array of available climate zones as strings
def self.get_deer_climate_zones(extended = false, extra = nil)
# Lookup From Model should be added as an option where appropriate in the measure
cz_choices = OpenStudio::StringVector.new
if !extra.nil?
cz_choices << extra
end
cz_choices << 'CEC T24-CEC1'
cz_choices << 'CEC T24-CEC2'
cz_choices << 'CEC T24-CEC3'
cz_choices << 'CEC T24-CEC4'
cz_choices << 'CEC T24-CEC5'
cz_choices << 'CEC T24-CEC6'
cz_choices << 'CEC T24-CEC7'
cz_choices << 'CEC T24-CEC8'
cz_choices << 'CEC T24-CEC9'
cz_choices << 'CEC T24-CEC10'
cz_choices << 'CEC T24-CEC11'
cz_choices << 'CEC T24-CEC12'
cz_choices << 'CEC T24-CEC13'
cz_choices << 'CEC T24-CEC14'
cz_choices << 'CEC T24-CEC15'
cz_choices << 'CEC T24-CEC16'

return cz_choices
end

# Get climate zones
#
# @param extended [Boolean] set to true to return additional climate zones
# @param extra [String] extra climate zone to append to list
# @return [OpenStudio::StringVector] array of available climate zones as strings
def self.get_climate_zones(extended = false, extra = nil)
# get climate_zones
if extended && !extra.nil?
doe = get_doe_climate_zones(true, extra)
deer = get_deer_climate_zones(true, nil)
elsif extended
doe = get_doe_climate_zones(true, nil)
deer = get_deer_climate_zones(true, nil)
elsif !extra.nil?
doe = get_doe_climate_zones(false, extra)
deer = get_deer_climate_zones(false, nil)
else
doe = get_doe_climate_zones
deer = get_deer_climate_zones
end

# combine climate zones
array = OpenStudio::StringVector.new
temp_array = doe.to_a + deer.to_a
temp_array.each do |i|
array << i
end

return array
end
end
end
Loading