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/add stratified tes #148

Merged
merged 109 commits into from
Feb 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
50ad59a
Add thermal energy storage to energyStorage.csv
MaGering Nov 18, 2020
30fff49
Add storage_02.csv
MaGering Nov 18, 2020
237e897
Set efficiencies to 1 for now in storage_02.csv
MaGering Nov 18, 2020
bba35fe
Add calculations of stratified thermal storage
MaGering Nov 20, 2020
b796852
Add input parameter of stratified thermal storage from oemof.thermal …
MaGering Nov 20, 2020
43be41e
Add stratified thermal storage to main.py
MaGering Nov 25, 2020
15e7d85
Correct minor flaws in startified_thermal_storage.py
MaGering Nov 25, 2020
40e75ab
Remove nominal_storage_capacity from time dependent values
MaGering Nov 25, 2020
64e210d
Merge branch 'dev' into feature/add_stratified_TES
MaGering Nov 25, 2020
1920bc2
Merge branch 'dev' into feature/add_stratified_TES
MaGering Nov 25, 2020
ca75fc1
Adjust input values in storage_02.csv
MaGering Nov 26, 2020
15a54ce
Add input parameter to template
MaGering Nov 26, 2020
528f686
Revert accidentally pushed changes in main
MaGering Dec 3, 2020
3f8fb3a
Add function for writing parameters of TES in storage_xx.csv to check…
MaGering Dec 7, 2020
89a43cf
Fix formatting of storage_02.csv template
MaGering Dec 7, 2020
80d4e30
Update storage_02 parameters
MaGering Dec 7, 2020
1064d2d
Update time dependent value handling
MaGering Dec 7, 2020
7457768
Clean up code
MaGering Dec 7, 2020
bbf62af
Include function of writing calculated values to storage_xx.csv
MaGering Dec 7, 2020
736ca3d
Update input data of small-scale stratified thermal storage
MaGering Dec 7, 2020
902f025
Clean up code documentation
MaGering Dec 7, 2020
f931a2b
Fix csv naming error
MaGering Dec 7, 2020
aa2c4b6
Add tests of stratified thermal storage component
MaGering Dec 7, 2020
12dbbe9
Add test data of stratified thermal storage
MaGering Dec 7, 2020
d3bf481
Apply black
MaGering Dec 7, 2020
80ecf86
Apply black on main
MaGering Dec 7, 2020
6403e54
Revert accidentally pushed changes in main
MaGering Dec 9, 2020
a78f331
Merge branch 'dev' into feature/add_stratified_TES
MaGering Dec 9, 2020
c97aa1f
Change names of heat and electricity busses
MaGering Dec 9, 2020
000849a
Update storage_02.csv structure after latest release
MaGering Dec 9, 2020
a2b011a
Update efficiency parameter to latest release
MaGering Dec 9, 2020
b03bb4e
Move precalculation in add_strat_tes function so that they are done i…
MaGering Dec 9, 2020
97b08c4
Separate writing of time dependet values from precalculations
MaGering Dec 9, 2020
47fc77c
Clean up script and adjust to recent changes
MaGering Dec 9, 2020
4a6ace3
Apply black
MaGering Dec 9, 2020
ee93b2a
Fix naming flaw of time dependent values
MaGering Dec 9, 2020
d302213
Extend tests
MaGering Dec 9, 2020
32fdd42
Clean up test storage csv files
MaGering Dec 9, 2020
2fa48b2
Apply black
MaGering Dec 9, 2020
990012c
Apply black
MaGering Dec 9, 2020
4943c49
Include the word 'thermal' in the name of relative and absolute losses
MaGering Dec 10, 2020
dcb9468
Apply black
MaGering Dec 10, 2020
e747c5f
Change parameter name of losses to more end user friendly names
MaGering Dec 11, 2020
80783d7
Correct header of fixed_thermal_losses_absolute in storage_02.csv
MaGering Dec 16, 2020
0ce8f62
Merge branch 'dev' into feature/add_stratified_TES
MaGering Dec 16, 2020
526ea08
Merge branch 'dev' into feature/add_stratified_TES
MaGering Dec 21, 2020
48933ff
Merge branch 'dev' into feature/add_stratified_TES
Piranias Dec 22, 2020
758e3bf
Merge branch 'dev' into feature/add_stratified_TES
MaGering Dec 27, 2020
9376cb9
Remove warning if heat demand seems not to be in energyConsumption.csv
MaGering Dec 27, 2020
b1a58b9
Add temp_high to add on in filename of fixed losses
MaGering Jan 4, 2021
2ed3857
Merge branch 'dev' into feature/add_stratified_TES
MaGering Jan 4, 2021
4206a69
Update tests of stratified thermal storage to new file name
MaGering Jan 4, 2021
f56dc97
Apply black
MaGering Jan 4, 2021
2a08feb
Update requirements.txt
MaGering Jan 12, 2021
8990c87
Merge dev into feature/add_stratified_TES
MaGering Jan 12, 2021
82638ea
Update stratified_thermal_storage.add_strat_tes function input parame…
MaGering Jan 12, 2021
d4e91a0
Apply black
MaGering Jan 12, 2021
26ad901
Merge branch 'feature/add_stratified_TES' of https://github.com/greco…
MaGering Jan 12, 2021
917fa23
Merge branch 'dev' into feature/add_stratified_TES
SabineHaas Jan 14, 2021
487ef62
Merge branch 'dev' into feature/add_stratified_TES
MaGering Jan 16, 2021
d5faf67
Apply suggestions from code review
MaGering Jan 20, 2021
a62d231
Merge branch 'dev' into feature/add_stratified_TES
MaGering Jan 21, 2021
b681f36
Adapt check if stratified thermal storage exists in specified system …
MaGering Jan 21, 2021
fc8e83c
Build check if efficiency and nominal storage capacity are already se…
MaGering Jan 21, 2021
2e71dc8
Write tests of add_parameters_to_storage_xx_file(...) function in tes…
MaGering Jan 21, 2021
1b93813
Remove storage_csv as input value of add_strat_tes(...) and read it f…
MaGering Jan 21, 2021
6bd4045
Clean up code
MaGering Jan 21, 2021
84dd924
Fix test of main
MaGering Jan 22, 2021
3f51ba7
Rework and update mvs input data of tests in test/data/user_inputs/mv…
MaGering Jan 26, 2021
002bfce
Shorten wheather input data in tests/data/static_inputs
MaGering Jan 26, 2021
3d1c25a
Update storage_xx_file in test_check_inputs.py to reworked input data
MaGering Jan 26, 2021
5b10215
Update test_heat_pump_and_chiller.py to reworked input data
MaGering Jan 26, 2021
387b400
Update test_stratified_thermal_storage.py to reworked input data
MaGering Jan 26, 2021
7166e2d
Add test of two different ways of implementing a stratified thermal s…
MaGering Jan 26, 2021
6083edf
Apply black on stratified_thermal_storage.py
MaGering Jan 26, 2021
9230867
Add due to gitignore lost file energyBusses.csv to mvs test input data
MaGering Jan 26, 2021
c921ab4
Set EXECUTE_TEST_ON to skipping mode in test_stratified_thermal_stora…
MaGering Jan 26, 2021
9055723
Merge branch 'dev' into feature/add_stratified_TES
MaGering Jan 26, 2021
dead5ed
Replace value of installedCap in storage_*.csv with 0 if it is NaN
MaGering Jan 28, 2021
88c0e06
Merge branch 'feature/add_stratified_TES' of https://github.com/greco…
MaGering Jan 28, 2021
381e5b5
Correct wrong values in user inputs collection's storage_02.csv
MaGering Jan 28, 2021
05161fc
Update docs/parameters.rst with stratified thermal storage specific p…
MaGering Jan 28, 2021
5b1c674
Merge branch 'dev' into feature/add_stratified_TES
SabineHaas Feb 5, 2021
6a2e745
Add stratified_thermal_storage.csv to user inputs collection
MaGering Feb 8, 2021
cbfa652
Fix SOC values of stratified TES in docs/parameters.rst
MaGering Feb 8, 2021
6e8d093
Apply precalculations and check if time series exist only if stratifi…
MaGering Feb 8, 2021
4b32297
Update pvcompare/check_inputs.py
MaGering Feb 8, 2021
46ad9e2
Apply black
MaGering Feb 8, 2021
5a612eb
Merge branch 'feature/add_stratified_TES' of https://github.com/greco…
MaGering Feb 8, 2021
52f78b1
Adapt temperatures of heat pump and TES in test data
MaGering Feb 8, 2021
f84e0b9
Add missing TES data to test user inputs collection
MaGering Feb 8, 2021
3cd3bfb
Fix tests of heat pump and TES due to temperature adaptations
MaGering Feb 8, 2021
4db5cd8
Adapt TES temperature in pvcompare inputs
MaGering Feb 8, 2021
633ac00
Write a check for matching temperatures of TES and heat pump
MaGering Feb 8, 2021
28b9460
Write tests for new feature of matching temperatures of TES and heat …
MaGering Feb 8, 2021
111db68
Merge branch 'dev' into feature/add_stratified_TES
SabineHaas Feb 8, 2021
3c1f1d5
Merge pull request #226 from greco-project/feature/restiction_TES_temp
MaGering Feb 10, 2021
754ec1c
Merge branch 'dev' into feature/add_stratified_TES
MaGering Feb 11, 2021
46edf00
Merge branch 'dev' into feature/add_stratified_TES
MaGering Feb 11, 2021
0195ba7
Apply suggestions from review on test_stratified_thermal_storage.py
MaGering Feb 11, 2021
f8651c9
Fix test_heat_pump_and_chiller.py
MaGering Feb 11, 2021
318b232
Fix name of function in test_stratified_thermal_storage.py
MaGering Feb 11, 2021
2071598
Apply review suggestion on docs/parameters.rst
MaGering Feb 15, 2021
7b4985a
Update pvcompare/stratified_thermal_storage.py
MaGering Feb 15, 2021
faf87db
Clean up docstrings in stratified_thermal_storage.py
MaGering Feb 15, 2021
2c138ba
Fix test_add_sector_coupling_strat_tes_file_already_exists
MaGering Feb 15, 2021
cfabcb7
Merge branch 'feature/add_stratified_TES' of https://github.com/greco…
MaGering Feb 15, 2021
6830dad
Merge branch 'dev' into feature/add_stratified_TES
MaGering Feb 15, 2021
a86f1db
Adapt stratified TES tests to recent changes on dev
MaGering Feb 15, 2021
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
54 changes: 54 additions & 0 deletions docs/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,60 @@ Some parameters can be calculated automatically by *pvcompare* and do not need t

b. **input power** and **output power**: kW

* storage_02.csv:
1. **age_installed**: year, 0 (for all components of the stratified thermal storage)
2. **development_costs**: currency, 0 (for all components of the stratified thermal storage)
3. **specific_costs**: currency/unit
a. **storage capacity**: 410, See `Danish energy agency's technology data of small-scale hot water tanks [dea_swt] <https://ens.dk/sites/ens.dk/files/Analyser/technology_data_catalogue_for_energy_storage.pdf>`_ on p.66 - However investment costs of stratified TES could be higher.
b. **input power** and **output power**: 0
4. **c_rate**: factor of total capacity (kWh)
a. **storage capacity**: NA (does not apply)
b. **input power** and **output power**: 1 (this just means that the whole capacity of the stratified thermal storage would be used during charging and discharging cycles)
SabineHaas marked this conversation as resolved.
Show resolved Hide resolved
5. **efficiency**: factor
a. **storage capacity**: 1, or "NA" if calculated
b. **input power** and **output power**: 1
6. **installedCap**: unit 0, or "NA" if calculated
a. **storage capacity**: 0, or "NA" if calculated
b. **input power** and **output power**: 0
7. **lifetime**: year, 30 (applies for all the parameters of the stratified thermal energy storage)
8. **specific_costs_om**: currency/unit/year
a. **storage capacity**: 16.67, [dea_swt] p.66 - however fix om costs of stratified TES could differ
b. **input power** and **output power**: 0
9. **dispatch_price**: currency/kWh
a. **storage capacity**: NA (does not apply)
b. **input power** and **output power**: 0
10. **soc_initial**: None or factor

a. **storage capacity**: None

b. **input power** and **output power**: NA
11. **soc_max**: factor

a. **storage capacity**: 0.925 (7.5% unused volume see `European Commission study large-scale heating and cooling in EU [EUC_heat] <https://op.europa.eu/en/publication-detail/-/publication/312f0f62-dfbd-11e7-9749-01aa75ed71a1/language-en>`_ p.168 - This applies for large scale TES but could be validated for a small scale storage too.)

b. **input power** and **output power**: NA
12. **soc_min**: factor

a. **storage capacity**: 0.075 (7.5% unused volume see [EUC_heat] p.168 - This applies for large scale TES but could be validated for a small scale storage too.)

MaGering marked this conversation as resolved.
Show resolved Hide resolved
b. **input power** and **output power**: NA
13. **unit**: str

a. **storage capacity**: kWh

b. **input power** and **output power**: kW
14. **fixed_thermal_losses_relative**: factor

a. **storage capacity**: "{'file_name': 'None', 'header': 'no_unit', 'unit': ''}", is calculated in pvcompare

b. **input power** and **output power**: NA (does not apply)
15. **fixed_thermal_losses_absolute**: kWh

a. **storage capacity**: "{'file_name': 'None', 'header': 'no_unit', 'unit': ''}", is calculated in pvcompare

b. **input power** and **output power**: NA (does not apply)



2. pvcompare-specific parameters
================================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
,unit
label,str
optimizeCap,bool
outflow_direction,str
inflow_direction,str
storage_filename,str
energyVector,str
type_oemof,str
,unit,storage_02
label,str,TES
optimizeCap,bool,True
outflow_direction,str,Heat bus
inflow_direction,str,Heat bus
storage_filename,str,storage_02.csv
energyVector,str,Heat
type_oemof,str,storage
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
,unit,storage capacity,input power,output power
unit,str,kWh,kW,kW
installedCap,kWh,NaN,0,0
age_installed,year,0,0,0
lifetime,year,30,30,30
development_costs,currency,0.0,0.0,0.0
specific_costs,currency/kWh,410,0,0
specific_costs_om,currency/kWh/year,16.67,0,0
dispatch_price,currency/kWh,NaN,0,0
c_rate,factor of total capacity (kWh),NaN,1,1
soc_initial,None or factor,None,NaN,NaN
soc_max,factor,0.925,NaN,NaN
soc_min,factor,0.075,NaN,NaN
efficiency,factor,NaN,1,1
fixed_thermal_losses_relative,factor,"{'file_name': 'None', 'header': 'no_unit', 'unit': ''}",,
fixed_thermal_losses_absolute,kWh,"{'file_name': 'None', 'header': 'kWh', 'unit': ''}",,
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var_name,var_value,var_unit
height,,m
diameter,0.99,m
temp_h,60,degC
temp_c,35,degC
s_iso,100,mm
lamb_iso,0.03,W/(m*K)
alpha_inside,10,W/(m2*K)
alpha_outside,2.31,W/(m2*K)
55 changes: 55 additions & 0 deletions pvcompare/check_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,3 +611,58 @@ def load_parameter_from_mvs_file(
f"mvs input file {mvs_filename}."
)
return pvcompare_parameter


def add_parameters_to_storage_xx_file(
nominal_storage_capacity, loss_rate, storage_csv, user_inputs_mvs_directory=None
):

"""
Enters new parameters into storage_xx.csv

Parameters
---------
nominal_storage_capacity : numeric
Maximum amount of stored thermal energy [MWh]

loss_rate : numeric (sequence or scalar)
The relative loss of the storage capacity between two consecutive
timesteps [-]

storage_csv: str
Name of the storage specific file

mvs_input_directory : str
directory to "mvs_inputs/"

Returns
-------
None
"""

if user_inputs_mvs_directory == None:
user_inputs_mvs_directory = constants.DEFAULT_USER_INPUTS_MVS_DIRECTORY

# Read storage_xx.csv from input value
storage_xx_path = os.path.join(
user_inputs_mvs_directory, "csv_elements", storage_csv
)
storage_xx = pd.read_csv(storage_xx_path, header=0, index_col=0,)

parameters = {"installedCap": nominal_storage_capacity, "efficiency": 1 - loss_rate}

for name, param in parameters.items():
# Check if efficiency and nominal storage capacity already exist and if not
# replace with calculated value from loss_rate
try:
int(float(storage_xx.at[name, "storage capacity"]))
logging.info(
f"The {name} of the storage already exists in {storage_csv}. If you want to calculate the storage's {name} with pvcompare please delete the value in {storage_csv}."
)
except ValueError:
# insert parameter values
storage_xx.loc[[name], ["storage capacity"]] = param
logging.info(f"The {name} of the storage has been added to {storage_csv}.")

# Save values in storage_xx.csv
storage_xx.to_csv(storage_xx_path)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
,unit,storage capacity,input power,output power
unit,str,kWh,kW,kW
installedCap,kWh,NaN,0,0
age_installed,year,0,0,0
lifetime,year,30,30,30
development_costs,currency,0.0,0.0,0.0
specific_costs,currency/kWh,410,0,0
specific_costs_om,currency/kWh/year,16.67,0,0
dispatch_price,currency/kWh,NaN,0,0
c_rate,factor of total capacity (kWh),NaN,1,1
efficiency,factor,1,1,1
soc_initial,None or factor,None,NaN,NaN
soc_max,factor,0.925,NaN,NaN
soc_min,factor,0.075,NaN,NaN
fixed_thermal_losses_relative,factor,"{'file_name': 'None', 'header': 'no_unit', 'unit': ''}",,
fixed_thermal_losses_absolute,kWh,"{'file_name': 'None', 'header': 'no_unit', 'unit': ''}",,
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var_name,var_value,var_unit
height,,m
diameter,0.99,m
temp_h,95,degC
temp_c,60,degC
s_iso,100,mm
lamb_iso,0.03,W/(m*K)
alpha_inside,10,W/(m2*K)
alpha_outside,2.31,W/(m2*K)
9 changes: 9 additions & 0 deletions pvcompare/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pvcompare import pv_feedin
from pvcompare import constants
from pvcompare import heat_pump_and_chiller
from pvcompare import stratified_thermal_storage
from pvcompare import check_inputs


Expand Down Expand Up @@ -179,6 +180,14 @@ def apply_pvcompare(
weather=weather,
)

stratified_thermal_storage.add_strat_tes(
weather=weather,
lat=latitude,
lon=longitude,
user_inputs_pvcompare_directory=user_inputs_pvcompare_directory,
user_inputs_mvs_directory=user_inputs_mvs_directory,
)


def apply_mvs(
scenario_name,
Expand Down
Loading