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

Implement OffsetTransformer as another generator model #92

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from

Conversation

smartie2076
Copy link
Collaborator

@smartie2076 smartie2076 commented Jul 9, 2020

PR #90 must be merged first, in case that this branch is merged at all

This introduces the offsetTransformer from oemof solph, which required oemof to be updated to oemof-solph v4.0

Homer might be an interesting comparison: Generator model Homer

This is placed on hold due to more urgent issues.

Changes applied in this pull request:

  • Reorder variables in constants.py
  • Add new parameter GENSET_WITH_EFFICIENCY_CURVE to inputs
  • Create B.process_generator_settings to evaluate different generator settings
  • Refactor genset functions in G2a and G1 to make them explicit
  • Implement OffsetTransformer as G2a.genset_fix_capacity_efficiency_curve_and_minimal_loading. Note: Efficiency of the new OffSet Transformer with efficiency curve uses the GENSET_EFFICIENCY as maximum efficiency, and GENSET_EFFICIENCY/2 as minimal part-load efficiency
  • Add benchmark test for generator with efficiency curve (OffsetTransformer), only termination-check
  • Retrieve CONSUMPTION_FUEL_TIMESERIES_KWH from simulation results and store to csv
  • Calculate generator efficiency (EFFICIENCY_GENSET_TIMESERIES), store to csv
  • Generate and store a graph of the efficiency curve if GENSET_WITH_EFFICIENCY_CURVE==True

@smartie2076 smartie2076 marked this pull request as draft July 9, 2020 10:29
@smartie2076 smartie2076 changed the title [On hold] Dirty fork genset fix offset Implement OffsetTransformer as another generator model Apr 8, 2021
@smartie2076
Copy link
Collaborator Author

CONSUMPTION_FUEL_TIMESERIES_KWH and EFFICIENCY_GENSET_TIMESERIES in csv output file

(Set `save_to_csv_flows_electricity_mg == True)

image

Example generator efficiency curve with OffsetTransformer / GENSET_EFFICIENCY_CURVE==True:

(Set save_to_png_flows_electricity_mg==True)
(Note: For GENSET_EFFICIENCY_CURVE==False this plot would be a straight line, so it is not displayed.)

image

@smartie2076
Copy link
Collaborator Author

@tobirieper this is the PR that includes the new OffsetGenerator feature.

@smartie2076
Copy link
Collaborator Author

It is not possible to activate a generator with efficiency curve which does not have minimal loading. The simulation runs though, but the efficiency curve is not applied. This needs to be checked, a test written, and fixed.

smartie2076 and others added 14 commits May 4, 2021 16:21
- Change `tests/test_basic.py`:
    - Remove pytests for black, as they do not work
    - Update `test_execution_not_terminated`
- Update `tests/inputs/pytest_test.xlsx`
… settings

- Add `GENSET_WITH_EFFICIENCY_CURVE` to `constants.py`
- Process new parameter `GENSET_WITH_EFFICIENCY_CURVE` from excel input
in `B` with new function `B.process_generator_settings`: Check possible
and impossible combinations of input settings and turn warnings or error
messages if invalid combination of `GENSET_WITH_MINIMAL_LOADING`,
`GENSET_WITH_MINIMAL_LOADING` or `GENSET_WITH_MINIMAL_LOADING` is
chosen.
- Added pytest for the new function `B.process_generator_settings`
- Refactor `G2a.genset_fix` to
`G2a.genset_fix_capacity_fix_efficiency_no_minload`
- Refactor `G2a.genset_fix_minload` to
`G2a.genset_fix_capacity_fix_efficiency_with_minload`
- Refactor `G2a.genset_oem` to
`G2a.genset_oem_fix_efficiency_no_minload`
To ease pytests in the future, add global constants:
`LOG_MESSAGE_GENSET_FIX_CAPACITY_FIX_EFFICIENCY_NO_MINLOAD`,
`LOG_MESSAGE_GENSET_FIX_CAPACITY_FIX_EFFICIENCY_WITH_MINLOAD`,
`LOG_MESSAGE_GENSET_OEM_FIX_EFFICIENCY_NO_MINLOAD`
…del building

- Change `F.update_dict` so that new parameter
`GENSET_WITH_EFFICIENCY_CURVE` is parsed
- Expand elif-statements in `G1` to choose appropriate generator model
- Add new option of OffsetTransformer
(`G2a.genset_fix_capacity_efficiency_curve_and_minimal_loading`)
- Note: Efficiency of the new OffSet Transformer with efficiency curve
uses the `GENSET_EFFICIENCY` as maximum efficiency, and
`GENSET_EFFICIENCY/2` as minimal part-load efficiency
…rmer)

- Add folder `tests/benchmark_tests` and
`tests/benchmark_tests/timeseries/test_site.csv` to serve future tests
- Add input file
`tests/benchmark_tests/generator_with_efficiency_curve.xlsx` including a
base case with optimization of the diesel generator and a follow-up case
which uses that capacities to simulate a diesel generator with
efficiency with the same capacities at the same location. Test only
ensures that no termination takes place, but does not test anything
else.
- Add `CONSUMPTION_FUEL_TIMESERIES_KWH` to `constants.py`
- Change `G3.get_fuel()` to also store the
`CONSUMPTION_FUEL_TIMESERIES_KWH` to `e_flows_df`
- Ensure that `CONSUMPTION_FUEL_TIMESERIES_KWH` is stored into the
`electricity_mg`-csv output, but not in the plot
- Add `EFFICIENCY_GENSET_TIMESERIES` to `constants.py
- Create function `G3.get_efficiency_genset` to calculate the effective
generator efficiency. In case that multiple generators are present, it
represents the average efficiency, as it is based on the aggregated
generator dispatch.
- Store timeseries to `electricity-mg`-csv but exclude from energy
dispatch plot
- If `GENSET_WITH_EFFICIENCY_CURVE==True` store additionally a plot of
the generator efficiency curve over the installed capacity. This curve
is only exact if a single generator is used!
@smartie2076 smartie2076 force-pushed the dirty_fork_genset_fix_offset branch from 4aa9230 to 47c6714 Compare May 4, 2021 14:35
@smartie2076
Copy link
Collaborator Author

Fixed the fuel price issue and rebased. @tobirieper this now also features the operational hours of the diesel generator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants