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

Revision history [back]

To answer your second question, yes an OpenStudio model can be updated to a newer version but is not backwards compatible. Unless you have a specific reason to keep your model in 1.9.1, I suggest updating it to the latest major release.

To answer your first question, staging plant equipment is possible through the GUI. However, a small bug is currently preventing any selection in the PlantLoop Load Distribution Scheme other than "Optimal" from being translated to EnergyPlus (see this question).

Until that bug is fixed, an EnergyPlus measure is needed to change this field during a simulation. Here's an (untested) EP measure you could try:

# see the URL below for information on how to write OpenStudio measures
# http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/

# start the measure
class SetPlantLoopLoadDistributionScheme < OpenStudio::Ruleset::WorkspaceUserScript

  # human readable name
  def name
    return "Set Plant Loop Load Distribution Scheme"
  end

  # human readable description
  def description
    return "TODO"
  end

  # human readable description of modeling approach
  def modeler_description
    return "TODO"
  end

  # define the arguments that the user will input
  def arguments(workspace)
    args = OpenStudio::Ruleset::OSArgumentVector.new

    # none

    return args
  end 

  # define what happens when the measure is run
  def run(workspace, runner, user_arguments)
    super(workspace, runner, user_arguments)

    # use the built-in error checking 
    if !runner.validateUserArguments(arguments(workspace), user_arguments)
      return false
    end

    # assign the user inputs to variables


    # check the user_name for reasonableness


    # get all thermal zones in the starting model


    # reporting initial condition of model


    # add a new zone to the model with the new name
    # http://apps1.eere.energy.gov/buildings/energyplus/pdfs/inputoutputreference.pdf#nameddest=Zone


    # set variables
    load_dist_scheme = "SequentialLoad"

    # get objects
    plant_loops = workspace.getObjectsByType("PlantLoop".to_IddObjectType) #array

    if not plant_loops.empty?

      plant_loops.each do |plant_loop|

        plant_loop.setString(19, load_dist_scheme)

      end

    end

    # echo the new zone's name back to the user, using the index based getString method


    # report final condition of model


    return true

  end

end 

# register the measure to be used by the application
SetPlantLoopLoadDistributionScheme.new.registerWithApplication

To answer your second question, yes an OpenStudio model can be updated to a newer version but is not backwards compatible. Unless you have a specific reason to keep your model in 1.9.1, I suggest updating it to the latest major release.

To answer your first question, staging plant equipment is possible through the GUI. However, a small bug is currently preventing any selection in the PlantLoop Load Distribution Scheme other than "Optimal" from being translated to EnergyPlus (see this question).

Until that bug is fixed, an EnergyPlus measure is needed to change this field during a simulation. Here's Below is an (untested) EP measure you could try:try that will change all plant loops.

# see the URL below for information on how to write OpenStudio measures
# http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/

# start the measure
class SetPlantLoopLoadDistributionScheme < OpenStudio::Ruleset::WorkspaceUserScript

  # human readable name
  def name
    return "Set Plant Loop Load Distribution Scheme"
  end

  # human readable description
  def description
    return "TODO"
  end

  # human readable description of modeling approach
  def modeler_description
    return "TODO"
  end

  # define the arguments that the user will input
  def arguments(workspace)
    args = OpenStudio::Ruleset::OSArgumentVector.new

    # none

    return args
  end 

  # define what happens when the measure is run
  def run(workspace, runner, user_arguments)
    super(workspace, runner, user_arguments)

    # use the built-in error checking 
    if !runner.validateUserArguments(arguments(workspace), user_arguments)
      return false
    end

    # assign the user inputs to variables


    # check the user_name for reasonableness


    # get all thermal zones in the starting model


    # reporting initial condition of model


    # add a new zone to the model with the new name
    # http://apps1.eere.energy.gov/buildings/energyplus/pdfs/inputoutputreference.pdf#nameddest=Zone


    # set variables
    load_dist_scheme = "SequentialLoad"

    # get objects
    plant_loops = workspace.getObjectsByType("PlantLoop".to_IddObjectType) #array

    if not plant_loops.empty?

      plant_loops.each do |plant_loop|

        plant_loop.setString(19, load_dist_scheme)

      end

    end

    # echo the new zone's name back to the user, using the index based getString method


    # report final condition of model


    return true

  end

end 

# register the measure to be used by the application
SetPlantLoopLoadDistributionScheme.new.registerWithApplication