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

How to add AFN in openstudio sdk

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

TomB's avatar

updated 2024-09-06 13:42:55 -0600

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 ?

openstudio.model.AirflowNetworkZone(model) 
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;

afn_zone.setVentingAvailabilitySchedule(model.alwaysOnDiscreteSchedule())

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
1

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

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

Comments

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

TomB's avatar TomB  ( 2024-05-07 14:21:47 -0600 )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 -0600 )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 -0600 )edit

Thanks very much for your answers @shorowit

TomB's avatar TomB  ( 2024-05-09 01:50:25 -0600 )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

Careers

Question Tools

1 follower

Stats

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

Seen: 152 times

Last updated: May 08