-
Notifications
You must be signed in to change notification settings - Fork 392
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 wshp array bounds error and sizing #10735
Conversation
@@ -2580,86 +2580,92 @@ namespace WaterToAirHeatPumpSimple { | |||
|
|||
// determine adjusted cooling and heating coil capacity | |||
simpleWatertoAirHP.RatedCapHeatAtRatedCdts = RatedCapHeatDes * RatedHeatCapTempModFac; |
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 believe what the code below is trying to do is to size a HP, so the coils would need to be the same size. In this case that's not necessary but an actual HP would need to be tested to make sure it works. I guess it does work since all WSHPs apparently size correctly, or do they?
state.dataSize->DataConstantUsedForSizing = WaterToAirHeatPumpSimple::GetCoilCapacity( | ||
state, HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num), this->m_CoolingCoilName, ErrFound); | ||
EqSizing.DesCoolingLoad = state.dataSize->DataConstantUsedForSizing; | ||
} |
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 just wrapped all this in 1 IF block. Still not sure if the code at the end of this block is needed.
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 next step is to remove this IF block. There is no reason to call the cooling coil to report the UnitarySystem heating capacity. That's a cover up.
Regarding if this fix is correct, there is the same check for the cooling coil where the companionCoil index is checked before looking for the companion heating coil. So this does look like the fix moved in the right direction. It's just that there are some oddities that could also be looked at here or in a separate issue. See issue discussion. |
Also some interesting table reports. 9849-Solution2-Separate UnitarySystems-in-v24.2-CompanionCoilCrash.txt |
@@ -2734,7 +2740,7 @@ namespace WaterToAirHeatPumpSimple { | |||
|
|||
// user provided inputs are assumed to be at rated conditions | |||
simpleWatertoAirHP.RatedPowerHeat = simpleWatertoAirHP.RatedCapHeat / simpleWatertoAirHP.RatedCOPHeatAtRatedCdts; | |||
simpleWatertoAirHP.RatedCapHeatAtRatedCdts = 0; | |||
simpleWatertoAirHP.RatedCapHeatAtRatedCdts = simpleWatertoAirHP.RatedCapHeat; |
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.
Why would the rated capacity sizing variable be set to 0 if not autosized? And what about rated power below? and check the cooling coil code.
Real64 RatedCapHeatAtRatedCdts = 0.0; // Rated Heating Capacity at Rated Conditions [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.
I guess I could have changed the water flow rate sizing to use RatedCapHeat instead.
if (simpleWatertoAirHP.WAHPType == WatertoAirHP::Heating) {
RatedWaterVolFlowRateDes =
simpleWatertoAirHP.RatedCapHeatAtRatedCdts / (state.dataSize->PlantSizData(PltSizNum).DeltaT * Cp * rho);
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.
There is likely a difference between RatedCapHeat and RatedCapHeatAtRatedCdts given the CapFT term applied. This is above at line 2743.
simpleWatertoAirHP.RatedCapHeat = RatedCapHeatDes;
simpleWatertoAirHP.RatedCapHeatAtRatedCdts = RatedCapHeatDes * RatedHeatCapTempModFac;
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 think these equations need to be moved up into the IF blocks in order to use the correct variable. If RatedCapHeat is the coil load and RatedCapHeatatRatedCdts is the coil size, when autosized, then declaring these variables AFTER the coil size is determined seems wrong (i.e., after the if/else). If autosized, RatedCapHeatatRatedCdts should be used as the capacity, if not autosized, RatedCapHeat should be used as the capacity.
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 actually want to revert this change and change the RatedWaterVolFlowRateDes sizing equation to use RatedCapHeat because that's what the sizing routine is setting as the final coil capacity. And the calc routine uses RatedCapHeat as the coil capacity. So RatedCapHeat should be the final coil size whether the coil is autosized or hard-sized.
HeatCapAtPeak = rhoair * VolFlowRate * Psychrometrics::PsyCpAirFnW(DataPrecisionGlobals::constant_zero) *
(HeatSupTemp - HeatMixTemp); // heating coil load
RatedCapHeatDes = (PeakHeatCapTempModFac > 0.0) ? HeatCapAtPeak / PeakHeatCapTempModFac : HeatCapAtPeak;
// heating capacity final determination
simpleWatertoAirHP.RatedCapHeat = RatedCapHeatDes;
simpleWatertoAirHP.RatedCapHeatAtRatedCdts = RatedCapHeatDes * RatedHeatCapTempModFac;
void CalcHPHeatingSimple(EnergyPlusData &state,
HeatCapRated = simpleWatertoAirHP.RatedCapHeat;
So it follows that the water flow rate should use RatedHeatCap because that's the coil size. You can't see an issue in model performance when the water flow rate is sized with either of these variables because only exit water temp changes, not performance. You would have to really critique the exiting water temp to see an issue and even then it would be hard to see.
if (simpleWatertoAirHP.WAHPType == WatertoAirHP::Heating) {
RatedWaterVolFlowRateDes =
simpleWatertoAirHP.RatedCapHeatAtRatedCdts / (state.dataSize->PlantSizData(PltSizNum).DeltaT * Cp * rho);
And then I look at this line and it looks like RatedCapHeatAtRatedCdts is the correct variable to use to size the water flow rate. So I will leave this branch in this state for now even though I think it's wrong.
RatedHeatCapTempModFac =
Curve::CurveValue(state, simpleWatertoAirHP.HeatCapCurveIndex, RatedHeatratioTDB, RatedHeatratioTS, 1.0, 1.0);
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.
RatedCapHeatDes is the CapFT modified coil capacity, as is RatedCapHeat. The next line modifies this value by the rated CapFT, which should be 1 by definition (but I expect it's not 1). So now I'm back to using RatedCapHeat to size the water flow rate. This is so very confusing but I think I am more comfortable with this now. @mjwitte ?
simpleWatertoAirHP.RatedCapHeatAtRatedCdts = RatedCapHeatDes * RatedHeatCapTempModFac;
@mjwitte I think it's time to review changes in unmet hours. This is for 9849-OffSml-MultiHVACSys DOAS_EP9_4 to24.2. |
} else { | ||
SystemCapacity = companionHeatingCoil.RatedCapHeat; | ||
} | ||
} else { | ||
SystemCapacity = simpleWatertoAirHP.RatedCapCoolAtRatedCdts; | ||
SystemCapacity = simpleWatertoAirHP.RatedCapCoolAtRatedCdts; // RatedCapCoolTotal ? * (1 + 1/COP) ? |
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.
These should also include the sizing ratio when basing condenser water flow sizing on cooling capacity.
AirLoopHVAC:UnitarySystem,
N1 , \field DX Heating Coil Sizing Ratio
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'm not awake yet apparently. I read the end comment here as actual code and could not understand what the ternary with multiplier (? *
) was doing 😴
|
@mjwitte @Myoldmopar it has been 28 days since this pull request was last updated. |
@rraustad Are you satisfied with the current changes? Defect file OffSml-MultiHVACSys DOAS_EP9_4 to24.2 hours not met look good now. |
@mjwitte I was looking over this last night. I still have questions on the best way to size this model but without a defect file that shows an issue I would rather not guess based on code review. So with no diffs I guess this can be merged so that additional testing can help with finding issues. @nealkruis would there be someone available to run this against known good input files? |
\EnergyPlusDevSupport\DefectFiles\9000s\9849\Ticket 16738\OffSml-MultiHVACSys DOAS_EP9_4 to24.2.idf should work. @rraustad I have other files from the same user, what combination are you looking for? |
I was interested if this change had an impact on sizing that wasn't expected. So a file that worked before should have the same sizing results? |
Given the unit tests that check autosized capacity maybe I'm being too cautious. If unit tests and example files have not changed then this is probably good enough. |
Here's a sizing comparison for one of the defect files. |
|
Those results look good. The blank results that show up now are likely related to #9273 moving PTUnits to UnitarySystem. Since design size cooling capacity reports correctly it's probably a simple fix to get design size heating capacity to also report. |
This would not be an easy fix. The UnitarySystem is pre-determining the operating air flow and capacity and passing that information to the coils. It appears to coil sizing as if the coils were hard-sized, which they were in this case. I've seen this before. For these single coil UnitarySystems the zone air flow rate is more than 10% different so should be reporting both design size and user specified values. Showing the air flow rates here as an example, similar issue with coil capacity.
This is where the heating coil gets it's air flow value, from the parent. But this is not the autosized air flow rate if the coil air flow is hard sized, it's the value passed from the parent. I think here, if the air flow is hard sized, then the zone or system design air flow rate should be set to the autosized value (e.g., FinalZoneSizing or FinalSysSizing data)
since the non-autosized value is stored in
|
I approve @rraustad 's changes here. @Myoldmopar This is ready to merge. |
@mjwitte, can you confirm that this also resolves the issues in CBECC generated files I sent you? Thanks! |
Yes, it does. |
Thanks for confirming that for @nealkruis , @mjwitte . And for your efforts too, @rraustad . Merging this. |
Pull request overview
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.