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

Revision history [back]

In EnergyPlus, you can define a FluidProperties:GlycolConcentration object and reference it as the working fluid of a plant loop. Currently this isn't exposed in OpenStudio, so you'd have to use an EnergyPlus measure to set the properties of your glycol loop, after you set them up in the model.

I put one together a while back to let you define arguments for the fluid loop and the glycol concentration:

loop_name = OpenStudio::Ruleset::OSArgument.makeStringArgument("loop_name", true)
loop_name.setDisplayName("Loop Name, e.g. 'GlycolLoop - Heating'")
loop_name.setDescription("Enter the loop to change the working fluid.")
args << loop_name

concentration = OpenStudio::Ruleset::OSArgument.makeDoubleArgument("concentration", true)
concentration.setDisplayName("Concentration of Propylene Glycol solution.")
concentration.setDefaultValue(0.4)
args << concentration

Then in the run section, get the arguments:

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

Get the loop:

#get list of workspace objects named loop_name
loop = workspace.getObjectsByName(loop_name, true)

Create the idf string and pass it into the workspace:

conc_string = "
FluidProperties:GlycolConcentration,
    ProGly#{concentration}Percent,
    PropyleneGlycol,
    ,
    #{concentration};
    "
idfObject = OpenStudio::IdfObject::load(conc_string)
object = idfObject.get
wsObject = workspace.addObject(object)
new_conc = wsObject.get

And set your loop to reference the fluid property:

if not loop.empty?
    loop[0].setString(1,"UserDefinedFluidType")
    loop[0].setString(2,"ProGly#{concentration}Percent")
end

In EnergyPlus, you can define a FluidProperties:GlycolConcentration object and reference it as the working fluid of a plant loop. Currently this isn't exposed in OpenStudio, so you'd have to use an EnergyPlus measure to set the properties of your glycol loop, after you set them up in the model.

I put one together a while back to let you define arguments for the fluid loop and the glycol concentration:

loop_name = OpenStudio::Ruleset::OSArgument.makeStringArgument("loop_name", true)
loop_name.setDisplayName("Loop Name, e.g. 'GlycolLoop - Heating'")
loop_name.setDescription("Enter the loop to change the working fluid.")
args << loop_name

concentration = OpenStudio::Ruleset::OSArgument.makeDoubleArgument("concentration", true)
concentration.setDisplayName("Concentration of Propylene Glycol solution.")
concentration.setDefaultValue(0.4)
args << concentration

Then in the run section, get the arguments:

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

Get the loop:

#get list of workspace objects named loop_name
loop = workspace.getObjectsByName(loop_name, true)

Create the idf string and pass it into the workspace:

conc_string = "
FluidProperties:GlycolConcentration,
    ProGly#{concentration}Percent,
    PropyleneGlycol,
    ,
    #{concentration};
    "
idfObject = OpenStudio::IdfObject::load(conc_string)
object = idfObject.get
wsObject = workspace.addObject(object)
new_conc = wsObject.get

And set your loop to reference the fluid property:

if not loop.empty?
    loop[0].setString(1,"UserDefinedFluidType")
    loop[0].setString(2,"ProGly#{concentration}Percent")
end

EDIT: Fluid properties are now exposed in the Plant Loop settings in OpenStudio (as of at least v2.3.0)

In EnergyPlus, you can define a FluidProperties:GlycolConcentration object and reference it as the working fluid of a plant loop. Currently this isn't exposed in OpenStudio, so you'd have to use an EnergyPlus measure to set the properties of your glycol loop, after you set them up in the model.

I put one together a while back to let you define arguments for the fluid loop and the glycol concentration:

loop_name = OpenStudio::Ruleset::OSArgument.makeStringArgument("loop_name", true)
loop_name.setDisplayName("Loop Name, e.g. 'GlycolLoop - Heating'")
loop_name.setDescription("Enter the loop to change the working fluid.")
args << loop_name

concentration = OpenStudio::Ruleset::OSArgument.makeDoubleArgument("concentration", true)
concentration.setDisplayName("Concentration of Propylene Glycol solution.")
concentration.setDefaultValue(0.4)
args << concentration

Then in the run section, get the arguments:

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

Get the loop:

#get list of workspace objects named loop_name
loop = workspace.getObjectsByName(loop_name, true)

Create the idf string and pass it into the workspace:

conc_string = "
FluidProperties:GlycolConcentration,
    ProGly#{concentration}Percent,
    PropyleneGlycol,
    ,
    #{concentration};
    "
idfObject = OpenStudio::IdfObject::load(conc_string)
object = idfObject.get
wsObject = workspace.addObject(object)
new_conc = wsObject.get

And set your loop to reference the fluid property:

if not loop.empty?
    loop[0].setString(1,"UserDefinedFluidType")
    loop[0].setString(2,"ProGly#{concentration}Percent")
end

EDIT: EDIT: Fluid properties are now exposed in the Plant Loop settings in OpenStudio (as of at least v2.3.0)