-
Notifications
You must be signed in to change notification settings - Fork 396
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
Refactor VRF static timing variables #7729
Comments
CurrentEndTime and CurrentEndTimeLast are only used to determine the progression of time and when down-shifting of the HVAC time step occurs. These variables are the same for all VRF systems (i.e., this time step has a time and last time step has a time). Yes these should probably be moved to the module level for unit testing. And if there is a better way to track time then that is preferred. Regarding the location of CurrentEndTime and CurrentEndTimeLast in the CalcVRFCondenser function, these variables should be moved up and down, respectively, outside the IF block where currently set. Also, TimeStepSysLast is not used in this function. i.e, outside (above and below) this IF block
|
* Changing static variables to namesake variables Partial fix to #7729 * Hotfix #7723 revert + Add flag to reset CurrentEndTimeLast when InitVRF is not called The unit test will work without Hotfix #7723. Not sure if multiple condensors will work. The HRTime, HRTimer variables still exist. * Revert "Hotfix #7723 revert + Add flag to reset CurrentEndTimeLast when InitVRF is not called" This reverts commit 469d49d. * Revert "Changing static variables to namesake variables" This reverts commit 67f7d23. * Removed static for CurrentEndTime + Removed TimeStepSysLast * Changed TimeStepSysLast to non-static * moved Real64 TimeStepSysLast; to namespace To try to get rid of build errors * Changed two of the CurrentEndTimeLast to non-static * trying to fix the condensor function * Change Final static variable to namespace Fingers crossed * Moving namespace variables to module level * Initialized variables Got build errors from uninitialized variables. Static variables are automatically zero initialized. Why were there no errors when they were in the namespace? * Removed and combine the three CurrentEndTimeLast Test if everything else working. * Resolve Conflict * Fixed license... * Split the InitVRF and CalcVRFCond CurrentEndTimeLast variables + code cleanup * Missed this variable rename. * Update clear_state() * Temp check * Code cleanup removed helper variables... * Comment + whitespace.
Issue overview
The VRF models have several troublesome static local variables in
InitVRF
,CalcVRFCondenser
andCalcVRFCondenser_FluidTCtrl
which can cause problems with serial unit tests. Seems they should either be part of the component structs or should be module level variables. Also, at first glance, if there's more than one VRF condenser these variables will be wrong, becauseCurrentEndTimeLast
will get updated for the first component and then it will be wrong for the next component? Also, some of these variables are beings stored in ...HRTimer and ...HRTime.Suggest refactoring the VRF models to use a different approach to track timing for control decisions that does not rely on local statics.
Details
Some additional details for this issue (if relevant):
Checklist
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
The text was updated successfully, but these errors were encountered: