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 1 commit
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
15 changes: 11 additions & 4 deletions resources/measures/upgrade_hvac_enable_ideal_air_loads/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,17 @@ def run(model, runner, user_arguments)

# 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

# Filter EMS objects that contain "pvav"
ems_objects_to_remove = ems_objects.select { |ems_object| ems_object.name.to_s.include?('Ground_HX') }
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|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def test_gshp
argument_map = OpenStudio::Measure::OSArgumentMap.new

# Apply the measure to the model and optionally run the model
result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: false)
result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true)
model = load_model(model_output_path(__method__))
assert_equal('Success', result.value.valueName)

Expand Down