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

Feature/routine for decomissioning of exisiting capacity #78

Merged
merged 30 commits into from
Jun 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
47a629e
Structure for steelcast test case
FelixMau Mar 5, 2024
192cb71
Merge Dev
FelixMau Mar 5, 2024
f51db2d
start test writing
FelixMau Mar 6, 2024
b832178
Adapt strukture and Mappings for steel
FelixMau Mar 13, 2024
4da45c7
Merge branch 'feature/add_mimo_adapter' into feature/routine-for-deco…
FelixMau Mar 15, 2024
4cc72fd
Add decomissioning to adapters & calculations
FelixMau Mar 15, 2024
32cf342
Linting
FelixMau Mar 15, 2024
82c57e0
Warn and return single capacity
FelixMau Mar 15, 2024
89ac703
Calc max value from capacity
FelixMau Apr 3, 2024
4e28f88
Commenting & Linting
FelixMau Apr 3, 2024
97a7ad0
Adding empty helper
FelixMau Apr 10, 2024
39192f5
Commenting & Linting
FelixMau Apr 10, 2024
c8b1f35
Loggin info if `max` already set
FelixMau Apr 11, 2024
cf958cb
Loggin info if `max` already set
FelixMau Apr 11, 2024
9583a68
Adding comment
FelixMau Apr 15, 2024
4cbeb22
Seperating calculation functionality
FelixMau Apr 15, 2024
0ee4eca
seperating functions for better overview
FelixMau Apr 16, 2024
1e3d412
Merge branch 'dev' into feature/routine-for-decomissioning-of-existin…
FelixMau Apr 16, 2024
6132c83
Move post mappinig calculations to calculations
FelixMau Apr 16, 2024
8c0c690
Commenting & Linting
FelixMau Apr 16, 2024
4cee6ff
Idea pitch to add in flow parameters
FelixMau Apr 16, 2024
e32c109
Rearranging functions
FelixMau Apr 17, 2024
d96d6f6
Revisting decomissioning
FelixMau Apr 17, 2024
2901bb9
Test fail due to empty parameter dicts
FelixMau Apr 17, 2024
3451937
Update oemof.industry
FelixMau Apr 24, 2024
78600e5
Update oemof.industry
FelixMau Apr 24, 2024
03fbefc
Adjust extra fields for mimo
FelixMau Apr 24, 2024
60c135f
Remove outputparameters in Mimo
FelixMau May 6, 2024
acdb9e9
Update dependencies
FelixMau May 6, 2024
d9e872d
Update documentation & Logging
FelixMau May 23, 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
Prev Previous commit
Next Next commit
Add decomissioning to adapters & calculations
FelixMau committed Mar 15, 2024
commit 4cc72fdd799ee2793a81e50a9e7344a329606f20
3 changes: 2 additions & 1 deletion data_adapter_oemof/adapters.py
Original file line number Diff line number Diff line change
@@ -74,7 +74,8 @@ def get_default_parameters(self) -> dict:
)
}
)

if self.process_name[-1] == "0":
defaults = calculations.decommission(defaults)
return defaults

def get_fields(self) -> list[Field]:
34 changes: 34 additions & 0 deletions data_adapter_oemof/calculations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from oemof.tools.economics import annuity
import numpy as np


class CalculationError(Exception):
@@ -34,3 +35,36 @@ def get_name(*args, counter=None):
@calculation
def get_capacity_cost(overnight_cost, fixed_cost, lifetime, wacc):
return annuity(overnight_cost, lifetime, wacc) + fixed_cost


def decommission(facade_adapter) -> dict:
"""
Non investment objects must be decomisioned in multi period to take end of lifetime
for said objet into account
Returns
-------
"""
capacity_column = "capacity"
max_column = "max"

if capacity_column not in facade_adapter.keys():
raise AttributeError("Capacity missing for decommissioning")

if max_column in facade_adapter.keys():
if facade_adapter[capacity_column] == facade_adapter[max_column]:
pass
else:
pass
# do something to recalculate max values
# FIXME: waiting for implementation of non-oemof value calculation
else:
# FIXME: Does `max`/`full_load_time_max`
facade_adapter[max_column] = facade_adapter[capacity_column]

max_capacity = np.max(facade_adapter[capacity_column])
facade_adapter[capacity_column] = [max_capacity for i in facade_adapter[capacity_column]]
return facade_adapter

# divide each capacity by max capacity and insert fraction as max value

28 changes: 13 additions & 15 deletions tests/test_build_datapackage.py
Original file line number Diff line number Diff line change
@@ -213,6 +213,7 @@ def test_tsam():
)
check_if_csv_dirs_equal(tsam_folder, os.path.join(tsam_folder, "..", "tsam_goal"))


def test_decomissioning():
"""
Tests Decomissioning with ind_steel_cast example
@@ -228,37 +229,34 @@ def test_decomissioning():
"SEDOS_Modellstruktur",
process_sheet="process_set_steel_casting",
parameter_sheet="parameter_input_output_steel_ca",
helper_sheet="steel_casting_helper"
helper_sheet="steel_casting_helper",
)

adapter = Adapter(
"steel_industry_test",
structure=structure,

)
adapter.get_process("ind_steel_casting_0")
process_adapter_map = {
'x2x_import_elec': 'CommodityAdapter',
'x2x_import_h2': 'CommodityAdapter',
'x2x_import_natural_gas': 'CommodityAdapter',
'ind_steel_casting_0': 'DispatchableAdapter',
'ind_steel_casting_1': 'DispatchableAdapter',
'ind_steel_hyddri_1': 'DispatchableAdapter',
'ind_steel_boiler_0': 'DispatchableAdapter',
'ind_exo_steel_demand': 'LoadAdapter',
'excess_co2': 'ExcessAdapter',
'excess_ch4': 'ExcessAdapter',
'excess_no2': 'ExcessAdapter'
"x2x_import_elec": "CommodityAdapter",
"x2x_import_h2": "CommodityAdapter",
"x2x_import_natural_gas": "CommodityAdapter",
"ind_steel_casting_0": "DispatchableAdapter",
"ind_steel_casting_1": "DispatchableAdapter",
"ind_steel_hyddri_1": "DispatchableAdapter",
"ind_steel_boiler_0": "DispatchableAdapter",
"ind_exo_steel_demand": "LoadAdapter",
"excess_co2": "ExcessAdapter",
"excess_ch4": "ExcessAdapter",
"excess_no2": "ExcessAdapter",
}

parameter_map = {
"DEFAULT": {
"": "",

},
"StorageAdapter": {
"": "",

},
"CommodityAdapter": {
"": "",