Skip to content

Commit

Permalink
files for #8
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewSteen committed Sep 16, 2020
1 parent 8ca001f commit 6a31f50
Show file tree
Hide file tree
Showing 4 changed files with 325 additions and 0 deletions.
51 changes: 51 additions & 0 deletions measures/hvac_dehumidifier_desiccant_system/README.md
Original file line number Diff line number Diff line change
@@ -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




42 changes: 42 additions & 0 deletions measures/hvac_dehumidifier_desiccant_system/README.md.erb
Original file line number Diff line number Diff line change
@@ -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 %>
132 changes: 132 additions & 0 deletions measures/hvac_dehumidifier_desiccant_system/measure.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<measure>
<schema_version>3.0</schema_version>
<name>hvac_dehumidifier_desiccant_system</name>
<uid>cba3a1f5-f3e0-419b-bc23-aa317512d444</uid>
<version_id>55693590-8279-4e31-b5fb-264ba9cc8d74</version_id>
<version_modified>20200817T220456Z</version_modified>
<xml_checksum>FE37E22F</xml_checksum>
<class_name>HVACDehumidifierDesiccantSystem</class_name>
<display_name>Dehumidifier Desiccant System</display_name>
<description>TODO</description>
<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.</modeler_description>
<arguments>
<argument>
<name>location</name>
<display_name>Location</display_name>
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
<choices>
<choice>
<value>Outdoor Air Stream</value>
<display_name>Outdoor Air Stream</display_name>
</choice>
<choice>
<value>Supply Air Stream</value>
<display_name>Supply Air Stream</display_name>
</choice>
</choices>
</argument>
<argument>
<name>air_loop_choice</name>
<display_name>Choose Air Loop(s)</display_name>
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
<choices>
<choice>
<value>ALL</value>
<display_name>ALL</display_name>
</choice>
</choices>
</argument>
<argument>
<name>string</name>
<display_name>String Included in Surrogate Object(s) Name</display_name>
<description>word included in the surrogate object(s) name</description>
<type>String</type>
<required>true</required>
<model_dependent>false</model_dependent>
</argument>
</arguments>
<outputs/>
<provenances/>
<tags>
<tag>HVAC.Cooling</tag>
</tags>
<attributes>
<attribute>
<name>Measure Type</name>
<value>EnergyPlusMeasure</value>
<datatype>string</datatype>
</attribute>
<attribute>
<name>Intended Software Tool</name>
<value>OpenStudio Application</value>
<datatype>string</datatype>
</attribute>
<attribute>
<name>Intended Software Tool</name>
<value>Parametric Analysis Tool</value>
<datatype>string</datatype>
</attribute>
</attributes>
<files>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>CD7F5672</checksum>
</file>
<file>
<filename>README.md.erb</filename>
<filetype>erb</filetype>
<usage_type>readmeerb</usage_type>
<checksum>703C9964</checksum>
</file>
<file>
<filename>hvac_dehumidifier_desiccant_system_test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>FA1DDEF9</checksum>
</file>
<file>
<filename>.gitkeep</filename>
<filetype>gitkeep</filetype>
<usage_type>doc</usage_type>
<checksum>00000000</checksum>
</file>
<file>
<filename>DesiccantDehumidifierWithCompanionCoil-SA.idf</filename>
<filetype>idf</filetype>
<usage_type>resource</usage_type>
<checksum>1A0DBF34</checksum>
</file>
<file>
<filename>DesiccantDehumidifierWithCompanionCoil-OA.idf</filename>
<filetype>idf</filetype>
<usage_type>resource</usage_type>
<checksum>B1046E86</checksum>
</file>
<file>
<version>
<software_program>OpenStudio</software_program>
<identifier>2.9.0</identifier>
<min_compatible>2.9.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>417A280B</checksum>
</file>
<file>
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>FD2B0722</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6a31f50

Please sign in to comment.