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

VRF terminal unit fan in SDK

asked 2016-01-14 06:11:43 -0500

ngkhanh's avatar

updated 2016-01-14 10:45:07 -0500

J Monteiro's avatar

Hello,

1/I would like to know how to modify default value of VRF TU supply fan. I want to change their pressure rise, fan and motor efficiency, schedule, etc ..

2/What's syntax i need to use when object is HVAC component class and schedule class ?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2016-01-14 09:18:46 -0500

require 'openstudio'

m = OpenStudio::Model::Model.new

terminal = OpenStudio::Model::ZoneHVACTerminalUnitVariableRefrigerantFlow.new(m)

# The default fan type for the terminal in OS is FanOnOff
# but if you want to see what type your terminal has you could do this
# I think FanConstantVolume is also allowed
puts terminal.supplyAirFan.briefDescription

# or this
puts terminal.iddObject.name

# this is how you "cast" the generic HVAC component "to_FanOnOff"
# note that the "get" will cause you program to crash 
# if the fan type is not FanOnOff
fan = terminal.supplyAirFan.to_FanOnOff.get

# you can check if the casting was successful before calling get like this
# this is a way to prevent a crash in your program if you don't know what type you have
optional_fan = terminal.supplyAirFan.to_FanOnOff

if ! optional_fan.empty? 
  fan = optional_fan.get
end

# might also be
#fan = terminal.supplyAirFan.to_FanConstantVolume.get

fan.setPressureRise(300)
fan.setFanEfficiency(0.5)
fan.setMotorEfficiency(0.75)
edit flag offensive delete link more

Comments

Thank a lot for an impressive answer. I would like to get more explanation about syntax in your examples : 1/ puts terminal.supplyAirFan.briefDescription/ puts terminal.iddObject.name - what i will get with this syntax : object or just info in screen ? if want to automately configure based on fan type information get from this syntax - which is next syntax ? 2/ May i use the syntax for changing object type like this : "iddObjectinitial.to_Iddobjectdestination" 3/ After that i dont need to reattach fan ?

ngkhanh's avatar ngkhanh  ( 2016-01-14 10:15:14 -0500 )edit

1) Yes the "puts" will merely output to the screen. I will update my answer a little later with some more detail about how to use this information to control the program flow.

2) You can reassign the fan, but not in the way you describe. I can provide an example of this too.

3) This is related to question 2. I think a code example will illuminate this for you. Again let me come back to this a little later today and I'll have some more examples for you.

Kyle Benne's avatar Kyle Benne  ( 2016-01-14 10:40:57 -0500 )edit

Done with fan setup by manually add scripts but still question for topics 2 and 3. Waiting for your reply. Thanks

ngkhanh's avatar ngkhanh  ( 2016-01-14 16:59:08 -0500 )edit

Your Answer

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

Add Answer

Careers

Question Tools

2 followers

Stats

Asked: 2016-01-14 06:11:43 -0500

Seen: 174 times

Last updated: Jan 14 '16