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

Update ideal air loads measure #221

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions national/housing_characteristics/options_lookup.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4671,6 +4671,7 @@ hvac_add_heat_pump_rtu orig_fuel_backup_25pct_oversize_no_hr upgrade_hvac_add_he
hvac_add_heat_pump_rtu orig_fuel_backup_25pct_oversize_hr upgrade_hvac_add_heat_pump_rtu backup_ht_fuel_scheme=match_original_primary_heating_fuel performance_oversizing_factor=0.25 htg_sizing_option=0F clg_oversizing_estimate=1 htg_to_clg_hp_ratio=1 hr=true dcv=false econ=false std_perf=false
hvac_add_heat_pump_rtu orig_fuel_backup_no_oversize_hr upgrade_hvac_add_heat_pump_rtu backup_ht_fuel_scheme=match_original_primary_heating_fuel performance_oversizing_factor=0 htg_sizing_option=0F clg_oversizing_estimate=1 htg_to_clg_hp_ratio=1 hr=true dcv=false econ=false std_perf=false
hvac_add_heat_pump_rtu standard_performance upgrade_hvac_add_heat_pump_rtu backup_ht_fuel_scheme=electric_resistance_backup performance_oversizing_factor=0 htg_sizing_option=0F clg_oversizing_estimate=1 htg_to_clg_hp_ratio=1 hr=false dcv=false econ=false std_perf=true
hvac_enable_ideal_air_loads ideal_air_loads upgrade_hvac_enable_ideal_air_loads
ppl_electric_kitchen_equip electric_kitchen_equip upgrade_ppl_electric_kitchen_equipment
hvac_add_multispeed_coil_min_flow multispeed_min_flow_default upgrade_hvac_multispeed_minimum_flow
hvac_advanced_rtu_controls advanced_rtu_no_dcv_no_econ upgrade_advanced_rtu_control add_econo=false add_dcv=false
Expand Down
13 changes: 13 additions & 0 deletions resources/measures/upgrade_hvac_enable_ideal_air_loads/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
OpenStudio(R), Copyright (c) 2008, 2023 Alliance for Sustainable Energy, LLC.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Redistribution of this software, without modification, must refer to the software by the same designation. Redistribution of a modified version of this software (i) may not refer to the modified version by the same designation, or by any confusingly similar designation, and (ii) must refer to the underlying software originally provided by Alliance as “OpenStudio®”. Except to comply with the foregoing, the term “OpenStudio®”, or any confusingly similar designation may not be used to refer to any modified version of this software or any modified version of the underlying software originally provided by Alliance without the prior written consent of Alliance.

4. The name of the copyright holder(s), any contributors, the United States Government, the United States Department of Energy, or any of their employees may not be used to endorse or promote products derived from this software without specific prior written permission from the respective party.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 26 additions & 0 deletions resources/measures/upgrade_hvac_enable_ideal_air_loads/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@


###### (Automatically generated documentation)

# Upgrade HVAC Enable Ideal Air Loads

## Description
Replaces all HVAC systems with conceptual ZoneHVACIdealLoadsAirSystems to model building thermal loads.

## Modeler Description
All HVAC systems are removed and replaced with ZoneHVACIdealLoadsAirSystems objects. Outdoor ventilation air follows occupancy schedule, which may not align with the original HVAC ventilation schedule found in the baseline model. All thermostat schedules are held constant with baseline model. Energy from ZoneHVACIdealLoadsAirSystems is reported under district end uses, not necesarily aligning with the HVAC fuel type of the baseline model.

## Measure Type
ModelMeasure

## Taxonomy


## Arguments




This measure does not have any user arguments


Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<%#= 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] %>

<% if argument[:type] == "Choice" && !argument[:model_dependent]%>
**Choice Display Names** <%= argument[:choice_display_names] %>
<% end %>

<% 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 %>
130 changes: 130 additions & 0 deletions resources/measures/upgrade_hvac_enable_ideal_air_loads/measure.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# dependencies
require 'openstudio-standards'

# start the measure
class UpgradeHvacEnableIdealAirLoads < OpenStudio::Measure::ModelMeasure
# define the name that a user will see, this method may be deprecated as
# the display name in PAT comes from the name field in measure.xml
def name
return 'Upgrade HVAC Enable Ideal Air Loads'
end

# human readable description
def description
return 'Replaces all HVAC systems with conceptual ZoneHVACIdealLoadsAirSystems to model building thermal loads.'
end

# human readable description of modeling approach
def modeler_description
return 'All HVAC systems are removed and replaced with ZoneHVACIdealLoadsAirSystems objects. Outdoor ventilation air follows occupancy schedule, which may not align with the original HVAC ventilation schedule found in the baseline model. All thermostat schedules are held constant with baseline model. Energy from ZoneHVACIdealLoadsAirSystems is reported under district end uses, not necesarily aligning with the HVAC fuel type of the baseline model.'
end


# define the arguments that the user will input
def arguments(model)
args = OpenStudio::Measure::OSArgumentVector.new

return args
end

# define what happens when the measure is run
def run(model, runner, user_arguments)
super(model, runner, user_arguments)

# use the built-in error checking
if !runner.validateUserArguments(arguments(model), user_arguments)
return false
end

# check which zone already include ideal air loads
existing_ideal_loads = model.getZoneHVACIdealLoadsAirSystems
runner.registerInitialCondition("The model has #{existing_ideal_loads.size} ideal air loads objects.")

# dummy standard to access methods in openstudio-standards
std = Standard.build('90.1-2013')

# remove existing HVAC
runner.registerInfo('Removing existing HVAC systems from the model')
std.remove_hvac(model)

# add zone hvac ideal load air system objects
conditioned_zones = []
model.getThermalZones.each do |zone|
next if zone.name.to_s.downcase.include?('plenum')
next if !OpenstudioStandards::ThermalZone.thermal_zone_heated?(zone) && !OpenstudioStandards::ThermalZone.thermal_zone_cooled?(zone)
conditioned_zones << zone
end

if conditioned_zones.empty?
runner.registerAsNotApplicable("No conditioned thermal zones found in model. Ideal air loads are not applicable to this model.")
return true
end

# modify design outdoor air object to follow occupancy; ComStock DSOA objects do not have schedules by default
conditioned_zones.each do |zone|
sch_ruleset = OpenstudioStandards::ThermalZone.thermal_zones_get_occupancy_schedule(thermal_zones=[zone],
occupied_percentage_threshold:0.05)
zone.spaces.each do |space|
next unless space.designSpecificationOutdoorAir.is_initialized
dsn_oa = space.designSpecificationOutdoorAir.get
dsn_oa.setOutdoorAirFlowRateFractionSchedule(sch_ruleset)
end
end

# add ideal air loads
ideal_loads_objects = std.model_add_ideal_air_loads(model,
conditioned_zones,
hvac_op_sch: nil,
heat_avail_sch: nil,
cool_avail_sch: nil,
heat_limit_type: 'NoLimit',
cool_limit_type: 'NoLimit',
dehumid_limit_type: 'ConstantSensibleHeatRatio',
cool_sensible_heat_ratio: 0.75,
humid_ctrl_type: 'None',
include_outdoor_air: true,
enable_dcv: false,
econo_ctrl_mthd: 'NoEconomizer',
heat_recovery_type: 'None',
heat_recovery_sensible_eff: 0.7,
heat_recovery_latent_eff: 0.65,
add_output_meters: false)


# remove any EMS objects tied to ground HX; these will fail model since HVAC has been removed
# get all EMS objects in the model
ems_objects = model.getEnergyManagementSystemSensors.to_a +
model.getEnergyManagementSystemActuators.to_a +
model.getEnergyManagementSystemPrograms.to_a +
model.getEnergyManagementSystemProgramCallingManagers.to_a +
model.getEnergyManagementSystemInternalVariables.to_a
eringold marked this conversation as resolved.
Show resolved Hide resolved

# Filter EMS objects that contain any of the strings in the list
ems_string_to_remove = ['Ground_HX', 'PVAV']
eringold marked this conversation as resolved.
Show resolved Hide resolved
ems_objects_to_remove = ems_objects.select do |ems_object|
ems_string_to_remove.any? { |str| ems_object.name.to_s.include?(str) }
end

# Remove each matching EMS object from the model
ems_objects_to_remove.each do |object_to_remove|
# Remove the EMS object from the model
runner.registerInfo("Removing unused GSHP objects from the model.")
object_to_remove.remove
end


# validity checks
if ideal_loads_objects.empty?
runner.registerError('Failure in creating ideal loads objects. See logs from [openstudio.model.Model]. Likely cause is an invalid schedule input or schedule removed from by another measure.')
return false
end

# runner register final conditions of model
runner.registerFinalCondition("The model has #{ideal_loads_objects.size} ideal air loads objects.")

return true
end
end

# this allows the measure to be use by the application
UpgradeHvacEnableIdealAirLoads.new.registerWithApplication
68 changes: 68 additions & 0 deletions resources/measures/upgrade_hvac_enable_ideal_air_loads/measure.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0"?>
<measure>
<schema_version>3.1</schema_version>
<name>upgrade_hvac_enable_ideal_air_loads</name>
<uid>f70d4a3d-8b93-4fef-b679-858fe1e05acc</uid>
<version_id>bb33bac3-a610-4d36-b557-faa60180d051</version_id>
<version_modified>2024-09-23T15:25:59Z</version_modified>
<xml_checksum>4435983D</xml_checksum>
<class_name>UpgradeHvacEnableIdealAirLoads</class_name>
<display_name>Upgrade HVAC Enable Ideal Air Loads</display_name>
<description>Replaces all HVAC systems with conceptual ZoneHVACIdealLoadsAirSystems to model building thermal loads.</description>
<modeler_description>All HVAC systems are removed and replaced with ZoneHVACIdealLoadsAirSystems objects. Outdoor ventilation air follows occupancy schedule, which may not align with the original HVAC ventilation schedule found in the baseline model. All thermostat schedules are held constant with baseline model. Energy from ZoneHVACIdealLoadsAirSystems is reported under district end uses, not necesarily aligning with the HVAC fuel type of the baseline model.</modeler_description>
<arguments />
<outputs />
<provenances />
<tags>
<tag>HVAC.Whole System</tag>
</tags>
<attributes>
<attribute>
<name>Measure Type</name>
<value>ModelMeasure</value>
<datatype>string</datatype>
</attribute>
<attribute>
<name>Uses SketchUp API</name>
<value>false</value>
<datatype>boolean</datatype>
</attribute>
</attributes>
<files>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>BFFB1AA6</checksum>
</file>
<file>
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>099DF8AD</checksum>
</file>
<file>
<filename>README.md.erb</filename>
<filetype>erb</filetype>
<usage_type>readmeerb</usage_type>
<checksum>232D0477</checksum>
</file>
<file>
<version>
<software_program>OpenStudio</software_program>
<identifier>2.0.0</identifier>
<min_compatible>2.0.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>B758A738</checksum>
</file>
<file>
<filename>measure_test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>4502DCB4</checksum>
</file>
</files>
</measure>
Loading