NREL / EnergyPlus

EnergyPlus™ is a whole building energy simulation program that engineers, architects, and researchers use to model both energy consumption and water use in buildings.
https://energyplus.net
Other
1.13k stars 389 forks source link

ExpandObjects generates bad file and InputProcessor fails to parse #7806

Open mbadams5 opened 4 years ago

mbadams5 commented 4 years ago

Issue overview

https://unmethours.com/question/42355/energyplus-jsonexceptiontype_error305/ The file is in Helpline Ticket 15382.

The real issue is that ExpandObjects is creating bad IDF files as shown in the expanded snippet below:

Connector:Splitter,
  Chiled Water Loop CndW Supply Splitter,                  !- Name
  Chiled Water Loop CndW Supply Inlet Branch,              !- Inlet Branch Name
  Chiled Water Loop CndW Supply Bypass Branch,             !- Outlet Branch Name

Connector:Mixer,
  Chiled Water Loop CndW Supply Mixer,                     !- Name
  Chiled Water Loop CndW Supply Outlet Branch,             !- Outlet Branch Name
  Chiled Water Loop CndW Supply Bypass Branch,             !- Inlet Branch Name
! Pump part load coefficients are linear to represent condenser pumps dedicated to each chiller.

Pump:VariableSpeed,
  Chiled Water Loop CndW Supply Pump,                      !- Name
  Chiled Water Loop CndW Supply Inlet,                     !- Inlet Node Name
  Chiled Water Loop CndW Pump Outlet,                      !- Outlet Node Name
  autosize,                                                !- Rated Volumetric Flow Rate {m3/s}
  179352,                                                  !- Rated Pump Head {Pa}
  autosize,                                                !- Rated Power Consumption {W}
  0.9,                                                     !- Motor Efficiency
  0,                                                       !- Fraction of Motor Inefficiencies to Fluid Stream
  0,                                                       !- Coefficient 1 of the Part Load Performance Curve
  0,                                                       !- Coefficient 2 of the Part Load Performance Curve
  1,                                                       !- Coefficient 3 of the Part Load Performance Curve
  0,                                                       !- Coefficient 4 of the Part Load Performance Curve
  0,                                                       !- Min Flow Rate while operating in variable flow capacity {m3/s}
  Intermittent,                                            !- Pump Control Type
  ;                                                        !- Pump Flow Rate Schedule Name

ExpandObjects should not output poorly formed IDFs. However, the input processor should still handle these poor IDFs with a more meaningful error message.

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.

JasonGlazer commented 4 years ago

Added the defect file to DevSupport repo.

mjwitte commented 4 years ago

The source of the problem can be found in the expanded idf, which explains why the idf generation stopped short:

Output:PreprocessorMessage,
  ExpandObjects,                                           !- Preprocessor Name
  Fatal,                                                   !- Error Severity
  Severe:  In HVACTemplate:Plant:ChilledWaterLoop "Chiled Water Loop" there,  !- message line
  is one or more water cooled chiller(s) but there are no towers serving this,  !- message line
  loop.;                                                   !- message line
mbadams5 commented 4 years ago

Interesting. I guess I would expect ExpandObjects to fail to generate the expanded idf in that instance, not generate a partially complete IDF. One option is for E+ to check for preprocessing messages and throw a fatal error if it encounters a fatal preprocessing message.

mjwitte commented 4 years ago

It builds the idf file as it goes. Prior to the input processor rewrite, the idf file would process and post the preprocessor errors to the EnergyPlus err file, so the user would see them. So, in some cases, the errors will need to be trapped earlier before starting to write an object, or the size of various component lists may need to be checked earlier before terminating the idf write.

mjwitte commented 4 years ago

For this particular file, it can be fixed by adding a cooling tower, or by changing the chiller to aircooled. But with that fixed, it still won't run, because a hot water loop is specified, but there are no hot water coils to be serve in the air handler or terminal units.

mjwitte commented 4 years ago

But yeah, if it's possible to scan the incoming file for Output:PreprocessorMessage and write those to the err output even if it finds a bad object, that would be helpful.

mbadams5 commented 4 years ago

That might be possible, but let me check in the code.

Myoldmopar commented 4 years ago

There are a couple things going on here, right? And part of it will persist past 9.3 if I understand it right. I'm going to change the milestone, but if I am wrong, please correct it.