-
Notifications
You must be signed in to change notification settings - Fork 16
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
Issues running EnergyPlus 9.0.1 models as FMUs (error while reading RUNPERIOD) #30
Comments
Any error message which could indicate why the FMU cannot be simulated? Few details about your set-up would be heplful (Operating system, master algorithm, EnergyPlus version, Type of ExternalInterface objects used) |
@tsnouidui, I think the hint is in this part of the above-cited error message (it is printed in the terminal):
The file
The RunPeriod object in the IDF looks as follows:
For comparison, a RunPeriod object in another model created using EnergyPlus 8.6:
So it looks that a wrong IDD is used. E.g. the 12th field in the first one is "Yes" while it is "1" in the second one. It fits to the message However, I use IDD from EnergyPlus 9.01 when calling EnergyPlusToFMU:
I have older EnergyPlus versions installed on my computer, but I have only the path to EnergyPlus 9.0.1 installation directory in my environmental variables. My set-up:
Since we couldn't make it working we switched from using FMU to using EnergyPlus CLI and Schedule:File objects instead (csv schedules). However, I can help with debugging this, so please let me know if you need any other details. |
@krzysztofarendt The fact that you can compile but cannot run it is puzzling to me. I would have suspected a mismatch between the version used to create the FMU and the version used to run FMU. Could you share your IDF file?
|
@tsnouidui, I'm getting nervous that it might be some issue in my setup, although I didn't manage to find the culprit yet. I have EnergyPlus 9.0.1 in PATH and I used IDD from EnergyPlus 9.0.1 to create the FMU. Here is the IDF with the external interface (three last objects): https://drive.google.com/open?id=1yyBF24seYEELm5RX-MkCgF089qthToD3 |
I have encountered the same issue with EnergyPlus version 9.0 for my own idf but the given example Examples\Schedule_fmu-export-schedule.idf could run with v9.0...very strange |
Hello, @kuzha @krzysztofarendt, I'm encountering the same problem as you two with similar setups. I was able to successfully run the example file but one thing that I noticed that might help: when I used idf-editor to make changes in the example file, I ended up getting the same error, but when I made the same changes directly in the .txt file, everything worked fine. It could have something to do with the way idf-editor compiles the txt file of models made with different versions of E+? Were you able to find a solution to this? Best, |
@dayjsun This is a good hint as I have so far not used the editor idf-editor to modify the IDF-file. I will do some investigations to see the impact of the idf-editor on the IDF-file |
@tsnouidui great! Let me know if I can help in any way or provide more information on my setup that might be useful to you. In the meantime, I'll comment here if I am able to find a temporary workaround |
I'm still experiencing the same problem with the EnergyPlusToFMU-v2.1.0, the FMU generates fine but I get the same errors presented above when I simulate. |
The issue seems to be related to the way the .idf is parsed:
, no return, no blanks. A lot of editors export the version info like this to the idf:
|
Thank you for sharing this. Changing the version line format does appear to resolve the issue across different EnergyPlus versions. I'm using this simple function as a final patch after exporting IDF files I generate using eppy. def fix_idf_version_line(idf_path, ep_version):
"""
Fix format of Version Identifier line in IDF file for EnergyPlusToFMU
https://github.com/lbl-srg/EnergyPlusToFMU/issues/30#issuecomment-621353009
"""
with open(idf_path, "r") as input:
with open(idf_path + ".patch", "w") as output:
for line in input:
if line == "Version,\n":
output.write(
line.replace("\n", "{};\n".format(ep_version))
)
elif "!- Version Identifier" not in line:
output.write(line)
shutil.move(idf_path + ".patch", idf_path) |
We are still experiencing the issue, even with formatting as proposed by @tomstesco . It seems to be related to the script fmu-export-idf-data.cpp. There is a variable idfVer in this script that is used to read the runperiod in the .idf file. We were using E+9.3 and it seems that idfVer was not set to a value bigger than 8. To test it, we added an hard fix to the code, setting manually idfVer to 9 in the related functions in fmu-export-idf-data.cpp (or any number higher than 9.0) and then it worked smoothly. Therefore, apparently, there is a problem on some platforms (we are using windows 10) with the idfVer variable. |
Did all of the above - but what actually saved me from hacking into cpp files is
removing |
I had the same issue, what helped me was removing all comments. |
@tomstesco I try to run you script but I get the following error: "NameError: name 'shutil' is not defined" Do you have any idea why this is happening? |
@bsl546 could you elaborate on the solution. I have the same issue in EP 9.3. Have there been other ways found to correct this error? |
@sajithjay Yes, sure. It is not the nicest fix, but it works: Actually it seems that fmu-export-idf-data.cpp continues reading the file after having found the first entry for the idf version. So a hard fix that work is to modify fmu-export-idf-data.cpp in both SourceCode\v10\fmu-export-prep\ and SourceCode\v20\fmu-export-prep.
For us it works. |
I have committed a fix on this branch https://github.com/lbl-srg/EnergyPlusToFMU/tree/issue30. You can pull it and try it out. I will do further testing prior to merging to the master. |
The updated package by @tsnouidui worked for me to run FMUs created using EP 9.4. |
When I try to run an FMU exported using EnergyPlus 9.0.1 I get the following error:
It might be related with the new RunPeriod format, which also caused problems in #24. I run into the same issue as in #24 so I downloaded EnergyPlusToFMU-v2.1.0. The FMU generates fine now, but I still can't simulate.
The text was updated successfully, but these errors were encountered: