-
Notifications
You must be signed in to change notification settings - Fork 233
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
Changes from 6 commits
e1e512c
10bb8c4
68e51d1
029bcc3
d22527a
59ccbce
5d3fdbd
9941697
65aa931
dfa12e3
a477ed9
6643ef2
92164d1
71873fd
3b25f89
3eb7cb0
aef90f0
303af7c
6df9e34
98a8c95
c925793
334073c
eb781ff
c177de5
188c4ed
dec4fb7
d52f0ca
0e15323
8a7d1b1
f37bfcb
01b8f3b
dddd080
e95636a
6a2062e
e607ce8
220de74
35b9eb8
c864d8d
177fab2
e09420b
82c8631
606fb81
ba72104
421296e
71a7c62
e1e03e8
bd4f9de
a31240e
fb97ea3
595d469
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -470,19 +470,27 @@ namespace model { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedAirFlowRateinHeatingMode() const { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return getAutosizedValue("Design Size Source Side Volume Flow Rate", "m3/s", "HeatPump:AirToWater:Heating"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+473
to
+493
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update SQL queries |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+472
to
+494
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct per IOFreeze, but the override of compType will not be needed once this PR is approved and dropped:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the strings will need adjustments too.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void HeatPumpAirToWater_Impl::autosize() {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -760,6 +768,14 @@ namespace model { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedWaterFlowRateinHeatingMode(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| boost::optional<double> HeatPumpAirToWater::autosizedRatedHeatingCapacity() const { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedHeatingCapacity(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| boost::optional<double> HeatPumpAirToWater::autosizedRatedCoolingCapacity() const { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedCoolingCapacity(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// @cond | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HeatPumpAirToWater::HeatPumpAirToWater(std::shared_ptr<detail::HeatPumpAirToWater_Impl> impl) : StraightComponent(std::move(impl)) {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// @endcond | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -348,9 +348,21 @@ namespace model { | |
| return result; | ||
| } | ||
|
|
||
| boost::optional<double> HeatPumpAirToWaterCooling_Impl::autosizedRatedCoolingCapacity() const { | ||
| boost::optional<double> result; | ||
| if (auto awhp_ = heatPumpAirToWater()) { | ||
| result = awhp_->autosizedRatedCoolingCapacity(); | ||
| } | ||
| return result; | ||
| } | ||
|
Comment on lines
+351
to
+357
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Cooling (/Heating) component queries the AWHP to get the SQL value |
||
|
|
||
| void HeatPumpAirToWaterCooling_Impl::autosize() { | ||
| autosizeRatedAirFlowRate(); | ||
| autosizeRatedWaterFlowRate(); | ||
| auto speeds = this->speeds(); | ||
| if (!speeds.empty()) { | ||
| speeds.back().autosize(); // Only need/can autosize the last (highest) speed | ||
| } | ||
|
Comment on lines
+362
to
+365
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| } | ||
|
|
||
| void HeatPumpAirToWaterCooling_Impl::applySizingValues() { | ||
|
|
@@ -361,6 +373,13 @@ namespace model { | |
| if (boost::optional<double> val_ = autosizedRatedWaterFlowRate()) { | ||
| setRatedWaterFlowRate(*val_); | ||
| } | ||
|
|
||
| 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 | ||
| } | ||
| } | ||
|
Comment on lines
+377
to
+382
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same in applySizingValue |
||
| } | ||
|
|
||
| ComponentType HeatPumpAirToWaterCooling_Impl::componentType() const { | ||
|
|
@@ -714,6 +733,10 @@ namespace model { | |
| return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->heatPumpAirToWater(); | ||
| } | ||
|
|
||
| boost::optional<double> HeatPumpAirToWaterCooling::autosizedRatedCoolingCapacity() const { | ||
| return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->autosizedRatedCoolingCapacity(); | ||
| } | ||
|
|
||
| /// @cond | ||
| HeatPumpAirToWaterCooling::HeatPumpAirToWaterCooling(std::shared_ptr<detail::HeatPumpAirToWaterCooling_Impl> impl) | ||
| : StraightComponent(std::move(impl)) {} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,7 +88,33 @@ namespace model { | |
| } | ||
|
|
||
| boost::optional<double> HeatPumpAirToWaterCoolingSpeedData_Impl::autosizedRatedCoolingCapacity() { | ||
| return getAutosizedValue("TODO_CHECK_SQL Rated Cooling Capacity", "W"); | ||
| 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; | ||
|
Comment on lines
+91
to
+117
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| } | ||
|
|
||
| double HeatPumpAirToWaterCoolingSpeedData_Impl::ratedCOPforCooling() const { | ||
|
|
||
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