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

How to add a supply tank to cooling tower

asked 2018-01-13 00:40:27 -0500

TomB's avatar

updated 2018-01-13 11:12:09 -0500

Using Openstudio, via the API or an EnergyPlus measure, is it possible to add a WaterUse:Storage object to a Cooling Tower? The CoolingTower:VariableSpeed has a selector field Supply Water Storage Tank. I can add a Tank, but only using an EnergyPlus measure to inject that code into the idf file on export/simulate.

I see no method on the OpenStudio API to edit the CoolingTower object.

Is it possible to grab the CoolingTower object from within an EnergyPlus measure, then edit the field for the supply tank ? Any other ideas on how to add a supply tank to the cooling tower?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-01-13 03:16:37 -0500

Avi's avatar

You can follow what I did in the E+ measure to add Storage tank for Rainwater collection. In order to grab a list of the CoolingTower:VariableSpeed in your model try something like that:

# argument for CoolingTower:VariableSpeed selection
    coolTowList = OpenStudio::StringVector.new
    coolTowers = workspace.getObjectsByType("CoolingTower:VariableSpeed".to_IddObjectType)
    coolTowers.each do |coolTower|
        coolTowList << coolTower.getString(0).to_s
    end

    coolTowsSel = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('coolTowsSel', coolTowList, false)
    coolTowsSel.setDisplayName("Plant Loop To add Availability Managers to?")       
    args << coolTowsSel

Then you will need to find the selected object in the run method:

# assign the user inputs to variables
    coolTowsSel = runner.getStringArgumentValue("coolTowsSel", user_arguments)

# find the selected Cooling Tower
    coolTowList = workspace.getObjectsByType("CoolingTower:VariableSpeed".to_IddObjectType)
    selCoolTower = coolTowList[0]
    coolTowList.each do |coolTow|
        if coolTow.getString(0).to_s == coolTowsSel.to_s
            selCoolTower = coolTow
            break
        end
    end

For sure that can be written more elegantly, but that should work.

edit flag offensive delete link more

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

1 follower

Stats

Asked: 2018-01-13 00:40:27 -0500

Seen: 101 times

Last updated: Jan 13 '18