-
Notifications
You must be signed in to change notification settings - Fork 448
Fix 10168 zone multiplier incorrectly applies to water heater tank losses #11240
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
base: develop
Are you sure you want to change the base?
Fix 10168 zone multiplier incorrectly applies to water heater tank losses #11240
Conversation
…lies-to-water-heater-tank-losses
…lies-to-water-heater-tank-losses
@mjwitte this looks OK to me, but I'd defer to you on it. |
if (state.dataHeatBal->Zone(ZoneNum).numSpaces > 1) { | ||
gainFrac = state.dataHeatBal->space(spaceNum).FloorArea / state.dataHeatBal->Zone(ZoneNum).FloorArea; | ||
} | ||
if (std::find(AdjustTankLossMultipliers.begin(), AdjustTankLossMultipliers.end(), IntGainCompType) != AdjustTankLossMultipliers.end()) { |
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 method here is sound, but a comment line to explain would be helpful here.
But should this be done at the space level instead of here? At this point, only zone-level internal gain types call SetupSpaceInternalGain
directly, so no multiplier adjustment is necessary. However, if at some point in the future the tank loss allows specifying a Zone Name or Space Name, then this adjustment will not get applied.
I think it would be better to move this into SetupSpaceInternalGain
.
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.
Added a comment and moved to SetupSpaceInternalGain
gainFrac = state.dataHeatBal->space(spaceNum).FloorArea / state.dataHeatBal->Zone(ZoneNum).FloorArea; | ||
} | ||
if (std::find(AdjustTankLossMultipliers.begin(), AdjustTankLossMultipliers.end(), IntGainCompType) != AdjustTankLossMultipliers.end()) { | ||
int multiplier = state.dataHeatBal->Zone(ZoneNum).Multiplier * state.dataHeatBal->Zone(ZoneNum).ListMultiplier; |
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.
Nit picking, this can be 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.
Fixed
int RetNodeNum = 0 // for return air heat gains | ||
); | ||
|
||
// Multipliers are double counted for tank losses - these are the internal gains that need adjust for this |
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.
It's not that the multipliers are double counted, but rather the loss should be distributed across the multiplied zones/spaces. Not sure how to say that more simply.
static constexpr std::array<DataHeatBalance::IntGainType, 4> AdjustTankLossMultipliers = { | ||
DataHeatBalance::IntGainType::WaterHeaterMixed, | ||
DataHeatBalance::IntGainType::WaterHeaterStratified, | ||
DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, | ||
DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified}; |
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.
If I'm following this correctly, any gain that comes from HVAC, electrical, refrigeration, etc. (anything other than the zone gains like lights, people, etc) should be included in this list. @shorowit ?
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.
I did it this way so we could easily add/remove other gains as needed, but beyond water heaters I wasn't sure what to add.
Pull request overview
Description of the purpose of this PR
Fix a defect in which zone multipliers are incorrectly applied to water heater tank losses. Add unit test to show correctly adjusted space gain fraction.
Pull Request Author
Reviewer