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

Refactor hopp solver #305

Merged
merged 15 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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