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

FMU Export of Python Code or Python Interface with FMI Standard for Use in EnergyPlus Co-Simulation

asked 2015-06-09 09:09:58 -0500

updated 2015-08-08 14:24:38 -0500

My research group has developed python code for a new building component that we would like to co-simulate with EnergyPlus. For reuseability and market impact we would like this connection to be as easy as possible for inexperienced users and believe packing the model using the Function Mockup Interface Standard (FMI) to be the best option.

We have explored JModelica to test other Functional Mockup Units (FMUs) but found that it does not do FMU export of Python code for model exchange or co-simulation.

I was curious if there any methods for packaging python code as an FMU? If there is not, is there another way of linking Python to the FMI standard or connecting it to a building energy software like EnergyPlus?

The alternative to this would be exporting the building energy model as an FMU and import into modelica/jmodelica or using BCVTB. Although this would work for us we worry it would make it too difficult for inexperienced individuals to use our tool.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2015-06-30 16:44:46 -0500

updated 2017-03-08 07:12:15 -0500

You could write your own FMU and ship your Python code along with it. The Python code could "sit" in the resource folder of your FMU. At run-time, your FMU could then invoke that Python code for co-simulation or model-exchange.

edit flag offensive delete link more

Comments

Hello Thierry, excellent suggestion. I've been reading up on the FMU/FMI Standard documentation and looking through the code of your EnergyPlusToFMU tool. I haven't really found how to make these connections to the FMU standard and/or create an FMU yet. Still pretty new to the FMI standard and programming. Is there anywhere you can recommend me to look more closely for development of an FMU, either in the documentation or functions in the code? Thank you, Justin

JustinShultz's avatar JustinShultz  ( 2015-07-09 08:19:00 -0500 )edit
1

Hi Justin,

best might be to start from here

https://resources.qtronic.de/fmusdk/FmuSdk_reference.html

They provided templates and examples on how to create an FMU. This might be simpler than the EnergyPlusToFMU code.

Thanks!

Thierry

Thierry Nouidui's avatar Thierry Nouidui  ( 2015-07-09 10:18:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

5 followers

Stats

Asked: 2015-06-08 18:55:12 -0500

Seen: 3,541 times

Last updated: Mar 08 '17