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

How to add internal loads to a model through measure script

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

newbie20's avatar

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
0

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.
https://github.com/NREL/openstudio-extension-gem/blob/develop/lib/openstudio/extension/core/os_lib_model_generation.rb#L3148

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
https://github.com/NREL/openstudio-extension-gem/blob/develop/lib/openstudio/extension/core/os_lib_model_generation.rb#L3140-L3141

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.
https://github.com/NREL/openstudio-extension-gem/blob/develop/lib/openstudio/extension/core/os_lib_model_generation.rb#L3154

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
https://github.com/NREL/openstudio-standards/blob/master/lib/openstudio-standards/standards/Standards.SpaceType.rb#L63-L79

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.
https://github.com/DavidGoldwasser/PAT_projects/blob/master/PAT_SDDC_PrimarySchool/measures/add_electric_equipment_instance_to_space/measure.rb#L87-L91

edit flag offensive delete link more

Comments

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's avatar 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's avatar 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's avatar 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's avatar 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's avatar 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

Training Workshops

Careers

Question Tools

Stats

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

Seen: 276 times

Last updated: May 19 '20