ComStock is an NREL model of the U.S. commercial building stock. The model takes some building characteristics from the U.S. Department of Energy's (DOE's) Commercial Prototype Building Models and Commercial Reference Building. However, unlike many other building stock models, ComStock also combines these with a variety of additional public- and private-sector data sets. Collectively, this information provides high-fidelity building stock representation with a realistic diversity of building characteristics.
This repository contains the source code used to build and execute ComStock models, including upgrade scenarios. In addition, the sampling of buildings characteristics used for the initial ComStock (V1.0) release is provided. The ComStock model is under active calibration and development, which is publicly visible on this repository.
Execution of the ComStock workflow is managed through the buildstockbatch repository, a shared asset of ResStock and ComStock, specifically developed to scale to execution of tens of millions of simulations through multiple infrastructure providers.
The dataset output from the initial ComStock (V1.0) release can be found at the accompanying ComStock data viewer website and additional information about ComStock found on the NREL Buildings Website. For more details about ongoing model development please consult the End Use Load Profiles website.
ComStock is a direct result of the NREL residential stock modeling tool ResStock (recipient of a R&D100 award) and was inspired by the high-fidelity solar & storage adoption model dGen. Additionally, this tool would not be possible without the decades of work undertaken by the OpenStudio and EnergyPlus visionaries and contributors, significant funding, feedback and support from the Los Angeles Department of Water and Power, and the Department of Energy's Building Technology Office ongoing support of and investment in building energy modeling software.
/build
contains instructions for building Apptainer images for running ComStock on HPC systems./documentation
contains LaTeX documentation and instructions for building the documentation./measures
contains the high-level "meta" measures used to call other measures, and the reporting measures used to summarize outputs./national
contains seed directories necessary for a ComStock run using buildstockbatch./postprocessing
contains postprocessing scripts to create graphics for viewing results and comparing to other data sources./resources
contains workflow and upgrade measures/samples
contains sample buildstock.csv files, which describe the set of models included in a run./sampling
contains instructions and code to generate buildstock.csv files./ymls
contains sample .yml files, which are the configuration files used to execture a ComStock run with buildstockbatch.
ComStock is under an open source license. See LICENSE.txt in this directory. You are welcome to use this repository for your own use. However, we do not provide technical support. Please refer to our technical assistance documentation instead. We strongly suggest and support using the public datasets instead of attempting to run millions of building energy models yourself.
This is needed if you are a developer making changes to openstudio-standards
or openstudio-geb
gems or are running simulations locally using BuildStock Batch.
-
Install the latest version of OpenStudio. ComStock requires OpenStudio 3.8.0 or newer.
-
Install the Ruby version that corresponds to your OpenStudio install. See the OpenStudio SDK Version Compatibility Matrix.
- On Mac:
- Install Ruby 3.2.2 using rbenv (
ruby -v
from command prompt to check installed version). - On Windows:
- Install Ruby+Devkit 3.2.2 (
ruby -v
from command prompt to check installed version).
-
Connect Ruby to OpenStudio:
- On Mac:
- Create a file called
openstudio.rb
- Contents:
require "/Applications/openstudio-3.8.0/Ruby/openstudio.rb"
Modify3.8.0
to the version you installed. - Save it here:
/usr/lib/ruby/site_ruby/openstudio.rb
- On Windows:
- Create a file called
openstudio.rb
- Contents:
require "C:/openstudio-3.8.0/Ruby/openstudio.rb"
Modify3.8.0
to the version you installed. - Save it here:
C:/Ruby32-x64/lib/ruby/site_ruby/openstudio.rb
-
gem install bundler
This installs thebundler
ruby gem. -
Install Git.
-
Install GitHub desktop or another GUI that makes Git easier to use.
-
Clone the ComStock source code using GitHub desktop (easier) or Git (harder).
-
Run all commands below from the top level
/ComStock
directory -
mkdir .custom_gems
This makes a temp directory to install required gems inside. -
copy /Y .\resources\Gemfile .\.custom_gems\Gemfile
This copies the Gemfile to the temp directory. -
gem install bundler:2.4.10
This installs the version of bundler needed by OpenStudio. -
bundle _2.4.10_ install --path "C:/GitRepos/ComStock/.custom_gems" --gemfile "C:/GitRepos/ComStock/.custom_gems/Gemfile" --without test
This will install all ruby gems necessary to develop this code. -
If running simulations locally, install BuildStock Batch
-
Add the following additional Python packages into your
buildstockbatch
environment:
conda activate buildstockbatch
pip install GHEDesigner==1.0
pip install NREL-PySAM==4.2.0