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

Fix #3905 - Allow ZoneHVAC:TerminalUnit:VariableRefrigerantFlow to connect to AirLoopHVAC #4253

Merged
merged 19 commits into from
Apr 6, 2021

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Mar 22, 2021

Pull request overview

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: #3905 - Allow ZoneHVAC:TerminalUnit:VariableRefrigerantFlow to connect to AirLoopHVAC OpenStudio-resources#137
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Checked behavior in OpenStudioApplication, adjusted policies as needed (src/openstudio_lib/library/OpenStudioPolicy.xml)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

jmarrec added 16 commits March 22, 2021 13:49
…ld for supply fan (if on OASys or AIrLoopHVAC -> not required)
…onents (this was affecting AirLoopHVACUnitarySystem too... but wasn't caught
… in a smart way

(not sure if I succeeded... I find it readable but maybe it's just me)
…ystem including testing the SPM Mixed air (failling for now)
@@ -26392,7 +26392,7 @@ OS:ZoneHVAC:TerminalUnit:VariableRefrigerantFlow,
\object-list ScheduleNames
\note Required for zone equipment. Leave blank if terminal unit is used in AirLoopHVAC:OutdoorAirSystem:EquipmentList.
\note Also leave blank if terminal unit is used on main AirloopHVAC branch and terminal unit has no fan.
A7 , \field Supply Air Fan placement
A7 , \field Supply Air Fan Placement
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This did not have any getter/setter until now. I renamed to match other model API objects, and E+

Comment on lines +26477 to +26483
A15; \field Controlling Zone or Thermostat Location
\type object-list
\object-list ThermalZoneNames
\note Used only for AirloopHVAC equipment on a main branch and defines zone name where thermostat is located.
\note Not required for zone equipment. Leave blank if terminal unit is used in AirLoopHVAC:OutdoorAirSystem:EquipmentList.
\note Required when terminal unit is used on main AirloopHVAC branch and coils are not set point controlled.
\note When terminal unit is used in air loop and is load controlled, this zone's thermostat will control operation.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New field

@@ -26403,7 +26403,6 @@ OS:ZoneHVAC:TerminalUnit:VariableRefrigerantFlow,
\note This field is also ignored if VRF terminal unit is used on main AirloopHVAC branch
\note and terminal unit has no fan.
A8 , \field Supply Air Fan
\required-field
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this is not required anymore... I have not changed the public model API for now because I would had to break backward compatibility. @kbenne

Comment on lines +358 to +360
} else if (auto comp = modelObject->optionalCast<ZoneHVACComponent>()) {
modelObjects.insert(modelObjects.begin(), *comp);
modelObject = comp->outletNode();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AirLoopHVACUnitarySystem also suffered from the same problem... It was not returned as part of AirLoopHVACOutdoorAirSystem_Impl::reliefComponents / AirLoopHVACOutdoorAirSystem_Impl::oaComponents

@@ -83,6 +84,8 @@ namespace model {

virtual unsigned outletPort() const override;

virtual bool addToNode(Node& node) override;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Override to allow connecting to AirLoopHVAC/AirLoopHVACOutdoorAirSystem

Comment on lines +222 to +237
if (boost::optional<Node> OANode = outdoorAirSystem.outboardOANode()) {
ZoneHVACTerminalUnitVariableRefrigerantFlow testObject(m);

EXPECT_TRUE(testObject.addToNode(OANode.get()));
EXPECT_EQ(3, airLoop.supplyComponents().size());
EXPECT_EQ(3, outdoorAirSystem.oaComponents().size());
EXPECT_TRUE(testObject.airLoopHVACOutdoorAirSystem());
}

if (boost::optional<Node> reliefNode = outdoorAirSystem.outboardReliefNode()) {
ZoneHVACTerminalUnitVariableRefrigerantFlow testObject(m);
EXPECT_TRUE(testObject.addToNode(reliefNode.get()));
EXPECT_EQ(3, airLoop.supplyComponents().size());
EXPECT_EQ(3, outdoorAirSystem.reliefComponents().size());
EXPECT_TRUE(testObject.airLoopHVACOutdoorAirSystem());
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test on AirLoopHVACOutdoorAirSystem: both OA intake and relief

}
}

TEST_F(ModelFixture, ZoneHVACTerminalUnitVariableRefrigerantFlow_controllingZoneorThermostatLocation) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test this field

EXPECT_FALSE(testObject.controllingZoneorThermostatLocation());
}

TEST_F(ModelFixture, ZoneHVACTerminalUnitVariableRefrigerantFlow_SupplyAirFanPlacement) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the other new one, including checking that it's correctly defaulted in both Ctors to "DrawThrough" (got bit by it in Reg test originally)

@@ -235,6 +256,58 @@ TEST_F(EnergyPlusFixture, ForwardTranslatorZoneHVACTerminalUnitVariableRefrigera

EXPECT_EQ(idf_fan.getString(Fan_OnOffFields::AirOutletNodeName).get(), idf_supHC.getString(Coil_Heating_WaterFields::AirInletNodeName).get());
}

// Supplemental HC = CoilHeatingWater, BlowThrough
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New FT test case to check that in BlowThrough, the nodes are also connected properly.

Comment on lines 534 to 547
WorkspaceObjectVector spm_mixedairs(w.getObjectsByType(IddObjectType::SetpointManager_MixedAir));
EXPECT_EQ(2u, spm_mixedairs.size());
for (const auto& spm_mixedair : spm_mixedairs) {
EXPECT_EQ("Temperature", spm_mixedair.getString(SetpointManager_MixedAirFields::ControlVariable).get());
EXPECT_EQ("Supply Outlet Node", spm_mixedair.getString(SetpointManager_MixedAirFields::ReferenceSetpointNodeName).get());
EXPECT_EQ(vrf.nameString() + " Heating Coil Outlet Node", spm_mixedair.getString(SetpointManager_MixedAirFields::FanInletNodeName).get());
EXPECT_EQ("Supply Outlet Node", spm_mixedair.getString(SetpointManager_MixedAirFields::FanOutletNodeName).get());
EXPECT_TRUE(spm_mixedair.nameString().find("OS Default SPM") != std::string::npos);
if (spm_mixedair.nameString().find("Mixed Air") != std::string::npos) {
EXPECT_EQ("Mixed Air Node", spm_mixedair.getString(SetpointManager_MixedAirFields::SetpointNodeorNodeListName).get());
} else {
EXPECT_EQ("VRF TU on Outdoor Air Outlet Node", spm_mixedair.getString(SetpointManager_MixedAirFields::SetpointNodeorNodeListName).get());
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that SPM:MixedAir correctly picked up the fan that is inside the VRF TU on the main branch

@jmarrec jmarrec added this to the OpenStudio SDK 3.2.0 milestone Mar 22, 2021
@jmarrec jmarrec added the Ready for Merge Set this once CI is passing and reviews are approved. label Mar 22, 2021
…rSystem, or placed on AirLoopHVAC main branch that has its own supply fan
@jmarrec
Copy link
Collaborator Author

jmarrec commented Mar 23, 2021

Windows CI is reporting the usual RUby test failure: 2998 - RubyTest-Date_Test-ymd_constructor (Failed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - IDF Translation component - Model Enhancement Request Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. Ready for Merge Set this once CI is passing and reviews are approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E+ 9.3.0: Allow ZoneHVAC:TerminalUnit:VariableRefrigerantFlow to connect to AirLoopHVAC
3 participants