Same results for different IDF when simulated using EnergyPlus API

asked 2023-01-17 07:48:55 -0500

prp92's avatar

updated 2023-01-17 15:04:25 -0500

Hi,

I have 4500 different IDFs with different configuration.

I have to simulate it using API and cannot use traditional group simulation.

I use 'for' loop to go through 4500 IDFs and save the resulting CSV results file in a separate folder with different name (see code below).

for i in range(0,4499,1):
  api = EnergyPlusAPI()
  state = api.state_manager.new_state()
  api.state_manager.reset_state(state)

  api.runtime.run_energyplus(state,
    [
        '-d', 'C:/Users/4500_IDFs',
        '-w', 'C:/Users/4500_IDFs/Weather_File_SYR_Modified_with_Real_Data.epw',
        '-r',
        'C:/Users/4500_IDFs/' + building_list[i] + '.idf'

    ]
   )

  original_file = 'eplusout.csv'
  new_file = building_list[i] + '.csv'

  shutil.copy(original_file, new_file)

building_list is the list containing all the file names of 4500 IDFs.

However, all of those files have the same results. How can I solve this issue?

Thanks for your time!

edit retag flag offensive close merge delete

Comments

@prp92 can you add the code of your script or another way for others to check that you're creating the 'for' loop correctly? It sounds like you are running the same IDF every time, or running each IDF but copying the CSV results from only one IDF.

Aaron Boranian's avatar Aaron Boranian  ( 2023-01-17 14:28:58 -0500 )edit

my code is as follows.

for i in range(0,4499,1): api = EnergyPlusAPI() state = api.state_manager.new_state() api.state_manager.reset_state(state)

api.runtime.run_energyplus(state,
    [
        '-d', 'C:/Users/4500_IDFs',
        '-w', 'C:/Users/4500_IDFs/Weather_File_SYR_Modified_with_Real_Data.epw',
        '-r',
        'C:/Users/4500_IDFs/' + building_list[i] + '.idf'

    ]
   )

original_file = 'eplusout.csv'
new_file = building_list[i] + '.csv'

shutil.copy(original_file, new_file)
prp92's avatar prp92  ( 2023-01-17 14:48:51 -0500 )edit

building_list is the list containing all the file names of 4500 IDFs.

prp92's avatar prp92  ( 2023-01-17 14:49:49 -0500 )edit

@prp92 thank you. In the future, please edit your post to add code and other important details like this instead of putting that into a comment (I've done it for you this time).

Aaron Boranian's avatar Aaron Boranian  ( 2023-01-17 15:05:01 -0500 )edit

@Aaron Boranian Sure. I will change the post next time.

prp92's avatar prp92  ( 2023-01-20 11:50:49 -0500 )edit