From 6a31f50c4137d2ea3d09c5e49dcdbeceef4dab20 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Wed, 16 Sep 2020 09:16:13 -0600 Subject: [PATCH] files for #8 --- .../README.md | 51 +++++++ .../README.md.erb | 42 ++++++ .../measure.xml | 132 ++++++++++++++++++ ...hvac_dehumidifier_desiccant_system_test.rb | 100 +++++++++++++ 4 files changed, 325 insertions(+) create mode 100644 measures/hvac_dehumidifier_desiccant_system/README.md create mode 100644 measures/hvac_dehumidifier_desiccant_system/README.md.erb create mode 100644 measures/hvac_dehumidifier_desiccant_system/measure.xml create mode 100644 measures/hvac_dehumidifier_desiccant_system/tests/hvac_dehumidifier_desiccant_system_test.rb diff --git a/measures/hvac_dehumidifier_desiccant_system/README.md b/measures/hvac_dehumidifier_desiccant_system/README.md new file mode 100644 index 0000000..c9552ba --- /dev/null +++ b/measures/hvac_dehumidifier_desiccant_system/README.md @@ -0,0 +1,51 @@ + + +###### (Automatically generated documentation) + +# Dehumidifier Desiccant System + +## Description +TODO + +## Modeler Description +This measure adds Dehumidifier:Desiccant:System (DDS) object(s) to the outdoor air (OA) or supply air (SA) stream of one or all air loops by replacing a surrogate object (e.g. CoilHeatingGas). + In either case, a SetpointManager must be on the outlet node of the surrogate object to control humidity. + If the DDS will be added to the SA stream, the surrogate object must be directly downstream of a cooling coil, which will be the Companion Cooling Coil to the DDS. + The measure uses objects from the EnergyPlus example file DesiccantDehumidifierWithCompanionCoil.idf, which are included in the resources folder. + +## Measure Type +EnergyPlusMeasure + +## Taxonomy + + +## Arguments + + +### Location + +**Name:** location, +**Type:** Choice, +**Units:** , +**Required:** true, +**Model Dependent:** false + +### Choose Air Loop(s) + +**Name:** air_loop_choice, +**Type:** Choice, +**Units:** , +**Required:** true, +**Model Dependent:** false + +### String Included in Surrogate Object(s) Name +word included in the surrogate object(s) name +**Name:** string, +**Type:** String, +**Units:** , +**Required:** true, +**Model Dependent:** false + + + + diff --git a/measures/hvac_dehumidifier_desiccant_system/README.md.erb b/measures/hvac_dehumidifier_desiccant_system/README.md.erb new file mode 100644 index 0000000..4deb9ae --- /dev/null +++ b/measures/hvac_dehumidifier_desiccant_system/README.md.erb @@ -0,0 +1,42 @@ +<%#= README.md.erb is used to auto-generate README.md. %> +<%#= To manually maintain README.md throw away README.md.erb and manually edit README.md %> +###### (Automatically generated documentation) + +# <%= name %> + +## Description +<%= description %> + +## Modeler Description +<%= modelerDescription %> + +## Measure Type +<%= measureType %> + +## Taxonomy +<%= taxonomy %> + +## Arguments + +<% arguments.each do |argument| %> +### <%= argument[:display_name] %> +<%= argument[:description] %> +**Name:** <%= argument[:name] %>, +**Type:** <%= argument[:type] %>, +**Units:** <%= argument[:units] %>, +**Required:** <%= argument[:required] %>, +**Model Dependent:** <%= argument[:model_dependent] %> +<% end %> + +<% if arguments.size == 0 %> +<%= "This measure does not have any user arguments" %> +<% end %> + +<% if outputs.size > 0 %> +## Outputs +<% output_names = [] %> +<% outputs.each do |output| %> +<% output_names << output[:display_name] %> +<% end %> +<%= output_names.join(", ") %> +<% end %> \ No newline at end of file diff --git a/measures/hvac_dehumidifier_desiccant_system/measure.xml b/measures/hvac_dehumidifier_desiccant_system/measure.xml new file mode 100644 index 0000000..222ef48 --- /dev/null +++ b/measures/hvac_dehumidifier_desiccant_system/measure.xml @@ -0,0 +1,132 @@ + + 3.0 + hvac_dehumidifier_desiccant_system + cba3a1f5-f3e0-419b-bc23-aa317512d444 + 55693590-8279-4e31-b5fb-264ba9cc8d74 + 20200817T220456Z + FE37E22F + HVACDehumidifierDesiccantSystem + Dehumidifier Desiccant System + TODO + This measure adds Dehumidifier:Desiccant:System (DDS) object(s) to the outdoor air (OA) or supply air (SA) stream of one or all air loops by replacing a surrogate object (e.g. CoilHeatingGas). + In either case, a SetpointManager must be on the outlet node of the surrogate object to control humidity. + If the DDS will be added to the SA stream, the surrogate object must be directly downstream of a cooling coil, which will be the Companion Cooling Coil to the DDS. + The measure uses objects from the EnergyPlus example file DesiccantDehumidifierWithCompanionCoil.idf, which are included in the resources folder. + + + location + Location + Choice + true + false + + + Outdoor Air Stream + Outdoor Air Stream + + + Supply Air Stream + Supply Air Stream + + + + + air_loop_choice + Choose Air Loop(s) + Choice + true + false + + + ALL + ALL + + + + + string + String Included in Surrogate Object(s) Name + word included in the surrogate object(s) name + String + true + false + + + + + + HVAC.Cooling + + + + Measure Type + EnergyPlusMeasure + string + + + Intended Software Tool + OpenStudio Application + string + + + Intended Software Tool + Parametric Analysis Tool + string + + + + + LICENSE.md + md + license + CD7F5672 + + + README.md.erb + erb + readmeerb + 703C9964 + + + hvac_dehumidifier_desiccant_system_test.rb + rb + test + FA1DDEF9 + + + .gitkeep + gitkeep + doc + 00000000 + + + DesiccantDehumidifierWithCompanionCoil-SA.idf + idf + resource + 1A0DBF34 + + + DesiccantDehumidifierWithCompanionCoil-OA.idf + idf + resource + B1046E86 + + + + OpenStudio + 2.9.0 + 2.9.0 + + measure.rb + rb + script + 417A280B + + + README.md + md + readme + FD2B0722 + + + diff --git a/measures/hvac_dehumidifier_desiccant_system/tests/hvac_dehumidifier_desiccant_system_test.rb b/measures/hvac_dehumidifier_desiccant_system/tests/hvac_dehumidifier_desiccant_system_test.rb new file mode 100644 index 0000000..d0a4840 --- /dev/null +++ b/measures/hvac_dehumidifier_desiccant_system/tests/hvac_dehumidifier_desiccant_system_test.rb @@ -0,0 +1,100 @@ +# insert your copyright here + +require 'openstudio' +require 'openstudio/measure/ShowRunnerOutput' +require 'minitest/autorun' +require_relative '../measure.rb' +require 'fileutils' + +class HVACDehumidifierDesiccantSystemTest < Minitest::Test + # def setup + # end + + # def teardown + + def test_number_of_arguments_and_argument_names + # create an instance of the measure + measure = HVACDehumidifierDesiccantSystem.new + + # make an empty workspace + workspace = OpenStudio::Workspace.new('Draft'.to_StrictnessLevel, 'EnergyPlus'.to_IddFileType) + + # get arguments and test that they are what we are expecting + arguments = measure.arguments(workspace) + assert_equal(1, arguments.size) + assert_equal('zone_name', arguments[0].name) + end + + def test_bad_argument_values + # create an instance of the measure + measure = HVACDehumidifierDesiccantSystem.new + + # create runner with empty OSW + osw = OpenStudio::WorkflowJSON.new + runner = OpenStudio::Measure::OSRunner.new(osw) + + # make an empty workspace + workspace = OpenStudio::Workspace.new('Draft'.to_StrictnessLevel, 'EnergyPlus'.to_IddFileType) + + # check that there are no thermal zones + assert_equal(0, workspace.getObjectsByType('Zone'.to_IddObjectType).size) + + # get arguments + arguments = measure.arguments(workspace) + argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments) + + # set argument values to bad value + zone_name = arguments[0].clone + assert(zone_name.setValue('')) + argument_map['zone_name'] = zone_name + + # run the measure + measure.run(workspace, runner, argument_map) + result = runner.result + assert_equal('Fail', result.value.valueName) + + # check that there are still no thermal zones + assert_equal(0, workspace.getObjectsByType('Zone'.to_IddObjectType).size) + end + + def test_good_argument_values + # create an instance of the measure + measure = HVACDehumidifierDesiccantSystem.new + + # create runner with empty OSW + osw = OpenStudio::WorkflowJSON.new + runner = OpenStudio::Measure::OSRunner.new(osw) + + # make an empty workspace + workspace = OpenStudio::Workspace.new('Draft'.to_StrictnessLevel, 'EnergyPlus'.to_IddFileType) + + # check that there are no thermal zones + assert_equal(0, workspace.getObjectsByType('Zone'.to_IddObjectType).size) + + # get arguments + arguments = measure.arguments(workspace) + argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments) + + # set argument values to good values + zone_name = arguments[0].clone + assert(zone_name.setValue('New Zone')) + argument_map['zone_name'] = zone_name + + # run the measure + measure.run(workspace, runner, argument_map) + result = runner.result + assert_equal('Success', result.value.valueName) + + # check that there is now 1 thermal zones + assert_equal(1, workspace.getObjectsByType('Zone'.to_IddObjectType).size) + + # check that zone is properly named + zone = workspace.getObjectsByType('Zone'.to_IddObjectType)[0] + assert(!zone.getString(0).empty?) + assert_equal('New Zone', zone.getString(0).get) + + # save the workspace to output directory + output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_output.idf') + workspace.save(output_file_path, true) + end +end