First time here? Check out the Help page!

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

Callback called multiple times during first day of simulation

asked 4 years ago

Chelydrae's avatar

updated 4 years ago

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

Preview: (hide)

Comments

1

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

Aaron Boranian's avatar Aaron Boranian  ( 4 years ago )

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's avatar Julien Marrec  ( 4 years ago )

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's avatar Chelydrae  ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

updated 4 years ago

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.

Preview: (hide)
link

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's avatar Julien Marrec  ( 4 years ago )

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's avatar Chelydrae  ( 4 years ago )
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's avatar Julien Marrec  ( 4 years ago )
1

Now it is working. Thank you Julien and shorowit!

Chelydrae's avatar Chelydrae  ( 4 years ago )

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 666 times

Last updated: Jan 06 '21