4

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

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.

JustinShultz's avatar
1.3k
JustinShultz
asked 2015-06-09 09:09:58 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2015-08-08 14:24:38 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

4

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.

Thierry Nouidui's avatar
1.5k
Thierry Nouidui
answered 2015-06-30 16:44:46 -0500
Julien Marrec's avatar
29.7k
Julien Marrec
updated 2017-03-08 07:12:15 -0500
edit flag offensive 0 remove flag delete link

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
add a comment see more comments