openstudio-geb 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/measures/GEB Metrics Report/resources/os_lib_reporting.rb +5 -24
  3. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/LICENSE.md +13 -0
  4. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/README.md +152 -0
  5. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/README.md.erb +45 -0
  6. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/docs/.gitkeep +0 -0
  7. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/measure.rb +604 -0
  8. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/measure.xml +265 -0
  9. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/tests/USA_NY_Buffalo.Niagara.Intl.AP.725280_TMY3.epw +8768 -0
  10. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/tests/add_fan_assist_night_ventilation_with_hybrid_control_test.rb +94 -0
  11. data/lib/measures/add_fan_assist_night_ventilation_with_hybrid_control/tests/medium_office_with_internal_windows.osm +13459 -0
  12. data/lib/measures/add_heat_pump_water_heater/measure.rb +2 -2
  13. data/lib/measures/apply_dynamic_coating_to_roof_wall/LICENSE.md +1 -0
  14. data/lib/measures/apply_dynamic_coating_to_roof_wall/README.md +101 -0
  15. data/lib/measures/apply_dynamic_coating_to_roof_wall/README.md.erb +45 -0
  16. data/lib/measures/apply_dynamic_coating_to_roof_wall/docs/.gitkeep +0 -0
  17. data/lib/measures/apply_dynamic_coating_to_roof_wall/measure.rb +421 -0
  18. data/lib/measures/apply_dynamic_coating_to_roof_wall/measure.xml +204 -0
  19. data/lib/measures/apply_dynamic_coating_to_roof_wall/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A.osm +13669 -0
  20. data/lib/measures/apply_dynamic_coating_to_roof_wall/tests/SF-CACZ6-HPWH-pre1978.osm +16130 -0
  21. data/lib/measures/apply_dynamic_coating_to_roof_wall/tests/USA_NY_Buffalo.Niagara.Intl.AP.725280_TMY3.epw +8768 -0
  22. data/lib/measures/apply_dynamic_coating_to_roof_wall/tests/apply_dynamic_coating_to_roof_wall_test.rb +81 -0
  23. data/lib/openstudio/geb/run.rb +34 -0
  24. data/lib/openstudio/geb/version.rb +1 -1
  25. metadata +23 -3
@@ -0,0 +1,94 @@
1
+ # *******************************************************************************
2
+ # OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC.
3
+ # See also https://openstudio.net/license
4
+ # *******************************************************************************
5
+
6
+ # insert your copyright here
7
+
8
+ require 'openstudio'
9
+ require 'openstudio/measure/ShowRunnerOutput'
10
+ require 'minitest/autorun'
11
+ require_relative '../measure.rb'
12
+ require 'fileutils'
13
+
14
+ class AddFanAssistNightVentilationWithHybridControlTest < Minitest::Test
15
+ # def setup
16
+ # end
17
+
18
+ # def teardown
19
+ # end
20
+
21
+ def test_good_argument_values
22
+ # create an instance of the measure
23
+ measure = AddFanAssistNightVentilationWithHybridControl.new
24
+
25
+ # create runner with empty OSW
26
+ osw = OpenStudio::WorkflowJSON.new
27
+ runner = OpenStudio::Measure::OSRunner.new(osw)
28
+
29
+ # load the test model
30
+ translator = OpenStudio::OSVersion::VersionTranslator.new
31
+ # path = "#{File.dirname(__FILE__)}/MediumOffice-90.1-2010-ASHRAE 169-2013-5A.osm"
32
+ path = "#{File.dirname(__FILE__)}/medium_office_with_internal_windows.osm"
33
+ model = translator.loadModel(path)
34
+ assert(!model.empty?)
35
+ model = model.get
36
+
37
+ # get arguments
38
+ arguments = measure.arguments(model)
39
+ argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
40
+
41
+ # create hash of argument values.
42
+ # If the argument has a default that you want to use, you don't need it in the hash
43
+ args_hash = {}
44
+ args_hash['design_night_vent_ach'] = 3
45
+ args_hash['min_outdoor_temp'] = 18
46
+ args_hash['max_outdoor_temp'] = 26
47
+ args_hash['night_vent_starttime'] = "20:00"
48
+ args_hash['night_vent_endtime'] = "08:00"
49
+ args_hash['night_vent_startdate'] = "03-01"
50
+ args_hash['night_vent_enddate'] = "10-31"
51
+ args_hash['wknds'] = true
52
+ # using defaults values from measure.rb for other arguments
53
+
54
+ # populate argument with specified hash value if specified
55
+ arguments.each do |arg|
56
+ temp_arg_var = arg.clone
57
+ if args_hash.key?(arg.name)
58
+ assert(temp_arg_var.setValue(args_hash[arg.name]))
59
+ end
60
+ argument_map[arg.name] = temp_arg_var
61
+ end
62
+
63
+ # run the measure
64
+ measure.run(model, runner, argument_map)
65
+ result = runner.result
66
+
67
+ # show the output
68
+ show_output(result)
69
+
70
+ # assert that it ran correctly
71
+ assert_equal('Success', result.value.valueName)
72
+ assert(result.info.size >= 4)
73
+ # assert(result.warnings.empty?)
74
+
75
+ # save the model to test output directory
76
+ output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
77
+ model.save(output_file_path, true)
78
+
79
+ # test run the modified model
80
+ osw = {}
81
+ osw["weather_file"] = File.join(File.dirname(__FILE__ ), "USA_NY_Buffalo.Niagara.Intl.AP.725280_TMY3.epw") # epw for medium office
82
+ # osw["weather_file"] = File.join(File.dirname(__FILE__ ), "USA_TX_Houston-Bush.Intercontinental.AP.722430_TMY3.epw") # epw for small hotel
83
+ osw["seed_file"] = output_file_path
84
+ osw_path = "#{File.dirname(__FILE__)}//output/test_output.osw"
85
+ File.open(osw_path, 'w') do |f|
86
+ f << JSON.pretty_generate(osw)
87
+ end
88
+ cli_path = OpenStudio.getOpenStudioCLI
89
+ cmd = "\"#{cli_path}\" run -w \"#{osw_path}\""
90
+ puts cmd
91
+ system(cmd)
92
+
93
+ end
94
+ end