Skip to content

Conversation

@RKStrand
Copy link
Contributor

@RKStrand RKStrand commented Jun 13, 2025

Pull request overview

Description of the purpose of this PR

In an IDF created by a user, there was a comma missing after the outlet node of an AirLoopHVAC:Mixer. When this was parsed, it meant that the first and only inlet node was not read in. This led to a hard crash of EnergyPlus. This PR fixes the problem so that when no inlet nodes are detected the program produces a severe/fatal with error messages that point to the location of the issue. A similar fix was made to the AirLoopHVAC:Splitter to avoid potential issues with that device. Both were tested with EnergyPlus and produce the severe/fatal when an IDF has a missing comma after the single required outlet (Mixer) or inlet (Splitter) node. A unit test testing the new code is also included.

Pull Request Author

  • [X ] 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

  • 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

RKStrand added 4 commits June 12, 2025 15:29
Boththe AirLoopHVAC:Mixer and AirLoopHVAC:Splitter do not have any sort of error message produced when the mixer has no inlet nodes or the splitter has not outlet nodes.  So, if a user by accident does not enter a mixer inlet or a splitter outlet, no error messages are produced and E+ crashes when it tries to simulate this device but the arrays are not sized to anything.  This error message would avoid a hard crash and alert the user that something is wrong (like a missing comma in the file that prompted this defect).  The new code additions here are to resolve the issue.
Forgot to clang-format the code that changed.  Also accidentally committed code that should not be changed but has to be modified to work on my Mac temporarily.
Typo got randomly introduced here and caused problems.  Fixing it back to the original state.
Creation of a unit test to exercise the new error messages for when a required node is missing from the mixer or splitter.
@RKStrand RKStrand added this to the EnergyPlus 25.2 IO Freeze milestone Jun 13, 2025
@RKStrand RKStrand requested review from Myoldmopar and mjwitte June 13, 2025 18:32
@RKStrand RKStrand self-assigned this Jun 13, 2025
@RKStrand RKStrand added the Defect Includes code to repair a defect in EnergyPlus label Jun 13, 2025
Copy link
Contributor

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

The new error messages work as expected (tested splitter and mixer).

   ** Severe  ** AirLoopHVAC:Splitter, "DOAS LOOP SPLITTER" does not have any outlet nodes.
   **   ~~~   ** All splitters must have at least one outlet node.
   **  Fatal  ** getAirLoopSplitter: Previous errors cause termination.

But this sort-of related warning is not clear:

   ** Warning ** AirLoopHVAC:OutdoorAirSystem = "DOAS LOOP OUTDOOR AIR EQUIPMENT LIST": blank Controller List Name must be used with AirLoopHVAC:DedicatedOutdoorAirSystem.

The system name is wrong, but even then, I don't think that controllers are a requirement for an AirLoopHVAC:DOAS system. If the DOAS equipment has no water coils, then it wouldn't need any controllers. The one example file has water coils, so it does have a controller list, SmallOffice_CentralDOAS. I would suggest removing this warning altogether. @rraustad ?

@mjwitte mjwitte changed the title Correction Identification of When a Required Node is Missing in HVAC Mixer and Splitter Throw Fatal Error When a Required Node is Missing in HVAC Mixer and Splitter Jun 13, 2025
@rraustad
Copy link
Contributor

rraustad commented Jun 13, 2025

Regarding the DOAS controller list, I agree, it should not be required unless there is a water coil in the list. I think the controller presence should be testing for the presence of a water coil.

The defect file DOAS OA System object has a blank controller list name so why is the equipment list name reported? The message is using AlphaArray(1) which gets overwritten when the equipment list gets processed prior to checking for the controller list.

AirLoopHVAC:DedicatedOutdoorAirSystem,
  DOAS loop,               !- Name
  DOAS loop AHU,           !- AirLoopHVAC:OutdoorAirSystem Name

AirLoopHVAC:OutdoorAirSystem,
  DOAS loop AHU,           !- Name
  ,                        !- Controller List Name
  DOAS loop Outdoor air Equipment List;  !- Outdoor Air Equipment List Name

The DOAS code requires the controller list and should instead check for a water coil here in this else? or move this message elsewhere? The air loop checks for a controller while processing the equipment list in SimAirServingZones::GetAirPathData around line 1340 here. Same for the OA System just below the code in SimAirServingZones here. Notice that AlphArray gets overwritten in the call for the equipment list. The DOAS data should be kept separate with this calling structure.

    if (!lAlphaBlanks(3)) {
        int ListNum = state.dataInputProcessing->inputProcessor->getObjectItemNum(
            state, CurrentModuleObjects[static_cast<int>(CMO::AirLoopEqList)], OASys.ComponentListName);
        if (ListNum > 0) {
            state.dataInputProcessing->inputProcessor->getObjectItem(
                state, CurrentModuleObjects[static_cast<int>(CMO::AirLoopEqList)], ListNum, AlphArray, NumAlphas, NumArray, NumNums, IOStat);

    if (!lAlphaBlanks(2)) {
    } else {
        if (state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "AirLoopHVAC:DedicatedOutdoorAirSystem") == 0) {
            ShowSevereError(state,
                            format("{} = \"{}\" invalid {} is blank and must be entered.", CurrentModuleObject, AlphArray(1), cAlphaFields(2)));
            ErrorsFound = true;
        } else {
            ShowWarningError(state,
                             format("{} = \"{}\": blank {} must be used with AirLoopHVAC:DedicatedOutdoorAirSystem.",
                                    CurrentModuleObject,
                                    AlphArray(1),
                                    cAlphaFields(2)));
        }
    }

@rraustad
Copy link
Contributor

rraustad commented Jun 13, 2025

SimAirServingZones already loops through all OA Systems so maybe @mjwitte is correct and these messages for missing DOAS controller can be deleted. The controller water coil connection will be tested in SimAirServingZones. i.e., just delete the else for if (!lAlphaBlanks(2)).

@RKStrand
Copy link
Contributor Author

I think I'm following this. So, @rraustad, would you say: yes, you are on board with the suggestion of @mjwitte to get rid of the code:

    } else {
        ShowWarningError(state,
                         format("{} = \"{}\": blank {} must be used with AirLoopHVAC:DedicatedOutdoorAirSystem.",
                                CurrentModuleObject,
                                AlphArray(1),
                                cAlphaFields(2)));

as part of this work? If yes, then I will delete it and make another commit. If no, I will hold until there is agreement.

Thanks to you both for your feedback on this!

@rraustad
Copy link
Contributor

@RKStrand yes I am on board with deleting this else. I would ask you test SmallOffice_CentralDOAS, by removing the controller list name from the AirLoopHVAC:OutdoorAirSystem, to make sure the correct warning is reported.

@RKStrand
Copy link
Contributor Author

@rraustad @mjwitte After removing the else code as described above and running SmallOffice_CentralDOAS with the controller list names removed from one of the AirLoopHVAC:OutdoorAirSystem definitions, I get the following error messages:

** Severe ** AirLoopHVAC:OutdoorAirSystem = "PSZ-AC:1_OA" invalid Controller List Name = " not found.
** Fatal ** getAirLoopHVACDOAS: Previous errors cause termination.

Is this what was expected/desire? If the answer is yes, I will commit this change. If no, please advise as to what you would like done. Thanks!

@rraustad
Copy link
Contributor

Yes, that's the correct type of warning I was looking for. But the test would be for the DOAS system where you removed the check.

AirLoopHVAC:DedicatedOutdoorAirSystem,
  AirLoopHVAC DOAS,        !- Name
  AirLoopDOAS OA system,   !- AirLoopHVAC:OutdoorAirSystem Name

Try removing OA Sys 1 Controllers here and see if you get the same message.

AirLoopHVAC:OutdoorAirSystem,
  AirLoopDOAS OA system,   !- Name
  OA Sys 1 Controllers,    !- Controller List Name
  OA Sys 1 Equipment;      !- Outdoor Air Equipment List Name

@RKStrand
Copy link
Contributor Author

@rraustad 😳 Either I needed to be wearing my glasses or it was a little too early in the morning and I wasn't firing on all cylinders, because clearly I missed that I was changing the wrong object. My bad--sorry about that and for wasting your time. Now, I believe I got rid of the correct controller list. Here is the error message that was produced:

** Severe ** AirLoopHVAC:ControllerList="OA SYS 1 CONTROLLERS" is not referenced on a AirLoopHVAC or AirLoopHVAC:OutdoorAirSystem object.
************* No node connection errors were found.
** Fatal ** Previous Conditions cause program termination.

Is this what you were looking for as far as an error message produced by E+?

@rraustad
Copy link
Contributor

That's the same dumb warning that requires a controller list and fatals out. A controller is required only if there is a water coil. Do we not have any example files with outdoor air systems that don't use a water coil?

    //  Now check AirLoopHVAC and AirLoopHVAC:OutdoorAirSystem
    int Found = 0;
    if (state.dataAirLoop->NumOASystems > 0) {
        Found = Util::FindItemInList(ControllerListName, state.dataAirLoop->OutsideAirSys, &OutsideAirSysProps::ControllerListName);
        if (Found > 0) {
            ++Count;
        }
    }

    if (Count == 0) {
        ShowSevereError(state,
                        format("{}=\"{}\" is not referenced on a AirLoopHVAC or AirLoopHVAC:OutdoorAirSystem object.",
                               CurrentModuleObject,
                               ControllerListName));
        ErrFound = true;

@mjwitte
Copy link
Contributor

mjwitte commented Jun 16, 2025

Not exactly, that error is because the controller list is present but never referenced. Try delete the controller list and leaving the controller list name blank.

@RKStrand
Copy link
Contributor Author

No problem. Here is what happened when I deleted the controller list and left the controller list name blank:

** Severe ** HVACControllers: GetControllerInput: Controller:WaterCoil="OA HC CONTROLLER 1" not found on any AirLoopHVAC:ControllerList.
** Severe ** HVACControllers: GetControllerInput: Controller:WaterCoil="OA CC CONTROLLER 1" not found on any AirLoopHVAC:ControllerList.
** Fatal ** HVACControllers: GetControllerInput: Errors found in getting Controller:WaterCoil input.

Not sure why the one error message shows up twice.

@mjwitte
Copy link
Contributor

mjwitte commented Jun 16, 2025

Ok, well, now we have dangling controllers, so we need to also delete the controller objects. Then you should have covered all of the bases.

@RKStrand
Copy link
Contributor Author

As above but now with the controller objects deleted. Here are the resulting error messages:

** Severe ** GetAirPathData: AirLoopHVAC="OA HEATING COIL 1", invalid actuator.
** ~~~ ** ...this coil requires a water coil controller and the inlet node of a water coil must also be an actuator node of a water coil controller.
** Severe ** GetAirPathData: AirLoopHVAC="OA COOLING COIL 1", invalid actuator.
** ~~~ ** ...this coil requires a water coil controller and the inlet node of a water coil must also be an actuator node of a water coil controller.
** Fatal ** GetAirPathData: Errors found retrieving input for AirLoopHVAC.

And I realized it wasn't a double error message previously but rather one was "CC" and one was "HC".

At the request of reviewers, removed an unnecessary warning error (else condition) in MixedAir.cc.
@RKStrand RKStrand requested a review from mjwitte June 18, 2025 12:28
if (state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "AirLoopHVAC:DedicatedOutdoorAirSystem") == 0) {
ShowSevereError(state,
format("{} = \"{}\" invalid {} is blank and must be entered.", CurrentModuleObject, AlphArray(1), cAlphaFields(2)));
ErrorsFound = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not to prolong this PR, but this if block makes no sense. It should also be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. I just made a commit that gets rid of this if block (assuming that I got the offending one). Hope this helps and everything continues to come back all green.

Got rid of another section of code that a reviewer felt did not make sense and was unnecessary.
@RKStrand RKStrand requested a review from mjwitte June 19, 2025 11:40
Copy link
Contributor

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

@RKStrand Thanks. This will merge once CI comes back and reports green.

@mjwitte
Copy link
Contributor

mjwitte commented Jun 20, 2025

CI is all green. Merging.

@mjwitte mjwitte merged commit 542d46b into develop Jun 20, 2025
9 checks passed
@mjwitte mjwitte deleted the 10815AirLoopHVACMixerSplitterMissingFieldsCrash branch June 20, 2025 14:56
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.

AirLoopHVAC:Mixer vector issue with missing comma

6 participants