Sha256: 7395e8c5cec9788ae4a97d676d322bcd3e4081772af6fea3aacd45364fbeeb5c

Contents?: true

Size: 1.85 KB

Versions: 2

Compression:

Stored size: 1.85 KB

Contents

# *******************************************************************************
# OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC.
# See also https://openstudio.net/license
# *******************************************************************************

# see the URL below for information on how to write OpenStudio measures
# http://openstudio.nrel.gov/openstudio-measure-writing-guide

# start the measure
class HardSizeHVAC < OpenStudio::Measure::ModelMeasure
  require 'openstudio-standards'

  # human readable name
  def name
    'Hard Size HVAC'
  end

  # human readable description
  def description
    'Run a simulation to autosize HVAC equipment and then apply these autosized values back to the model.'
  end

  # human readable description of modeling approach
  def modeler_description
    'Run a simulation to autosize HVAC equipment and then apply these autosized values back to the model.'
  end

  # define the arguments that the user will input
  def arguments(_model)
    OpenStudio::Measure::OSArgumentVector.new
  end

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

    # Make the standard applier
    standard = Standard.build('90.1-2004') # template choice doesn't matter

    # Perform a sizing run (2.5.1 and later)
    sizing_run_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/SR1").to_s
    runner.registerInfo("Performing sizing run at #{sizing_run_path}.")
    if standard.model_run_sizing_run(model, sizing_run_path) == false
      return false
    end

    # Hard sizing every object in the model.
    model.applySizingValues

    # Log the openstudio-standards messages to the runner
    log_messages_to_runner(runner, false)

    true
  end
end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openstudio-calibration-0.11.0 lib/measures/HardSizeHvac/measure.rb
openstudio-calibration-0.10.0 lib/measures/HardSizeHvac/measure.rb