From eaf9b2c2c82c06d29ba3a63e636713d962c39764 Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Thu, 3 Dec 2020 17:31:53 +0100 Subject: [PATCH 01/39] Updates input file list --- docs/simulating_with_the_mvs.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/simulating_with_the_mvs.rst b/docs/simulating_with_the_mvs.rst index b9e782bce..bc100b3ce 100644 --- a/docs/simulating_with_the_mvs.rst +++ b/docs/simulating_with_the_mvs.rst @@ -36,6 +36,7 @@ that works just like above described "mvs_config.json". For that, each of the following files have to be present in the folder "csv_elements": - `economic_data.csv `_ - Major economic parameters of the project +- `energyBusses.csv `_ - Energy busses of the energy system to be simulated - `energyConsumption.csv `_ - Energy demands and paths to their time series as csv - `energyConversion.csv `_ - Conversion/transformer objects, eg. transformers, generators, heat pumps - `energyProduction.csv `_ - Act as energy "sources", ie. PV or wind plants, with paths to their generation time series as csv From 00e11b5fcf0f098f1f45983a4953968b576aeb80 Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Wed, 9 Dec 2020 12:34:58 +0100 Subject: [PATCH 02/39] Update with CO2 emission factors --- docs/Model_Assumptions.rst | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/Model_Assumptions.rst b/docs/Model_Assumptions.rst index f4d29de7b..457523ee5 100644 --- a/docs/Model_Assumptions.rst +++ b/docs/Model_Assumptions.rst @@ -287,6 +287,54 @@ For example, the `degree of sector coupling` will reach its maximum, when the sy In the MVS, there is no distinction between energy carriers and energy vector. For `Electricity` of the `Electricity` vector this may be self-explanatory. However, the energy carriers of the `Heat` vector can have different technical characteristics: A fluid on different temperature levels. As the MVS measures the energy content of a flow in kWh(thermal) however, this distinction is only relevant for the end user to be aware of, as two assets that have different energy carriers as an output should not be connected to one and the same bus if a detailed analysis is expected. An example of this would be, that a system where the output of the diesel boiler as well as the output of a solar thermal panel are connected to the same bus, eventhough they can not both supply the same kind of heat demands (radiator vs. floor heating). This, however, is something that the end-user has to be aware of themselves, eg. by defining self-explanatory labels. +CO2 Emission factors +---------------------------- +In order to optimise the energy system with minimum CO2 emissions, it is important to calculate CO2 emission per unit electricity generation. + +Following emission factors for energy carriers are defined: + +.. _table_CO2_emissions_energyCarriers: + +.. list-table:: CO2 Emission factors: grams of CO2 equivalent per kWh of electricity generation + :widths: 50 25 + :header-rows: 1 + + * - Energy carrier + - Value + * - Diesel + - 650 + * - Biogas + - 85 + * - Biomass + - 230 + * - Natural gas + - 490 + +The values mentioned in the following table account for emissions during the complete life cycle. This includes emissions during energy production, energy conversion, energy storage and energy transmission. These values always fluctuate and depend on various factors such as energy mix, weather conditions, and demand fluctuations. + +CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, India): + +.. _table_CO2_emissions_countries: + +.. list-table:: CO2 Emission factors: grams of CO2 equivalent per kWh of electricity consumption + :widths: 50 25 + :header-rows: 1 + + * - Country + - Value + * - Germany + - 518 + * - Norway + - 25 + * - Spain + - 174 + * - Romania + - 291 + * - India (Delhi) + - 476 + +Despite the comparatively higher capacity of solar PV and wind energy generation potential in Germany, the CO2 emission is high during winter because of the lower solar irradiation available. Moreover, the thermal energy demand is higher during winter which is largely fulfilled using coal as a primary energy source. + Limitations ----------- From 153836111efc560201ef7e67c0fa60c9e232866e Mon Sep 17 00:00:00 2001 From: Bachibouzouk Date: Tue, 20 Oct 2020 14:53:33 +0200 Subject: [PATCH 03/39] Take transpose of expected results to make it tidy data --- .../test_data_economic_expected_values.csv | 33 ++++-------------- .../test_data_economic_expected_values.xls | Bin 13312 -> 6518 bytes 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/tests/benchmark_test_inputs/Economic_KPI_C2_E2/test_data_economic_expected_values.csv b/tests/benchmark_test_inputs/Economic_KPI_C2_E2/test_data_economic_expected_values.csv index d83afbb19..3e8b9887b 100644 --- a/tests/benchmark_test_inputs/Economic_KPI_C2_E2/test_data_economic_expected_values.csv +++ b/tests/benchmark_test_inputs/Economic_KPI_C2_E2/test_data_economic_expected_values.csv @@ -1,27 +1,6 @@ -,diesel_generator,pv_plant_01,storage capacity,input power,output power -group,energyConversion,energyProduction,energyStorage,energyStorage,energyStorage -age_installed,0.0,0.0,0.0,0.0,0.0 -development_costs,0.0,2.0,0.0,0.0,0.0 -specific_costs,100.0,500.0,500.0,200.0,300.0 -installedCap,1.0,1.0,1.0,1.0,1.0 -specific_costs_om,5.0,5.0,5.0,0.0,0.0 -dispatch_price,0.0,0.01,0.0,0.0,0.0 -lifetime,30.0,20.0,10.0,10.0,10.0 -lifetime_specific_cost_om,49.090737037246505,49.090737037246505,49.090737037246505,0.0,0.0 -lifetime_price_dispatch,0.0,0.09818147407449301,0.0,0.0,0.0 -lifetime_specific_cost,92.84839308653143,500.0,731.596744042342,292.638697616937,438.958046425405 -annuity_of_specific_investment_costs_and_specific_annual_om,14.4568139215434,55.926104411575295,79.5147443485377,29.8058977394151,44.7088466091226 -simulation_annuity,14.4568139215434,55.926104411575295,79.5147443485377,29.8058977394151,44.7088466091226 -Specific_replacement_costs_of_installed_capacity,-7.15160691346856,0.0,231.59674404234198,92.6386976169368,138.958046425405 -Specific_replacement_costs_of_optimized_capacity,-7.15160691346856,0.0,231.59674404234198,92.6386976169368,138.958046425405 -optimizedAddCap,0.0,0.0,0.0,0.0,0.0 -annuity_om,5.0000000000000036,16.637940000000054,5.0000000000000036,0.0,0.0 -annuity_total,4.271593039228317,16.841644417646357,28.58863993696238,9.435455974784949,14.153183962177405 -costs_total,41.93913012377794,165.35374747629743,280.6874810795885,92.6386976169368,138.958046425405 -costs_om_total,49.090737037246505,163.35374747629743,49.090737037246505,0.0,0.0 -costs_cost_om,49.090737037246505,49.090737037246505,49.090737037246505,0.0,0.0 -costs_dispatch,0.0,114.26301043905092,0.0,0.0,0.0 -costs_investment_over_lifetime,-7.15160691346856,2.0,231.59674404234198,92.6386976169368,138.958046425405 -costs_upfront_in_year_zero,0.0,2.0,0.0,0.0,0.0 -Replacement_costs_during_project_lifetime,-7.15160691346856,0.0,231.59674404234198,92.6386976169368,138.958046425405 -levelized_cost_of_energy_of_asset,0.00048762477616761605,0.014471327758732474,0.016317716858994358,0,0 +,group,age_installed,development_costs,specific_costs,installedCap,specific_costs_om,dispatch_price,lifetime,lifetime_specific_cost_om,lifetime_price_dispatch,lifetime_specific_cost,annuity_of_specific_investment_costs_and_specific_annual_om,simulation_annuity,Specific_replacement_costs_of_installed_capacity,Specific_replacement_costs_of_optimized_capacity,optimizedAddCap,annuity_om,annuity_total,costs_total,costs_om_total,costs_cost_om,costs_dispatch,costs_investment_over_lifetime,costs_upfront_in_year_zero,Replacement_costs_during_project_lifetime,levelized_cost_of_energy_of_asset +diesel_generator,energyConversion,0,0,100,1,5,0.0,30,49.090737037246505,0.0,92.84839308653143,14.4568139215434,14.4568139215434,-7.15160691346856,-7.15160691346856,0,5.000000000000004,4.271593039228317,41.939130123777936,49.090737037246505,49.090737037246505,0.0,-7.15160691346856,0,-7.15160691346856,0.0004876247761676161 +pv_plant_01,energyProduction,0,2,500,1,5,0.01,20,49.090737037246505,0.098181474074493,500.0,55.926104411575295,55.926104411575295,0.0,0.0,0,16.637940000000054,16.841644417646357,165.35374747629743,163.35374747629743,49.090737037246505,114.26301043905092,2.0,2,0.0,0.014471327758732475 +storage capacity,energyStorage,0,0,500,1,5,0.0,10,49.090737037246505,0.0,731.596744042342,79.5147443485377,79.5147443485377,231.59674404234198,231.59674404234198,0,5.000000000000004,28.58863993696238,280.6874810795885,49.090737037246505,49.090737037246505,0.0,231.59674404234198,0,231.59674404234198,0.016317716858994358 +input power,energyStorage,0,0,200,1,0,0.0,10,0.0,0.0,292.638697616937,29.8058977394151,29.8058977394151,92.6386976169368,92.6386976169368,0,0.0,9.435455974784947,92.6386976169368,0.0,0.0,0.0,92.6386976169368,0,92.6386976169368,0.0 +output power,energyStorage,0,0,300,1,0,0.0,10,0.0,0.0,438.958046425405,44.7088466091226,44.7088466091226,138.958046425405,138.958046425405,0,0.0,14.153183962177405,138.958046425405,0.0,0.0,0.0,138.958046425405,0,138.958046425405,0.0 diff --git a/tests/benchmark_test_inputs/Economic_KPI_C2_E2/test_data_economic_expected_values.xls b/tests/benchmark_test_inputs/Economic_KPI_C2_E2/test_data_economic_expected_values.xls index 745ccaac66cb8a7f1638f62a3230b1374f73bb25..0246756978991583fade2587e8f2ed529fb38fdb 100644 GIT binary patch literal 6518 zcmaKQ1yodP+cwS6UD72;j+6sPNk|RdFd#8BLk!&w(%m4P(j_S+QlqqlfRYDMIwbwT z^ZvgczwbTwUTeo%`+oMbue&cbB~&z0Bme+_*EYJcmx51)3zP>Fr892s4v|l_#xY)}jBaOSkhHgLx;U8~V<0+- zLxEPVK44})dF9;~WVHMyiqQsnSEHLGYD$=Zuq=VB-CGdep&%it{a2U>Z{M(RG*@$R zbb|AmIyv!pI@sqXsM_6P^=9vqwD&j*q@=|D#(A4kl&nQs$Q>uIx{2o|qB`Yx@%>`{ zH?K!xVh72`bM7srAZg`=j=0AWOcl-w^c z@}5Q_7LVI{B&ATweJ?aljZ}y9+=-{0z){b9f12h{D_%And>hRV++kF`57eNqP=@K9 z;e$V(q^3)pmBil=^TjvP*#l96_`NxO;`@#lP-@|q9CJKqMI}8sfR&wEK<#TzYeViT z?HR7q1@O^+8!WHKfKAaz_=FE-QS0>gM|U_)Y$}|7xkbSn`QLCN z`5h;7H@K^#!{1OLU?D)l&^5iNFfI46iJs|Mg%QYGQ(&3d1?c#lcgPY2l$@D z)5Z&TtAR~vRSO;Qm|3la`!tb!lcz<(y8G^r#|0AtbGJK&?`iiIqS$|7JNQzqN%xdY zo+U%A7kwf%2Hi`&9Y>)F?257D7NLH@-`EdSoH6j48DSU&1y~;58@K&(TKCY8lOvu3rj3c5dCk zjofxs?snUC-Fv`f#l?0;H~yh26z4P{_}Vynt*H2d`VJ>d_$;PHzCA|IUAUL9JO^R^Wf{~ z_NtcdGEvHA?2sC1=n!geR&X?*^de&NwRE147HN|$nngKkEcrQjgvB&A*lI>zEj;A( zW#V|~Fz&b5L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D)davw4e^=uzRW{mGf=CS-nWG+xeWS;X5 zBlCE3D>AqIcOkQ<-<=fQWbgrWb*5Z7kV)-!^7$dWVO5+objl#IJaummW$8WZNP}9M zg7<%TZhNWo=+CIqoKrLVsYCRsA3k;8YnF8%y9f4fc=5qqz!CxM24LK8uybbGL|)q1 z3`g^;=@sIEm-F|(8b5(GB+N}bT?{hFkgmh8kIQlp9~AjJO}vaSfXd zE9o8XB#t@Vt%*kqUmt=m2S+*1G+3-!NPI>8}Y_B+dosA*(vr f`U~{A>9hTxu%GLH#qIy)xXji6{@-8!r~Cg07lK|@ From bbf77b0dd1bac395002d9c6c2fdee73ad6bfcad3 Mon Sep 17 00:00:00 2001 From: Bachibouzouk Date: Tue, 20 Oct 2020 15:00:00 +0200 Subject: [PATCH 04/39] Simplify expected data retrieval now that data is tidy --- tests/test_benchmark_KPI.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 8032a23dd..f90274910 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -163,15 +163,6 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): sep=",", index_col=0, ) - # Define numbers in the csv as int/floats instead of str, but leave row "group" as a string - groups = expected_values.loc["group"] - # need to transpose the DataFrame before applying the conversion and retranspose after - # the conversion because it does not follow the tidy data principle - # see https://en.wikipedia.org/wiki/Tidy_data for more info - expected_values = expected_values.T.apply( - pd.to_numeric, errors="ignore", downcast="integer" - ).T - expected_values.loc["group"] = groups expected_values.loc[FLOW] = [0, 0, 0, 0, 0] KEYS_TO_BE_EVALUATED = [ From cacb1212275d8115df9341ea881c211e4eedb6d0 Mon Sep 17 00:00:00 2001 From: Bachibouzouk Date: Tue, 20 Oct 2020 15:00:26 +0200 Subject: [PATCH 05/39] Rename variable --- tests/test_benchmark_KPI.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index f90274910..e9fe5e00b 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -76,24 +76,24 @@ TEST_INPUT_PATH = os.path.join(TEST_REPO_PATH, "benchmark_test_inputs") TEST_OUTPUT_PATH = os.path.join(TEST_REPO_PATH, "benchmark_test_outputs") -dict_economic = { +DICT_ECONOMIC = { CURR: "Euro", DISCOUNTFACTOR: {VALUE: 0.08}, PROJECT_DURATION: {VALUE: 20}, } -dict_economic.update( +DICT_ECONOMIC.update( { ANNUITY_FACTOR: { VALUE: C2.annuity_factor( - project_life=dict_economic[PROJECT_DURATION][VALUE], - discount_factor=dict_economic[DISCOUNTFACTOR][VALUE], + project_life=DICT_ECONOMIC[PROJECT_DURATION][VALUE], + discount_factor=DICT_ECONOMIC[DISCOUNTFACTOR][VALUE], ) }, CRF: { VALUE: C2.crf( - project_life=dict_economic[PROJECT_DURATION][VALUE], - discount_factor=dict_economic[DISCOUNTFACTOR][VALUE], + project_life=DICT_ECONOMIC[PROJECT_DURATION][VALUE], + discount_factor=DICT_ECONOMIC[DISCOUNTFACTOR][VALUE], ) }, } From 3a63afddc9418c77f68ac03844f8275ce473dde6 Mon Sep 17 00:00:00 2001 From: Bachibouzouk Date: Wed, 21 Oct 2020 11:10:22 +0200 Subject: [PATCH 06/39] Refactor access to info in DataFrame --- tests/test_benchmark_KPI.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index e9fe5e00b..f295aad49 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -227,15 +227,18 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): ) # Check if asset costs were correctly calculated in C2 and E2 - for asset in expected_values.columns: + for asset in expected_values.index: + + asset_group = expected_values.loc[asset, "group"] + # determine asset dictionary (special for storages) if asset in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: - asset_data = data[expected_values[asset]["group"]]["storage_01"][asset] + asset_data = data[asset_group]["storage_01"][asset] else: - asset_data = data[expected_values[asset]["group"]][asset] + asset_data = data[asset_group][asset] # assertion for key in KEYS_TO_BE_EVALUATED: - assert expected_values[asset][key] == pytest.approx( + assert expected_values.loc[asset, key] == pytest.approx( asset_data[key][VALUE], rel=1e-3 ), f"Parameter {key} of asset {asset} is not of expected value." From a6b4853daf33759192e8761dcd6f6c8fd3b633aa Mon Sep 17 00:00:00 2001 From: Bachibouzouk Date: Wed, 21 Oct 2020 11:10:49 +0200 Subject: [PATCH 07/39] Comment potentially unused code --- tests/test_benchmark_KPI.py | 85 ++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index f295aad49..16603a09b 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -163,7 +163,7 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): sep=",", index_col=0, ) - expected_values.loc[FLOW] = [0, 0, 0, 0, 0] + KEYS_TO_BE_EVALUATED = [ LIFETIME_SPECIFIC_COST_OM, @@ -186,45 +186,50 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): LCOE_ASSET, ] - # Derive expected values dependent on actual dispatch of the asset(s) - for asset in expected_values.columns: - # determine asset dictionary (special for storages) - if asset in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: - asset_data = data[expected_values[asset]["group"]]["storage_01"][asset] - else: - asset_data = data[expected_values[asset]["group"]][asset] - # Get dispatch of the assets - expected_values[asset][FLOW] = asset_data[FLOW] - # Calculate cost parameters that are dependent on the flow - expected_values[asset][COST_DISPATCH] = expected_values[asset][ - LIFETIME_PRICE_DISPATCH - ] * sum(expected_values[asset][FLOW]) - expected_values[asset][COST_OPERATIONAL_TOTAL] = ( - expected_values[asset][COST_DISPATCH] + expected_values[asset][COST_OM] - ) - expected_values[asset][COST_TOTAL] = ( - expected_values[asset][COST_OPERATIONAL_TOTAL] - + expected_values[asset][COST_INVESTMENT] - ) - # Process cost - expected_values[asset][ANNUITY_OM] = ( - expected_values[asset][COST_OPERATIONAL_TOTAL] - * dict_economic[CRF][VALUE] - ) - expected_values[asset][ANNUITY_TOTAL] = ( - expected_values[asset][COST_TOTAL] * dict_economic[CRF][VALUE] - ) - if sum(expected_values[asset][FLOW]) == 0: - expected_values[asset][LCOE_ASSET] = 0 - else: - expected_values[asset][LCOE_ASSET] = expected_values[asset][ - ANNUITY_TOTAL - ] / sum(expected_values[asset][FLOW]) - - # Store to csv to enable manual check, eg. of LCOE_A. Only previously empty rows have been changed. - expected_values.drop("flow").to_csv( - os.path.join(TEST_OUTPUT_PATH, use_case, expected_value_file), sep="," - ) + # # Derive expected values dependent on actual dispatch of the asset(s) + # for asset in expected_values.columns: + # # determine asset dictionary (special for storages) + # result_key = expected_values[asset]["group"] + # + # if asset in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: + # asset_data = data[result_key]["storage_01"][asset] + # else: + # asset_data = data[result_key][asset] + # + # # Get dispatch of the assets + # expected_values[asset][FLOW] = asset_data[FLOW] + # + # # Calculate cost parameters that are dependent on the flow + # expected_values[asset][COST_DISPATCH] = expected_values[asset][ + # LIFETIME_PRICE_DISPATCH + # ] * sum(expected_values[asset][FLOW]) + # expected_values[asset][COST_OPERATIONAL_TOTAL] = ( + # expected_values[asset][COST_DISPATCH] + expected_values[asset][COST_OM] + # ) + # expected_values[asset][COST_TOTAL] = ( + # expected_values[asset][COST_OPERATIONAL_TOTAL] + # + expected_values[asset][COST_INVESTMENT] + # ) + # + # # Process cost + # expected_values[asset][ANNUITY_OM] = ( + # expected_values[asset][COST_OPERATIONAL_TOTAL] + # * DICT_ECONOMIC[CRF][VALUE] + # ) + # expected_values[asset][ANNUITY_TOTAL] = ( + # expected_values[asset][COST_TOTAL] * DICT_ECONOMIC[CRF][VALUE] + # ) + # if sum(expected_values[asset][FLOW]) == 0: + # expected_values[asset][LCOE_ASSET] = 0 + # else: + # expected_values[asset][LCOE_ASSET] = expected_values[asset][ + # ANNUITY_TOTAL + # ] / sum(expected_values[asset][FLOW]) + # + # # Store to csv to enable manual check, eg. of LCOE_A. Only previously empty rows have been changed. + # expected_values.drop("flow").to_csv( + # os.path.join(TEST_OUTPUT_PATH, use_case, expected_value_file), sep="," + # ) # Check if asset costs were correctly calculated in C2 and E2 for asset in expected_values.index: From 4f120f9c5790b23b28121e14d199fac55ac5abb7 Mon Sep 17 00:00:00 2001 From: Bachibouzouk Date: Wed, 21 Oct 2020 19:50:04 +0200 Subject: [PATCH 08/39] Add assertion for lcoe --- tests/test_benchmark_KPI.py | 42 +++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 16603a09b..37cfe3e38 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -20,8 +20,10 @@ from _constants import ( EXECUTE_TESTS_ON, TESTS_ON_MASTER, + JSON_WITH_RESULTS, TEST_REPO_PATH, CSV_EXT, + TIME_SERIES, ) from multi_vector_simulator.utils.constants import ( @@ -71,6 +73,14 @@ TOTAL_RENEWABLE_ENERGY_USE, TOTAL_NON_RENEWABLE_GENERATION_IN_LES, TOTAL_RENEWABLE_GENERATION_IN_LES, + ENERGY_CONVERSION, + ENERGY_CONSUMPTION, + ENERGY_PRODUCTION, + ENERGY_STORAGE, + ENERGY_BUSSES, + ENERGY_PROVIDERS, + KPI, + KPI_SCALARS_DICT, ) TEST_INPUT_PATH = os.path.join(TEST_REPO_PATH, "benchmark_test_inputs") @@ -231,12 +241,12 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): # os.path.join(TEST_OUTPUT_PATH, use_case, expected_value_file), sep="," # ) - # Check if asset costs were correctly calculated in C2 and E2 + # Compare asset costs calculated in C2 and E2 with benchmark data from csv file for asset in expected_values.index: asset_group = expected_values.loc[asset, "group"] - # determine asset dictionary (special for storages) + # determine asset dictionnary (special for storages) if asset in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: asset_data = data[asset_group]["storage_01"][asset] else: @@ -247,6 +257,34 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): asset_data[key][VALUE], rel=1e-3 ), f"Parameter {key} of asset {asset} is not of expected value." + demand = pd.read_csv( + os.path.join(TEST_INPUT_PATH, use_case, TIME_SERIES, "demand.csv"), sep=",", + ) + aggregated_demand = demand.sum()[0] + + # Compute the aggregated_annuity + aggregated_annuity = 0 + + for asset_group in (ENERGY_CONSUMPTION, ENERGY_PRODUCTION, ENERGY_STORAGE): + for asset in data[asset_group]: + # for storage we look at the annuity of the in and out flows and storage capacity + if asset_group == ENERGY_STORAGE: + for storage_type in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: + asset_data = data[asset_group][asset][storage_type] + aggregated_annuity += asset_data[ANNUITY_TOTAL][VALUE] + else: + asset_data = data[asset_group][asset] + aggregated_annuity += asset_data[ANNUITY_TOTAL][VALUE] + + # Compute the lcoe for this simple case (single demand) + lcoe = aggregated_annuity / aggregated_demand + mvs_lcoe = data[KPI][KPI_SCALARS_DICT][ + "Levelized costs of electricity equivalent" + ] + assert lcoe == pytest.approx( + mvs_lcoe, rel=1e-2 + ), f"Parameter {LCOE_ASSET} of asset is not of expected value (benchmark of {lcoe} versus computed value of {mvs_lcoe}." + def teardown_method(self): if os.path.exists(TEST_OUTPUT_PATH): shutil.rmtree(TEST_OUTPUT_PATH, ignore_errors=True) From 78425f8ada8b2edea1c7e460e8fdb9ed5a92b6a1 Mon Sep 17 00:00:00 2001 From: Bachibouzouk Date: Wed, 21 Oct 2020 20:06:24 +0200 Subject: [PATCH 09/39] Add test for npc (total costs) --- tests/test_benchmark_KPI.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 37cfe3e38..8c05fcc18 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -262,8 +262,9 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): ) aggregated_demand = demand.sum()[0] - # Compute the aggregated_annuity + # Compute the aggregated annuity and costs (NPC) aggregated_annuity = 0 + aggregated_costs = 0 for asset_group in (ENERGY_CONSUMPTION, ENERGY_PRODUCTION, ENERGY_STORAGE): for asset in data[asset_group]: @@ -272,9 +273,11 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): for storage_type in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: asset_data = data[asset_group][asset][storage_type] aggregated_annuity += asset_data[ANNUITY_TOTAL][VALUE] + aggregated_costs += asset_data[COST_TOTAL][VALUE] else: asset_data = data[asset_group][asset] aggregated_annuity += asset_data[ANNUITY_TOTAL][VALUE] + aggregated_costs += asset_data[COST_TOTAL][VALUE] # Compute the lcoe for this simple case (single demand) lcoe = aggregated_annuity / aggregated_demand @@ -283,7 +286,12 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): ] assert lcoe == pytest.approx( mvs_lcoe, rel=1e-2 - ), f"Parameter {LCOE_ASSET} of asset is not of expected value (benchmark of {lcoe} versus computed value of {mvs_lcoe}." + ), f"Parameter {LCOE_ASSET} of system is not of expected value (benchmark of {lcoe} versus computed value of {mvs_lcoe}." + + mvs_costs = data[KPI][KPI_SCALARS_DICT]["costs_total"] + assert aggregated_costs == pytest.approx( + mvs_costs, rel=1e-2 + ), f"Parameter {COST_TOTAL} of system is not of expected value (benchmark of {aggregated_costs} versus computed value of {mvs_costs}." def teardown_method(self): if os.path.exists(TEST_OUTPUT_PATH): From 616b90a095c17db0f1b61d0b4f9f24e76fe7aac4 Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Thu, 10 Dec 2020 01:03:54 +0100 Subject: [PATCH 10/39] Update with CO2 emission factors --- docs/Model_Assumptions.rst | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/docs/Model_Assumptions.rst b/docs/Model_Assumptions.rst index 457523ee5..766cad5eb 100644 --- a/docs/Model_Assumptions.rst +++ b/docs/Model_Assumptions.rst @@ -159,7 +159,7 @@ Following conversion factors and energy carriers are defined: * - Energy carrier - Unit - Value - * - H2 [`3 `_] + * - H2 [`3 `_]) - kgoe/kgH2 - 2.87804 * - LNG @@ -289,28 +289,33 @@ In the MVS, there is no distinction between energy carriers and energy vector. F CO2 Emission factors ---------------------------- -In order to optimise the energy system with minimum CO2 emissions, it is important to calculate CO2 emission per unit electricity generation. +In order to optimise the energy system with minimum CO2 emissions, it is important to calculate CO2 emission per unit of fuel consumption. Following emission factors for energy carriers are defined: .. _table_CO2_emissions_energyCarriers: -.. list-table:: CO2 Emission factors: grams of CO2 equivalent per kWh of electricity generation - :widths: 50 25 +.. list-table:: CO2 Emission factors: Kg of CO2 equivalent per unit of fuel consumption + :widths: 50 25 25 :header-rows: 1 * - Energy carrier + - Unit - Value * - Diesel - - 650 + - kg/litre + - 2.68 [`4 `_] + * - Gasoline + - kg/litre + - 2.29[`4 `_] * - Biogas - - 85 - * - Biomass - - 230 + - kg/m3 + - 0 * - Natural gas - - 490 + - kg/m3 + - 1.88[`4 `_] -The values mentioned in the following table account for emissions during the complete life cycle. This includes emissions during energy production, energy conversion, energy storage and energy transmission. These values always fluctuate and depend on various factors such as energy mix, weather conditions, and demand fluctuations. +The CO2 emission of biogas is considered neutral since CO2 is considered as biogenic.[`5 `_] CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, India): @@ -323,15 +328,17 @@ CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, Indi * - Country - Value * - Germany - - 518 + - 397 [`6 `_] * - Norway - - 25 + - 14.4 [`7 `_] * - Spain - - 174 + - 197 [`6 `_] * - Romania - - 291 + - 339 [`6 `_] * - India (Delhi) - - 476 + - 697 [`8 `_] + +The values mentioned in the table above account for emissions during the complete life cycle. This includes emissions during energy production, energy conversion, energy storage and energy transmission. These values always fluctuate and depend on various factors such as energy mix, weather conditions, and demand fluctuations. Despite the comparatively higher capacity of solar PV and wind energy generation potential in Germany, the CO2 emission is high during winter because of the lower solar irradiation available. Moreover, the thermal energy demand is higher during winter which is largely fulfilled using coal as a primary energy source. From 854c94f9d96b649ed4b0ba905692eaa537cf01dd Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Thu, 10 Dec 2020 10:41:38 +0100 Subject: [PATCH 11/39] Changed CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ad306aeb..90f0aab93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Here is a template for new release sections ### Added - Updated release protocol with info on credentials for test.pypi.org (step 9) and added "Fixed" to unreleased section of changelog.md in release protocol (#695) - Added information about the API to the docs (#701) +- Added CO2 emission factors in the section model_assumption.rst (#697) ### Changed - From cfca04c3a336419d7004cb1371cbe13dbf5c256e Mon Sep 17 00:00:00 2001 From: paragpatil39 <58882654+paragpatil39@users.noreply.github.com> Date: Thu, 10 Dec 2020 11:10:03 +0100 Subject: [PATCH 12/39] Apply suggestions from code review Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com> --- docs/Model_Assumptions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Model_Assumptions.rst b/docs/Model_Assumptions.rst index 62f51d183..00b84fee4 100644 --- a/docs/Model_Assumptions.rst +++ b/docs/Model_Assumptions.rst @@ -328,7 +328,7 @@ CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, Indi * - Country - Value * - Germany - - 397 [`6 `_] + - 397 [`6 `__] * - Norway - 14.4 [`7 `_] * - Spain From ef7dab0d13c533f756a3d1a4ea6028784c6536ce Mon Sep 17 00:00:00 2001 From: mahendra Date: Wed, 9 Dec 2020 18:33:03 +0100 Subject: [PATCH 13/39] Add information regarding the MVS server API to the docs --- docs/Overview.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/Overview.rst b/docs/Overview.rst index 4e408f095..fb73f93ec 100644 --- a/docs/Overview.rst +++ b/docs/Overview.rst @@ -56,3 +56,12 @@ The validation techniques used are listed here below and expanded in :ref:`valid * Comparison to other model + +Access MVS Server API +--------------------- + +The multi-vector simulator can be used to simulate energy systems directly via the browser using the API of the server which processes the simulation. Users can interact with the API at this `URL `_. +It is as simple as uploading the simulation files (by clicking the 'Browse' button) and then hitting the 'Run simulation' button. One can also visualize the log messages (error/warning) during the simulation. + +The code for the implementation of the MVS E-Land API is hosted in this `github repository `_. + From 4cc6dab2a1bbd0d7682c9baa35426be096935377 Mon Sep 17 00:00:00 2001 From: mahendra Date: Wed, 9 Dec 2020 18:38:44 +0100 Subject: [PATCH 14/39] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b487a119..3ad306aeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Here is a template for new release sections ### Added - Updated release protocol with info on credentials for test.pypi.org (step 9) and added "Fixed" to unreleased section of changelog.md in release protocol (#695) +- Added information about the API to the docs (#701) ### Changed - From 03bdf1f47d2c5ffe3eec6f0e56f277becd2fb204 Mon Sep 17 00:00:00 2001 From: Mahendranath R Date: Wed, 9 Dec 2020 21:58:44 +0100 Subject: [PATCH 15/39] Implement suggestion Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com> --- docs/Overview.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/Overview.rst b/docs/Overview.rst index fb73f93ec..33109c026 100644 --- a/docs/Overview.rst +++ b/docs/Overview.rst @@ -60,8 +60,7 @@ The validation techniques used are listed here below and expanded in :ref:`valid Access MVS Server API --------------------- -The multi-vector simulator can be used to simulate energy systems directly via the browser using the API of the server which processes the simulation. Users can interact with the API at this `URL `_. +The Multi-Vector Simulator can be used to simulate energy systems via the browser using the `API on the RLI server `__. It processes the parsed JSON input file, and returns the JSON result file. It is as simple as uploading the simulation files (by clicking the 'Browse' button) and then hitting the 'Run simulation' button. One can also visualize the log messages (error/warning) during the simulation. The code for the implementation of the MVS E-Land API is hosted in this `github repository `_. - From e1404d295f87d3c4ead43d3d4e204509a2b30329 Mon Sep 17 00:00:00 2001 From: Mahendranath R Date: Wed, 9 Dec 2020 21:59:18 +0100 Subject: [PATCH 16/39] Add second underscore to the link text Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com> --- docs/Overview.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Overview.rst b/docs/Overview.rst index 33109c026..4af32f5d1 100644 --- a/docs/Overview.rst +++ b/docs/Overview.rst @@ -63,4 +63,4 @@ Access MVS Server API The Multi-Vector Simulator can be used to simulate energy systems via the browser using the `API on the RLI server `__. It processes the parsed JSON input file, and returns the JSON result file. It is as simple as uploading the simulation files (by clicking the 'Browse' button) and then hitting the 'Run simulation' button. One can also visualize the log messages (error/warning) during the simulation. -The code for the implementation of the MVS E-Land API is hosted in this `github repository `_. +The code for the implementation of the MVS E-Land API is hosted in this `github repository `__. From 08d5693795b120161cb268f6f552cef3710efced Mon Sep 17 00:00:00 2001 From: Mahendranath R Date: Wed, 9 Dec 2020 21:59:39 +0100 Subject: [PATCH 17/39] Reword sentence Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com> --- docs/Overview.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Overview.rst b/docs/Overview.rst index 4af32f5d1..fd871f1ce 100644 --- a/docs/Overview.rst +++ b/docs/Overview.rst @@ -61,6 +61,6 @@ Access MVS Server API --------------------- The Multi-Vector Simulator can be used to simulate energy systems via the browser using the `API on the RLI server `__. It processes the parsed JSON input file, and returns the JSON result file. -It is as simple as uploading the simulation files (by clicking the 'Browse' button) and then hitting the 'Run simulation' button. One can also visualize the log messages (error/warning) during the simulation. +The simulation is executed by uploading the simulation files (by clicking the 'Browse' button) and then hitting the 'Run simulation' button. One can also visualize the log messages (error/warning) during the simulation. The code for the implementation of the MVS E-Land API is hosted in this `github repository `__. From 4482273bc77b497c6a0bccde9f86b98809e1b27f Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Wed, 9 Dec 2020 17:10:30 +0100 Subject: [PATCH 18/39] Merges, minor fixes, back --- tests/test_benchmark_KPI.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 8c05fcc18..23550e2c8 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -36,7 +36,6 @@ OUTPUT_POWER, STORAGE_CAPACITY, VALUE, - FLOW, LIFETIME_SPECIFIC_COST_OM, LIFETIME_PRICE_DISPATCH, LIFETIME_SPECIFIC_COST, @@ -55,15 +54,13 @@ COST_UPFRONT, COST_REPLACEMENT, LCOE_ASSET, + LCOeleq, CURR, DISCOUNTFACTOR, PROJECT_DURATION, ANNUITY_FACTOR, CRF, - ENERGY_PRODUCTION, TOTAL_FLOW, - KPI, - KPI_SCALARS_DICT, KPI_UNCOUPLED_DICT, TOTAL_DEMAND, SUFFIX_ELECTRICITY_EQUIVALENT, @@ -73,12 +70,9 @@ TOTAL_RENEWABLE_ENERGY_USE, TOTAL_NON_RENEWABLE_GENERATION_IN_LES, TOTAL_RENEWABLE_GENERATION_IN_LES, - ENERGY_CONVERSION, ENERGY_CONSUMPTION, ENERGY_PRODUCTION, ENERGY_STORAGE, - ENERGY_BUSSES, - ENERGY_PROVIDERS, KPI, KPI_SCALARS_DICT, ) @@ -174,7 +168,6 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): index_col=0, ) - KEYS_TO_BE_EVALUATED = [ LIFETIME_SPECIFIC_COST_OM, LIFETIME_PRICE_DISPATCH, @@ -279,13 +272,13 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): aggregated_annuity += asset_data[ANNUITY_TOTAL][VALUE] aggregated_costs += asset_data[COST_TOTAL][VALUE] + # todo when adding fix costs, there might be additional costs that are to be added here. + # Compute the lcoe for this simple case (single demand) lcoe = aggregated_annuity / aggregated_demand - mvs_lcoe = data[KPI][KPI_SCALARS_DICT][ - "Levelized costs of electricity equivalent" - ] + mvs_lcoe = data[KPI][KPI_SCALARS_DICT][LCOeleq] assert lcoe == pytest.approx( - mvs_lcoe, rel=1e-2 + mvs_lcoe, rel=1e-3 ), f"Parameter {LCOE_ASSET} of system is not of expected value (benchmark of {lcoe} versus computed value of {mvs_lcoe}." mvs_costs = data[KPI][KPI_SCALARS_DICT]["costs_total"] From ed8f8e8ac87bd47fdf89815165db5e8b6899633e Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Thu, 10 Dec 2020 12:34:01 +0100 Subject: [PATCH 19/39] Add `COST_REPLACEMENT` to output of system costs --- src/multi_vector_simulator/utils/constants_output.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/multi_vector_simulator/utils/constants_output.py b/src/multi_vector_simulator/utils/constants_output.py index 269cca16e..20f465a9b 100644 --- a/src/multi_vector_simulator/utils/constants_output.py +++ b/src/multi_vector_simulator/utils/constants_output.py @@ -9,6 +9,7 @@ COST_OPERATIONAL_TOTAL, COST_INVESTMENT, COST_UPFRONT, + COST_REPLACEMENT, COST_DISPATCH, COST_OM, ANNUITY_TOTAL, @@ -34,6 +35,7 @@ COST_OPERATIONAL_TOTAL, COST_INVESTMENT, COST_UPFRONT, + COST_REPLACEMENT, COST_DISPATCH, COST_OM, ANNUITY_TOTAL, From fca16298e06bbf0c0a82679ff024ee6434428466 Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Thu, 10 Dec 2020 12:36:52 +0100 Subject: [PATCH 20/39] Define function for processing of expected values --- tests/test_benchmark_KPI.py | 130 ++++++++++++++++++++++-------------- 1 file changed, 79 insertions(+), 51 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 23550e2c8..402548d76 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -75,6 +75,7 @@ ENERGY_STORAGE, KPI, KPI_SCALARS_DICT, + FLOW ) TEST_INPUT_PATH = os.path.join(TEST_REPO_PATH, "benchmark_test_inputs") @@ -103,6 +104,79 @@ } ) +USE_CASE = "Economic_KPI_C2_E2" + + +def process_expected_values(): + """ + Processes expected values from ` + Derive expected values dependent on actual dispatch of the asset(s) + for asset in expected_values.columns: + + + Returns + ------- + Save expected values to `expected_value_file`, to be used in benchmark tests + """ + #To edit the values, please use the test_data_economic_expected_values.xls file first and convert the first tab to csv. + expected_value_file = "test_data_economic_expected_values.csv" + expected_values = pd.read_csv( + os.path.join(TEST_INPUT_PATH, USE_CASE, expected_value_file), + sep=",", + index_col=0, + ) + + # read json with results file + data = load_json( + os.path.join( + TEST_OUTPUT_PATH, USE_CASE, JSON_WITH_RESULTS + JSON_FILE_EXTENSION + ) + ) + + for asset in expected_values.index: + + # determine asset dictionary (special for storages) + result_key = expected_values[asset]["group"] + + if asset in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: + asset_data = data[result_key]["storage_01"][asset] + else: + asset_data = data[result_key][asset] + + # get dispatch of the assets + expected_values[asset][FLOW] = asset_data[FLOW] + + # calculate cost parameters that are dependent on the flow + expected_values[asset][COST_DISPATCH] = expected_values[asset][ + LIFETIME_PRICE_DISPATCH + ] * sum(expected_values[asset][FLOW]) + expected_values[asset][COST_OPERATIONAL_TOTAL] = ( + expected_values[asset][COST_DISPATCH] + expected_values[asset][COST_OM] + ) + expected_values[asset][COST_TOTAL] = ( + expected_values[asset][COST_OPERATIONAL_TOTAL] + + expected_values[asset][COST_INVESTMENT] + ) + + # process cost + expected_values[asset][ANNUITY_OM] = ( + expected_values[asset][COST_OPERATIONAL_TOTAL] + * DICT_ECONOMIC[CRF][VALUE] + ) + expected_values[asset][ANNUITY_TOTAL] = ( + expected_values[asset][COST_TOTAL] * DICT_ECONOMIC[CRF][VALUE] + ) + if sum(expected_values[asset][FLOW]) == 0: + expected_values[asset][LCOE_ASSET] = 0 + else: + expected_values[asset][LCOE_ASSET] = expected_values[asset][ + ANNUITY_TOTAL + ] / sum(expected_values[asset][FLOW]) + + # store to csv to enable manual check, eg. of lcoe_a. only previously empty rows have been changed. + expected_values.drop("flow").to_csv( + os.path.join(TEST_OUTPUT_PATH, USE_CASE, expected_value_file), sep="," + ) class Test_Economic_KPI: def setup_method(self): @@ -142,28 +216,27 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): - Annuity """ - use_case = "Economic_KPI_C2_E2" # Execute the script main( overwrite=True, display_output="warning", - path_input_folder=os.path.join(TEST_INPUT_PATH, use_case), + path_input_folder=os.path.join(TEST_INPUT_PATH, USE_CASE), input_type=CSV_EXT, - path_output_folder=os.path.join(TEST_OUTPUT_PATH, use_case), + path_output_folder=os.path.join(TEST_OUTPUT_PATH, USE_CASE), ) # read json with results file data = load_json( os.path.join( - TEST_OUTPUT_PATH, use_case, JSON_WITH_RESULTS + JSON_FILE_EXTENSION + TEST_OUTPUT_PATH, USE_CASE, JSON_WITH_RESULTS + JSON_FILE_EXTENSION ) ) - # Read expected values from file. To edit the values, please use the .xls file first and convert the first tab to csv. + # Read expected values from file. expected_value_file = "test_data_economic_expected_values.csv" expected_values = pd.read_csv( - os.path.join(TEST_INPUT_PATH, use_case, expected_value_file), + os.path.join(TEST_INPUT_PATH, USE_CASE, expected_value_file), sep=",", index_col=0, ) @@ -189,51 +262,6 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): LCOE_ASSET, ] - # # Derive expected values dependent on actual dispatch of the asset(s) - # for asset in expected_values.columns: - # # determine asset dictionary (special for storages) - # result_key = expected_values[asset]["group"] - # - # if asset in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: - # asset_data = data[result_key]["storage_01"][asset] - # else: - # asset_data = data[result_key][asset] - # - # # Get dispatch of the assets - # expected_values[asset][FLOW] = asset_data[FLOW] - # - # # Calculate cost parameters that are dependent on the flow - # expected_values[asset][COST_DISPATCH] = expected_values[asset][ - # LIFETIME_PRICE_DISPATCH - # ] * sum(expected_values[asset][FLOW]) - # expected_values[asset][COST_OPERATIONAL_TOTAL] = ( - # expected_values[asset][COST_DISPATCH] + expected_values[asset][COST_OM] - # ) - # expected_values[asset][COST_TOTAL] = ( - # expected_values[asset][COST_OPERATIONAL_TOTAL] - # + expected_values[asset][COST_INVESTMENT] - # ) - # - # # Process cost - # expected_values[asset][ANNUITY_OM] = ( - # expected_values[asset][COST_OPERATIONAL_TOTAL] - # * DICT_ECONOMIC[CRF][VALUE] - # ) - # expected_values[asset][ANNUITY_TOTAL] = ( - # expected_values[asset][COST_TOTAL] * DICT_ECONOMIC[CRF][VALUE] - # ) - # if sum(expected_values[asset][FLOW]) == 0: - # expected_values[asset][LCOE_ASSET] = 0 - # else: - # expected_values[asset][LCOE_ASSET] = expected_values[asset][ - # ANNUITY_TOTAL - # ] / sum(expected_values[asset][FLOW]) - # - # # Store to csv to enable manual check, eg. of LCOE_A. Only previously empty rows have been changed. - # expected_values.drop("flow").to_csv( - # os.path.join(TEST_OUTPUT_PATH, use_case, expected_value_file), sep="," - # ) - # Compare asset costs calculated in C2 and E2 with benchmark data from csv file for asset in expected_values.index: From ff046faab0f1f7a4d5941f5f011a38573d1d4953 Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Thu, 10 Dec 2020 12:38:42 +0100 Subject: [PATCH 21/39] Adapt benchmark so that all economic parameters of system are tested --- tests/test_benchmark_KPI.py | 67 ++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 402548d76..5f1e958c7 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -71,6 +71,7 @@ TOTAL_NON_RENEWABLE_GENERATION_IN_LES, TOTAL_RENEWABLE_GENERATION_IN_LES, ENERGY_CONSUMPTION, + ENERGY_CONVERSION, ENERGY_PRODUCTION, ENERGY_STORAGE, KPI, @@ -241,7 +242,7 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): index_col=0, ) - KEYS_TO_BE_EVALUATED = [ + KEYS_TO_BE_EVALUATED_PER_ASSET = [ LIFETIME_SPECIFIC_COST_OM, LIFETIME_PRICE_DISPATCH, LIFETIME_SPECIFIC_COST, @@ -273,47 +274,73 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): else: asset_data = data[asset_group][asset] # assertion - for key in KEYS_TO_BE_EVALUATED: + for key in KEYS_TO_BE_EVALUATED_PER_ASSET: assert expected_values.loc[asset, key] == pytest.approx( asset_data[key][VALUE], rel=1e-3 ), f"Parameter {key} of asset {asset} is not of expected value." + # Now we established that the externally calculated values are equal to the internally calculated values. + # Therefore, we can now use the cost data from the assets to validate the cost data for the whole energy system. + demand = pd.read_csv( - os.path.join(TEST_INPUT_PATH, use_case, TIME_SERIES, "demand.csv"), sep=",", + os.path.join(TEST_INPUT_PATH, USE_CASE, TIME_SERIES, "demand.csv"), sep=",", ) aggregated_demand = demand.sum()[0] - # Compute the aggregated annuity and costs (NPC) - aggregated_annuity = 0 - aggregated_costs = 0 - - for asset_group in (ENERGY_CONSUMPTION, ENERGY_PRODUCTION, ENERGY_STORAGE): + KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM = { + COST_INVESTMENT: 0, + COST_UPFRONT: 0, + COST_REPLACEMENT: 0, + COST_OM: 0, + COST_DISPATCH: 0, + COST_OPERATIONAL_TOTAL: 0, + COST_TOTAL: 0, + ANNUITY_OM: 0, + ANNUITY_TOTAL: 0, + } + + def add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data): + """ + Add individual cost to each of the seperate costs + + Parameters + ---------- + KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM: dict + dict of keys to be evaluated for system costs, to be updated + asset_data: dict + Asset data with economic parameters + + Returns + ------- + Updated KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM + """ + for key in KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM: + KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM.update( + {key: KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key] + asset_data[key][VALUE]}) + + for asset_group in (ENERGY_CONSUMPTION, ENERGY_CONVERSION, ENERGY_PRODUCTION, ENERGY_STORAGE): for asset in data[asset_group]: # for storage we look at the annuity of the in and out flows and storage capacity if asset_group == ENERGY_STORAGE: for storage_type in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: asset_data = data[asset_group][asset][storage_type] - aggregated_annuity += asset_data[ANNUITY_TOTAL][VALUE] - aggregated_costs += asset_data[COST_TOTAL][VALUE] + add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data) else: asset_data = data[asset_group][asset] - aggregated_annuity += asset_data[ANNUITY_TOTAL][VALUE] - aggregated_costs += asset_data[COST_TOTAL][VALUE] + add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data) - # todo when adding fix costs, there might be additional costs that are to be added here. + for key in KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM: + assert KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key] == pytest.approx( + data[KPI][KPI_SCALARS_DICT][key],rel=1e-3 + ), f"The key {key} is not of expected value {KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key]} but {data[KPI][KPI_SCALARS_DICT][key]}. This is based on the before esablished assertion, that the expected values of asset costs are equal to the ones in the json results file." - # Compute the lcoe for this simple case (single demand) - lcoe = aggregated_annuity / aggregated_demand + # Compute the lcoe for this simple case from the data (single demand) + lcoe = KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[ANNUITY_TOTAL] / aggregated_demand mvs_lcoe = data[KPI][KPI_SCALARS_DICT][LCOeleq] assert lcoe == pytest.approx( mvs_lcoe, rel=1e-3 ), f"Parameter {LCOE_ASSET} of system is not of expected value (benchmark of {lcoe} versus computed value of {mvs_lcoe}." - mvs_costs = data[KPI][KPI_SCALARS_DICT]["costs_total"] - assert aggregated_costs == pytest.approx( - mvs_costs, rel=1e-2 - ), f"Parameter {COST_TOTAL} of system is not of expected value (benchmark of {aggregated_costs} versus computed value of {mvs_costs}." - def teardown_method(self): if os.path.exists(TEST_OUTPUT_PATH): shutil.rmtree(TEST_OUTPUT_PATH, ignore_errors=True) From 78b393273ba04031e5717d0ffab44621dac49cc2 Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Thu, 10 Dec 2020 13:02:24 +0100 Subject: [PATCH 22/39] Add assertion of ATTRIBUTED_COSTS --- tests/test_benchmark_KPI.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 5f1e958c7..075a5502e 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -76,7 +76,8 @@ ENERGY_STORAGE, KPI, KPI_SCALARS_DICT, - FLOW + FLOW, + ATTRIBUTED_COSTS, ) TEST_INPUT_PATH = os.path.join(TEST_REPO_PATH, "benchmark_test_inputs") @@ -341,6 +342,12 @@ def add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data): mvs_lcoe, rel=1e-3 ), f"Parameter {LCOE_ASSET} of system is not of expected value (benchmark of {lcoe} versus computed value of {mvs_lcoe}." + attributed_costs = 0 + for key in data[KPI][KPI_SCALARS_DICT]: + if ATTRIBUTED_COSTS in key: + + attributed_costs += data[KPI][KPI_SCALARS_DICT][key] + assert attributed_costs == data[KPI][KPI_SCALARS_DICT][COST_TOTAL], f"The total attributed costs are not the costs of the total system." def teardown_method(self): if os.path.exists(TEST_OUTPUT_PATH): shutil.rmtree(TEST_OUTPUT_PATH, ignore_errors=True) From d490a46087059591b8428cf6e820c1e9a6239f33 Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Wed, 9 Dec 2020 17:24:45 +0100 Subject: [PATCH 23/39] Update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ad306aeb..678594281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,9 @@ Here is a template for new release sections - Added information about the API to the docs (#701) ### Changed -- +- Benchmark test for investment model (`Test_Economic_KPI.test_benchmark_Economic_KPI_C2_E2`): Expand test to LCOE as well as all all other system-wide economic parameters, transpose `test_data_economic_expected_values.csv`, change `test_data_economic_expected_values.xls` (#613) +- Adapt pre-processing for investment benchmark tests into a seperate function (#613) +- `COST_REPLACEMENT` is now a parameter that is included in output cost matrix (#613) ### Removed - @@ -35,6 +37,7 @@ Here is a template for new release sections - Decreased warnings of RTD compilation drastically (#693) - Use current version number as defined in `version.py` for RTD (#693) - Added storage to the table in autoreport listing the energy system components (#686) +- Add assertion `sum(attributed_costs)==cost_total` (for single-vector system) (#613) ## [0.5.3] - 2020-12-08 From 6298bc470e57c20db00f3cf35dca3207d3ed897d Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Thu, 10 Dec 2020 13:04:06 +0100 Subject: [PATCH 24/39] Black --- tests/test_benchmark_KPI.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 075a5502e..2657cbadb 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -120,7 +120,7 @@ def process_expected_values(): ------- Save expected values to `expected_value_file`, to be used in benchmark tests """ - #To edit the values, please use the test_data_economic_expected_values.xls file first and convert the first tab to csv. + # To edit the values, please use the test_data_economic_expected_values.xls file first and convert the first tab to csv. expected_value_file = "test_data_economic_expected_values.csv" expected_values = pd.read_csv( os.path.join(TEST_INPUT_PATH, USE_CASE, expected_value_file), @@ -162,8 +162,7 @@ def process_expected_values(): # process cost expected_values[asset][ANNUITY_OM] = ( - expected_values[asset][COST_OPERATIONAL_TOTAL] - * DICT_ECONOMIC[CRF][VALUE] + expected_values[asset][COST_OPERATIONAL_TOTAL] * DICT_ECONOMIC[CRF][VALUE] ) expected_values[asset][ANNUITY_TOTAL] = ( expected_values[asset][COST_TOTAL] * DICT_ECONOMIC[CRF][VALUE] @@ -180,6 +179,7 @@ def process_expected_values(): os.path.join(TEST_OUTPUT_PATH, USE_CASE, expected_value_file), sep="," ) + class Test_Economic_KPI: def setup_method(self): if os.path.exists(TEST_OUTPUT_PATH): @@ -317,9 +317,18 @@ def add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data): """ for key in KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM: KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM.update( - {key: KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key] + asset_data[key][VALUE]}) - - for asset_group in (ENERGY_CONSUMPTION, ENERGY_CONVERSION, ENERGY_PRODUCTION, ENERGY_STORAGE): + { + key: KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key] + + asset_data[key][VALUE] + } + ) + + for asset_group in ( + ENERGY_CONSUMPTION, + ENERGY_CONVERSION, + ENERGY_PRODUCTION, + ENERGY_STORAGE, + ): for asset in data[asset_group]: # for storage we look at the annuity of the in and out flows and storage capacity if asset_group == ENERGY_STORAGE: @@ -332,8 +341,8 @@ def add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data): for key in KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM: assert KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key] == pytest.approx( - data[KPI][KPI_SCALARS_DICT][key],rel=1e-3 - ), f"The key {key} is not of expected value {KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key]} but {data[KPI][KPI_SCALARS_DICT][key]}. This is based on the before esablished assertion, that the expected values of asset costs are equal to the ones in the json results file." + data[KPI][KPI_SCALARS_DICT][key], rel=1e-3 + ), f"The key {key} is not of expected value {KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key]} but {data[KPI][KPI_SCALARS_DICT][key]}. This is based on the before esablished assertion, that the expected values of asset costs are equal to the ones in the json results file." # Compute the lcoe for this simple case from the data (single demand) lcoe = KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[ANNUITY_TOTAL] / aggregated_demand @@ -347,7 +356,10 @@ def add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data): if ATTRIBUTED_COSTS in key: attributed_costs += data[KPI][KPI_SCALARS_DICT][key] - assert attributed_costs == data[KPI][KPI_SCALARS_DICT][COST_TOTAL], f"The total attributed costs are not the costs of the total system." + assert ( + attributed_costs == data[KPI][KPI_SCALARS_DICT][COST_TOTAL] + ), f"The total attributed costs are not the costs of the total system." + def teardown_method(self): if os.path.exists(TEST_OUTPUT_PATH): shutil.rmtree(TEST_OUTPUT_PATH, ignore_errors=True) From 42f4e3c66995d99fdaaadc8f9b74283f56e25c87 Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Thu, 10 Dec 2020 18:49:15 +0100 Subject: [PATCH 25/39] Update CO2 emission values and format --- docs/Model_Assumptions.rst | 64 +++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/docs/Model_Assumptions.rst b/docs/Model_Assumptions.rst index 00b84fee4..2ea8eb71a 100644 --- a/docs/Model_Assumptions.rst +++ b/docs/Model_Assumptions.rst @@ -296,52 +296,80 @@ Following emission factors for energy carriers are defined: .. _table_CO2_emissions_energyCarriers: .. list-table:: CO2 Emission factors: Kg of CO2 equivalent per unit of fuel consumption - :widths: 50 25 25 + :widths: 50 25 25 25 :header-rows: 1 * - Energy carrier - Unit - Value + - Source * - Diesel - - kg/litre - - 2.68 [`4 `_] + - kgCO2eq/litre + - 2.68 + - [`4 `__] * - Gasoline - - kg/litre - - 2.29[`4 `_] + - kgCO2eq/litre + - 2.29 + - [`4 `__] + * - Biodiesel + - kgCO2eq/litre + - 0.03178 + - [`4 `__] + * - Bioethanol + - kgCO2eq/litre + - 0.00855 + - [`4 `__] + * - LPG + - kgCO2eq/litre + - 1.611 + - [`4 `__] * - Biogas - - kg/m3 + - kgCO2eq/m3 - 0 + - [`5 `__] * - Natural gas - - kg/m3 - - 1.88[`4 `_] + - kgCO2eq/m3 + - 1.88 + - [`4 `__] -The CO2 emission of biogas is considered neutral since CO2 is considered as biogenic.[`5 `_] + +The CO2 emission of biogas is considered neutral since CO2 is considered as biogenic.[`5 `__] CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, India): .. _table_CO2_emissions_countries: .. list-table:: CO2 Emission factors: grams of CO2 equivalent per kWh of electricity consumption - :widths: 50 25 + :widths: 50 25 25 25 :header-rows: 1 * - Country - Value + - Unit + - Source * - Germany - - 397 [`6 `__] + - 397 + - kgCO2eq/kWh + - [`6 `__] * - Norway - - 14.4 [`7 `_] + - 14.4 + - kgCO2eq/kWh + - [`7 `__] * - Spain - - 197 [`6 `_] + - 197 + - kgCO2eq/kWh + - [`6 `__] * - Romania - - 339 [`6 `_] - * - India (Delhi) - - 697 [`8 `_] + - 339 + - kgCO2eq/kWh + - [`6 `__] + * - India + - 697 + - kgCO2eq/kWh + - [`8 `__] The values mentioned in the table above account for emissions during the complete life cycle. This includes emissions during energy production, energy conversion, energy storage and energy transmission. These values always fluctuate and depend on various factors such as energy mix, weather conditions, and demand fluctuations. -Despite the comparatively higher capacity of solar PV and wind energy generation potential in Germany, the CO2 emission is high during winter because of the lower solar irradiation available. Moreover, the thermal energy demand is higher during winter which is largely fulfilled using coal as a primary energy source. - Limitations ----------- From 6d9358f0f63db53eaeca9bb84549ad579c326a13 Mon Sep 17 00:00:00 2001 From: smartie2076 <44204527+smartie2076@users.noreply.github.com> Date: Fri, 11 Dec 2020 10:20:36 +0100 Subject: [PATCH 26/39] Apply suggestions from code review Co-authored-by: Sabine Haas --- CHANGELOG.md | 2 +- tests/test_benchmark_KPI.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 678594281..461887674 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ Here is a template for new release sections - Added information about the API to the docs (#701) ### Changed -- Benchmark test for investment model (`Test_Economic_KPI.test_benchmark_Economic_KPI_C2_E2`): Expand test to LCOE as well as all all other system-wide economic parameters, transpose `test_data_economic_expected_values.csv`, change `test_data_economic_expected_values.xls` (#613) +- Benchmark test for investment model (`Test_Economic_KPI.test_benchmark_Economic_KPI_C2_E2`): Expand test to LCOE as well as all other system-wide economic parameters, transpose `test_data_economic_expected_values.csv`, change `test_data_economic_expected_values.xls` (#613) - Adapt pre-processing for investment benchmark tests into a seperate function (#613) - `COST_REPLACEMENT` is now a parameter that is included in output cost matrix (#613) diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index 2657cbadb..d14646455 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -111,7 +111,8 @@ def process_expected_values(): """ - Processes expected values from ` + Processes expected values from `test_data_economic_expected_values.csv`. + Derive expected values dependent on actual dispatch of the asset(s) for asset in expected_values.columns: @@ -269,7 +270,7 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): asset_group = expected_values.loc[asset, "group"] - # determine asset dictionnary (special for storages) + # determine asset dictionary (special for storages) if asset in [INPUT_POWER, OUTPUT_POWER, STORAGE_CAPACITY]: asset_data = data[asset_group]["storage_01"][asset] else: @@ -278,7 +279,7 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): for key in KEYS_TO_BE_EVALUATED_PER_ASSET: assert expected_values.loc[asset, key] == pytest.approx( asset_data[key][VALUE], rel=1e-3 - ), f"Parameter {key} of asset {asset} is not of expected value." + ), f"Parameter {key} of asset {asset} is not of expected value, expected {expected_values.loc[asset, key]}, got {asset_data[key][VALUE]}." # Now we established that the externally calculated values are equal to the internally calculated values. # Therefore, we can now use the cost data from the assets to validate the cost data for the whole energy system. @@ -302,7 +303,7 @@ def test_benchmark_Economic_KPI_C2_E2(self, margs): def add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data): """ - Add individual cost to each of the seperate costs + Add individual cost to each of the separate costs. Parameters ---------- @@ -342,7 +343,7 @@ def add_to_key(KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM, asset_data): for key in KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM: assert KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key] == pytest.approx( data[KPI][KPI_SCALARS_DICT][key], rel=1e-3 - ), f"The key {key} is not of expected value {KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key]} but {data[KPI][KPI_SCALARS_DICT][key]}. This is based on the before esablished assertion, that the expected values of asset costs are equal to the ones in the json results file." + ), f"The key {key} is not of expected value {KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[key]} but {data[KPI][KPI_SCALARS_DICT][key]}. This is based on the before established assertion, that the expected values of asset costs are equal to the ones in the json results file." # Compute the lcoe for this simple case from the data (single demand) lcoe = KEYS_TO_BE_EVALUATED_FOR_TOTAL_SYSTEM[ANNUITY_TOTAL] / aggregated_demand From ceb5cbbd75bae0f03fe2aedef28091ffc33c7c6c Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Fri, 11 Dec 2020 11:31:08 +0100 Subject: [PATCH 27/39] Merge branch 'dev' of https://github.com/rl-institut/multi-vector-simulator into fix/energybusses-in-rtd  Conflicts:  docs/simulating_with_the_mvs.rst --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1089d11ef..e0d3a0752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Here is a template for new release sections ### Added - Updated release protocol with info on credentials for test.pypi.org (step 9) and added "Fixed" to unreleased section of changelog.md in release protocol (#695) - Added information about the API to the docs (#701) +- Added energyBusses.csv in RTD ### Changed - Benchmark test for investment model (`Test_Economic_KPI.test_benchmark_Economic_KPI_C2_E2`): Expand test to LCOE as well as all all other system-wide economic parameters, transpose `test_data_economic_expected_values.csv`, change `test_data_economic_expected_values.xls` (#613) From de63f1c88786a9922db73c72e2aa44535f0b1daf Mon Sep 17 00:00:00 2001 From: paragpatil39 <58882654+paragpatil39@users.noreply.github.com> Date: Fri, 11 Dec 2020 12:09:26 +0100 Subject: [PATCH 28/39] Update CHANGELOG.md Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0d3a0752..6b8b12daf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ Here is a template for new release sections ### Added - Updated release protocol with info on credentials for test.pypi.org (step 9) and added "Fixed" to unreleased section of changelog.md in release protocol (#695) - Added information about the API to the docs (#701) -- Added energyBusses.csv in RTD +- Added energyBusses.csv in RTD (#678) ### Changed - Benchmark test for investment model (`Test_Economic_KPI.test_benchmark_Economic_KPI_C2_E2`): Expand test to LCOE as well as all all other system-wide economic parameters, transpose `test_data_economic_expected_values.csv`, change `test_data_economic_expected_values.xls` (#613) From 277c3c3ba77cad1ed7b01cfbc8ebd5597dc7c573 Mon Sep 17 00:00:00 2001 From: paragpatil39 <58882654+paragpatil39@users.noreply.github.com> Date: Fri, 11 Dec 2020 12:09:40 +0100 Subject: [PATCH 29/39] Update docs/simulating_with_the_mvs.rst Co-authored-by: smartie2076 <44204527+smartie2076@users.noreply.github.com> --- docs/simulating_with_the_mvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/simulating_with_the_mvs.rst b/docs/simulating_with_the_mvs.rst index 4cb7cbbad..cb40ec419 100644 --- a/docs/simulating_with_the_mvs.rst +++ b/docs/simulating_with_the_mvs.rst @@ -36,7 +36,7 @@ that works just like above described "mvs_config.json". For that, each of the following files have to be present in the folder "csv_elements": - `economic_data.csv `__ - Major economic parameters of the project -- `energyBusses.csv `_ - Energy busses of the energy system to be simulated +- `energyBusses.csv `__ - Energy busses of the energy system to be simulated - `energyConsumption.csv `__ - Energy demands and paths to their time series as csv - `energyConversion.csv `__ - Conversion/transformer objects, eg. transformers, generators, heat pumps - `energyProduction.csv `__ - Act as energy "sources", ie. PV or wind plants, with paths to their generation time series as csv From a26571fe00d40a6b258d9da7e1b6614a7fc78f48 Mon Sep 17 00:00:00 2001 From: Andra Date: Fri, 11 Dec 2020 12:23:10 +0100 Subject: [PATCH 30/39] Add renewableAsset to RTD --- docs/MVS_parameters.rst | 1 + docs/MVS_parameters_list.csv | 69 ++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/docs/MVS_parameters.rst b/docs/MVS_parameters.rst index c4281fd0e..3924d9050 100644 --- a/docs/MVS_parameters.rst +++ b/docs/MVS_parameters.rst @@ -98,6 +98,7 @@ The file `energyProduction.csv` defines the assets that serve as energy sources, * :ref:`outflowdirec-label` * :ref:`filename-label` * :ref:`energyvector-label` +* :ref:`renewableasset-label` * :ref:`typeoemof-label` energyProviders.csv diff --git a/docs/MVS_parameters_list.csv b/docs/MVS_parameters_list.csv index 25447c7ec..4b7e2154d 100644 --- a/docs/MVS_parameters_list.csv +++ b/docs/MVS_parameters_list.csv @@ -1,47 +1,48 @@ ,:Default:,:Definition:,:Example:,:Restrictions:,:Type:,:Unit:,label,ref -0, None, The number of years the asset has already been in operation., 10, Natural numbers, Numeric, Years,age_installed,age_ins-label +0, None, The number of years the asset has already been in operation.,10, Natural numbers, Numeric, Years,age_installed,age_ins-label 1, None, Name of the country where the project is being deployed, Norway, None, str, None,country,country-label 2, None, The currency of the country where the project is implemented., EUR, None, str, None,currency,currency-label 3, None, C-rate is the rate at which the storage can charge or discharge relative to the nominal capacity of the storage. A c-rate of 1 implies that the battery can discharge or charge completely in a single timestep.," *storage capacity*: NaN, *input power*: 1, *output power*: 1"," Only the columns ""input power"" and ""output power"" require a value, in column ""storage capacity"" c_rate should be set to NaN. The C-rate has to be in [0,1].", Numeric, factor of total capacity (kWh),c-rate,crate-label -4, None," A fixed cost to implement the asset, eg. planning costs which do not depend on the (optimized) asset capacity.", 10000, Positive real numbers, Numeric, currency,development_costs,developmentcosts-label -5, None," Discount factor is the factor which accounts for the depreciation in the value of money in the future, compared to the current value of the same money. The common method is to calculate the weighted average cost of capital (WACC) and use it as the discount rate.", 0.06, None, Numeric, Factor,discount_factor,discountfactor-label -6, None, Variable cost associated with a flow through/from the asset (eg. Euro/kWh)., 0.64," In ""storage_xx.csv"" only the columns ""input power"" and ""output power"" require a value, in column ""storage capacity"" dispatch_price should be set to NaN.", Numeric, currency/kWh,dispatch_price,dispatchprice-label +4, None," A fixed cost to implement the asset, eg. planning costs which do not depend on the (optimized) asset capacity.",10000, Positive real numbers, Numeric, currency,development_costs,developmentcosts-label +5, None," Discount factor is the factor which accounts for the depreciation in the value of money in the future, compared to the current value of the same money. The common method is to calculate the weighted average cost of capital (WACC) and use it as the discount rate.",0.06, None, Numeric, Factor,discount_factor,discountfactor-label +6, None, Variable cost associated with a flow through/from the asset (eg. Euro/kWh).,0.64," In ""storage_xx.csv"" only the columns ""input power"" and ""output power"" require a value, in column ""storage capacity"" dispatch_price should be set to NaN.", Numeric, currency/kWh,dispatch_price,dispatchprice-label 7, None," Stands for Demand Side Management. Currently, not implemented.", False, Acceptable values are either True or False., str, Boolean value,dsm,dsm-label -8, None," Ratio of energy output/energy input. The battery efficiency is the ratio of the energy taken out from the battery, to the energy put into the battery. It means that it is not possible to retrieve as much energy as provided to the battery due to the discharge losses. The efficiency of the ""input power"" and ""ouput power"" columns should be set equal to the charge and dischage efficiencies respectively, while the ""storage capacity"" efficiency should be equal to the storage's efficiency/ability to hold charge over time (`= 1 - self-discharge/decay`), which is usually in the range of 0.95 to 1 for electrical storages.", 0.95, Between 0 and 1., Numeric, Factor,efficiency,efficiency-label -9, None, Price of energy carrier sourced from the utility grid., 0.1, None, Numeric, currency/energy carrier unit (for e.g.: Euro/kWh),energy_price,energyprice-label -10, None, The number of days for which the simulation is to be run., 365, None, Numeric, Days,evaluated_period,evaluatedperiod-label +8, None," Ratio of energy output/energy input. The battery efficiency is the ratio of the energy taken out from the battery, to the energy put into the battery. It means that it is not possible to retrieve as much energy as provided to the battery due to the discharge losses. The efficiency of the ""input power"" and ""ouput power"" columns should be set equal to the charge and dischage efficiencies respectively, while the ""storage capacity"" efficiency should be equal to the storage's efficiency/ability to hold charge over time (`= 1 - self-discharge/decay`), which is usually in the range of 0.95 to 1 for electrical storages.",0.95, Between 0 and 1., Numeric, Factor,efficiency,efficiency-label +9, None, Price of energy carrier sourced from the utility grid.,0.1, None, Numeric, currency/energy carrier unit (for e.g.: Euro/kWh),energy_price,energyprice-label +10, None, The number of days for which the simulation is to be run.,365, None, Numeric, Days,evaluated_period,evaluatedperiod-label 11, None," Energy vector/commodity. Convention: For an energy conversion asset define energyVector of the output. For a sink define based on inflow. For a source define based on output flow. For a storage, define based on stored energy carrier."," Electricity (or heat, bio-gas, etc.)", None, str, None,energyVector,energyvector-label -12, None, Price received for feeding electricity into the grid., 0.0, None, Numeric, currency/kWh,feedin_tariff,feedintariff-label +12, None, Price received for feeding electricity into the grid.,0, None, Numeric, currency/kWh,feedin_tariff,feedintariff-label 13, None, Name of the csv file containing the input PV generation time-series. E.g.: filename.csv, demand_harbor.csv, None, str, None,file_name,filename-label 14, None, The bus/component from which the energyVector is arriving into the asset., Electricity, None, str, None,inflow_direction,inflowdirection-label -15, None," The already existing installed capacity in-place, which will also be replaced after its lifetime.", 50, Each component in the energyProduction.csv should have a value., Numeric, kWp,installedCap,installedcap-label +15, None," The already existing installed capacity in-place, which will also be replaced after its lifetime.",50, Each component in the energyProduction.csv should have a value., Numeric, kWp,installedCap,installedcap-label 16, None, Name of the asset, Electricity grid DSO," Input the names in a computer readable format, preferably with underscores instead of spaces, and avoiding special characters (eg. pv_plant_01)", str, None,label,labl-label -17, None, Latitude coordinate of the project's geographical location., 45.641603, Should follow geographical convention, Numeric, None,latitude,latitude-label -18, None, Number of operational years of the asset until it has to be replaced., 30, None, Numeric, Year,lifetime,lifetime-label -19, None, Longitude coordinate of the project's geographical location., 10.95787, Should follow geographical convention, Numeric, None,longitude,longitude-label -20, None, The maximum installable capacity., 1000, None, Alphanumeric, None or float,maximumCap,maxcap-label -21, None, The minimum share of energy supplied by renewable generation in the optimized energy system., 0.7, Between 0 and 1, Numeric, factor,minimal_renewable_factor,minrenshare-label +17, None, Latitude coordinate of the project's geographical location.,45.641603, Should follow geographical convention, Numeric, None,latitude,latitude-label +18, None, Number of operational years of the asset until it has to be replaced.,30, None, Numeric, Year,lifetime,lifetime-label +19, None, Longitude coordinate of the project's geographical location.,10.95787, Should follow geographical convention, Numeric, None,longitude,longitude-label +20, None, The maximum installable capacity.,1000, None, Alphanumeric, None or float,maximumCap,maxcap-label +21, None, The minimum share of energy supplied by renewable generation in the optimized energy system.,0.7, Between 0 and 1, Numeric, factor,minimal_renewable_factor,minrenshare-label 22, None, `True` if the user wants to perform capacity optimization for various components as part of the simulation., True, Permissible values are either True or False, str, Boolean value,optimizeCap,optimizecap-label 23, None," Entering True would result in the generation of a file with the linear equation system describing the simulation, ie., with the objective function and all the constraints. This lp file enables the user look at the underlying equations of the optimization.", False, Acceptable values are either True or False, str, Boolean,output_lp_file,outputlpfile-label 24, None," The bus/component to which the energyVector is leaving, from the asset.", PV plant (mono), None, str, None,outflow_direction,outflowdirec-label -25, None, Price to be paid additionally for energy-consumption based on the peak demand of a period., 60, None, Numeric, currency/kW,peak_demand_pricing,peakdemand-label -26, None," Number of reference periods in one year for the peak demand pricing. Only one of the following are acceptable values: 1 (yearly), 2, 3 ,4, 6, 12 (monthly).", 2," Should be one of the following values: 1,2,3,4,6, or 12", Numeric," times per year (1,2,3,4,6,12)",Peak_demand_pricing_period,peakdemandperiod-label -27, None, The name of years the project is intended to be operational. The project duration also sets the installation time of the assets used in the simulation. After the project ends these assets are 'sold' and the refund is charged against the initial investment costs., 30, None, Numeric, Years,Project_duration,projectduration-label -28, None, Users can assign a project ID as per their preference., 1, None, Alphanumeric, None,Project_id,projectid-label +25, None, Price to be paid additionally for energy-consumption based on the peak demand of a period.,60, None, Numeric, currency/kW,peak_demand_pricing,peakdemand-label +26, None," Number of reference periods in one year for the peak demand pricing. Only one of the following are acceptable values: 1 (yearly), 2, 3 ,4, 6, 12 (monthly).",2," Should be one of the following values: 1,2,3,4,6, or 12", Numeric," times per year (1,2,3,4,6,12)",Peak_demand_pricing_period,peakdemandperiod-label +27, None, The name of years the project is intended to be operational. The project duration also sets the installation time of the assets used in the simulation. After the project ends these assets are 'sold' and the refund is charged against the initial investment costs.,30, None, Numeric, Years,Project_duration,projectduration-label +28, None, Users can assign a project ID as per their preference.,1, None, Alphanumeric, None,Project_id,projectid-label 29, None, Users can assign a project name as per their preference., Borg Havn, None, Alphanumeric, None,Project_name,projectname-label -30, None, The share of renewables in the generation mix of the energy supplied by the DSO (utility)., 0.1, Between 0 and 1, Numeric, Factor,renewable_share,renshare-label -31, None, Users can assign a scenario id as per their preference., 1, None, Alphanumeric, None,scenario_id,scenarioid-label -32, None, Users can assign a scenario name as per their preference., Warehouse 14, None, Alphanumeric, None,scenario_name,scenarioname-label -33, None, The level of charge (as a factor of the actual capacity) in the storage in the zeroth time-step.," *storage capacity*: None, *input power*: NaN"," Acceptable values are either None or the factor. Only the column ""storage capacity"" requires a value, in column ""input power"" and ""output power"" soc_initial should be set to NaN.", Numeric, None or factor,soc_initial,socin-label -34, None," The maximum permissible level of charge in the battery (generally, it is when the battery is filled to its nominal capacity), represented by the value 1.0. Users can also specify a certain value as a factor of the actual capacity.", 1.0," Only the column ""storage capacity"" requires a value, in column ""input power"" and ""output power"" soc_max should be set to NaN.", Numeric, Factor,soc_max,socmax-label -35, None, The minimum permissible level of charge in the battery as a factor of the nominal capacity of the battery., 0.2," Only the column ""storage capacity"" requires a value, in column ""input power"" and ""output power"" soc_min should be set to NaN.", Numeric, Factor,soc_min,socmin-label -36, None," Actual CAPEX of the asset, i.e., specific investment costs", 4000, None, Numeric, currency/unit (e.g.: Euro/kW),specific_costs,specificcosts-label -37, None," Actual OPEX of the asset, i.e., specific operational and maintenance costs.", 0, None, Numeric, currency/unit/year,specific_costs_om,specificomcosts-label -38, None, The data and time on which the simulation starts at the first step., 2018-01-01 00:00:00, Acceptable format is YYYY-MM-DD HH:MM:SS, str, None,start_date,startdate-label -39, None," Corresponding to the values in C1, D1, E1... cells, enter the correct CSV filename which hosts the parameters of the corresponding storage component.", storage_01.csv, Follows the convention of 'storage_xx.csv' where 'xx' is a number, str, None,storage_filename,storagefilename-label -40, None, [Developer setting] Assigning True would enable the results to be stored in a OEMOF file., False, Acceptable values are either True or False, str, Boolean,store_oemof_results,storeoemoefresults-label -41, None, Tax factor., 0.0, None, Numeric, Factor,tax,tax-label -42, None, Length of the time-steps., 60, None, Numeric, Minutes,timestep,timestep-label -43, None, The type of the component., demand, *demand*, str, None,type_asset,typeasset-label -44, None," Input the type of OEMOF component. For example, a PV plant would be a source, a solar inverter would be a transformer, etc. The `type_oemof` will later on be determined through the EPA.", sink, *sink* or *source* or one of the other component classes of OEMOF., str, None,type_oemof,typeoemof-label -45, None, Unit associated with the capacity of the component.," Storage could have units like kW or kWh, transformer station could have kVA, and so on.", Appropriate scientific unit, str, NA,unit,unit-label +30, None, User can enter True if the asset is considered as a renewable energy source. False should be entered otherwise., True, Acceptable values are either True or False, str, Boolean, renewableAsset, renewableasset-label +31, None, The share of renewables in the generation mix of the energy supplied by the DSO (utility).,0.1, Between 0 and 1, Numeric, Factor,renewable_share,renshare-label +32, None, Users can assign a scenario id as per their preference.,1, None, Alphanumeric, None,scenario_id,scenarioid-label +33, None, Users can assign a scenario name as per their preference., Warehouse 14, None, Alphanumeric, None,scenario_name,scenarioname-label +34, None, The level of charge (as a factor of the actual capacity) in the storage in the zeroth time-step.," *storage capacity*: None, *input power*: NaN"," Acceptable values are either None or the factor. Only the column ""storage capacity"" requires a value, in column ""input power"" and ""output power"" soc_initial should be set to NaN.", Numeric, None or factor,soc_initial,socin-label +35, None," The maximum permissible level of charge in the battery (generally, it is when the battery is filled to its nominal capacity), represented by the value 1.0. Users can also specify a certain value as a factor of the actual capacity.",1," Only the column ""storage capacity"" requires a value, in column ""input power"" and ""output power"" soc_max should be set to NaN.", Numeric, Factor,soc_max,socmax-label +36, None, The minimum permissible level of charge in the battery as a factor of the nominal capacity of the battery.,0.2," Only the column ""storage capacity"" requires a value, in column ""input power"" and ""output power"" soc_min should be set to NaN.", Numeric, Factor,soc_min,socmin-label +37, None," Actual CAPEX of the asset, i.e., specific investment costs",4000, None, Numeric, currency/unit (e.g.: Euro/kW),specific_costs,specificcosts-label +38, None," Actual OPEX of the asset, i.e., specific operational and maintenance costs.",0, None, Numeric, currency/unit/year,specific_costs_om,specificomcosts-label +39, None, The data and time on which the simulation starts at the first step., 2018-01-01 00:00:00, Acceptable format is YYYY-MM-DD HH:MM:SS, str, None,start_date,startdate-label +40, None," Corresponding to the values in C1, D1, E1... cells, enter the correct CSV filename which hosts the parameters of the corresponding storage component.", storage_01.csv, Follows the convention of 'storage_xx.csv' where 'xx' is a number, str, None,storage_filename,storagefilename-label +41, None, [Developer setting] Assigning True would enable the results to be stored in a OEMOF file., False, Acceptable values are either True or False, str, Boolean,store_oemof_results,storeoemoefresults-label +42, None, Tax factor.,0, None, Numeric, Factor,tax,tax-label +43, None, Length of the time-steps.,60, None, Numeric, Minutes,timestep,timestep-label +44, None, The type of the component., demand, *demand*, str, None,type_asset,typeasset-label +45, None," Input the type of OEMOF component. For example, a PV plant would be a source, a solar inverter would be a transformer, etc. The `type_oemof` will later on be determined through the EPA.", sink, *sink* or *source* or one of the other component classes of OEMOF., str, None,type_oemof,typeoemof-label +46, None, Unit associated with the capacity of the component.," Storage could have units like kW or kWh, transformer station could have kVA, and so on.", Appropriate scientific unit, str, NA,unit,unit-label From 75f5aaa654e272ad6a74b1a5ccdf7b8dfbeb2964 Mon Sep 17 00:00:00 2001 From: Andra Date: Fri, 11 Dec 2020 12:33:53 +0100 Subject: [PATCH 31/39] Fix bug renewableAsset not showing --- docs/MVS_parameters_list.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MVS_parameters_list.csv b/docs/MVS_parameters_list.csv index 4b7e2154d..c58e7a534 100644 --- a/docs/MVS_parameters_list.csv +++ b/docs/MVS_parameters_list.csv @@ -29,7 +29,7 @@ 27, None, The name of years the project is intended to be operational. The project duration also sets the installation time of the assets used in the simulation. After the project ends these assets are 'sold' and the refund is charged against the initial investment costs.,30, None, Numeric, Years,Project_duration,projectduration-label 28, None, Users can assign a project ID as per their preference.,1, None, Alphanumeric, None,Project_id,projectid-label 29, None, Users can assign a project name as per their preference., Borg Havn, None, Alphanumeric, None,Project_name,projectname-label -30, None, User can enter True if the asset is considered as a renewable energy source. False should be entered otherwise., True, Acceptable values are either True or False, str, Boolean, renewableAsset, renewableasset-label +30, None, User can enter True if the asset is considered as a renewable energy source. False should be entered otherwise., True, Acceptable values are either True or False, str, Boolean,renewableAsset,renewableasset-label 31, None, The share of renewables in the generation mix of the energy supplied by the DSO (utility).,0.1, Between 0 and 1, Numeric, Factor,renewable_share,renshare-label 32, None, Users can assign a scenario id as per their preference.,1, None, Alphanumeric, None,scenario_id,scenarioid-label 33, None, Users can assign a scenario name as per their preference., Warehouse 14, None, Alphanumeric, None,scenario_name,scenarioname-label From a1ba76e50894a23888c3512336dcdbcced5c2d91 Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Fri, 11 Dec 2020 14:14:17 +0100 Subject: [PATCH 32/39] Fix renewable share benchmark test --- .../csv_elements/energyProviders.csv | 2 +- tests/test_benchmark_KPI.py | 31 ++++++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/tests/benchmark_test_inputs/AB_grid_PV/csv_elements/energyProviders.csv b/tests/benchmark_test_inputs/AB_grid_PV/csv_elements/energyProviders.csv index 9d1f7eead..64ad6f024 100644 --- a/tests/benchmark_test_inputs/AB_grid_PV/csv_elements/energyProviders.csv +++ b/tests/benchmark_test_inputs/AB_grid_PV/csv_elements/energyProviders.csv @@ -9,4 +9,4 @@ peak_demand_pricing,currency/kW,0 peak_demand_pricing_period,"times per year (1,2,3,4,6,12)",1 type_oemof,str,source energyVector,str,Electricity -renewable_share,factor,0.1 +renewable_share,factor,0 diff --git a/tests/test_benchmark_KPI.py b/tests/test_benchmark_KPI.py index d14646455..ee4ff79ed 100644 --- a/tests/test_benchmark_KPI.py +++ b/tests/test_benchmark_KPI.py @@ -73,11 +73,15 @@ ENERGY_CONSUMPTION, ENERGY_CONVERSION, ENERGY_PRODUCTION, + ENERGY_PROVIDERS, ENERGY_STORAGE, KPI, KPI_SCALARS_DICT, FLOW, ATTRIBUTED_COSTS, + TOTAL_EXCESS, + LABEL, + DSO_CONSUMPTION, ) TEST_INPUT_PATH = os.path.join(TEST_REPO_PATH, "benchmark_test_inputs") @@ -112,7 +116,7 @@ def process_expected_values(): """ Processes expected values from `test_data_economic_expected_values.csv`. - + Derive expected values dependent on actual dispatch of the asset(s) for asset in expected_values.columns: @@ -381,7 +385,7 @@ def setup_method(self): "EXECUTE_TESTS_ON to 'master' to run this test", ) @mock.patch("argparse.ArgumentParser.parse_args", return_value=argparse.Namespace()) - def renewable_factor_and_renewable_share_of_local_generation(self, margs): + def test_renewable_factor_and_renewable_share_of_local_generation(self, margs): r""" Benchmark test that checks the calculation of * TOTAL_NON_RENEWABLE_GENERATION_IN_LES @@ -411,10 +415,13 @@ def renewable_factor_and_renewable_share_of_local_generation(self, margs): # Get total flow of PV total_res_local = data[ENERGY_PRODUCTION]["pv_plant_01"][TOTAL_FLOW][VALUE] - # Get total demand - total_demand = data[KPI][KPI_SCALARS_DICT][ - TOTAL_DEMAND + SUFFIX_ELECTRICITY_EQUIVALENT + dso_consumption_source = ( + data[ENERGY_PROVIDERS]["Electricity_grid_DSO"][LABEL] + DSO_CONSUMPTION + ) + total_supply_dso = data[ENERGY_PRODUCTION][dso_consumption_source][TOTAL_FLOW][ + VALUE ] + assert ( data[KPI][KPI_SCALARS_DICT][TOTAL_RENEWABLE_GENERATION_IN_LES] == total_res_local @@ -427,15 +434,15 @@ def renewable_factor_and_renewable_share_of_local_generation(self, margs): ), f"There is another renewable energy source apart from PV." assert ( data[KPI][KPI_SCALARS_DICT][TOTAL_NON_RENEWABLE_ENERGY_USE] - == total_demand - total_res_local + == total_supply_dso ), "The non-renewable energy use was expected to be all grid supply, but this does not hold true." - assert ( - data[KPI][KPI_SCALARS_DICT][RENEWABLE_FACTOR] - == total_res_local / total_demand + assert data[KPI][KPI_SCALARS_DICT][RENEWABLE_FACTOR] == (total_res_local) / ( + total_res_local + total_supply_dso ), f"The {RENEWABLE_FACTOR} is not as expected." - assert ( - data[KPI][KPI_UNCOUPLED_DICT][RENEWABLE_FACTOR]["Electricity"] - == total_res_local / total_demand + assert data[KPI][KPI_UNCOUPLED_DICT][RENEWABLE_FACTOR]["Electricity"] == ( + total_res_local + ) / ( + total_res_local + total_supply_dso ), f"The {RENEWABLE_FACTOR} is not as expected." assert ( data[KPI][KPI_SCALARS_DICT][RENEWABLE_SHARE_OF_LOCAL_GENERATION] == 1 From 19455f0329d271ade41d420547760de0edcc2698 Mon Sep 17 00:00:00 2001 From: smartie2076 Date: Fri, 11 Dec 2020 14:15:19 +0100 Subject: [PATCH 33/39] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 461887674..1714d5d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ Here is a template for new release sections - Use current version number as defined in `version.py` for RTD (#693) - Added storage to the table in autoreport listing the energy system components (#686) - Add assertion `sum(attributed_costs)==cost_total` (for single-vector system) (#613) +- Benchmark test for renewable share (`TestTechnicalKPI.test_renewable_factor_and_renewable_share_of_local_generation()`) (#613) ## [0.5.3] - 2020-12-08 From 9898fa777165be2f1284135bb2af2ae5d63ddb90 Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Sun, 13 Dec 2020 17:08:41 +0100 Subject: [PATCH 34/39] Merge branch 'dev' of https://github.com/rl-institut/multi-vector-simulator into fix/energybusses-in-rtd  Conflicts:  docs/simulating_with_the_mvs.rst --- docs/Model_Assumptions.rst | 87 ++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/docs/Model_Assumptions.rst b/docs/Model_Assumptions.rst index 2ea8eb71a..af56f3095 100644 --- a/docs/Model_Assumptions.rst +++ b/docs/Model_Assumptions.rst @@ -287,15 +287,17 @@ For example, the `degree of sector coupling` will reach its maximum, when the sy In the MVS, there is no distinction between energy carriers and energy vector. For `Electricity` of the `Electricity` vector this may be self-explanatory. However, the energy carriers of the `Heat` vector can have different technical characteristics: A fluid on different temperature levels. As the MVS measures the energy content of a flow in kWh(thermal) however, this distinction is only relevant for the end user to be aware of, as two assets that have different energy carriers as an output should not be connected to one and the same bus if a detailed analysis is expected. An example of this would be, that a system where the output of the diesel boiler as well as the output of a solar thermal panel are connected to the same bus, eventhough they can not both supply the same kind of heat demands (radiator vs. floor heating). This, however, is something that the end-user has to be aware of themselves, eg. by defining self-explanatory labels. -CO2 Emission factors +Emission factors ---------------------------- In order to optimise the energy system with minimum CO2 emissions, it is important to calculate CO2 emission per unit of fuel consumption. Following emission factors for energy carriers are defined: -.. _table_CO2_emissions_energyCarriers: +These values are based on direct emissions during stationary consumption of the mentioned fuels. -.. list-table:: CO2 Emission factors: Kg of CO2 equivalent per unit of fuel consumption +.. _table_emissions_energyCarriers: + +.. list-table:: Emission factors: Kg of CO2 equivalent per unit of fuel consumption :widths: 50 25 25 25 :header-rows: 1 @@ -305,37 +307,38 @@ Following emission factors for energy carriers are defined: - Source * - Diesel - kgCO2eq/litre - - 2.68 - - [`4 `__] + - 2.7 + - [`4 `__] * - Gasoline - kgCO2eq/litre - - 2.29 - - [`4 `__] + - 2.3 + - [`4 `__] + * - Kerosene + - kgCO2eq/litre + - 2.5 + - [`4 `__] + * - Natural gas + - kgCO2eq/m3 + - 1.9 + - [`4 `__] + * - LPG + - kgCO2eq/litre + - 1.6 + - [`4 `__] * - Biodiesel - kgCO2eq/litre - - 0.03178 - - [`4 `__] + - 0.000125 + - [`5 `__] * - Bioethanol - kgCO2eq/litre - - 0.00855 - - [`4 `__] - * - LPG - - kgCO2eq/litre - - 1.611 - - [`4 `__] + - 0.0000807 + - [`5 `__] * - Biogas - kgCO2eq/m3 - - 0 - - [`5 `__] - * - Natural gas - - kgCO2eq/m3 - - 1.88 - - [`4 `__] - + - 0.12 + - [`6 `__] -The CO2 emission of biogas is considered neutral since CO2 is considered as biogenic.[`5 `__] - -CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, India): +Following CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, India) are defined: .. _table_CO2_emissions_countries: @@ -344,31 +347,31 @@ CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, Indi :header-rows: 1 * - Country - - Value - Unit + - Value - Source * - Germany - - 397 - - kgCO2eq/kWh - - [`6 `__] + - gCO2eq/kWh + - 338 + - [`7 `__] * - Norway - - 14.4 - - kgCO2eq/kWh - - [`7 `__] + - gCO2eq/kWh + - 19 + - [`7 `__] * - Spain - - 197 - - kgCO2eq/kWh - - [`6 `__] + - gCO2eq/kWh + - 207 + - [`7 `__] * - Romania - - 339 - - kgCO2eq/kWh - - [`6 `__] + - gCO2eq/kWh + - 293 + - [`7 `__] * - India - - 697 - - kgCO2eq/kWh - - [`8 `__] + - gCO2eq/kWh + - 708 + - [`8 `__] -The values mentioned in the table above account for emissions during the complete life cycle. This includes emissions during energy production, energy conversion, energy storage and energy transmission. These values always fluctuate and depend on various factors such as energy mix, weather conditions, and demand fluctuations. +The values mentioned in the table above account for emissions during the complete life cycle. This includes emissions during energy production, energy conversion, energy storage and energy transmission. Limitations ----------- From 84a8360830819cdcc224cfa8dd7c281c9d26f5ae Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Mon, 14 Dec 2020 10:54:04 +0100 Subject: [PATCH 35/39] Page numbers included with Source --- docs/Model_Assumptions.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/Model_Assumptions.rst b/docs/Model_Assumptions.rst index af56f3095..7bed3b538 100644 --- a/docs/Model_Assumptions.rst +++ b/docs/Model_Assumptions.rst @@ -308,35 +308,35 @@ These values are based on direct emissions during stationary consumption of the * - Diesel - kgCO2eq/litre - 2.7 - - [`4 `__] + - [`4 `__] Page No. 26 * - Gasoline - kgCO2eq/litre - 2.3 - - [`4 `__] + - [`4 `__]Page No. 26 * - Kerosene - kgCO2eq/litre - 2.5 - - [`4 `__] + - [`4 `__]Page No. 26 * - Natural gas - kgCO2eq/m3 - 1.9 - - [`4 `__] + - [`4 `__]Page No. 26 * - LPG - kgCO2eq/litre - 1.6 - - [`4 `__] + - [`4 `__]Page No. 26 * - Biodiesel - kgCO2eq/litre - 0.000125 - - [`5 `__] + - [`5 `__]Page No. 6 * - Bioethanol - kgCO2eq/litre - 0.0000807 - - [`5 `__] + - [`5 `__]Page No. 6 * - Biogas - kgCO2eq/m3 - 0.12 - - [`6 `__] + - [`6 `__]Page No. 1 Following CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, India) are defined: @@ -353,23 +353,23 @@ Following CO2 emissions for Germany and the four pilot sites (Norway, Spain, Rom * - Germany - gCO2eq/kWh - 338 - - [`7 `__] + - [`7 `__] Fig. 1 * - Norway - gCO2eq/kWh - 19 - - [`7 `__] + - [`7 `__] Fig. 1 * - Spain - gCO2eq/kWh - 207 - - [`7 `__] + - [`7 `__] Fig. 1 * - Romania - gCO2eq/kWh - 293 - - [`7 `__] + - [`7 `__] Fig. 1 * - India - gCO2eq/kWh - 708 - - [`8 `__] + - [`8 `__] Page No. 7 The values mentioned in the table above account for emissions during the complete life cycle. This includes emissions during energy production, energy conversion, energy storage and energy transmission. From c89e67b7a56b29846849b89a4cd2b7420f798db5 Mon Sep 17 00:00:00 2001 From: smartie2076 <44204527+smartie2076@users.noreply.github.com> Date: Mon, 14 Dec 2020 12:28:56 +0100 Subject: [PATCH 36/39] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1089d11ef..e69e30f75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Here is a template for new release sections ### Added - Updated release protocol with info on credentials for test.pypi.org (step 9) and added "Fixed" to unreleased section of changelog.md in release protocol (#695) - Added information about the API to the docs (#701) +- Add and link `rewableAsset` as parameter in RTD, specifically `MVS_parameters.rst` and `MVS_parameters_list.csv` (#710) ### Changed - Benchmark test for investment model (`Test_Economic_KPI.test_benchmark_Economic_KPI_C2_E2`): Expand test to LCOE as well as all all other system-wide economic parameters, transpose `test_data_economic_expected_values.csv`, change `test_data_economic_expected_values.xls` (#613) From b6c48d5666880fee2298f162b9a82657acfb68ce Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Mon, 14 Dec 2020 13:29:40 +0100 Subject: [PATCH 37/39] Wrongly reverted the commit/Page nos included with Source again --- docs/Model_Assumptions.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/Model_Assumptions.rst b/docs/Model_Assumptions.rst index 7bed3b538..8d7101ef1 100644 --- a/docs/Model_Assumptions.rst +++ b/docs/Model_Assumptions.rst @@ -312,31 +312,31 @@ These values are based on direct emissions during stationary consumption of the * - Gasoline - kgCO2eq/litre - 2.3 - - [`4 `__]Page No. 26 + - [`4 `__] Page No. 26 * - Kerosene - kgCO2eq/litre - 2.5 - - [`4 `__]Page No. 26 + - [`4 `__] Page No. 26 * - Natural gas - kgCO2eq/m3 - 1.9 - - [`4 `__]Page No. 26 + - [`4 `__] Page No. 26 * - LPG - kgCO2eq/litre - 1.6 - - [`4 `__]Page No. 26 + - [`4 `__] Page No. 26 * - Biodiesel - kgCO2eq/litre - 0.000125 - - [`5 `__]Page No. 6 + - [`5 `__] Page No. 6 * - Bioethanol - kgCO2eq/litre - 0.0000807 - - [`5 `__]Page No. 6 + - [`5 `__] Page No. 6 * - Biogas - kgCO2eq/m3 - 0.12 - - [`6 `__]Page No. 1 + - [`6 `__] Page No. 1 Following CO2 emissions for Germany and the four pilot sites (Norway, Spain, Romania, India) are defined: @@ -353,19 +353,19 @@ Following CO2 emissions for Germany and the four pilot sites (Norway, Spain, Rom * - Germany - gCO2eq/kWh - 338 - - [`7 `__] Fig. 1 + - [`7 `__] Fig. 2 * - Norway - gCO2eq/kWh - 19 - - [`7 `__] Fig. 1 + - [`7 `__] Fig. 2 * - Spain - gCO2eq/kWh - 207 - - [`7 `__] Fig. 1 + - [`7 `__] Fig. 2 * - Romania - gCO2eq/kWh - 293 - - [`7 `__] Fig. 1 + - [`7 `__] Fig. 2 * - India - gCO2eq/kWh - 708 From 40dcb38281ceafd1ce567f6ee6ccd98fbc5d26ab Mon Sep 17 00:00:00 2001 From: paragpatil39 Date: Mon, 14 Dec 2020 13:36:50 +0100 Subject: [PATCH 38/39] By mistakenly removed comment from changelog is added --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1935972b0..bb3d16cf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Here is a template for new release sections - Use current version number as defined in `version.py` for RTD (#693) - Added storage to the table in autoreport listing the energy system components (#686) - Add assertion `sum(attributed_costs)==cost_total` (for single-vector system) (#613) +- Benchmark test for renewable share (`TestTechnicalKPI.test_renewable_factor_and_renewable_share_of_local_generation()`) (#613) ## [0.5.3] - 2020-12-08 From 8ad9b26768eee36506c6e605fa6b28ed93f8e04a Mon Sep 17 00:00:00 2001 From: paragpatil39 <58882654+paragpatil39@users.noreply.github.com> Date: Mon, 14 Dec 2020 15:15:25 +0100 Subject: [PATCH 39/39] Update docs/Model_Assumptions.rst Co-authored-by: Sabine Haas --- docs/Model_Assumptions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Model_Assumptions.rst b/docs/Model_Assumptions.rst index 8d7101ef1..2b8cc257a 100644 --- a/docs/Model_Assumptions.rst +++ b/docs/Model_Assumptions.rst @@ -289,7 +289,7 @@ In the MVS, there is no distinction between energy carriers and energy vector. F Emission factors ---------------------------- -In order to optimise the energy system with minimum CO2 emissions, it is important to calculate CO2 emission per unit of fuel consumption. +In order to optimise the energy system with minimum emissions, it is important to calculate emission per unit of fuel consumption. Following emission factors for energy carriers are defined: