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

How to add AFN in openstudio sdk

asked 2024-05-07 05:14:19 -0500

TomB's avatar

updated 2024-05-08 04:57:48 -0500

The sdk documentation on how to create a AFN object confuses me; it seems to be self-referential?

openstudio::model::AirflowNetworkZone::AirflowNetworkZone ( const AirflowNetworkZone &  other)

Can anyone provide an example of how to add the AFN objects (in python or ruby) ? More generally, why does the below approach work for most objects, but not some like the AFN objects ?

TypeError: Wrong number or type of arguments for overloaded function 'new_AirflowNetworkZone'. Possible C/C++ prototypes are: openstudio::model::AirflowNetworkZone::AirflowNetworkZone(openstudio::model::AirflowNetworkZone const &) openstudio::model::AirflowNetworkZone::AirflowNetworkZone(openstudio::model::AirflowNetworkZone &&)

Second part to my question;

Am I doing something wrong here, or is this a python binding issue?

calling this;


returns this error message;

[openstudio.model.ScheduleTypeRegistry] <2> No 'Venting Availability' Schedule is registered for class    AirflowNetworkZone.
RuntimeError: D:\a\OpenStudio\OpenStudio\src\model\ScheduleTypeRegistry.cpp@44 : No 'Venting Availability' Schedule is registered for class AirflowNetworkZone
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2024-05-07 08:06:50 -0500

There are a couple AFN examples in the OpenStudio-resources repo in both ruby and python. For example, here’s one in ruby using the AirflowNetworkZone object.

edit flag offensive delete link more


Thank you ! The model.getAfnThing way of making objects throws me

TomB's avatar TomB  ( 2024-05-07 14:21:47 -0500 )edit

This approach is used whenever EnergyPlus only allows a single instance. In this case, an EnergyPlus thermal zone can only have a single AirflowNetworkZone. If you were instantiating the AirflowNetworkZone object yourself, there would be no way to prevent you from creating multiple.

shorowit's avatar shorowit  ( 2024-05-07 14:39:56 -0500 )edit

Regarding your second question, yes that's a bug in OpenStudio. I've filed a bug report here.

shorowit's avatar shorowit  ( 2024-05-08 10:32:07 -0500 )edit

Thanks very much for your answers @shorowit

TomB's avatar TomB  ( 2024-05-09 01:50:25 -0500 )edit

Your Answer

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

Add Answer

Training Workshops


Question Tools

1 follower


Asked: 2024-05-07 05:14:19 -0500

Seen: 98 times

Last updated: May 08