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

RunPeriod not applied when running in Python (library mode)

asked 2022-09-28 21:33:08 -0600

joproulx's avatar

updated 2022-09-29 11:53:12 -0600


UPDATE I cannot answer my question for 2 days since I am new, but I found the issue. I was using a python sample that was passing -a when running the simulation. This seems to force an annual simulation:

result = self.api.runtime.run_energyplus(
            self.state,
            [
            '-a',
            '-w', self.epw_path,
            '-d', 'output',
            self.idf_path
            ]
        )

I'll add the answer when I can


In my idf file, I configured the following RunPeriod where the start date is 02/03/1986:

RunPeriod,
    Run Period 1,            !- Name
    2,                       !- Begin Month
    3,                       !- Begin Day of Month
    1986,                    !- Begin Year
    2,                       !- End Month
    5,                       !- End Day of Month
    1986,                    !- End Year
    Tuesday,                 !- Day of Week for Start Day
    Yes,                     !- Use Weather File Holidays and Special Days
    Yes,                     !- Use Weather File Daylight Saving Period
    No,                      !- Apply Weekend Holiday Rule
    Yes,                     !- Use Weather File Rain Indicators
    Yes,                     !- Use Weather File Snow Indicators
    No;                      !- Treat Weather as Actual

When I run the simulation in Python using energyplus in library mode, I get the following output where you can see that the start date is 01/01/1986. I would expect to see 02/03/1986. Please note that during the simulation in Python, the simulation time I get from the Python api starts indeed at 01/01/1986 confirming that the date is wrong:

Initializing SimulationReporting SurfacesBeginning Primary SimulationInitializing New Environment Parameters
Warming up {1}
Warming up {2}
Warming up {3}
Warming up {4}
Warming up {5}
Warming up {6}
Starting Simulation at 01/01/1986 for RUN PERIOD 1
Updating Shadowing Calculations, Start Date=01/21/1986

If I run with the same idf and ewp file in energyplus directly from the command line (without Python), I get the following output where the start date is good (02/03/1986):

EnergyPlus Starting
EnergyPlus, Version 22.1.0-ed759b17ee, YMD=2022.09.28 22:07
Adjusting Air System Sizing
Adjusting Standard 62.1 Ventilation Sizing
Initializing Simulation
Reporting Surfaces
Beginning Primary Simulation
Initializing New Environment Parameters
Warming up {1}
Warming up {2}
Warming up {3}
Warming up {4}
[... removed warming up steps to reduce output size ...]
Warming up {29}
Warming up {30}
Starting Simulation at 12/21 for DENVER CENTENNIAL ANN HTG 99.6% CONDNS DB
Initializing New Environment Parameters
Warming up {1}
Warming up {2}
Warming up {3}
Warming up {4}
Warming up {5}
Warming up {6}
Starting Simulation at 07/21 for DENVER CENTENNIAL ANN CLG 1% CONDNS DB=>MWB
Initializing New Environment Parameters
Warming up {1}
Warming up {2}
Warming up {3}
Warming up {4}
Warming up {5}
Warming up {6}
Starting Simulation at 02/03/1986 for RUN PERIOD 1
Writing tabular output file results using tab format.
Writing tabular output file results using HTML format.

Notes:

  • I am using the idf file USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw that comes when installing EnergyPlus.

Is there anything that I should do in Python to control the RunPeriod? Let me know if I can provide more info.

Thanks, Jonathan

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2022-10-01 06:37:27 -0600

joproulx's avatar

I found the issue. I was using a python sample that was passing -a when running the simulation. This seems to force an annual simulation:

result = self.api.runtime.run_energyplus(
            self.state,
            [
            '-a',
            '-w', self.epw_path,
            '-d', 'output',
            self.idf_path
            ]
        )
edit flag offensive delete link more
0

answered 2022-09-30 04:05:46 -0600

kem's avatar

Hi Jonathan,

the simulation is controlled by the SimulationControl section as well.

  SimulationControl,
    Yes,                     !- Do Zone Sizing Calculation
    Yes,                     !- Do System Sizing Calculation
    No,                      !- Do Plant Sizing Calculation
    Yes,                     !- Run Simulation for Sizing Periods
    Yes,                     !- Run Simulation for Weather File Run Periods
    No,                      !- Do HVAC Sizing Simulation for Sizing Periods
    1;                       !- Maximum Number of HVAC Sizing Simulation Passes

There can be also multiple RunPeriods defined in the IDF file. Please check it.

We are using the PythonPlugin mode, specifying the run period start stop by regex changes of source idf file (before execution). It works. I am not much familiar with the Python library mode you are using.

edit flag offensive delete link more

Comments

Thanks @kem, I'll try that!

joproulx's avatar joproulx  ( 2022-10-01 06:45:06 -0600 )edit

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: 2022-09-28 21:33:08 -0600

Seen: 12,674 times

Last updated: Oct 01 '22