Conversation
…on 1f4d455848) [x86_64-linux], Rubocop 0.81.0)
9c7f8bf to
0aba90c
Compare
0aba90c to
75f4ccc
Compare
| # Add ZoneHVACEvaporativeCoolerUnit | ||
| zoneHVACEvaporativeCoolerUnit = OpenStudio::Model::ZoneHVACEvaporativeCoolerUnit.new(model) | ||
| direct_evap = zoneHVACEvaporativeCoolerUnit.firstEvaporativeCooler | ||
| indirect_evap = OpenStudio::Model::EvaporativeCoolerIndirectResearchSpecial.new(model) | ||
| zoneHVACEvaporativeCoolerUnit.setSecondEvaporativeCooler(indirect_evap) | ||
| zoneHVACEvaporativeCoolerUnit.addToThermalZone(z) |
There was a problem hiding this comment.
This should exercise the other setters for demonstration purposes
model_tests.rb
Outdated
| # def test_zone_hvac_evaporative_cooler_py | ||
| # result = sim_test('zone_hvac_evaporative_cooler.py') | ||
| # end |
There was a problem hiding this comment.
TODO: once happy with he ruby test, the python one needs to be added now in this PR
| # result = sim_test('zone_hvac_evaporative_cooler.py') | ||
| # end | ||
|
|
||
| # def test_zone_hvac_evaporative_cooler_osm |
There was a problem hiding this comment.
MISSING the # TODO: To be added in the next official release after: 3.9.0
|
Also needs to be added to autosize_hvac test since the |
…on 1f4d455848) [x86_64-linux], Rubocop 0.81.0)
|
…x Direct/Indirect x secondary (8 combos)
…on 1f4d455848) [x86_64-linux], Rubocop 0.81.0)
| when 44 | ||
| zoneHVACEvaporativeCoolerUnit = OpenStudio::Model::ZoneHVACEvaporativeCoolerUnit.new(model) | ||
| zoneHVACEvaporativeCoolerUnit.autosizeDesignSupplyAirFlowRate | ||
| zoneHVACEvaporativeCoolerUnit.addToThermalZone(zn) | ||
|
|
There was a problem hiding this comment.
Added to the autosize_hvac! Which told me the method was not implemented correctly so did NatLabRockies/OpenStudio@c969110
| # result = sim_test('zone_hvac_evaporative_cooler.py') | ||
| # end | ||
|
|
||
| # def test_zone_hvac_evaporative_cooler_osm |
| # make a 8 stories, 100m X 50m, 8 zone building | ||
| model.add_geometry({ 'length' => 100, | ||
| 'width' => 50, | ||
| 'num_floors' => 8, | ||
| 'floor_to_floor_height' => 4, | ||
| 'plenum_height' => 0, | ||
| 'perimeter_zone_depth' => 0 }) |
There was a problem hiding this comment.
Because I found the node connections to be broken, I'm using 8 zones...
| def make_zone_hvac_cooler(z, direct_is_first: false, add_secondary: true, fan_placement: 'BlowThrough') | ||
| model = z.model | ||
| indirect_evap = nil | ||
| direct_evap = nil | ||
| if direct_is_first | ||
| # There is a default ctor | ||
| zoneHVACEvaporativeCoolerUnit = OpenStudio::Model::ZoneHVACEvaporativeCoolerUnit.new(model) | ||
| direct_evap = zoneHVACEvaporativeCoolerUnit.firstEvaporativeCooler | ||
| supplyAirFan = zoneHVACEvaporativeCoolerUnit.supplyAirFan | ||
|
|
||
| fan_system = OpenStudio::Model::FanSystemModel.new(model) | ||
| zoneHVACEvaporativeCoolerUnit.setSupplyAirFan(fan_system) | ||
| supplyAirFan.remove | ||
| supplyAirFan = fan_system | ||
| # An optional Second EvaporativeCooler | ||
| if add_secondary | ||
| indirect_evap = OpenStudio::Model::EvaporativeCoolerIndirectResearchSpecial.new(model) | ||
| zoneHVACEvaporativeCoolerUnit.setSecondEvaporativeCooler(indirect_evap) | ||
| end | ||
| else | ||
| # And an explicit Ctor: | ||
| # ZoneHVACEvaporativeCoolerUnit(const Model& model, Schedule& availabilitySchedule, HVACComponent& supplyAirFan, HVACComponent& firstEvaporativeCooler); | ||
| supplyAirFan = OpenStudio::Model::FanSystemModel.new(model) | ||
|
|
||
| indirect_evap = OpenStudio::Model::EvaporativeCoolerIndirectResearchSpecial.new(model) | ||
| zoneHVACEvaporativeCoolerUnit = OpenStudio::Model::ZoneHVACEvaporativeCoolerUnit.new( | ||
| model, model.alwaysOnDiscreteSchedule, supplyAirFan, indirect_evap | ||
| ) | ||
| # An optional Second EvaporativeCooler | ||
| if add_secondary | ||
| direct_evap = OpenStudio::Model::EvaporativeCoolerDirectResearchSpecial.new(model, model.alwaysOnDiscreteSchedule) | ||
| zoneHVACEvaporativeCoolerUnit.setSecondEvaporativeCooler(direct_evap) | ||
| end | ||
| end | ||
| indirect_evap&.setName("#{z.nameString} Indirect Evaporative Cooler") | ||
| direct_evap&.setName("#{z.nameString} Direct Evaporative Cooler") | ||
| supplyAirFan.setName("#{z.nameString} Supply Fan") | ||
| zoneHVACEvaporativeCoolerUnit.setName("#{z.nameString} Evap Unit") | ||
| # zoneHVACEvaporativeCoolerUnit.resetSecondEvaporativeCooler | ||
| # | ||
| # Redoing what the default constructor does for demonstration purposes | ||
| # zoneHVACEvaporativeCoolerUnit.setDesignSupplyAirFlowRate(1.0) | ||
| zoneHVACEvaporativeCoolerUnit.autosizeDesignSupplyAirFlowRate | ||
| zoneHVACEvaporativeCoolerUnit.setAvailabilitySchedule(model.alwaysOnDiscreteSchedule) | ||
| zoneHVACEvaporativeCoolerUnit.setSupplyAirFan(zoneHVACEvaporativeCoolerUnit.supplyAirFan) | ||
| zoneHVACEvaporativeCoolerUnit.setFanPlacement(fan_placement) | ||
| zoneHVACEvaporativeCoolerUnit.setCoolerUnitControlMethod('ZoneCoolingLoadVariableSpeedFan') | ||
| zoneHVACEvaporativeCoolerUnit.setThrottlingRangeTemperatureDifference(1.1) | ||
| zoneHVACEvaporativeCoolerUnit.setCoolingLoadControlThresholdHeatTransferRate(100.0) | ||
| zoneHVACEvaporativeCoolerUnit.setShutOffRelativeHumidity(100.0) | ||
|
|
||
| # Add it to a ThermalZone | ||
| zoneHVACEvaporativeCoolerUnit.addToThermalZone(z) | ||
|
|
||
| # Rename nodes for clarity | ||
| z.zoneAirNode.setName("#{z.nameString} Zone Air Node") | ||
| # z.returnAirModelObjects.modelObjects[0].setName("#{z.nameString} Zone Return Air Node") | ||
| z.inletPortList.modelObjects[0].setName("#{z.nameString} Zone Air Inlet Node") | ||
| z.exhaustPortList.modelObjects[0].setName("#{z.nameString} Zone Air Exhaust Node") | ||
| end |
There was a problem hiding this comment.
Helper to create a specific configuration
| # In order to produce more consistent results between different runs, | ||
| # we sort the zones by names | ||
| zones = model.getThermalZones.sort_by { |z| z.name.to_s } | ||
|
|
||
| configs = [ | ||
| { zone_name: 'DirectFirst', direct_is_first: true, add_secondary: true }, | ||
|
|
||
| # Mimic SMStore8 from StripMallZoneEvapCoolerAutosized.idf | ||
| # https://github.com/NREL/EnergyPlus/blob/31e3c33467c5873371bf48b12a7318215971c315/testfiles/StripMallZoneEvapCoolerAutosized.idf#L4767-L4784 | ||
| { zone_name: 'IndirectFirst', direct_is_first: false, add_secondary: true }, | ||
|
|
||
| { zone_name: 'DirectOnly', direct_is_first: true, add_secondary: false }, | ||
|
|
||
| { zone_name: 'IndirectOnly', direct_is_first: false, add_secondary: false } | ||
| ] | ||
| fan_placements = ['BlowThrough', 'DrawThrough'] | ||
| raise 'Mismatch' unless configs.size * fan_placements.size == zones.size | ||
|
|
||
| configs.product(fan_placements).zip(zones).each do |(config, fan_placement), z| | ||
| z.setName("#{config[:zone_name]} #{fan_placement} Zn") | ||
| make_zone_hvac_cooler( | ||
| z, | ||
| direct_is_first: config[:direct_is_first], | ||
| add_secondary: config[:add_secondary], | ||
| fan_placement: fan_placement | ||
| ) | ||
| end |
There was a problem hiding this comment.
Testing 8 combinations: for each of these four, I test BlowThrough + DrawThrough
- DirectOnly
- IndirectOnly
- Direct then Indirect
- Indirect then Direct
|
Geez, eplusout.err still shows a node error |
Ok fixed via NatLabRockies/OpenStudio@73365b1 |
|
Getting a warning in ONE of the cases, but AFAIK I can't fix that anyways,so I'm going to ignore it (FYI @joseph-robertson ) |
There was a problem hiding this comment.
Here is that python version!
Pull request overview
Companion PR:
Link to relevant GitHub Issue(s) if appropriate:
Link to the Ubuntu 22.04 .deb installer to use for CI Testing. If not set, it will default to latest official release.
[OpenStudio Installer]: http://openstudio-ci-builds.s3-website-us-west-2.amazonaws.com/PR-5326/OpenStudio-3.9.1-alpha%2B73365b115a-Ubuntu-22.04-x86_64.deb
This Pull Request is concerning:
NewTest: a new test for a new model API class,TestFix: a fix for an existing test. The GitHub issue should be referenced in the PR descriptionNewTestForExisting: a new test for an already-existing model API classOther: Something else, like maintenance of the repo, or just committing test results with a new OpenStudio version.Depending on your answer, please fill out the required section below, and delete the three others.
Leave the review checklist in place.
Case 1: New test for a new model API class
This pull request is in relation with the Pull Request:
and will specifically test for the following classes:
ZoneHVACEvaporativeCoolerUnitWork Checklist
The following has been checked to ensure compliance with the guidelines:
Tests pass either:
with official OpenStudio release (include version):
AddedOSMhas been added to this PRout.oswhave been committedwith current develop (incude SHA):
PendingOSMhas been added to this PRmodel_tests.rbhas a TODO.out.oswhave been committed as they need to be run with an official OpenStudio versionRuby test is stable: when run multiple times on the same machine, it produces the same total site kBTU.
Please paste the heatmap png generated after running the following commands:
model.getThermalZones.sort_by{|z| z.name.to_s}.each do ...so I am sure I put the same ZoneHVAC systems to the same zones regardless of their order)process_results.py(seepython process_results.py --helpfor usage).Object has been added to
autosize_hvac.rbto ensure the autosizedXXX values methods do workReview Checklist
# TODOadded tomodel_tests.rbout.oswhave been committedautosize_hvacas appropriateNewTest,TestFix,NewTestForExisting,OtherNewTest: addPendingOSMorAddedOSM