Skip to content

Commit

Permalink
Merge pull request #36 from jaredthomas68/gs-test-pr
Browse files Browse the repository at this point in the history
Gs test pr
  • Loading branch information
kbrunik authored Jun 5, 2024
2 parents 9dc2f1a + 4e3aa5c commit c8191e8
Show file tree
Hide file tree
Showing 47 changed files with 4,391 additions and 1,790 deletions.
11 changes: 9 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
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
25 changes: 9 additions & 16 deletions greenheart/simulation/greenheart_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,25 +271,18 @@ def setup_greenheart_simulation(config: GreenHeartSimulationConfig):
"is being overwritten with the value from the greenheart_config",
UserWarning,
)

if (
config.orbit_config["plant"]["turbine_spacing"]
!= config.greenheart_config["site"]["wind_layout"]["turbine_spacing"]
):
config.orbit_config["plant"].update(
{"turbine_spacing": config.greenheart_config["site"]["wind_layout"]["turbine_spacing"]}
)
warnings.warn(f"'turbine_spacing' in the orbit_config was {config.orbit_config['plant']['turbine_spacing']}, but 'turbine_spacing' in"
f"greenheart_config was {config.greenheart_config['site']['wind_layout']['turbine_spacing']}. The 'turbine_spacing' value in the orbit_config"
"is being overwritten with the value from the greenheart_config", UserWarning)

if config.orbit_config["plant"]["row_spacing"] != config.greenheart_config["site"]["wind_layout"]["row_spacing"]:
config.orbit_config["plant"].update(
{
"turbine_spacing": config.greenheart_config["site"]["wind_layout"][
"turbine_spacing"
]
}
)
warnings.warn(
f"site depth in the orbit_config was {config.orbit_config['plant']['turbine_spacing']}, but 'turbine_spacing' in"
f"greenheart_config was {config.greenheart_config['site']['wind_layout']['turbine_spacing']}. The 'turbine_spacing' value in the orbit_config"
"is being overwritten with the value from the greenheart_config",
UserWarning,
)

if (
config.orbit_config["plant"]["row_spacing"]
!= config.greenheart_config["site"]["wind_layout"]["row_spacing"]
Expand All @@ -302,7 +295,7 @@ def setup_greenheart_simulation(config: GreenHeartSimulationConfig):
}
)
warnings.warn(
f"site depth in the orbit_config was {config.orbit_config['plant']['row_spacing']}, but 'row_spacing' in"
f"'row_spacing' in the orbit_config was {config.orbit_config['plant']['row_spacing']}, but 'row_spacing' in"
f"greenheart_config was {config.greenheart_config['site']['wind_layout']['row_spacing']}. The 'row_spacing' value in the orbit_config"
"is being overwritten with the value from the greenheart_config",
UserWarning,
Expand Down
5 changes: 3 additions & 2 deletions greenheart/tools/optimization/gc_PoseOptimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ def get_number_design_variables(self):
n_DV += self.config.hopp_config["technologies"]["wind"]["num_turbines"]

# Wrap-up at end with multiplier for finite differencing
if self.config.greenheart_config["opt_options"]["driver"]["optimization"]["form"] == "central": # TODO this should probably be handled at the MPI point to avoid confusion with n_DV being double what would be expected
n_DV *= 2
if "form" in self.config.greenheart_config["opt_options"]["driver"]["optimization"].keys():
if self.config.greenheart_config["opt_options"]["driver"]["optimization"]["form"] == "central": # TODO this should probably be handled at the MPI point to avoid confusion with n_DV being double what would be expected
n_DV *= 2

return n_DV

Expand Down
28 changes: 21 additions & 7 deletions hopp/simulation/technologies/dispatch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
from hopp.simulation.technologies.dispatch.power_sources.pv_dispatch import PvDispatch
from hopp.simulation.technologies.dispatch.power_sources.wind_dispatch import WindDispatch
from hopp.simulation.technologies.dispatch.power_sources.wind_dispatch import (
WindDispatch,
)
from hopp.simulation.technologies.dispatch.power_sources.csp_dispatch import CspDispatch
from hopp.simulation.technologies.dispatch.power_sources.trough_dispatch import TroughDispatch
from hopp.simulation.technologies.dispatch.power_sources.tower_dispatch import TowerDispatch
from hopp.simulation.technologies.dispatch.power_sources.wave_dispatch import WaveDispatch
from hopp.simulation.technologies.dispatch.power_sources.trough_dispatch import (
TroughDispatch,
)
from hopp.simulation.technologies.dispatch.power_sources.tower_dispatch import (
TowerDispatch,
)
from hopp.simulation.technologies.dispatch.power_sources.wave_dispatch import (
WaveDispatch,
)

from hopp.simulation.technologies.dispatch.grid_dispatch import GridDispatch
from hopp.simulation.technologies.dispatch.hybrid_dispatch_options import HybridDispatchOptions
from hopp.simulation.technologies.dispatch.hybrid_dispatch_options import (
HybridDispatchOptions,
)
from hopp.simulation.technologies.dispatch.hybrid_dispatch import HybridDispatch
from hopp.simulation.technologies.dispatch.dispatch_problem_state import DispatchProblemState
from hopp.simulation.technologies.dispatch.power_storage.simple_battery_dispatch import SimpleBatteryDispatch
from hopp.simulation.technologies.dispatch.dispatch_problem_state import (
DispatchProblemState,
)
from hopp.simulation.technologies.dispatch.power_storage.simple_battery_dispatch import (
SimpleBatteryDispatch,
)
34 changes: 22 additions & 12 deletions hopp/simulation/technologies/dispatch/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
try:
u.USD
except AttributeError:
u.load_definitions_from_strings(['USD = [currency]', 'lifecycle = [energy] / [energy]'])
u.load_definitions_from_strings(
["USD = [currency]", "lifecycle = [energy] / [energy]"]
)


class Dispatch:
"""
""" """

"""
def __init__(self,
pyomo_model: pyomo.ConcreteModel,
index_set: pyomo.Set,
system_model,
financial_model,
block_set_name: str = 'dispatch'):
def __init__(
self,
pyomo_model: pyomo.ConcreteModel,
index_set: pyomo.Set,
system_model,
financial_model,
block_set_name: str = "dispatch",
):

self.block_set_name = block_set_name
self.round_digits = int(4)
Expand All @@ -29,13 +33,19 @@ def __init__(self,

@staticmethod
def dispatch_block_rule(block, t):
raise NotImplemented("This function must be overridden for specific dispatch model")
raise NotImplemented(
"This function must be overridden for specific dispatch model"
)

def initialize_parameters(self):
raise NotImplemented("This function must be overridden for specific dispatch model")
raise NotImplemented(
"This function must be overridden for specific dispatch model"
)

def update_time_series_parameters(self, start_time: int):
raise NotImplemented("This function must be overridden for specific dispatch model")
raise NotImplemented(
"This function must be overridden for specific dispatch model"
)

@staticmethod
def _check_efficiency_value(efficiency):
Expand Down
Loading

0 comments on commit c8191e8

Please sign in to comment.