dragonfly_energy.run module

Module for running geoJSON and OpenStudio files through URBANopt.

dragonfly_energy.run.base_honeybee_osw(project_directory, sim_par_json=None, additional_measures=None, additional_mapper_measures=None, base_osw=None, epw_file=None, skip_report=True, emissions_year=None)[source]

Create a honeybee_workflow.osw to be used as a base in URBANopt simulations.

This method will also copy the Honeybee.rb mapper to this folder if it is available in the config of this library.

Parameters
  • project_directory – Full path to a folder out of which the URBANopt simulation will be run. This is the folder that contains the feature geoJSON.

  • sim_par_json – Optional file path to the SimulationParameter JSON. If None, the OpenStudio models generated in the URBANopt run will not have everything they need to be simulate-able unless such parameters are supplied from one of the additional_measures or the base_osw. (Default: None).

  • additional_measures – An optional array of honeybee-energy Measure objects to be included in the output osw. These Measure objects must have values for all required input arguments or an exception will be raised while running this function. (Default: None).

  • additional_mapper_measures – An optional array of dragonfly-energy MapperMeasure objects to be included in the output osw. These MapperMeasure objects must have values for all required input arguments or an exception will be raised while running this function. (Default: None).

  • base_osw – Optional file path to an existing OSW JSON be used as the base for the honeybee_workflow.osw. This is another way that outside measures can be incorporated into the workflow. (Default: None).

  • epw_file – Optional file path to an EPW that should be associated with the output energy model. (Default: None).

  • skip_report – Set to True to have the URBANopt default feature reporting measure skipped as part of the workflow. If False, the measure will be run after all simulations are complete. Note that this input has no effect if the default_feature_reports measure is already in the base_osw or additional_measures. (Default: True).

  • emissions_year – An optional integer to set the year for which carbon emissions will be computed. If not for a historical year, values must be an even number and be between 2020 and 2050. If None, no carbon emission calculations will be included in the simulation. (Default: None).

Returns

The file path to the honeybee_workflow.osw written out by this method. This is used as the base for translating all features in the geoJSON.

dragonfly_energy.run.prepare_urbanopt_folder(feature_geojson, cpu_count=None, verbose=False)[source]

Prepare a directory with a feature geoJSON for URBANopt simulation.

This includes copying the Gemfile to the folder and generating the runner.conf to specify the number of CPUs to be used in the simulation. Lastly, the the scenario .csv file will be generated from the feature_geojson.

Parameters
  • feature_geojson – An URBANopt feature geoJSON to be prepared for URBANopt simulation.

  • cpu_count – A positive integer for the number of CPUs to use in the simulation. This number should not exceed the number of CPUs on the machine running the simulation and should be lower if other tasks are running while the simulation is running. If set to None, it should automatically default to one less than the number of CPUs currently available on the machine (or 1 if the machine has only one processor). (Default: None).

  • verbose – Boolean to note if the simulation should be run with verbose reporting of progress. (Default: False).

Returns

Path to the .csv file for the URBANopt scenario.

dragonfly_energy.run.run_default_report(feature_geojson, scenario_csv)[source]

Generate default reports after an URBANopt simulation is run.

Parameters
  • feature_geojson – The full path to a .geojson file containing the footprints of buildings to be simulated.

  • scenario_csv – The full path to a .csv file for the URBANopt scenario.

Returns

A series of file paths to the report output files

  • csv – Path to a CSV file containing default scenario results.

  • report_json – Path to a JSON file containing default scenario results.

dragonfly_energy.run.run_des_modelica(sys_param_json, feature_geojson, scenario_csv)[source]

Run the GMT command to create the Modelica files from the system param JSON.

Parameters
  • sys_param_json – The full path to a system parameter JSON from which the Modelica files will be generated.

  • feature_geojson – The full path to a .geojson file containing the footprints of buildings to be simulated.

  • scenario_csv – The full path to a .csv file for the URBANopt scenario.

Returns

The path to the folder where the Modelica files have been written.

dragonfly_energy.run.run_des_sys_param(feature_geojson, scenario_csv)[source]

Run the GMT command to add the time series building loads to the sys param JSON.

Parameters
  • feature_geojson – The full path to a .geojson file containing the footprints of buildings to be simulated.

  • scenario_csv – The full path to a .csv file for the URBANopt scenario.

dragonfly_energy.run.run_modelica_docker(modelica_project_dir)[source]

Execute Modelica files of a DES.

Parameters

modelica_project_dir – The full path to the folder in which the Modelica files were written.

Returns

The path to where the results have been written.

dragonfly_energy.run.run_reopt(feature_geojson, scenario_csv, urdb_label, reopt_parameters=None, developer_key=None)[source]

Run a feature and scenario file through REopt post processing.

Note that the URBANopt simulation must already be run with the input feature_geojson and scenario_csv in order for the post-processing to be successful.

Parameters
  • feature_geojson – The full path to a .geojson file containing the footprints of buildings to be simulated.

  • scenario_csv – The full path to a .csv file for the URBANopt scenario.

  • urdb_label – Text string for the Utility Rate Database (URDB) label for the particular electrical utility rate for the optimization. The label is the last term of the URL of a utility rate detail page (eg. the label for the rate at https://openei.org/apps/IURDB/rate/view/5b0d83af5457a3f276733305 is 5b0d83af5457a3f276733305). Utility rates for specific locations can be looked up in the REopt Lite tool (https://reopt.nrel.gov/tool) and the label can be obtained by clicking on “Rate Details” link for a particular selected rate.

  • reopt_parameters – A REoptParameter object to describe the major assumptions of the REopt analysis. If None some default parameters will be generated for a typical analysis. (Default: None).

  • developer_key – Text string for the NREL developer key. You can get a developer key at (https://developer.nrel.gov/). (Default: None).

Returns

A series of file paths to the simulation output files

  • csv – Path to a CSV file containing scenario optimization results.

  • report_json – Path to a JSON file containing scenario optimization results.

dragonfly_energy.run.run_rnm(feature_geojson, scenario_csv, underground_ratio=0.9, lv_only=True, nodes_per_building=1)[source]

Run a feature and scenario file through RNM post processing.

Note that the URBANopt simulation must already be run with the input feature_geojson and scenario_csv in order for the RNM post-processing to be successful.

Parameters
  • feature_geojson – The full path to a .geojson file containing the footprints of buildings to be simulated.

  • scenario_csv – The full path to a .csv file for the URBANopt scenario.

  • underground_ratio – A number between 0 and 1 for the ratio of overall cables that are underground vs. overhead in the analysis. (Default: 0.9).

  • lv_only – Boolean to note whether to consider only low voltage consumers in the analysis. (Default: True).

  • nodes_per_building – Positive integer for the maximum number of low voltage nodes to represent a single building. (Default: 1).

Returns

Path to a folder that contains all of the RNM output files.

dragonfly_energy.run.run_urbanopt(feature_geojson, scenario_csv, cpu_count=None)[source]

Run a feature and scenario file through URBANopt on any operating system.

Parameters
  • feature_geojson – The full path to a .geojson file containing the footprints of buildings to be simulated.

  • scenario_csv – The full path to a .csv file for the URBANopt scenario.

  • cpu_count – This input is deprecated and currently not used given that the runner.conf generated in the prepare_urbanopt_folder step correctly identifies the number of CPUs to be used.

Returns

A series of file paths to the simulation output files

  • osm – Array of paths to .osm files for all generated OpenStudio models.

  • idf – Array of paths to .idf files containing the input for the EnergyPlus simulation.

  • sql – Array of paths to .sqlite files containing all simulation results.

  • zsz – Array of paths to .csv files containing detailed zone load information recorded over the course of the design days.

  • rdd – Array of paths to .rdd files containing all possible outputs that can be requested from the simulation.

  • html – Array of paths to .html files containing all summary reports.

  • err – Array of paths to .err files containing all errors and warnings from the simulation.