Skip to content

Commit

Permalink
Latest measures.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Aug 9, 2017
1 parent e691589 commit 459786e
Show file tree
Hide file tree
Showing 500 changed files with 22,518 additions and 8,934 deletions.
2 changes: 1 addition & 1 deletion measures/TimeseriesCSVExport/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def arguments()
reporting_frequency_chs << "Daily"
reporting_frequency_chs << "Monthly"
reporting_frequency_chs << "Runperiod"
reporting_frequency = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('reporting_frequency', reporting_frequency_chs, true)
reporting_frequency = OpenStudio::Measure::OSArgument::makeChoiceArgument('reporting_frequency', reporting_frequency_chs, true)
reporting_frequency.setDisplayName("Reporting Frequency")
reporting_frequency.setDefaultValue("Hourly")
args << reporting_frequency
Expand Down
6 changes: 3 additions & 3 deletions measures/TimeseriesCSVExport/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<schema_version>3.0</schema_version>
<name>timeseries_csv_export</name>
<uid>2a3442c1-944d-4e91-9e11-11e0cf368c64</uid>
<version_id>a04c3f7f-d8cd-45e7-a9c3-80686b6c6423</version_id>
<version_modified>20170419T215221Z</version_modified>
<version_id>3392aa31-2979-4635-a259-a4f17df3c8ac</version_id>
<version_modified>20170519T001656Z</version_modified>
<xml_checksum>15BF4E57</xml_checksum>
<class_name>TimeseriesCSVExport</class_name>
<display_name>Timeseries CSV Export</display_name>
Expand Down Expand Up @@ -67,7 +67,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>77BDA8D6</checksum>
<checksum>1FCFC74B</checksum>
</file>
</files>
</measure>
2 changes: 1 addition & 1 deletion project_resstock_dsgrid/seeds/EmptySeedModel.osm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

OS:Version,
{fc003c06-618b-4051-9b37-6b6f71b12672}, !- Handle
1.12.2; !- Version Identifier
2.2.0; !- Version Identifier

OS:Building,
{bf305633-c5a1-4881-9edf-ca5e1a8e1274}, !- Handle
Expand Down
2 changes: 1 addition & 1 deletion project_resstock_national/seeds/EmptySeedModel.osm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

OS:Version,
{fc003c06-618b-4051-9b37-6b6f71b12672}, !- Handle
1.12.2; !- Version Identifier
2.2.0; !- Version Identifier

OS:Building,
{bf305633-c5a1-4881-9edf-ca5e1a8e1274}, !- Handle
Expand Down
2 changes: 1 addition & 1 deletion project_resstock_pnw/seeds/EmptySeedModel.osm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

OS:Version,
{fc003c06-618b-4051-9b37-6b6f71b12672}, !- Handle
1.12.2; !- Version Identifier
2.2.0; !- Version Identifier

OS:Building,
{bf305633-c5a1-4881-9edf-ca5e1a8e1274}, !- Handle
Expand Down
2 changes: 1 addition & 1 deletion project_resstock_testing/seeds/EmptySeedModel.osm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

OS:Version,
{fc003c06-618b-4051-9b37-6b6f71b12672}, !- Handle
1.12.2; !- Version Identifier
2.2.0; !- Version Identifier

OS:Building,
{bf305633-c5a1-4881-9edf-ca5e1a8e1274}, !- Handle
Expand Down
50 changes: 38 additions & 12 deletions resources/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ def self.BuildingUnitFeatureNumBedrooms
def self.BuildingUnitTypeResidential
return 'Residential'
end
def self.CalcTypeERIRatedHome
return 'HERS Rated Home'
end
def self.CalcTypeERIReferenceHome
return 'HERS Reference Home'
end
def self.CalcTypeERIIndexAdjustmentDesign
return 'HERS Index Adjustment Design'
end
def self.CalcTypeStandard
return 'Standard'
end
def self.CeilingFanControlTypical
return 'typical'
end
Expand Down Expand Up @@ -230,15 +242,6 @@ def self.EndUseHVACFan
def self.EndUseMechVentFan
return 'residential mech vent fan'
end
def self.ERIRatedHome
return 'rated home'
end
def self.ERIReferenceHome
return 'reference home'
end
def self.ERIndexAdjustmentDesign
return 'index adjustment design'
end
def self.FacadeFront
return 'front'
end
Expand Down Expand Up @@ -496,22 +499,30 @@ def self.ObjectNameClothesWasher(unit_name=self.ObjectNameBuildingUnit)
return "residential clothes washer#{s_unit}"
end
def self.ObjectNameClothesDryer(fueltype, unit_name=self.ObjectNameBuildingUnit)
s_fuel = ""
if not fueltype.nil?
s_fuel = " #{fueltype}"
end
s_unit = ""
if unit_name != self.ObjectNameBuildingUnit
s_unit = "|#{unit_name}"
end
return "residential clothes dryer #{fueltype}#{s_unit}"
return "residential clothes dryer#{s_fuel}#{s_unit}"
end
def self.ObjectNameCookingRange(fueltype, ignition=false, unit_name=self.ObjectNameBuildingUnit)
s_fuel = ""
if not fueltype.nil?
s_fuel = " #{fueltype}"
end
s_ignition = ""
s_unit = ""
if ignition
s_ignition = " ignition"
end
s_unit = ""
if unit_name != self.ObjectNameBuildingUnit
s_unit = "|#{unit_name}"
end
return "residential range #{fueltype}#{s_ignition}#{s_unit}"
return "residential range#{s_fuel}#{s_ignition}#{s_unit}"
end
def self.ObjectNameCoolingSeason
return 'residential cooling season'
Expand Down Expand Up @@ -797,6 +808,18 @@ def self.ObjectNameWellPump(unit_name=self.ObjectNameBuildingUnit)
def self.ObjectNameWindowShading
return 'residential window shading'
end
def self.OptionTypeLightingFractions
return 'Lamp Fractions'
end
def self.OptionTypeLightingEnergyUses
return 'Annual Energy Uses'
end
def self.OptionTypePlugLoadsMultiplier
return 'Multiplier'
end
def self.OptionTypePlugLoadsEnergyUse
return 'Annual Energy Use'
end
def self.PierBeamFoundationType
return "pier and beam"
end
Expand Down Expand Up @@ -1142,5 +1165,8 @@ def self.WaterHeaterTypeTank
def self.WaterHeaterTypeHeatPump
return 'heatpump'
end
def self.WorkflowDescription
return ' See https://github.com/NREL/OpenStudio-BEopt#workflows for supported workflows using this measure.'
end

end
53 changes: 49 additions & 4 deletions resources/geometry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ def self.get_building_stories(spaces)
return space_min_zs.uniq.length
end

def self.get_above_grade_building_stories(spaces)
space_min_zs = []
spaces.each do |space|
next if not self.space_is_finished(space)
next if not self.space_is_above_grade(space)
surfaces_min_zs = []
space.surfaces.each do |surface|
zvalues = self.getSurfaceZValues([surface])
surfaces_min_zs << zvalues.min + OpenStudio::convert(space.zOrigin,"m","ft").get
end
space_min_zs << surfaces_min_zs.min
end
return space_min_zs.uniq.length
end

def self.make_one_space_from_multiple_spaces(model, spaces)
new_space = OpenStudio::Model::Space.new(model)
spaces.each do |space|
Expand All @@ -119,7 +134,7 @@ def self.make_one_space_from_multiple_spaces(model, spaces)
space.remove
end
return new_space
end
end

def self.make_polygon(*pts)
p = OpenStudio::Point3dVector.new
Expand Down Expand Up @@ -298,9 +313,12 @@ def self.get_volume_from_spaces(spaces, apply_multipliers=false, runner=nil)
end
volume += OpenStudio.convert(space.volume * mult,"m^3","ft^3").get
end
if volume <= 0 # FIXME: until we figure out how to deal with volumes
return 0.001
end
if volume == 0 and not runner.nil?
runner.registerError("Could not find any volume.")
return nil
runner.registerError("Could not find any volume.")
return nil
end
return volume
end
Expand Down Expand Up @@ -339,6 +357,26 @@ def self.get_above_grade_finished_floor_area_from_spaces(spaces, apply_multiplie
return floor_area
end

def self.get_finished_volume_from_spaces(spaces, apply_multipliers=false, runner=nil)
volume = 0
spaces.each do |space|
next if not self.space_is_finished(space)
mult = 1.0
if apply_multipliers
mult = space.multiplier.to_f
end
volume += OpenStudio.convert(space.volume * mult,"m^3","ft^3").get
end
if volume <= 0 # FIXME: until we figure out how to deal with volumes
return 0.001
end
if volume == 0 and not runner.nil?
runner.registerError("Could not find any finished volume.")
return nil
end
return volume
end

def self.get_above_grade_finished_volume_from_spaces(spaces, apply_multipliers=false, runner=nil)
volume = 0
spaces.each do |space|
Expand All @@ -349,6 +387,9 @@ def self.get_above_grade_finished_volume_from_spaces(spaces, apply_multipliers=f
end
volume += OpenStudio.convert(space.volume * mult,"m^3","ft^3").get
end
if volume <= 0 # FIXME: until we figure out how to deal with volumes
return 0.001
end
if volume == 0 and not runner.nil?
runner.registerError("Could not find any above-grade finished volume.")
return nil
Expand Down Expand Up @@ -853,6 +894,10 @@ def self.is_garage(space_or_zone)
return true if space_or_zone.name.to_s.start_with?(Constants.GarageSpace) or space_or_zone.name.to_s.start_with?(Constants.GarageZone)
end

def self.is_foundation(space_or_zone)
return true if self.is_pier_beam(space_or_zone) or self.is_crawl(space_or_zone) or self.is_finished_basement(space_or_zone) or self.is_unfinished_basement(space_or_zone)
end

def self.get_crawl_spaces(spaces)
crawl_spaces = []
spaces.each do |space|
Expand Down Expand Up @@ -1146,7 +1191,7 @@ def self.get_spaces_below_grade_exterior_walls(spaces)
end
return below_grade_exterior_walls
end

def self.get_spaces_below_grade_exterior_floors(spaces)
below_grade_exterior_floors = []
spaces.each do |space|
Expand Down

0 comments on commit 459786e

Please sign in to comment.