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

Using CoilHeatingWaters in the Supplemental Heating Coil Object Type field for the AirLoopHVACUnitaryHeatPumpAirToAir group causes failure. #5313

Open
hobsonbw opened this issue Dec 6, 2024 · 2 comments · May be fixed by #5322

Comments

@hobsonbw
Copy link

hobsonbw commented Dec 6, 2024

Issue overview

When using OpenStudio::Model::AirLoopHVACUnitaryHeatPumpAirToAir.new(), specifying a supplementary heating coil of type CoilHeatingWater fails. This occurs even though the plant loop, branches, and connector objects to support the hot water supplemental heating coil are placed on the demand side of the plantloop.

Current Behavior

The following error in Windows:
[BOOST_ASSERT] <2> Assertion result failed on line 244 of class openstudio::model::HVACComponent __cdecl openstudio::model::detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplementalHeatingCoil(void) const in file D:\OSN\Openstudio\src\model\AirLoopHVACUnitaryHeatPumpAirToAir.cpp.

And the following more severe error with a segmentation fault in the Linux-based development environment:
[BOOST_ASSERT] <2> Assertion result failed on line 244 of openstudio::model::HVACComponent openstudio::model::detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplementalHeatingCoil() const in file /srv/jenkins/openstudio/git/nightly/ubuntu_2004/src/model/AirLoopHVACUnitaryHeatPumpAirToAir.cpp. hp_test_lnx.rb:53: [BUG] Segmentation fault at 0x0000000000000000 ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]

The above segmentation fault is followed by several hundred lines of error code under headings 'Control frame information', 'Ruby level backtrace information', 'Machine register context', and 'Other runtime information'.

Expected Behavior

The AirLoopHVACUnitaryHeatPumpAirToAir should accept a CoilHeatingWater for the supplemental heating coil, at least according to the EnergyPlus 24.2.0 documentation.

Steps to Reproduce

Try to specify a hot water supplemental heating coil in the AirLoopHVACUnitaryHeatPumpAirToAir group. Example files here.

Possible Solution

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): Windows 10 Enterprise, 10.0.19045 Build 19045
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.7.0, 3.9.0
  • Platform (Operating system, version): Ubuntu, 20.04.6 LTS
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.7.0, 3.9.0

Context

@hobsonbw hobsonbw added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Dec 6, 2024
@jmarrec jmarrec added severity - Normal Bug component - Model and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed labels Dec 18, 2024
@jmarrec
Copy link
Collaborator

jmarrec commented Dec 18, 2024

Two issues:

  • We don't accept two supplemental heating coil types we should per E+
  • When the Ctor fails to assign, it tries to remove() before LOG_AND_THROW, and that, unfortutenaly fails with the assert

E+ idd:

   A12, \field Supplemental Heating Coil Object Type
        \required-field
        \type choice
        \key Coil:Heating:Fuel
        \key Coil:Heating:Electric
        \key Coil:Heating:Water
        \key Coil:Heating:Steam
        \note works with gas, electric, hot water and steam heating coils

it is NOT ok here:

ok = setSupplementalHeatingCoil(supplementalHeatingCoil);
if (!ok) {
remove();
LOG_AND_THROW("Unable to set " << briefDescription() << "'s supplemental heating coil to " << supplementalHeatingCoil.briefDescription()
<< ".");
}

so in children, it throws

result.push_back(supplementalHeatingCoil());

@jmarrec jmarrec self-assigned this Dec 18, 2024
@jmarrec
Copy link
Collaborator

jmarrec commented Dec 18, 2024

Oh awesome, the other one, AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed does not have any tests.
The addToNode is unrestricted, and the clone() method fails to reset the inlet/outlet nodes.

jmarrec added a commit that referenced this issue Dec 18, 2024
…eatPumpAirToAirMultiSpeed

```
[==========] Running 12 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 12 tests from ModelFixture
[ RUN      ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GettersSetters
[       OK ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GettersSetters (51 ms)
[ RUN      ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_addToNode
/media/DataExt4/Software/Others/OpenStudio2/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp:310: Failure
Value of: testObject.addToNode(inletNode)
  Actual: true
Expected: false

/media/DataExt4/Software/Others/OpenStudio2/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp:311: Failure
Expected equality of these values:
  5
  airLoop.demandComponents().size()
    Which is: 7

/media/DataExt4/Software/Others/OpenStudio2/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp:316: Failure
Value of: testObject.addToNode(supplyOutletNode)
  Actual: true
Expected: false

/media/DataExt4/Software/Others/OpenStudio2/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp:317: Failure
Expected equality of these values:
  5
  plantLoop.supplyComponents().size()
    Which is: 7

/media/DataExt4/Software/Others/OpenStudio2/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp:321: Failure
Value of: testObject.addToNode(demandOutletNode)
  Actual: true
Expected: false

/media/DataExt4/Software/Others/OpenStudio2/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp:322: Failure
Expected equality of these values:
  5
  plantLoop.demandComponents().size()
    Which is: 7

/media/DataExt4/Software/Others/OpenStudio2/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp:331: Failure
Expected equality of these values:
  5
  airLoop.supplyComponents().size()
    Which is: 3

[  FAILED  ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_addToNode (106 ms)
[ RUN      ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Ctor_WrongChildType
/media/DataExt4/Software/Others/OpenStudio2/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp:346: Failure
Expected equality of these values:
  0
  m.getConcreteModelObjects<AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed>().size()
    Which is: 1

[  FAILED  ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Ctor_WrongChildType (18 ms)
[ RUN      ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_AirLoopHVACUnitaryHeatPumpAirToAir
Running main() from gmock_main.cc
[       OK ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_AirLoopHVACUnitaryHeatPumpAirToAir (90 ms)
[ RUN      ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_addToNode
[       OK ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_addToNode (75 ms)
[ RUN      ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_VariableSpeedCoils
[       OK ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_VariableSpeedCoils (65 ms)
[ RUN      ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_CoilSystemIntegratedHeatPumpAirSource
[       OK ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_CoilSystemIntegratedHeatPumpAirSource (145 ms)
[ RUN      ] ModelFixture.AirLoopHVACUnitaryHeatPumpAirToAir_Ctor_WrongChildType
[BOOST_ASSERT] <2> Assertion result failed on line 244 of openstudio::model::HVACComponent openstudio::model::detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplementalHeatingCoil() const in file /media/DataExt4/Software/Others/OpenStudio2/src/model/AirLoopHVACUnitaryHeatPumpAirToAir.cpp.
openstudio_model_tests: /media/DataExt4/Software/Others/OpenStudio2/src/model/test/../../utilities/core/Assert.hpp:37: void boost::assertion_failed(const char*, const char*, const char*, long int): Assertion `false' failed.
Aborted (core dumped)
```
jmarrec added a commit that referenced this issue Dec 18, 2024
@jmarrec jmarrec linked a pull request Dec 18, 2024 that will close this issue
19 tasks
jmarrec added a commit that referenced this issue Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants