As shown below, in some situations, in the IDF file generated from GH+LB+HB workflow in which generator system object is created, the last output variable DISTRIBUTIONSYSTEM,Electric Load Center Produced Electric Energy is wrongly written as the following, in which the last word “Simple” should be one of the four time period words, i.e. “hourly”, “daily”, “monthly”, and “annual”.
Output:Variable,My_PV_generator_system:DISTRIBUTIONSYSTEM,Electric Load Center Produced Electric Energy, Simple;
This could result in:
- Error while running EnergyPlus simulation through LB+HB.
- The time period of this output variable been interpreted as “hourly” by E+, rather than that been specified for the rest of the output variables through the EPOutput component.
Related discussion is shown in the following post on UnmetHours.com:
2. Source of error
The following function is to extract the time period from the last word of the last output variable specified by the user (line 1926 to 1932 in the code for runEnergySimulation, v 0.0.63, JAN_20_2018, or line 1937 to 1943 in the code for runEnergySimulation, v 0.0.63, JUL_24_2018 ) :
def extracttimeperiod(simulationOutputs): try: timeperiod = simulationOutputs[-1].split(',')[-1] HBgeneratortimeperiod = timeperiod.replace(";","") return HBgeneratortimeperiod except: pass
However, the last output variable specified by the user may not be one ended with a time period. E.g:
Output:Variable,*,Surface Outside Face Incident Ground Diffuse Solar Radiation Rate per Area, annual; Output:Diagnostics,DisplayExtraWarnings; Output:SQLite, Simple;
3.1 Solution A
Rearrange the order of the additional output variables in the GH+LB+HB workflow so that the last one is one ended with a time period:
Output:Diagnostics,DisplayExtraWarnings; Output:SQLite, Simple; Output:Variable,*,Surface Outside Face Incident Ground Diffuse Solar Radiation Rate per Area, annual;
3.2 Solution B
Revise the function to loop through all output variables, and see if the last word matches one of the four time periods (I’m sure the code can be written more succinctly):
def extracttimeperiod(simulationOutputs): try: timePeriods = ['hourly', 'daily', 'monthly', 'annual'] for output in simulationOutputs: endWord = output.split(',')[-1].strip().replace(";","") print endWord if endWord in timePeriods: HBgeneratortimeperiod = endWord return HBgeneratortimeperiod except: pass
An example file with the code revised is attached here as reference.
Appreciate if the development team can take a look and see if the code revision is necessary.
test_extract_timePeriod_issue.gh (1.0 MB)