Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOPP v2.2.0 #310

Merged
merged 30 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d6871a3
Adding heuristic load following dispatch method and load following ex…
genevievestarke Jul 13, 2023
32bdb7d
Updating heuristic battery dispatch description
genevievestarke Jul 14, 2023
c1045e2
Cleaning up the code
genevievestarke Jul 14, 2023
284d177
Adding updated analysis code and test
genevievestarke Dec 21, 2023
46fc75d
Adding todo for battery config file
genevievestarke Dec 21, 2023
65be686
Fix tests
camirmas Dec 27, 2023
d7e8b4d
Temporarily remove example
camirmas Dec 27, 2023
739c72b
Replace print statements with logs
camirmas Dec 28, 2023
3f7254b
Add docs, small fixes
camirmas Dec 28, 2023
376e565
Fix update_soc to use configured params
camirmas Dec 28, 2023
e993c8a
Merge pull request #262 from camirmas/load_following_heuristic
camirmas Dec 29, 2023
3fe5d2b
Bug Fix: email for API calls (#291)
elenya-grant Mar 28, 2024
0ad85a7
formatting
bayc Apr 5, 2024
1bfcf53
move the max_gross_profit_objective from hybrid_dispatch into respect…
bayc Apr 5, 2024
8482bc1
move the min_operating_cost_objective from hybrid_dispatch into respe…
bayc Apr 5, 2024
ae0fcb6
move the variable and port generation from hybrid_dispatch into respe…
bayc Apr 6, 2024
e615145
generalize the technology objective attributes to just be obj
bayc Apr 12, 2024
2d98df7
move grid constraint to grid_dispatch and update hybrid constraints
bayc Apr 12, 2024
702a7dd
generalize variable creation to eliminate if/else in hybrid_dispatch
bayc Apr 12, 2024
6bf6581
add variable and port creation methods to base power generation dispa…
bayc Apr 12, 2024
2bab8c9
remove hardcoded values. sync financial and system models.
kbrunik Apr 16, 2024
bf529be
add docstring, reformat power sources dispatch.
kbrunik Apr 17, 2024
75e8ef6
changing blocks to hybrid_blocks for clarity
bayc Apr 17, 2024
424186c
add docstrings, reformat power storage.
kbrunik Apr 17, 2024
6066982
reformatting
kbrunik Apr 18, 2024
6f77700
remove setter docstring
kbrunik Apr 18, 2024
b63c22c
add dispatch to docs
bayc Apr 17, 2024
55b39dd
Merge pull request #305 from bayc/feature/refactor_hopp_solver
bayc Apr 22, 2024
5e45463
Merge branch 'main' into develop
bayc Apr 22, 2024
9f2f0a4
update version to v2.2.0
bayc Apr 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ solar and storage.
[https://developer.nrel.gov/signup/](https://developer.nrel.gov/signup/)


7. To set up the `NREL_API_KEY` required for resource downloads, you can create an Environment Variable called
`NREL_API_KEY`. Otherwise, you can keep the key in a new file called ".env" in the root directory of this project.
7. To set up the `NREL_API_KEY` and `NREL_API_EMAIL` required for resource downloads, you can create Environment Variables called `NREL_API_KEY` and `NREL_API_EMAIL`. Otherwise, you can keep the key in a new file called ".env" in the root directory of this project.

Create a file ".env" that contains the single line:
```
```
NREL_API_KEY=key
NREL_API_EMAIL=your.name@email.com
```

8. Verify setup by running tests:
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
9 changes: 8 additions & 1 deletion hopp/simulation/hybrid_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,14 @@ def simulate_power(self, project_life: int = 25, lifetime_sim=False):
# Consolidate grid generation by copying over power and storage generation information
if self.battery:
self.grid.generation_profile_wo_battery = total_gen_before_battery
self.grid.simulate_grid_connection(hybrid_size_kw, total_gen, project_life, lifetime_sim, total_gen_max_feasible_year1)
self.grid.simulate_grid_connection(
hybrid_size_kw,
total_gen,
project_life,
lifetime_sim,
total_gen_max_feasible_year1,
self.dispatch_builder.options
)
self.grid.hybrid_nominal_capacity = hybrid_nominal_capacity
self.grid.total_gen_max_feasible_year1 = total_gen_max_feasible_year1
logger.info(f"Hybrid Peformance Simulation Complete. AEPs are {self.annual_energies}.")
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
Loading