How to combine trnsys and energyplus through python? [closed]
It is easy to model building in energyplus with the help of ladybug and honeybee, and it is easy to model cooling coil and other kind of end equipments. and, energyplus now can work with python in Library and Plugin mode, but energyplus is not easy to use when we want to simulate chiller plant and other kind of plants. Trnsys is easy to simulate plant, and trnsys is also work well with python. If there are some method to combine trnsys with energyplus through python? Hope someone can give some tips.
I mean combine trnsys and energyplus through python, when trnsys finish its one timestep, then transfer the data to energyplus, energyplus get the data and start to simulate corresponed timestep, when energyplus finish it works, transfer data back to trnsys and start the next timestep.
Hi @wentabo, I'm sorry I don't have an actual Python answer, however, if no direct Python solution is available, have you looked at the FMU path? E+ can be used as FMU, I am fairly certain TRNSYS also can. FMUs do/can communicate on a tilmestep basis. However, be aware that setting this up is not entirely straightforward. Best, Achim
Thanks very much for your suggestion. FMU is a method. I am trying to combine them together directly through Python. May the method look troublesome. The method looks like: A.py write data to AA.txt first, then B.py read data from AA.txt, when B.py finish its work, then clear or delete AA.txt. Then next, A.py scan if there is AA.txt, if AA.txt is still there, then A.py wait for a while, and scan second times and so on, till A.py find there is no AA.txt, then A.py write data to a new AA.txt at the next timestep. I don't know if it works, i am trying.
You do not need to go via text files, the communication (at least for E+) is via variables defined in the .idf using ExternalInterfaceFuncionalMockupUnitExport:From:Variable and External[]:To:Schedule (in EnergyPlusToFMU there are examples). If going via text file is necessary will depend on the FMU capabilities of TRNSYS, if at all. Best, Achim
a good news. I have finish this work in writing and reading csv-file method. The thought above works well. Trnsys and Energyplus can transfer data step by step in this method. And, I think, may this method can combine fluent as well. So, trnsys, energyplus and fluent can work together through python. I will try. Python is great!