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

Scaling Commercial Reference Buildings

asked 2015-03-10 09:20:10 -0600

dpud12's avatar

updated 2017-08-05 13:17:17 -0600

Are there any forthcoming measures that will allow the OpenStudio versions of the Commercial Reference Buildings to be scaled is size?

edit retag flag offensive close merge delete

Comments

Great question!

__AmirRoth__'s avatar __AmirRoth__  ( 2015-03-10 09:39:51 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
4

answered 2015-03-10 12:48:48 -0600

updated 2015-03-10 12:49:29 -0600

Here is some code that allows you to scale the X-Y-Z dimensions of the building. Make a new measure and put this into the measure.rb file:

 #start the measure
class ScaleBuildingSize < OpenStudio::Ruleset::ModelUserScript

  #define the name that a user will see, this method may be deprecated as
  #the display name in PAT comes from the name field in measure.xml
  def name
    return "ScaleBuildingSize"
  end

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

    #make an argument for the X direction scale
    x_scale = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("x_scale",true)
    x_scale.setDisplayName("X-dimension scale")
    x_scale.setDefaultValue(1.0)
    args << x_scale

    #make an argument for the Y direction scale
    y_scale = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("y_scale",true)
    y_scale.setDisplayName("Y-dimension scale")
    y_scale.setDefaultValue(1.0)
    args << y_scale

    #make an argument for the Z direction scale
    z_scale = OpenStudio::Ruleset::OSArgument::makeDoubleArgument("z_scale",true)
    z_scale.setDisplayName("Z-dimension scale")
    z_scale.setDefaultValue(1.0)
    args << z_scale    

    return args
  end #end the arguments method

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

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

    #assign the user inputs to variables
    x_scale = runner.getDoubleArgumentValue("x_scale",user_arguments)
    y_scale = runner.getDoubleArgumentValue("y_scale",user_arguments)
    z_scale = runner.getDoubleArgumentValue("z_scale",user_arguments)

    #check the user_name for reasonableness
    if x_scale <= 0 or y_scale <= 0 or z_scale <= 0
      runner.registerError("X, Y, and Z scale values must all be > 0")
      return false
    end 

    #report the initial building area
    if model.building.is_initialized
      initial_building_area = OpenStudio::convert(model.building.get.floorArea,"m^2","ft^2").get
      runner.registerInitialCondition("The building floor area started at #{initial_building_area} ft^2.")
    end

    model.getPlanarSurfaces.each do |surface|
      new_vertices = OpenStudio::Point3dVector.new
      surface.vertices.each do |vertex|
        new_vertices << OpenStudio::Point3d.new(vertex.x * x_scale, vertex.y * y_scale, vertex.z * z_scale)
      end    
      surface.setVertices(new_vertices)
    end

    model.getPlanarSurfaceGroups.each do |surface_group|
      transformation = surface_group.transformation
      translation = transformation.translation
      euler_angles = transformation.eulerAngles
      new_translation = OpenStudio::Vector3d.new(translation.x * x_scale, translation.y * y_scale, translation.z * z_scale)
      #TODO these might be in the wrong order
      new_transformation = OpenStudio::createRotation(euler_angles) * OpenStudio::createTranslation(new_translation) 
      surface_group.setTransformation(new_transformation)
    end

    #report the final building area
    if model.building.is_initialized
      final_building_area = OpenStudio::convert(model.building.get.floorArea,"m^2","ft^2").get
      runner.registerFinalCondition("The building floor area ended at #{final_building_area} ft^2.")
    end 

    return true

  end #end the run method

end #end the measure

#this allows the measure to be use by the application
ScaleBuildingSize.new.registerWithApplication
edit flag offensive delete link more

Comments

1

To give credit, this code was mainly figured out by @macumber.

aparker's avatar aparker  ( 2015-03-10 12:50:33 -0600 )edit

@aparker@macumber Thanks this will make things a lot easier!

dpud12's avatar dpud12  ( 2015-03-11 14:54:37 -0600 )edit
2

answered 2015-03-10 10:53:45 -0600

I'm going to point to a few existing questions, and then make a few additional comments.

This thread talks about our plans to make measures to produce DOE reference buildings.

Ideally in most cases you will feed in a the geometry from your current design, but if you did want to use the reference building envelope, there are a few options for scaling it. I think the most straight forward approach would be to adjust the thermal zone multipliers.

If you do physically want to stretch the reference building geometry (or any model) you can adapt the process shown on this post that shows a plugin and a measure based approach to increase the floor to floor height of a model. Same logic will work on x and y axis as well.

edit flag offensive delete link more

Comments

@David Goldwasser Thanks the zone multipliers are a very elegant solution. I need to think through the assumptions that are inherent in both the scaling geometry and thermal zone multiplier approaches to decide which will be more accurate for my application

dpud12's avatar dpud12  ( 2015-03-11 14:57:15 -0600 )edit

Your welcome. My main concern with scaling the geometry to mimic a larger building is that exterior walls won't scale equitability (for a building with similar depth) with the floor area. As a result changes to wall constructions and window to wall ratio won't impact results as much as they should. Also scaling surfaces won't address daylighting controls if they exist.

If you are just scaling to 120% Probably not much to worry about, but 300% is another issue.

If the building is a bar you could just scale it along one axis vs both, although at some point in real life would add more floors or break into multiple buildings.

David Goldwasser's avatar David Goldwasser  ( 2015-03-11 17:41:47 -0600 )edit

Oh, and if the model has any loads and they are not area based they won't scale properly with geometry. Water use equipment would always fall into this category. Exhaust fans would be issue since not auto sized. Zone multipliers should handle most of these, but maybe not water use equipment since it doesn't have to be part of a zone. Similar for exterior lighting.

David Goldwasser's avatar David Goldwasser  ( 2015-03-11 17:56:53 -0600 )edit

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2015-03-10 09:20:10 -0600

Seen: 435 times

Last updated: Mar 10 '15