Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .reset() to fmu #57

Open
ChristophGehbauer opened this issue May 10, 2021 · 2 comments
Open

Add .reset() to fmu #57

ChristophGehbauer opened this issue May 10, 2021 · 2 comments

Comments

@ChristophGehbauer
Copy link

For users who want to conduct multiple simulation runs usually the fmu (or coupled system) is reset to its original state after each run by calling the .reset() function, which is currently not implemented in EnergyPlusToFMU (I'm using version 3.1.0). If a consecutive run is conducted without resetting the EnergyPlus fmu, the following error might occur:

Error: No digits were found in getIntCheckErrorFMU.
Further characters after number: p%�}(V2 -10

Sending EXIT_FAILURE = : 1
Error: No digits were found in getIntCheckErrorFMU.
Further characters after number: p%�}(V2 -10

Sending EXIT_FAILURE = : 1
**FATAL:Error in ExternalInterface: Check EnergyPlus *.err file.
EnergyPlus Run Time=00hr 00min  1.17sec
Program terminated: EnergyPlus Terminated--Error(s) Detected.
Error: No digits were found in getIntCheckErrorFMU.
Further characters after number: P{�z(V2 -1

Sending EXIT_FAILURE = : 1

Error file: RefBldgMediumOfficeNew2004_v1_4_7_2_4B_USA_NM_ALBUQUERQUE.err.txt

A workaround is to delete the EnergyPlus fmu object and reload:

del energyplus_fmu # Delete the object
energyplus_fmu = load_fmu(....) # Relaod the object

By doing so EnergyPlusToFMU flushes the results files and closes the object:

Writing tabular output file results using HTML format.
Writing Tariff Reports
Writing final SQL reports
 ReadVarsESO program starting.
 ReadVars Run Time=00hr 00min  0.08sec
 ReadVarsESO program completed successfully.
 ReadVarsESO program starting.
 ReadVars Run Time=00hr 00min  0.07sec
 ReadVarsESO program completed successfully.
EnergyPlus Run Time=00hr 00min 15.74sec
EnergyPlus Completed Successfully.

Thank you,
Christoph

@meiguozhendelaji
Copy link

meiguozhendelaji commented Apr 8, 2022

However, when I try to do like that, sometime it is work great, but the most of time the process will return -1073740940 (0xC0000374)
Do it like this way will make a great work:

model = load_fmu(XXXX)
opts = model.simulate_options()
opts['ncp'] = XXXX  # set number of TimeSteps
opts['initialize'] = False
model.setup_experiment(stop_time=XXXX)#this is the key of the code
model.initialize(start_time=XXXX, stop_time=XXXX, stop_time_defined=True)

#new loop
model.setup_experiment(stop_time=XXXX)#this is the key of the code
model.initialize(start_time=XXXX, stop_time=XXXX, stop_time_defined=True)

PS: If your idf file made by openstudio, you need to delete the part of your idf file of SQL, otherwise,
your process will be locked by SQL process.

@jiahuizi
Copy link

jiahuizi commented Jan 6, 2024

And so it was with my mistakes, but I tried your approach and it still didn't work @meiguozhendelaji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants