First time here? Check our help page!
1

How to add AFN in openstudio sdk

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
TomB's avatar
1.7k
TomB
asked 2024-05-07 05:14:19 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2024-09-06 13:42:55 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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.

shorowit's avatar
11.8k
shorowit
answered 2024-05-07 08:06:50 -0500
edit flag offensive 0 remove flag delete link

Comments

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