-
Notifications
You must be signed in to change notification settings - Fork 222
Fix #5490 - E+ 25.2.0: Wrap HeatPump:AirToWater #5496
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
Conversation
|
@jmarrec Per NREL/EnergyPlus#11001, I expected there to be updates in this PR related to the new "Water Loop Type" field on the |
Hi @joseph-robertson this "Water Loop Type" field was used to assign whether the air to water heat pump component is heating or cooling. For the HeatPump:PlantLoop:EIR:Heating and HeatPump:PlantLoop:EIR:Cooling ones, they can know this by the :Heating and :Cooling. But for this object, it has to know from what type of loop it's connected to thus the field is added. It's not used in other objects. |
I'm considering breaking it further into subobjects, but I need to start somewhere while I wait on stakeholder feedback
…mps and handle Curves properly
Some notes: * I'm considering skipping the ModelObjectList and use extensible groups directly * I'm not sure if I want the SpeedData objects to be unique or shared (I need to switch to ResourceObject in that case I think) * The clone/remove/children need some work
…the Heating/Cooling side
joseph-robertson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we write a new functional test on OS-resources before merging this?
00ea1c6 to
42fe449
Compare
…plement top-level autosizedRatedHeating/CoolingCapacity
…apacity: grab it from SQL only if it's the last speed (highest)
…ts the LAST speed too The way Model::autosize/applySizingValues works is that it does it for HVACComponent, and the speed data is not one and we do not want to add an explicit case because none of the speeds should be autosized except the last (highest) one
…ll be gone by 25.2.0 release (will revert then)
42fe449 to
71a7c62
Compare
| // Water Loop Type | ||
| // TODO JM 2025-11-13: This field should never have been added to 25.2.0, so it is purposefully NOT wrapped in the model namespace | ||
| // MJW is looking into removing it today, will assess later | ||
| ComponentType waterLoopType = plantLoop.componentType(); | ||
| if (waterLoopType == ComponentType::Heating) { | ||
| idfObject.setString(PlantLoopFields::WaterLoopType, "HotWater"); | ||
| } else if (waterLoopType == ComponentType::Cooling) { | ||
| idfObject.setString(PlantLoopFields::WaterLoopType, "ChilledWater"); | ||
| } else if (waterLoopType == ComponentType::None) { | ||
| idfObject.setString(PlantLoopFields::WaterLoopType, "None"); | ||
| } else if (waterLoopType == ComponentType::Both) { | ||
| if (!plantLoop.supplyComponents(IddObjectType::OS_HeatPump_AirToWater_Cooling).empty()) { | ||
| idfObject.setString(PlantLoopFields::WaterLoopType, "ChilledWater"); | ||
| } else if (!plantLoop.supplyComponents(IddObjectType::OS_HeatPump_AirToWater_Heating).empty()) { | ||
| idfObject.setString(PlantLoopFields::WaterLoopType, "HotWater"); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove/revert depending on:
| case openstudio::IddObjectType::OS_HeatPump_AirToWater_Cooling: { | ||
| // no-op, just Log a Trace message | ||
| LOG(Trace, "HeatPumpAirToWaterCooling is not translated by itself but in the parent HeatPumpAirToWater"); | ||
| break; | ||
| } | ||
| case openstudio::IddObjectType::OS_HeatPump_AirToWater_Heating: { | ||
| // no-op, just Log a Trace message | ||
| LOG(Trace, "HeatPumpAirToWaterHeating is not translated by itself but in the parent HeatPumpAirToWater"); | ||
| break; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid "Unknown IddObjectType" warning
| return getAutosizedValue("Design Size Rated Air Volume Flow Rate in Heating Mode", "m3/s"); | ||
| } | ||
|
|
||
| boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedWaterFlowRateinHeatingMode() const { | ||
| return getAutosizedValue("Design Size Load Side Volume Flow Rate", "m3/s", "HeatPump:AirToWater:Heating"); | ||
| return getAutosizedValue("Design Size Rated Water Volume Flow Rate in Heating Mode", "m3/s"); | ||
| } | ||
|
|
||
| boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedAirFlowRateinCoolingMode() const { | ||
| return getAutosizedValue("Design Size Source Side Volume Flow Rate", "m3/s", "HeatPump:AirToWater:Cooling"); | ||
| return getAutosizedValue("Design Size Rated Air Volume Flow Rate in Cooling Mode", "m3/s"); | ||
| } | ||
|
|
||
| boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedWaterFlowRateinCoolingMode() const { | ||
| return getAutosizedValue("Design Size Load Side Volume Flow Rate", "m3/s", "HeatPump:AirToWater:Cooling"); | ||
| return getAutosizedValue("Design Size Rated Water Volume Flow Rate in Cooling Mode", "m3/s"); | ||
| } | ||
|
|
||
| boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedHeatingCapacity() const { | ||
| return getAutosizedValue("Design Size Rated Heating Capacity", "W"); | ||
| } | ||
|
|
||
| boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedCoolingCapacity() const { | ||
| return getAutosizedValue("Design Size Rated Cooling Capacity", "W"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update SQL queries
| boost::optional<double> HeatPumpAirToWaterCooling_Impl::autosizedRatedCoolingCapacity() const { | ||
| boost::optional<double> result; | ||
| if (auto awhp_ = heatPumpAirToWater()) { | ||
| result = awhp_->autosizedRatedCoolingCapacity(); | ||
| } | ||
| return result; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Cooling (/Heating) component queries the AWHP to get the SQL value
| auto speeds = this->speeds(); | ||
| if (!speeds.empty()) { | ||
| speeds.back().autosize(); // Only need/can autosize the last (highest) speed | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in autosize, this is weird, but I autosize the last speed.
The way Model::autosize/applySizingValues works is that it does it for HVACComponent, and the speed data is not one and we do not want to add an explicit case because none of the speeds should be autosized except the last (highest) one
| if (boost::optional<double> val_ = autosizedRatedCoolingCapacity()) { | ||
| auto speeds = this->speeds(); | ||
| if (!speeds.empty()) { | ||
| speeds.back().setRatedCoolingCapacity(*val_); // Only need/can autosize the last (highest) speed | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same in applySizingValue
| boost::optional<double> result; | ||
| auto awhp_ccs = heatPumpAirToWaterCoolings(); | ||
| if (awhp_ccs.empty()) { | ||
| return result; | ||
| } | ||
| size_t n_found = 0; | ||
| for (const auto& awhp_cc : awhp_ccs) { | ||
| // Check needed because could be the booster speed | ||
| if (awhp_cc.speeds().empty()) { | ||
| continue; | ||
| } | ||
| // It has to be the last speed | ||
| if (awhp_cc.speeds().back().handle() != this->handle()) { | ||
| continue; | ||
| } | ||
| if (n_found == 0) { | ||
| // Setting the first one only | ||
| result = awhp_cc.autosizedRatedCoolingCapacity(); | ||
| } | ||
| ++n_found; | ||
| } | ||
| if (n_found > 1) { | ||
| LOG(Warn, briefDescription() << " is used as the highest speed in multiple HeatPumpAirToWaterCooling objects, " | ||
| "returning the autosized value from the first one only."); | ||
| } | ||
|
|
||
| return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HeatPumpAirToWaterCoolingSpeedData_Impl::autosizedRatedCoolingCapacity
We only grab it from sql if it's the LAST speed
|
This is pretty much ready, except there are moving pieces on E+ side:
But I got the OpenStudio-resources tests ready (new rb + python tests, and add it to autosize_hvac) |
…490_HeatPumpAirToWater
…490_HeatPumpAirToWater
…field will be gone by 25.2.0 release (will revert then)" This reverts commit 71a7c62.
|
CI Results for 595d469:
|
Pull request overview
This wraps HeatPump:AirToWater into OpenStudio SDK, and it's a major effort.
This object is broken into 5 classes:
There are still a few missing pieces here:
Pull Request Author
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)Labels:
IDDChangeAPIChangePull Request - Ready for CIso that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.