I am having trouble getting this little bit of code to work:
# Make a new fan and coils
vav_fan = OpenStudio::Model::FanVariableVolume.new(model, model.alwaysOnDiscreteSchedule)
new_cooling_coil = OpenStudio::Model::CoilCoolingDXMultiSpeed.new(model)
new_heating_coil = OpenStudio::Model::CoilHeatingDXMultiSpeed.new(model)
new_supheating_coil = OpenStudio::Model::CoilHeatingElectric.new(model)
# Make a new AirLoopHVAC:UnitarySystem object
runner.registerInitialCondition("Line 212")
air_loop_hvac_unitary_system_multi = OpenStudio::Model::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.new(model, vav_fan, new_heating_coil, new_cooling_coil, new_supheating_coil)
# Add the VAV fan to the AirLoopHVAC:UnitarySystem object
air_loop_hvac_unitary_system_multi.setSupplyAirFan(vav_fan)
# Set the AirLoopHVAC:UnitarySystem fan placement
air_loop_hvac_unitary_system_multi.setSupplyAirFanPlacement('BlowThrough')
# Set the AirLoopHVAC:UnitarySystem Supply Air Fan Operating Mode Schedule
air_loop_hvac_unitary_system_multi.setSupplyAirFanOperatingModeSchedule(model.alwaysOnDiscreteSchedule)
runner.registerInitialCondition("Line 214")
I get this error telling me that the new object does not have a supply fan attached:
[openstudio.model.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed] Object of type 'OS:AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed' and named 'Air Loop HVAC Unitary Heat Pump Air To Air Multi Speed 1' does not have an Supply Air Fan attached.
[10:57:43.599224 ERROR] D:\OSN\src\model\AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp@102 : Object of type 'OS:AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed' and named 'Air Loop HVAC Unitary Heat Pump Air To Air Multi Speed 1' does not have an Supply Air Fan attached.
C:/Users/owner/OpenStudio/Measures/create_variable_speed_rtu_copy/measure.rb:213:in initialize'
C:/Users/owner/OpenStudio/Measures/create_variable_speed_rtu_copy/measure.rb:213:in
new'
C:/Users/owner/OpenStudio/Measures/create_variable_speed_rtu_copy/measure.rb:213:in run'
:/ruby/2.7.0/gems/openstudio-workflow-2.2.1/lib/openstudio/workflow/util/measure.rb:517:in
apply_measure'
:/ruby/2.7.0/gems/openstudio-workflow-2.2.1/lib/openstudio/workflow/util/measure.rb:114:in block in apply_measures'
:/ruby/2.7.0/gems/openstudio-workflow-2.2.1/lib/openstudio/workflow/util/measure.rb:67:in
each_index'
:/ruby/2.7.0/gems/openstudio-workflow-2.2.1/lib/openstudio/workflow/util/measure.rb:67:in apply_measures'
:/ruby/2.7.0/gems/openstudio-workflow-2.2.1/lib/openstudio/workflow/jobs/run_os_measures.rb:70:in
perform'
:/ruby/2.7.0/gems/openstudio-workflow-2.2.1/lib/openstudio/workflow/run.rb:287:in step'
:/ruby/2.7.0/gems/openstudio-workflow-2.2.1/lib/openstudio/workflow/run.rb:229:in
run'
:/openstudio_cli.rb:1013:in execute'
:/openstudio_cli.rb:803:in
execute'
:/openstudio_cli.rb:1797:in '
eval:185:in
eval'
eval:185:in require_embedded_absolute'
eval:170:in
block in require_embedded'
eval:164:in each'
eval:164:in
require_embedded'
eval:123:in require'
eval:3:in
'