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

Improved Controller:WaterCoil FindRoot error message with TemperatureAndHumidityRatio #10435

Merged
merged 7 commits into from Mar 15, 2024

Conversation

mjwitte
Copy link
Contributor

@mjwitte mjwitte commented Mar 12, 2024

Pull request overview

  • User file (helpdesk ticket 16605) was tripping on the infamous FindRootSimpleController error, but the error message was missing one important detail, the ChW temp:
   ** Severe  ** FindRootSimpleController: Controller error for controller = "CENTRAL COOLING COIL CONTOLLER 1"
   **   ~~~   **  Environment=WEATHERFILEDAYS, at Simulation time=01/01 20:03 - 20:07
   **   ~~~   **   Controller function is inconsistent with user specified controller action = Reverse action
   **   ~~~   **   Actuator will be set to maximum action
   **   ~~~   ** Controller control type=Temperature and humidity ratio
   **   ~~~   ** Controller temperature setpoint = 6.31E-003 [C]
   **   ~~~   ** Controller sensed temperature = 7.62E-003 [C]
   **   ~~~   ** Controller humidity ratio setpoint = 6.31E-003 [kgWater/kgDryAir]
   **   ~~~   ** Controller sensed humidity ratio = 7.62E-003 [kgWater/kgDryAir]
   **   ~~~   ** Controller actuator mass flow rate set to 4.07 [kg/s]

This pull request modifies the error message to:

   ** Severe  ** FindRootSimpleController: Controller error for controller = "CENTRAL COOLING COIL CONTOLLER 1"
   **   ~~~   **  Environment=WEATHERFILEDAYS, at Simulation time=01/01 20:25 - 20:30
   **   ~~~   **   Controller function is inconsistent with user specified controller action = Reverse action
   **   ~~~   **   Actuator will be set to maximum action
   **   ~~~   ** Controller control type=Temperature and humidity ratio
   **   ~~~   ** Humidity control is active.
   **   ~~~   ** Controller humidity ratio setpoint = 6.73E-003 [kgWater/kgDryAir]
   **   ~~~   ** Controller sensed humidity ratio = 7.22E-003 [kgWater/kgDryAir]
   **   ~~~   ** Controller humidity ratio setpoint dew-point temperature = 7.94 [C]
   **   ~~~   ** Controller temperature setpoint = 17.00 [C]
   **   ~~~   ** Controller sensed temperature = 11.04 [C]
   **   ~~~   ** Controller actuator mass flow rate set to 3.94 [kg/s]
   **   ~~~   ** Controller actuator temperature = 8.00 [C]
   **   ~~~   ** The entering chilled water temperature (controller actuator temperature) should be below the humidity ratio setpoint dew-point temperature.
  • Also implement a limit on setpoint temperature based one coil type (heating or cooling) and entering water temperature.
    • Initially use max/min(setpoint temperature, water temp), but this might need a small tolerance.
    • If this introduces diffs, then this part will be reverted and just the error message changes can go in for v24.1

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@mjwitte mjwitte added the Defect Includes code to repair a defect in EnergyPlus label Mar 12, 2024
@rraustad
Copy link
Contributor

I was thinking if we knew if CW or HW coil the message could be made even clearer.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 12, 2024

@rraustad We do figure out the coil type earlier, but haven't been saving that. How's this?

   ** Severe  ** FindRootSimpleController: Controller error for controller = "CENTRAL COOLING COIL CONTOLLER 1"
   **   ~~~   **  Environment=WEATHERFILEDAYS, at Simulation time=01/01 20:25 - 20:30
   **   ~~~   **   Controller function is inconsistent with user specified controller action = Reverse action
   **   ~~~   **   Actuator will be set to maximum action
   **   ~~~   ** Controller control type=Temperature and humidity ratio
   **   ~~~   ** Controller temperature setpoint = 6.73E-003 [C]
New=>   **   ~~~   ** Temperature setpoint has been reduced for humidity control.
   **   ~~~   ** Controller sensed temperature = 7.22E-003 [C]
   **   ~~~   ** Controller humidity ratio setpoint = 6.73E-003 [kgWater/kgDryAir]
   **   ~~~   ** Controller sensed humidity ratio = 7.22E-003 [kgWater/kgDryAir]
   **   ~~~   ** Controller actuator mass flow rate set to 3.94 [kg/s]
   **   ~~~   ** Controller actuator temperature = 8.00 [C]
Modified=>   **   ~~~   ** Chilled water coils should be reverse action and the entering chilled
Modified=>   **   ~~~   ** water temperature (controller actuator temperature) should be below the setpoint temperature

Anything else you would like to add?

@rraustad
Copy link
Contributor

This looks good, and I could live with it, but...

You already know the controller is set to reverse action:

**   ~~~   **   Controller function is inconsistent with user specified controller action = Reverse action

So these new lines don't need the "Chilled water coils should be reverse action and" in this case but do if controller is set to Normal action (I suspect this is warned elsewhere for CW coils?).

Modified=>   **   ~~~   ** Chilled water coils should be reverse action and the entering chilled
Modified=>   **   ~~~   ** water temperature (controller actuator temperature) should be below the setpoint temperature

And now I know what's causing the issue with the UnmetHours post (but not sure how to fix it):

New=>   **   ~~~   ** Temperature setpoint has been reduced for humidity control.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 13, 2024

How's this?

   ** Severe  ** FindRootSimpleController: Controller error for controller = "CENTRAL COOLING COIL CONTOLLER 1"
   **   ~~~   **  Environment=WEATHERFILEDAYS, at Simulation time=01/01 20:25 - 20:30
   **   ~~~   **   Controller function is inconsistent with user specified controller action = Reverse action
   **   ~~~   **   Actuator will be set to maximum action
   **   ~~~   ** Controller control type=Temperature and humidity ratio
   **   ~~~   ** Controller temperature setpoint = 6.73E-003 [C]
   **   ~~~   ** Temperature setpoint has been reduced for humidity control.
   **   ~~~   ** Controller sensed temperature = 7.22E-003 [C]
   **   ~~~   ** Controller humidity ratio setpoint = 6.73E-003 [kgWater/kgDryAir]
   **   ~~~   ** Controller sensed humidity ratio = 7.22E-003 [kgWater/kgDryAir]
   **   ~~~   ** Controller actuator mass flow rate set to 3.94 [kg/s]
   **   ~~~   ** Controller actuator temperature = 8.00 [C]
   **   ~~~   ** The entering chilled water temperature (controller actuator temperature) should be below the setpoint temperature.

Copy link
Contributor

@rraustad rraustad left a comment

Choose a reason for hiding this comment

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

This warning is much clearer now and targets specific coil types (e.g., CW vs HW).

@rraustad
Copy link
Contributor

This can merge once CI is clean. Now I want to know why the SPM or controller code was setting the CW SP temp below the CW temp (where CW SP temp = humrat SP???), and if that's a problem, and if that can be corrected.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 13, 2024

Well, that's a good point, if the setpoint was limited to the ChW temp, then the findroot error shouldn't occur. The humidity control won't be achieved, but it's not achieved anyway in this case. I can try adding that here.

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 13, 2024

Should the setpoint always be adjusted to >= ChW temp (and similar to HW temp)? Even without humidity control?

@rraustad
Copy link
Contributor

From what I recall of the controller code, I think the initial conditions need to be static, min/max flow, min/max SP, etc. There is a place where you updated the controller to switch between temp and humidity control where I think this is happening but not sure why it's showing up now. I think if on one iteration the CW SP is changed and then on a subsequent interation that CW SP is changed to something outside the initial limits then there is a problem. It's like a SolveRoot failure with -2.

case HVACControllers::CtrlVarType::TemperatureAndHumidityRatio: { // 'TemperatureAndHumidityRatio'
    if (thisController.HumRatCtrlOverride) {
        // Humidity ratio control
        thisController.SensedValue = state.dataLoopNodes->Node(SensedNode).HumRat;
    } else {
        // Temperature control
        thisController.SensedValue = state.dataLoopNodes->Node(SensedNode).Temp;
    }

@rraustad
Copy link
Contributor

I think what's happening is the controller has switched to humrat control, set the controller vars based on humrat, and then reports that data as if it's temperature controlled. Here the SP is lower than the sensed value, which is fine, but the water temp is still the water temp at 8 C. Why haven't we seen this before?

**   ~~~   ** Controller temperature setpoint = 6.73E-003 [C]
**   ~~~   ** Temperature setpoint has been reduced for humidity control.
**   ~~~   ** Controller sensed temperature = 7.22E-003 [C]

 **   ~~~   ** Controller actuator temperature = 8.00 [C]

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 13, 2024

Correct, when humidity control is active, the sensed value is changed to humidity ratio, not temperature. Will re-work this section, yet again. I think I'll report the dewpoint temp of the humrat setpoint and say the chilled water temp needs to be below that.

Also, this file has other issues that are causing this problem in the first place - the chilled water coil is coming on at 8pm on January 1, probably because the OA dampers have closed and the fixed supply air temp in this VAV system wants cold air . . .

@rraustad
Copy link
Contributor

Yes, but the controller converged on temperature control? before it switched over to humrat control. Is it just the warning that is incorrectly being reported? i.e., the humrat is below the water temp so the code threw this warning.

@mjwitte mjwitte changed the title Report actuator temp for FindRoot error with TemperatureAndHumidityRatio Improved Controller:WaterCoil FindRoot error message with TemperatureAndHumidityRatio plus Limit setpoints by water temp Mar 13, 2024
@mjwitte mjwitte added this to the EnergyPlus 24.1 milestone Mar 13, 2024
@Myoldmopar
Copy link
Member

This feels like it might be ready...but the discussion earlier doesn't feel entirely wrapped. I'm not sure if I should dig in here or not. @rraustad approved the changes, so I'm leaning toward reviewing/merging. I'll pivot to other PRs for now but come back to this later.

@rraustad
Copy link
Contributor

I have no other suggestions on the warning message. The issue of why this message is being reported can be addressed here or elsewhere. @mjwitte ?

@mjwitte
Copy link
Contributor Author

mjwitte commented Mar 15, 2024 via email

@Myoldmopar
Copy link
Member

CI is green, just a few ERR diffs. Merging, thanks @mjwitte and @rraustad

@Myoldmopar Myoldmopar merged commit fab2e15 into develop Mar 15, 2024
15 checks passed
@Myoldmopar Myoldmopar deleted the controllErrMsgTweak branch March 15, 2024 15:28
@mjwitte mjwitte changed the title Improved Controller:WaterCoil FindRoot error message with TemperatureAndHumidityRatio plus Limit setpoints by water temp Improved Controller:WaterCoil FindRoot error message with TemperatureAndHumidityRatio Mar 15, 2024
@Myoldmopar Myoldmopar added the LowComplexityApproved Used for subcontractor defect complexity requests label Apr 24, 2024
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 LowComplexityApproved Used for subcontractor defect complexity requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants