Skip to content

sarocu/superstudio

Repository files navigation

🏢 🏬 🏥 🏰 SuperStudio 🏰 🏥 🏬 🏢

The Nice to use, OpenStudio automation CLI

Feature Usage Description
Set an ASHRAE building type --building_type [...] Adds space types, loads and schedules from OpenStudio-Standards
Set an ASHRAE Standard --standard [...] Adds basic systems and schedules
Set the Climate Zone --climate_zone [...] Adds construction sets and loads
Add weather data --weather [-epw ...] [-ddy ...] Asign EPW and DDY files
Merge geometry from JSON --geometry [--json ...] Swap out standard geometry with JSON formatted from FloorspaceJS
Create thermal zones --geometry --zoning per-space Create thermal zones according to a given scheme; currently only one zone per space is supported
Set WWR --geometry --wwr 0.3 Set the window-wall ratio of all exterior walls
Scale floor area --geometry --floor_area 2000 Scales the X and Y axis of the existing geometry to match the provided floor area in square meters

This project is still in its early stages and not exactly production ready - I will be fixing bugs and applying a number of new features including:

  • Geometry scaling
  • Apply window-to-wall ratios
  • Plugin template system
  • Stock HVAC system templates
  • Space type assignment for FloorspaceJS files
  • Basic simulation run manager
  • Results extraction
  • Basic plotting

Getting Started

Dependencies:

Eventually this will be available through Ruby Gems but for the moment, installing the package requires you to clone it down and manually install:

gem build superstudio.gemspec
gem install superstudio-0.1.0.gem

# install the rest of the dependencies:
bundle

irb
> require 'superstudio'
> => true

or with Rake:

rake install

# test the CLI by creating a baseline model:
rake test_create

Creating a Basic Workflow File

OpenStudio workflows provide a convenient way to bootstrap measure runs for your models. Create a basic workflow with a seed file and weather file with:

superstudio workflow --new --model /path/to/model.osm --weather /path/to/weather.epw

# Create a workflow.json in the current directory:

🏢💡 SuperStudio 🔌🏢

⚙️  Creating a Workflow File ⚙️
Successfully created workflow.json

Exporting a FloorSpaceJS Library

The export subcommand can be used to create a JSON file that FloorSpaceJS uses to add space types and construction sets to the user interface that can be scripted with measures. You can filter the complete list of OpenStudio-Standards space types by template and building type; the resulting JSON will plug in randomly generated colors for rendering the space types in the editor.

Usage:

superstudio export --template 90.1-2004 --building_type LargeHotel --output ./hotel.json

# you can also use a Rake task to create a library file with everything:
rake test_export

Adding a Template Plugin

Templates contain bits of code to drop in HVAC systems and make sure loads and schedules are properly applied - basically the stuff you need to get the model up and running. Templates in SuperStudio can draw from the OpenStudio SDK itself, OpenStudio-Standards, or the convenience methods in lib/templates.

A local settings folder contains the path to your local templates directory (currently just edit the file bin/superstudio-settings.json, this will change in the future). Each Ruby module in this directory is imported at runtime. A template should minimimally include a method that provides an entrypoint - this is the method that gets called when you specify a template on the CLI. So that means:

./bin/superstudio ...  --template bootstrapCentralHwChwVavBasic

Will call the method bootstrapCentralHwChwVavBasic using Ruby's __send__

Git Pre-Commit Hooks

pre-commit and rubocop are required as dev dependencies in the Gemfile. These will enforce style guidelines and common linting. Get started with pre-commit hooks by running pre-commit install

Run the pre-commit scripts on all files outside of a commit with a pre-commit run --all-files

To run the linter, simply run rubocop in the project root.

Docker and Docker-Compose

Docker provides a great way to produce portable models that will run the same on your coworker's machine. Docker-Compose enhances this workflow by making it easy to map volumes and tie together different services. The provided Dockerfile creates an OpenStudio image with the superstudio CLI built right in and basic dependencies like OpenStudio-Standards installed by default. The Compose file will map a local directory (./model) to the container so you can drop OSM files, weather files, and measures right in.

# Run the container and access it through a shell:
docker-compose run model /bin/bash

# Run a OS workflow with the OpenStudio-CLI:
docker-compose run model openstudio run --workflow /code/model/workflow.json

# Rebuild the container if you made changes to the Dockerfile:
docker-compose build model

# Something go wrong? Check your logs:
docker-compose logs model

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published