Skip to content

Support CoilSystem:Cooling:Water - #5350

Merged
joseph-robertson merged 67 commits into
developfrom
coilsystem-cooling-water
May 7, 2025
Merged

Support CoilSystem:Cooling:Water#5350
joseph-robertson merged 67 commits into
developfrom
coilsystem-cooling-water

Conversation

@joseph-robertson

@joseph-robertson joseph-robertson commented Jan 31, 2025

Copy link
Copy Markdown
Collaborator

Pull request overview

Wrap CoilSystem:Cooling:Water, and support:

  • "Water Size Economizer Model" (WaterSideEconomizer_PreCoolCoil.idf)
  • "Wrap Around Water Coil Heat Recovery Mode" (5ZoneAirCooled_RunaroundHeatRecovery.idf).

Related OpenStudio-resources tests:

  • airterminal_cooledbeam.rb (CoilCoolingWater)
  • coilsystem_waterhx.rb (CoilSystemCoolingWaterHeatExchangerAssisted)
  • coilsystem_cooling_water.rb (CoilSystemCoolingWater) <- new test file

Perhaps we don't need to create a Controller:WaterCoil in coil.addToNode.

Pull Request Author

  • 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: Support CoilSystem:Cooling:Water OpenStudio-resources#218
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • 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

@joseph-robertson joseph-robertson added Enhancement Request component - Model component - IDF Translation Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Jan 31, 2025
@joseph-robertson joseph-robertson self-assigned this Jan 31, 2025
@jmarrec

jmarrec commented Mar 14, 2025

Copy link
Copy Markdown
Collaborator

@joseph-robertson this is still marked as draft, no review asked, what is the status of this?

and is there a corresponding OS-resources test?

@joseph-robertson
joseph-robertson marked this pull request as ready for review April 30, 2025 15:43

@jmarrec jmarrec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed IDD and Ctors, good!

Comment thread resources/model/OpenStudio.idd
Comment thread resources/model/OpenStudio.idd
Comment thread resources/model/OpenStudio.idd
Comment thread resources/model/OpenStudio.idd
Comment thread resources/model/OpenStudio.idd
Comment thread resources/model/OpenStudio.idd
Comment thread resources/model/OpenStudio.idd
Comment thread src/model/CoilSystemCoolingWater.cpp Outdated
Comment thread src/model/CoilSystemCoolingWater.cpp Outdated
Comment thread src/model/CoilSystemCoolingWater.cpp Outdated
jmarrec added 3 commits May 5, 2025 11:44
…companion to CoilCoolingWater per IDD/IO ref

CoilSystem:Cooling:Water:HeatExchangerAssisted isn't  WaterToAirComponent
Comment thread src/model/CoilSystemCoolingWater.hpp Outdated
Comment thread src/model/CoilSystemCoolingWater.hpp Outdated
Comment thread src/model/CoilSystemCoolingWater.hpp
Comment thread src/model/ScheduleTypeRegistry.cpp
Comment on lines +128 to +142

boost::optional<HVACComponent> CoilSystemCoolingWater_Impl::containingHVACComponent() const {
// AirLoopHVACUnitarySystem
std::vector<AirLoopHVACUnitarySystem> airLoopHVACUnitarySystems = this->model().getConcreteModelObjects<AirLoopHVACUnitarySystem>();

for (const auto& airLoopHVACUnitarySystem : airLoopHVACUnitarySystems) {
if (boost::optional<HVACComponent> coolingCoil = airLoopHVACUnitarySystem.coolingCoil()) {
if (coolingCoil->handle() == this->handle()) {
return airLoopHVACUnitarySystem;
}
}
}

return boost::none;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. Can this really be added to a AirLoopHVACUnitarySystem?
  2. Our model API is ridden with this weird stuff, but AirLoopHVACUnitarySystem IS a ZoneHVACComponent

https://github.com/NREL/OpenStudio/blob/4c3a4a3f83065e84278f9a6c1e2f64b2c0a0ac36/src/model/AirLoopHVACUnitarySystem.hpp#L30

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AFAIK, this cannot be added to any HVAC/ZoneHVACComponent. The E+ IDD shows no possible references. I'm going to remove this.

14c7357

Comment on lines +33 to +34
// Cooling Coil: Required Object
CoilCoolingWater coolingCoil(m);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nowhere I'm seeing a test with the other coil type: CoilSystem:Cooling:Water:HeatExchangerAssisted

And I'm realizing that this object isn't a WaterToAirComponent, so your implementation is likely broken.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Done in #5404

Comment on lines +78 to +79
// Shouldn't happen, accepts only Coil:Cooling:Water or Coil:Cooling:Water:DetailedGeometry
// Shouldn't happen, accepts only Coil:Cooling:DX:SingleSpeed or Coil:Cooling:DX:VariableSpeed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

first line is wrong, second is a copy paste

idfObject.setString(CoilSystem_Cooling_WaterFields::CompanionCoilUsedForHeatRecovery, wo_->nameString());
if (wo_->iddObject().type() == IddObjectType::Coil_Cooling_Water) {
wo_->setString(Coil_Cooling_WaterFields::AirInletNodeName, modelObject.airLoopHVACOutdoorAirSystem()->reliefAirModelObject()->nameString());
wo_->setString(Coil_Cooling_WaterFields::AirOutletNodeName, wo_->nameString() + " Exhaust Outlet Node"); // FIXME

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

FIXME?

Comment thread src/model/CoilSystemCoolingWater.cpp Outdated
Comment on lines +322 to +323
ok = setCoolingCoil(coolingCoil);
OS_ASSERT(ok);

@jmarrec jmarrec May 5, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • TODO: Need to gracefully handle this instead of hitting a boost assert!

Unlike the rest of the setXXX calls, this is likely to fail, in case the user passed a wrong HVACComponent type, so we need to remove() and LOG_AND_THROW

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Done in #5404


EXPECT_EQ(2u, a.supplyComponents().size());

EXPECT_TRUE(cc.addToNode(n));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I misread since it's truncated. cc is not the CoilSystemCoolingater but the child CoilCoolingWater here. No, this should not be allowed.

jmarrec added 7 commits May 5, 2025 14:50
… of the primary cooling cooling of a CoilSystemCoolingWater to an AirLoopHVAC

Ensures coils that are part of a cooling system are not directly connected to an air loop, preventing potential errors.

Also manages the creation and removal of ControllerWaterCoil objects based on the coil's parent system and presence within a ZoneHVACComponent.
Comment on lines +385 to +398
// CoilSystemCoolingWater
{
auto coilSystems = model().getConcreteModelObjects<CoilSystemCoolingWater>();
for (const auto& coilSystem : coilSystems) {
if (coilSystem.coolingCoil().handle() == handle()) {
return coilSystem;
}
if (boost::optional<WaterToAirComponent> companionCoilUsedForHeatRecovery = coilSystem.companionCoilUsedForHeatRecovery()) {
if (companionCoilUsedForHeatRecovery->handle() == this->handle()) {
return coilSystem;
}
}
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need the same for CoilSystemCoolingWaterHeatExchangerAssisted

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Done in #5404

Comment on lines +477 to +488
// Special case for CoilSystemCoolingWater (Wrap Around Water Coil Heat Recovery Mode)
for (const auto& comp : subsetCastVector<HVACComponent>(plantLoop.demandComponents())) {
if (comp.iddObject().type().value() == openstudio::IddObjectType::OS_Coil_Cooling_Water) {
auto coil = comp.cast<CoilCoolingWater>();
if (auto containingHVACComponent = coil.containingHVACComponent()) {
if (auto coilSystemCoolingWater = containingHVACComponent->optionalCast<CoilSystemCoolingWater>()) {
result.push_back(operationSchemeComponent(*coilSystemCoolingWater));
}
}
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hummmm. I am NOT following this one... @joseph-robertson

jmarrec added 7 commits May 5, 2025 16:20
…ode (and getting them out of sync) in both ctors
…has a FIXME (it fails)

 /home/julien/Software/Others/OpenStudio/src/energyplus/Test/CoilSystemCoolingWater_GTest.cpp:297: Failure
Expected equality of these values:
  "Relief Node"
  idf_companionCoil.getString(Coil_Cooling_WaterFields::AirOutletNodeName).get()
    Which is: "CompanionCoilUsedForHeatRecovery Exhaust Outlet Node"
#5350 - Changes to Support CoilSystem:Cooling:Water
…ded (and OS-resources test show E+ issuing a warning)
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.

Projects

None yet

5 participants