Open ChristophGehbauer opened 3 years ago
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.
And so it was with my mistakes, but I tried your approach and it still didn't work @meiguozhendelaji
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 file: RefBldgMediumOfficeNew2004_v1_4_7_2_4B_USA_NM_ALBUQUERQUE.err.txt
A workaround is to delete the EnergyPlus fmu object and reload:
By doing so EnergyPlusToFMU flushes the results files and closes the object:
Thank you, Christoph