Skip to content
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

FixHVACUnitarySystem SetOnOffMassFlowRate NAN problem #4761

Merged
merged 18 commits into from
Mar 21, 2015

Conversation

mjwitte
Copy link
Contributor

@mjwitte mjwitte commented Mar 1, 2015

Fixes #4557

… assignments for MSHPMassFlowRateLow and MSHPMassFlowRateHigh to prevent divide by zero in CalcMultiSpeedDXCoilCooling/Heating.
@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 2, 2015

@rraustad This is ready for your review. The BadAxe-Base_141019_4spd-MJW defect file runs now, with dx coil airflow per capacity warnings. Not sure if those warnings are expected or if that indicates a problem with the fix. Also, the fix does not really address how a multispeed coil should be controlled when using a unitary system with setpoint control. This just addresses avoiding a divide by zero.

rraustad added 2 commits March 3, 2015 11:19
…d revised logic in SetOnOffMassFlowRate subroutine to always set multi-speed coil mass flow rate globals.
@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 3, 2015

@rraustad Thanks for the second pass on this. I see one unit test is failing. I'll wait for the CI backlog on new features to settle down then merge develop back in here and fix that.

@Myoldmopar
Copy link
Member

Myoldmopar commented Mar 3, 2015 via email

@rraustad
Copy link
Contributor

rraustad commented Mar 3, 2015

All unit tests passed here. I expanded on the unit test you created and pushed that up. If it's failing now you didn't get the latest version of unit tests?

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 3, 2015

@rraustad The CI reports showed a failure. I'll reconfirm when I merge in develop (and resolve conflicts ).

@rraustad
Copy link
Contributor

rraustad commented Mar 3, 2015

HVACTemplate-5ZoneUnitarySystem has audit, rdd, and err (less max iters) diff's. Also convergence diff's in the eio. I typically don't believe those results since it's a moving target.

@rraustad
Copy link
Contributor

rraustad commented Mar 4, 2015

I went through the Win64-Windows-7-VisualStudio-12 failures and all I see are aud, err, rdd, and eio (convergence) diff's for HVACTemplate-5ZoneUnitarySystem and aud, rdd, and eio (convergence) for UnitarySystem_*. Where do I see csv diff's?

@Myoldmopar
Copy link
Member

Myoldmopar commented Mar 4, 2015 via email

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 4, 2015

@Myoldmopar @rraustad Brought this branch up to date, resolved the conflict, added deallocates to a bunch of unit tests (trying not to conflict withe @jasondegraw changes on the fluid cooler branch), and a couple of other cleanups to the IDD and dx coil warnings.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 5, 2015

@Myoldmopar Concerned that the regression diffs here show max iteration warnings for HVACTemplate-5ZoneUnitarySystem in both develop and this branch. When did those creep in? But I have yet to reproduce those warnings locally. See error diffs here
https://nrel.github.io/EnergyPlusBuildResults/EnergyPlus-8af21d60e78a6f2424d04fb2e9c524839841637c-Win64-Windows-7-VisualStudio-12.html

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 5, 2015

@Myoldmopar Oh - CI forces design day runs, which do produce max iteration warnings for HVACTemplate-5ZoeneUnitarySystem - even with 8.2.0. Shouldn't be. Need to work on figuring out why for that (and any others that don't run well with design days only. Post that as an issue or a story or?

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 5, 2015

@Myoldmopar Please review changes to unit tests. I restarted the integration coverage tests (seemed stuck for too long) . Because I've made unit test changes both here and in #4624 this should wait until 4624 gets merged in and then I'll merge develop back here to resolve any conflicts in the unit tests.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 5, 2015

@rraustad So, these changes are causing new max iteration warnings with HVACTemplate-5ZoneUnitarySystem when run as-is (using the short runperiods in the example file). Current develop does not have these warnings. So, we need to double-check these changes. UnitarySystem_VSHeatPumpWaterToAirEquationFit has max iteration warnings both before and after this fix - which isn't good either, but perhaps a different issue.

@rraustad
Copy link
Contributor

rraustad commented Mar 5, 2015

So these fixes broke something. I thought this was rather straight-forward, and would only affect the multispeed coils. I also thought the max iterations were already there so it didn't strike me when I saw them during this fix. The zone temps are no longer maintained.
nanbranch

@rraustad
Copy link
Contributor

rraustad commented Mar 5, 2015

It's not as bad as first thought once I got the right variables compared.
nanbranch

@rraustad
Copy link
Contributor

rraustad commented Mar 6, 2015

I haven't been able to find a problem with changes to this PR. I do see where the load is very close to the comp off capacity (~1W) which appeared to confuse the model. A few time steps later, it runs fine with only a couple iterations. I'll need to look more closely at what is happening. I can't say yet if this is a new problem but does look so thus far.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 6, 2015

@rraustad Thanks for looking at this more. Do you have an pending changes on your machine? If not, I will merge develop into here again and resolve the conflict (which is probably in the unit tests again).

@rraustad
Copy link
Contributor

rraustad commented Mar 6, 2015

No pending changes at this time. I will look at this more over the weekend.

…ixNANProblems-Issue4557

Conflicts:
	tst/EnergyPlus/unit/PurchasedAirManager.unit.cc
@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 6, 2015

@rraustad I've merged in develop and pushed this up, so be sure to pull down the latest before you look at this again.

…iteration on PLR (actually CycRatio or SpeedRatio).
@rraustad
Copy link
Contributor

rraustad commented Mar 9, 2015

** Warning ** SimHVAC: Maximum iterations (20) exceeded for all HVAC loops, at LONDON - - - WMO#=-, 01/14 08:30 - 08:45
** ~~~ ** The solution for one or more of the Air Loop HVAC systems did not appear to converge
** ~~~ ** ...use Output:Diagnostics,DisplayExtraWarnings; to show more details on each max iteration exceeded.

I know what causes it but have not found a solution.
Starting with a previous time step air flow rate is at the heating flow rate. Heating coil is gas with a single speed. Cooling coil is multipseed DX. The outdoor air system determines the mixed air temp is ~19C given the 23C return temp, 6C outdoor air temp, 0.29 kg/s recirc flow and 0.05 kg/s OA flow. The UnitarySystem is simulated and finds a small cooling load and operates at speed 1 (0.06 kg/s) to meet that load. The OA system is simulated again and now finds a 13C mixed air temp given the approximate equal recirc and OA flow. The UnitarySystem, still with a cooling load, finds that operating the constant fan at this low inlet temp pushes the zone temp below the heating set point. It switches to heating mode, adjusts flow rate to the heating flow (0.29 kg/s), and meets the load to heating set point. This high recirc flow rate triggers a change in mixed air temp, back to the original 21C. Next time through the UnitarySystem finds that speed 1 cooling can meet the cooling load. And round and round we go.
The system does control the loads well and hits the cool/heat temps fairly close.
nan

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 9, 2015

@rraustad So, what it really needs is to operate at a mixture of flow rates during a single timestep. Could that be done? Would a reasonable compromise be to lock the flow rate based on the initial zone load request? In this case, zone needs cooling (albeit a very small amount) so operate this timestep at the cooling supply flow rate. Other solutions?

@rraustad
Copy link
Contributor

rraustad commented Mar 9, 2015

Well, the zone needs cooling if the air flow is at the heating flow rate. The zone needs heating if operating at the cooling air flow rate. Constant fan is used during the day. If we change the example file to be multispeed heating and cooling, I think the max iters would go away (nope, they were not eliminated, I tried 2- and 3-spd heating, that surprises me). I wonder if industry has ever ran into this? What would a real system do if OA was provided and heating used full flow only while cooling allowed multiple speeds? A real system would operate in one mode based on zone load as you suggested. Eventually, the zone would float to the deadband while the system fan continued to operate. Either cooling or heating mode would turn on eventually. What's different with E+ is the OA system uses the previous time step flow to determine mixed air temp, this sometimes screws up the model.

Maybe if flow was determined by load, this wouldn't be an issue. I guess that's what a real system would do so maybe it's a reasonable solution. This would mean then that constant fan systems would at times overshoot the (alternate) set point and also lead to smaller system time steps. I'll see if I can test this theory (comment out where I switch modes).

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 9, 2015

@rraustad Longer term we should consider making the OA system a child of the unitary system so it gets simulated with whatever airflow rate the unitary system is operating at (no back and forth on that). And there may be some control logic changes that are in order as well. But for now, the changes you pushed up yesterday have resolved the iteration errors for the two single-day runperiods. I'm running an annual simulation now.

@rraustad
Copy link
Contributor

rraustad commented Mar 9, 2015

Remember I was using London, I wanted the mild loads.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 9, 2015

@rraustad That went right past me (London). And Chicago annual simulation hits max iteration errors as well.

@rraustad
Copy link
Contributor

rraustad commented Mar 9, 2015

After commenting out the mode switching, this looks like what I would expect. What I didn't expect is to still get max iteration warnings (starts at 1/14 8 AM ~100 of them). Uses 3-spd DX cooling and heating coils. I don't know if this is a different issue or not (i.e., if the model is working as I intend). Since the heating speed never got above 1 (10 in the figure), the OA system should have reasonably determined the mixed air temp from the previous time step recirc flow.
Component Sizing Information, Coil:Heating:DX:MultiSpeed, SYS 2 FURNACE DX HEAT MULTISPD HEATING COIL, Speed 3 Design Size Rated Air Flow Rate [m3/s], 0.24293
Component Sizing Information, Coil:Heating:DX:MultiSpeed, SYS 2 FURNACE DX HEAT MULTISPD HEATING COIL, Speed 2 Design Size Rated Air Flow Rate [m3/s], 0.16195
Component Sizing Information, Coil:Heating:DX:MultiSpeed, SYS 2 FURNACE DX HEAT MULTISPD HEATING COIL, Speed 1 Design Size Rated Air Flow Rate [m3/s], 8.09775E-002

nomodeswitching

@nrel-bot
Copy link

@rraustad @mjwitte @lgentile it has been 7 days since this pull request was last updated.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 18, 2015

@rraustad I've lost track of our status on this one. Is it ready to go in?

…ixNANProblems-Issue4557

Conflicts:
	tst/EnergyPlus/unit/CMakeLists.txt
@@ -10987,13 +11094,21 @@ namespace HVACUnitarySystem {
InletNode = UnitarySystem( UnitarySysNum ).UnitarySystemInletNodeNum;

if ( SpeedNum > 1 ) {
AverageUnitMassFlow = CompOnMassFlow;
if( CoolingLoad && MultiOrVarSpeedCoolCoil( UnitarySysNum ) || HeatingLoad && MultiOrVarSpeedHeatCoil( UnitarySysNum ) ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rraustad The clang tests are throwing four warnings like this:
'&&' within '||' [-Wlogical-op-parentheses]
This line looks like it needs some clarification with parentheses. Also 11107 below. Not sure why four warnings.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 18, 2015

@Myoldmopar @jasondegraw This is the pull request where I mixed in a bunch of new unit test deallocates.

@rraustad
Copy link
Contributor

I'll fix that as soon as I can. Should be ( && ) || ( && )

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 19, 2015

@rraustad If you can't get to it, I can make that change.

@rraustad
Copy link
Contributor

Corrected () || () issue and merged develop again. Defect file runs to completion. I still don't like some of the code I see, but since this model was presumably thoroughly tested, I am hesitant to make significant changes. I do see some areas that still need to be revised but these are not associated with this issue. So I suggest this gets merged. I'm pushing now to see what CI does.

@Myoldmopar
Copy link
Member

Looks like CI should be OK with it. The semi-expected unit test issues plus a few isolated regressions and reduced max-hvac-iteration warnings. I'll wait until I'm in the office and there should be a few more results by then, then I can merge or whoever else.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 20, 2015

@Myoldmopar @rraustad This branch has merge conflicts now. I can fix unless one of you has already started.

mjwitte added 2 commits March 20, 2015 13:05
…ixNANProblems-Issue4557

Conflicts:
	idd/Energy+.idd.in
	tst/EnergyPlus/unit/PurchasedAirManager.unit.cc
@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 20, 2015

@Myoldmopar @rraustad Develop merged, conflict resolved, IDD reference re-fixed. One more round of CI, then this can go in.

mjwitte added a commit that referenced this pull request Mar 21, 2015
FixHVACUnitarySystem SetOnOffMassFlowRate NAN problem
@mjwitte mjwitte merged commit 2970be4 into develop Mar 21, 2015
@Myoldmopar Myoldmopar added the Defect Includes code to repair a defect in EnergyPlus label Mar 26, 2015
@mjwitte mjwitte deleted the 89224666-FixNANProblems-Issue4557 branch March 28, 2015 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User file fails with NAN in predicted load
4 participants