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

How to add internal loads to a model through measure script

asked 2020-05-18 13:41:32 -0600

newbie20 gravatar image

updated 2020-05-18 18:47:10 -0600

Is there any example that explains how to add the internal loads to model via ruby measure script and OpenStudio openstudio-standards gem?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-05-19 13:55:53 -0600

updated 2020-05-19 14:14:29 -0600

There is a method in openstudio-standards-gem named space_type_apply_internal_loads. This is used in our Space Type and Construction Set Wizard measure. That measure now uses code in the openstudio-extension-gem which also ships with OpenStudio along side the standards gem.

The extension gem calls the method under a wizard method.

Not that for this to work on a space type, you need to first tag the space type so the gem recognized the intended building type and space type and the target standard. That is done here right after the space type is made

space_type_apply_internal_loads adds internal loads but not the schedules, shortly after the prior method space_type_apply_internal_load_schedules is called, which adds the schedules.

Both methods have a series of bools allowing you to control what types of interior loads this is applied to. This gives you the ability to selectively apply loads and schedules. You could for example not touch plug loads, use 90.1 2004 for other loads, but 2013 for lighting.

You can see more detailed documentation on space_type_apply_internal_loads in the standards gem repository. Link to the method is below

If you want a very simple example instead that doesn't use the standards gem, here is a measure that takes an existing electric equipment definition, schedule, and space already in the model and creates an electric equipment instance of that definition in the space. The link below points to 5 lines that add the object. This could easily be extended to make a new definition instead of expecting it to already be in the model, with one or more arguments to define the new electric equipment definition. My use case here was to pre-load elevators descriptions in th model but have the modeler hook them up as needed.

edit flag offensive delete link more


David, thanks for the detailed response. However, I'm new to OpenStudio, measure and even ruby. I'm importing a floorplan JSON to OpenStudio via measure code, but then I'm having trouble getting the building type and thermal zone info that are needed to add the loads. Would you please help me with that too?

newbie20 gravatar image newbie20  ( 2020-05-19 23:06:27 -0600 )edit

@newbi20 if you start in the OpenStuido Application, and run the space type wizard measure to generate space types. You can then create a FloorSpace.json with those space types setup. We have a measure to merge FloorSpaceJS. You may also want to look at SuperStudio which uses OpenStudio Standards and FloorSpaceJS that can do this.

David Goldwasser gravatar image David Goldwasser  ( 2020-05-19 23:36:54 -0600 )edit

@David Thank you again and sorry for the many questions. I used this measure to import the floorplanJS to OS. One thing that is confusing me is the difference between this script and the one you provided to import the floorpan. For my purpose, I have a frontend application that generates the floorplanJS and from there I needed to import the floorplan and eed to run openstudio-standards gem on the created geometry so the internal loads, envelope parameters, etc. are added to the building based on building type, building standard, and climate zone. Does the merge FloorSpaceJS still work for me ?

newbie20 gravatar image newbie20  ( 2020-05-20 10:43:45 -0600 )edit

Yes, you can use this, but just need to have an OSM with pre-loaded space types with the standard building type and space type set. If your FloorSpaceJS has space types of the same name, the measure will merge them together. Then you can run a measure like the wizard to add loads. Here is an example OSW using this workflow that you can checkout and run.

Just out of interest, what front end program are you using to create the FloorSpaceJS.

David Goldwasser gravatar image David Goldwasser  ( 2020-05-20 10:51:11 -0600 )edit

Thank you again David for your promoted response! It is a project with front end code that conforms to FloorspaceJS and create the floorplanJS JSON.

newbie20 gravatar image newbie20  ( 2020-05-20 11:15:10 -0600 )edit

Your Answer

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

Add Answer


Question Tools


Asked: 2020-05-18 13:41:32 -0600

Seen: 127 times

Last updated: May 19 '20