Skip to content

Commit

Permalink
Merge pull request #564 from fschreyer/LCOEReport
Browse files Browse the repository at this point in the history
Add SE tax on electricity for hydrogen production to LCOE reporting and adapt reporting to changes from H2 Update
  • Loading branch information
fschreyer authored Mar 14, 2024
2 parents 1e50f6f + d226bf2 commit 0183c2c
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '2247162736'
ValidationKey: '2247182532'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'remind2: The REMIND R package (2nd generation)'
version: 1.135.16
version: 1.135.17
date-released: '2024-03-14'
abstract: Contains the REMIND-specific routines for data and model output manipulation.
authors:
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: remind2
Title: The REMIND R package (2nd generation)
Version: 1.135.16
Version: 1.135.17
Date: 2024-03-14
Authors@R: c(
person("Renato", "Rodrigues", , "[email protected]", role = c("aut", "cre")),
Expand Down
35 changes: 30 additions & 5 deletions R/reportLCOE.R
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@ reportLCOE <- function(gdx, output.type = "both"){
`Total LCOE (time step prices)` <- NULL
`Total LCOE (intertemporal prices)` <- NULL
`Adjustment Cost` <- NULL
`SE Tax` <- NULL
`tau_SE_tax` <- NULL



Expand Down Expand Up @@ -795,7 +797,7 @@ reportLCOE <- function(gdx, output.type = "both"){
# # annuity factor from REMIND,
# TODO: check whether this is the same as calculated above
# so far only used in levelized cost of DAC calculation below
p_teAnnuity <- readGDX(gdx, "p_teAnnuity", restore_zeros = F)
p_teAnnuity <- readGDX(gdx, c("p_teAnnuity","pm_teAnnuity"), restore_zeros = F)

### Read marginal adjustment costs ----

Expand Down Expand Up @@ -1181,6 +1183,26 @@ df.co2price.weighted <- df.pomeg.expand %>%
rename(tech = all_te, FlexPriceShare = value) %>%
select(region, period, tech, FlexPriceShare)


### Read SE Tax for Electrolysis ----

# read SE tax for electrolysis from GDX
v21_tau_SE_tax <- readGDX(gdx, "v21_tau_SE_tax", field = "l", restore_zeros = F)
# if not SE tax in run, set to 0
if(is.null(v21_tau_SE_tax)) {
v21_tau_SE_tax <- vm_costTeCapital
v21_tau_SE_tax[,,] <- 0
}

df.tau_SE_tax <- as.quitte(v21_tau_SE_tax) %>%
rename(tech = all_te, tau_SE_tax = value) %>%
select(region, period, tech, tau_SE_tax) %>%
# convert to USD2015/MWh
mutate( tau_SE_tax = 1.2 / as.vector(s_twa2mwh) * 1e12 * tau_SE_tax)




### Read Final Energy Taxes ----


Expand Down Expand Up @@ -1269,6 +1291,7 @@ df.co2price.weighted <- df.pomeg.expand %>%
left_join(df.curtShare, by = c("region", "period", "tech")) %>%
left_join(df.CCStax, by = c("region", "period", "tech")) %>%
left_join(df.flexPriceShare, by = c("region", "period", "tech")) %>%
left_join(df.tau_SE_tax, by = c("region", "period", "tech")) %>%
left_join(df.FEtax, relationship = "many-to-many", by = c("region", "period", "output")) %>%
left_join(df.AddTeInvH2, by = c("region", "period", "tech", "sector")) %>%
# filter to only have LCOE technologies
Expand All @@ -1283,7 +1306,7 @@ df.co2price.weighted <- df.pomeg.expand %>%
# replace NA by 0 in certain columns
# columns where NA should be replaced by 0
col.NA.zero <- c("OMF","OMV", "AdjCost","co2.price","co2.price.weighted", "fuel.price","fuel.price.weighted", "co2_dem","emiFac.se2fe","Co2.Capt.Price",
"secfuel.prod", "secfuel.price", "curtShare","CCStax.cost","FEtax","AddH2TdCost")
"secfuel.prod", "secfuel.price", "curtShare","CCStax.cost","FEtax","AddH2TdCost","tau_SE_tax")
df.LCOE[,col.NA.zero][is.na(df.LCOE[,col.NA.zero])] <- 0

# replace NA by 1 in certain columns
Expand Down Expand Up @@ -1385,6 +1408,8 @@ df.co2price.weighted <- df.pomeg.expand %>%
# Flex Tax benefit for electrolysis
# FlexPriceShare denotes share of the electricity price that electrolysis sees
mutate( `Flex Tax` = -(1-FlexPriceShare) * `Fuel Cost (time step prices)`) %>%
# SE tax for electrolysis, calculates fuel cost increase due to taxes and grid fees on electricity going into electrolysis
mutate(`SE Tax` = tau_SE_tax / eff) %>%
# se2fe technologies come with FE tax
mutate( `FE Tax` = FEtax,
# FE H2 has some additional t&d cost at low H2 shares (phase-in cost) in REMIND
Expand All @@ -1393,10 +1418,10 @@ df.co2price.weighted <- df.pomeg.expand %>%
mutate(
# Total LCOE with fuel cost and co2 tax cost based on fuel prices and carbon prices of time step for which LCOE are calculated
`Total LCOE (time step prices)` = `Investment Cost` + `OMF Cost` + `OMV Cost` + `Adjustment Cost` + `Fuel Cost (time step prices)` + `CO2 Tax Cost (time step prices)` +
`CO2 Provision Cost` + `Second Fuel Cost` + `CCS Tax Cost` + `Curtailment Cost` + `Flex Tax` + `FE Tax` + `Additional H2 t&d Cost`,
`CO2 Provision Cost` + `Second Fuel Cost` + `CCS Tax Cost` + `Curtailment Cost` + `Flex Tax` + `SE Tax` + `FE Tax` + `Additional H2 t&d Cost`,
# Total LCOE with fuel cost and co2 tax cost based on fuel prices and carbon prices that are intertemporally weighted and averaged over the plant lifetime
`Total LCOE (intertemporal prices)` = `Investment Cost` + `OMF Cost` + `OMV Cost` + `Adjustment Cost` + `Fuel Cost (intertemporal prices)` + `CO2 Tax Cost (intertemporal prices)` +
`CO2 Provision Cost` + `Second Fuel Cost` + `CCS Tax Cost` + `Curtailment Cost` + `Flex Tax` + `FE Tax` + `Additional H2 t&d Cost`)
`CO2 Provision Cost` + `Second Fuel Cost` + `CCS Tax Cost` + `Curtailment Cost` + `Flex Tax` + `SE Tax` + `FE Tax` + `Additional H2 t&d Cost`)


# Levelized Cost of UE in Buildings Putty Realization ----
Expand Down Expand Up @@ -1478,7 +1503,7 @@ df.co2price.weighted <- df.pomeg.expand %>%
`Fuel Cost (time step prices)` , `CO2 Tax Cost (time step prices)`,
`Fuel Cost (intertemporal prices)`, `CO2 Tax Cost (intertemporal prices)`,
`CO2 Provision Cost`,`Second Fuel Cost`, `Curtailment Cost`,
`CCS Tax Cost`, `Flex Tax`,`FE Tax`,`Additional H2 t&d Cost`,
`CCS Tax Cost`, `Flex Tax`,`SE Tax`,`FE Tax`,`Additional H2 t&d Cost`,
`Total LCOE (time step prices)`,
`Total LCOE (intertemporal prices)`
) %>%
Expand Down
2 changes: 1 addition & 1 deletion R/reportPrices.R
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL,
)

vm_costTeCapital <- readGDX(gdx, "vm_costTeCapital", field = "l", restore_zeros = F)[, YearsFrom2005, tech] # [tr USD2005/TWh]
p_teAnnuity <- readGDX(gdx, "p_teAnnuity", restore_zeros = F)[, , tech]
p_teAnnuity <- readGDX(gdx, c("p_teAnnuity","pm_teAnnuity"), restore_zeros = F)[, , tech]
vm_capFac <- readGDX(gdx, "vm_capFac", field = "l", restore_zeros = F)[, YearsFrom2005, tech] * 8760
pm_data_omf <- readGDX(gdx, "pm_data", restore_zeros = F)[, , "omf"][, , tech]

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The REMIND R package (2nd generation)

R package **remind2**, version **1.135.16**
R package **remind2**, version **1.135.17**

[![CRAN status](https://www.r-pkg.org/badges/version/remind2)](https://cran.r-project.org/package=remind2) [![R build status](https://github.com/pik-piam/remind2/workflows/check/badge.svg)](https://github.com/pik-piam/remind2/actions) [![codecov](https://codecov.io/gh/pik-piam/remind2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/remind2) [![r-universe](https://pik-piam.r-universe.dev/badges/remind2)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -49,7 +49,7 @@ In case of questions / problems please contact Renato Rodrigues <renato.rodrigue

To cite package **remind2** in publications use:

Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Duerrwaechter J, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P (2024). _remind2: The REMIND R package (2nd generation)_. R package version 1.135.16, <https://github.com/pik-piam/remind2>.
Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Duerrwaechter J, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P (2024). _remind2: The REMIND R package (2nd generation)_. R package version 1.135.17, <https://github.com/pik-piam/remind2>.

A BibTeX entry for LaTeX users is

Expand All @@ -58,7 +58,7 @@ A BibTeX entry for LaTeX users is
title = {remind2: The REMIND R package (2nd generation)},
author = {Renato Rodrigues and Lavinia Baumstark and Falk Benke and Jan Philipp Dietrich and Alois Dirnaichner and Jakob Duerrwaechter and Pascal Führlich and Anastasis Giannousakis and Robin Hasse and Jérome Hilaire and David Klein and Johannes Koch and Katarzyna Kowalczyk and Antoine Levesque and Aman Malik and Anne Merfort and Leon Merfort and Simón Morena-Leiva and Michaja Pehl and Robert Pietzcker and Sebastian Rauner and Oliver Richters and Marianna Rottoli and Christof Schötz and Felix Schreyer and Kais Siala and Björn Sörgel and Mike Spahr and Jessica Strefler and Philipp Verpoort and Pascal Weigmann},
year = {2024},
note = {R package version 1.135.16},
note = {R package version 1.135.17},
url = {https://github.com/pik-piam/remind2},
}
```

0 comments on commit 0183c2c

Please sign in to comment.