Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/greensteel-eco-sync' into stee…
Browse files Browse the repository at this point in the history
…l-model
  • Loading branch information
kbrunik committed Jul 16, 2024
2 parents 8da2b5d + 37d4fb7 commit 69a2ca6
Show file tree
Hide file tree
Showing 230 changed files with 158,742 additions and 13,129 deletions.
29 changes: 25 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ log/
# needed for h2 test inputs: tests/analysis/results/
*_disp.txt

# Results
resource_files/wind
resource_files/solar
resource_files/grid
# Resource files (force add ones that are really needed in the repository)
hopp/simulation/resource_files/wind
hopp/simulation/resource_files/solar
hopp/simulation/resource_files/grid

.idea/*
.idea/workspace.xml
Expand Down Expand Up @@ -121,3 +121,24 @@ ENV/
*.gz
*.db-wal

# GreenHEART structure specific
tests/greenheart/data/*
tests/greenheart/output.txt
tests/greenheart/test_hydrogen/data/*
tests/greenheart/test_hydrogen/output.txt
hopp/simulation/resource_files/*/*.csv
hopp/simulation/resource_files/*/*.srw
examples/reference_plants/*/output/*
*speed_dir_data.csv
examples/greenheart/*/data
examples/greenheart/*/figures
tests/greenheart/reports/
tests/greenheart/test_hydrogen/output/
tests/hopp/data/
tests/reports/
tests/data/
tests/resource_files/
tests/test_dump.txt
output*
snopt_history.txt
reports/*
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Hybrid Optimization and Performance Platform
# Packages

## HOPP: Hybrid Optimization and Performance Platform

![CI Tests](https://github.com/NREL/HOPP/actions/workflows/ci.yml/badge.svg)

As part of NREL's [Hybrid Energy Systems Research](https://www.nrel.gov/wind/hybrid-energy-systems-research.html), this
software assesses optimal designs for the deployment of utility-scale hybrid energy plants, particularly considering wind,
solar and storage.

## GreenHEART: Grean Hydrogen Energy and Renewable Technologies
Hybrid project power-to-x component-level system performance and financial modeling for control and design optimization. Currently includes renewable energy, hydrogen, ammonia, and steel. Other elements such as desalination systems, pipelines, compressors, and storage systems can also be included as needed.

`greenheart` will install alongside `hopp` by following the instructions for installing HOPP from source.

## Software requirements
- Python version 3.8, 3.9, 3.10 64-bit
- Other versions may still work, but have not been extensively tested at this time
Expand All @@ -17,7 +24,7 @@ solar and storage.
pip install HOPP
```
## Installing from Source
## Installing from Source
1. Using Git, navigate to a local target directory and clone repository:
```
git clone https://github.com/NREL/HOPP.git
Expand Down Expand Up @@ -76,6 +83,19 @@ solar and storage.
2. To set up `NREL_API_KEY` for resource downloads, first refer to section 7 and 8 above. But for the `.env` file method,
the file should go in the working directory of your Python project, e.g. directory from where you run `python`.
## Parallel Processing for GreenHEART finite differences and design of experiments
GreenHEART is set up to run in parallel using MPI and PETSc for finite differencing and for design of experiments runs through OpenMDAO. To use this capability you will need to follow the addtional installation instruction below:
```
conda install -c conda-forge mpi4py petsc4py
```
For more details on implementation and installation, reference the documentation for OpenMDAO.
To to check that your installation is working, do the following:
```
cd tests/greenheart/
mpirun -n 2 pytest test_openmdao_mpi.py
```
## Getting Started
The [Examples](./examples/) contain Jupyter notebooks and sample YAML files for common usage scenarios in HOPP. These are actively maintained and updated to demonstrate HOPP's capabilities. For full details on simulation options and other features, see the [documentation](https://hopp.readthedocs.io/en/latest/).
Expand Down
12 changes: 6 additions & 6 deletions alt_dev/run_alt.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def init_simulation_pv():

# Load in weather and price data files
solar_file = Path(
__file__).parent.parent / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"
__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"

# Combine the data into a site definition
site_info = SiteInfo(site_data, solar_resource_file=solar_file, grid_resource_file=grid_file)
Expand Down Expand Up @@ -151,8 +151,8 @@ def init_simulation_csp():

# Load in weather and price data files
solar_file = Path(
__file__).parent.parent / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"
__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"

# Combine the data into a site definition
site_info = SiteInfo(site_data, solar_resource_file=solar_file, grid_resource_file=grid_file)
Expand Down Expand Up @@ -228,8 +228,8 @@ def init_simulation_hybrid():

# Load in weather and price data files
solar_file = Path(
__file__).parent.parent / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"
__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "solar" / WEATHER_FILE #"Beni_Miha" / "659265_32.69_10.90_2019.csv"
grid_file = Path(__file__).parent.parent / "hopp" / "simulation" / "resource_files" / "grid" / PRICE_FILE #"tunisia_est_grid_prices.csv"

# Combine the data into a site definition
site_info = SiteInfo(site_data, solar_resource_file=solar_file, grid_resource_file=grid_file)
Expand Down
50 changes: 50 additions & 0 deletions docs/hopp/simulation/technologies/dispatch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. _Dispatch:

Dispatch Strategies
===================

These are the dispatch strategies that may be used for a standard HOPP simulation. Dispatch
settings can be defined through :class:`.HybridDispatchOptions`.

Storage Dispatch
----------------

.. toctree::
:maxdepth: 1

dispatch/power_storage/simple_battery_dispatch.rst
dispatch/power_storage/simple_battery_dispatch_heuristic.rst
dispatch/power_storage/heuristic_load_following_dispatch.rst
dispatch/power_storage/linear_voltage_convex_battery_dispatch.rst
dispatch/power_storage/linear_voltage_nonconvex_battery_dispatch.rst
dispatch/power_storage/one_cycle_battery_dispatch_heuristic.rst

The above dispatch classes inherit from the :py:class:`.PowerStorageDispatch` class.

.. toctree::
:maxdepth: 1

dispatch/power_storage/power_storage_dispatch.rst

Technology Dispatch
-------------------

Dispatch classes are made for each technology where their specific components of the objectives,
their parameters, and other technology specific dispatch properties are defined.

.. toctree::
:maxdepth: 1

dispatch/power_sources/pv_dispatch.rst
dispatch/power_sources/wind_dispatch.rst
dispatch/power_sources/wave_dispatch.rst
dispatch/power_sources/trough_dispatch.rst
dispatch/power_sources/tower_dispatch.rst
dispatch/power_sources/csp_dispatch.rst

The above technology classes inherit from the :py:class:`.PowerSourceDispatch` class.

.. toctree::
:maxdepth: 1

dispatch/power_sources/power_source_dispatch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _CSPDispatch:


CSP Dispatch
============

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_sources.csp_dispatch.CspDispatch
:members:
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
:orphan:

.. _PowerSourceDispatch:


PowerSourceDispatch: Abstract Class
===================================

Base dispatch class for power source models
Power Source Dispatch
=====================

.. toctree::


.. autoclass:: hopp.simulation.technologies.dispatch.power_sources.power_source_dispatch.PowerSourceDispatch
:members:
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _PVDispatch:


PV Dispatch
===========

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_sources.pv_dispatch.PvDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _TowerDispatch:


Tower Dispatch
==============

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_sources.tower_dispatch.TowerDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _TroughDispatch:


Trough Dispatch
===============

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_sources.trough_dispatch.TroughDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _WaveDispatch:


Wave Dispatch
=============

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_sources.wave_dispatch.WaveDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _WindDispatch:


Wind Dispatch
=============

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_sources.wind_dispatch.WindDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _HeuristicLoadFollowingDispatch:


Heuristic Load Following Dispatch
=================================

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_storage.heuristic_load_following_dispatch.HeuristicLoadFollowingDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _ConvexLinearVoltageBatteryDispatch:


Convex Linear Voltage Battery Dispatch
======================================

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_storage.linear_voltage_convex_battery_dispatch.ConvexLinearVoltageBatteryDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _NonConvexLinearVoltageBatteryDispatch:


Non-Convex Linear Voltage Battery Dispatch
==========================================

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_storage.linear_voltage_nonconvex_battery_dispatch.NonConvexLinearVoltageBatteryDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _OneCycleBatteryDispatchHeuristic:


One Cycle Battery Dispatch Heuristic
====================================

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_storage.one_cycle_battery_dispatch_heuristic.OneCycleBatteryDispatchHeuristic
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _PowerStorageDispatch:


Power Storage Dispatch
======================

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_storage.power_storage_dispatch.PowerStorageDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _SimpleBatteryDispatch:


Simple Battery Dispatch
=======================

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_storage.simple_battery_dispatch.SimpleBatteryDispatch
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _SimpleBatteryDispatchHeuristic:


Simple Battery Dispatch Heuristic
=================================

.. toctree::

.. autoclass:: hopp.simulation.technologies.dispatch.power_storage.simple_battery_dispatch_heuristic.SimpleBatteryDispatchHeuristic
:members:
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Welcome to HOPP's documentation!
hopp/simulation/hopp_interface.rst
hopp/simulation/technologies/sites/site_info.rst
hopp/simulation/technologies/technologies.rst

hopp/simulation/technologies/dispatch.rst

.. toctree::
:maxdepth: 1
Expand Down
3 changes: 2 additions & 1 deletion examples/Wind_Floris/simulate_hybrid_custom_wind_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from hopp.simulation.technologies.sites import SiteInfo, flatirons_site
from hopp.simulation.hybrid_simulation import HybridSimulation
from hopp.utilities.keys import set_nrel_key_dot_env
from hopp import ROOT_DIR

# ADD CUSTOM WIND MODULE
# download FLORIS at www.github.com/NREL/FLORIS
Expand All @@ -31,7 +32,7 @@
# Get resource
lat = flatirons_site['lat']
lon = flatirons_site['lon']
prices_file = Path(__file__).parent.absolute().parent.parent / 'resource_files' / 'grid' / 'pricing-data-2015-IronMtn-002_factors.csv'
prices_file = ROOT_DIR / "simulation" / 'resource_files' / 'grid' / 'pricing-data-2015-IronMtn-002_factors.csv'
site = SiteInfo(flatirons_site, grid_resource_file=prices_file)

# initialize custom model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from hopp.simulation.hybrid_simulation import HybridSimulation

from hopp.simulation.technologies.dispatch.plot_tools import plot_battery_output, plot_battery_dispatch_error, plot_generation_profile

from hopp import ROOT_DIR

from hopp.utilities.keys import set_developer_nrel_gov_key
import yaml
Expand Down Expand Up @@ -48,7 +48,7 @@
# Get resource
lat = flatirons_site['lat']
lon = flatirons_site['lon']
prices_file = Path(__file__).parent.absolute().parent.parent / 'resource_files' / 'grid' / 'pricing-data-2015-IronMtn-002_factors.csv'
prices_file = ROOT_DIR / "simulation" / 'resource_files' / 'grid' / 'pricing-data-2015-IronMtn-002_factors.csv'
site = SiteInfo(flatirons_site, grid_resource_file=prices_file)

# Create model
Expand Down
Loading

0 comments on commit 69a2ca6

Please sign in to comment.