Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page
Ask Your Question
2

Callback called multiple times during first day of simulation

asked 2021-01-01 13:24:41 -0500

Chelydrae gravatar image

updated 2021-01-05 12:32:16 -0500

Dear all,

I am using the EnergyPlus Python API and try to plot the daily energy consumption of a building. It is working for every day besides the first day of simulation. It seems like the callback_end_zone_timestep_after_zone_reporting Callback is called multiple times for the first day of the weather file. See the resulting plot in the attachement. Any ideas how to avoid this?

Next, I have seen hat the simulation goes through a DESIGN DAY and a RUN PERIOD X period. Do you know the differences?

Thank you! Pimage description

edit retag flag offensive close merge delete

Comments

1

@Chelydrae it doesn't look like you attached the plot. Could you try again, please?

Aaron Boranian gravatar image Aaron Boranian  ( 2021-01-03 15:59:48 -0500 )edit

callback_end_zone_timestep_after_zone_reporting as the name implies will be called at the end of each zone timestep, so if in your IDF file you have Timestep,4;, that's 24*4=96 times for each day of simulation.

Julien Marrec gravatar image Julien Marrec  ( 2021-01-04 03:20:45 -0500 )edit

Hi! Sorry for my late response. I added the plot to the original post. The problem is not due to the timesteps. The values per timestep are averaged for each hour and the plot looks good for all following simulations. The graph looks like a correction process during warm up period.

Chelydrae gravatar image Chelydrae  ( 2021-01-05 12:36:51 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-01-04 15:08:51 -0500

updated 2021-01-04 15:30:27 -0500

It sounds like you might be seeing the effect of the warmup calculation (where the first day of the year is repeated several times until convergence) before the simulation of the run period. See this question for similar discussion.

edit flag offensive delete link more

Comments

(I didn't think OP could be referring to the warmup but that sounds that it's likely the source of the confusion indeed!)

Julien Marrec gravatar image Julien Marrec  ( 2021-01-05 02:58:45 -0500 )edit

Thank you for your support!!! I also believe it is due to the warmup calculation.

As a consequence, I added the callback_after_new_environment_warmup_complete callback in order to set a warmup_complete variable to True after this callback is called. The plot object is only adressed, when this variable is set to True. Unfortunately, this is not resolving the problem here.

Chelydrae gravatar image Chelydrae  ( 2021-01-05 12:43:54 -0500 )edit
1

Instead of doing that, inside your callback_end_zone_timestep_after_zone_reporting function just do this:

if api.exchange.warmup_flag(state_argument):
    return
Julien Marrec gravatar image Julien Marrec  ( 2021-01-06 01:59:15 -0500 )edit
1

Now it is working. Thank you Julien and shorowit!

Chelydrae gravatar image Chelydrae  ( 2021-01-06 03:24:13 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2021-01-01 13:24:41 -0500

Seen: 233 times

Last updated: Jan 06