This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Heating sources * Create energyusage.yml * Update footprints.yml * Create energyprices.yml * lint * lint * Update definitions.js * fixed Oli's comments * move energyfootprints to own file * lint * lint * lint * disabled line-length rule for ymling * yaml fix * Add yamllint * fix energyfootprints.yml * Added wip energy model js * lint * fixes oli's comments * fixes oli's comments * Clean up * WIP * added text + links * add non elec heating * lin * add checksum Co-authored-by: Olivier Baumann <olivier.baumann@tmrow.com> Co-authored-by: Olivier Corradi <1655848+corradio@users.noreply.github.com>
- Loading branch information
1 parent
820f91d
commit a4c85d0
Showing
4 changed files
with
262 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
line-length: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
heating: | ||
HEATING_SOURCE_COAL_BOILER: | ||
kWh: | ||
intensityKilograms: 0.63 # kg co2e/kWh | ||
source: https://www.icax.co.uk/Decarbonising_Heating_2022.html | ||
HEATING_SOURCE_OIL_BOILER: | ||
kWh: | ||
intensityKilograms: 0.43 # kg co2e/kWh | ||
source: http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf | ||
HEATING_SOURCE_GAS_BOILER: | ||
kWh: | ||
intensityKilograms: 0.295 # kg co2e/kWh | ||
source: http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf | ||
HEATING_SOURCE_GAS_MICRO_COMBINED_HEAT_AND_POWER: | ||
kWh: | ||
intensityKilograms: 0.26 # kg co2e/kWh | ||
source: http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf | ||
HEATING_SOURCE_GAS_ABSORPTION_HEAT_PUMP: | ||
kWh: | ||
intensityKilograms: 0.175 # kg co2e/kWh | ||
source: http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf | ||
HEATING_SOURCE_BIOSOURCED_GASES: | ||
kWh: | ||
intensityKilograms: 0.06 # kg co2e/kWh | ||
source: http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf | ||
HEATING_SOURCE_BIOMASS_BOILER: | ||
kWh: | ||
intensityKilograms: 0.1 # kg co2e/kWh | ||
source: http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf | ||
HEATING_SOURCE_GEOTHERMAL: | ||
kWh: | ||
intensityKilograms: 0.01 # kg co2e/kWh | ||
source: http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf | ||
HEATING_SOURCE_SOLAR_THERMAL: | ||
kWh: | ||
intensityKilograms: 0.0225 # kg co2e/kWh | ||
source: http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf | ||
HEATING_SOURCE_DISTRICT_HEATING: | ||
kWh: | ||
country: | ||
AT: | ||
intensityKilograms: 0.138613768592457 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
BE: | ||
intensityKilograms: 0.153246230482934 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
BG: | ||
intensityKilograms: 0.242628007169097 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
CY: | ||
intensityKilograms: -0.00969682540749218 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
CZ: | ||
intensityKilograms: 0.287764611249576 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
DE: | ||
intensityKilograms: 0.188820002160917 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
DK: | ||
intensityKilograms: 0.203981361123157 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
EE: | ||
intensityKilograms: 0.163115712753168 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
ES: | ||
intensityKilograms: 0 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
FI: | ||
intensityKilograms: 0.185356469136768 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
FR: | ||
intensityKilograms: 0.0827175916129129 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
UK: | ||
intensityKilograms: 0.138031379296288 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
GR: | ||
intensityKilograms: 0.315308456821223 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
HR: | ||
intensityKilograms: 0.218491125208843 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
HU: | ||
intensityKilograms: 0.181767842244441 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
IE: | ||
intensityKilograms: 0 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
IT: | ||
intensityKilograms: 0.200398663230602 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
LT: | ||
intensityKilograms: 0.0966513330178206 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
LU: | ||
intensityKilograms: 0.126744277506435 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
LV: | ||
intensityKilograms: 0.104791562263033 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
MT: | ||
intensityKilograms: 0.162345134012572 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
NL: | ||
intensityKilograms: 0.157277165673387 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
PL: | ||
intensityKilograms: 0.345769096000686 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
PT: | ||
intensityKilograms: 0.272338841231362 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
RO: | ||
intensityKilograms: 0.220377645786264 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
SE: | ||
intensityKilograms: 0.0968585307202192 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
SI: | ||
intensityKilograms: 0.269687224992362 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' | ||
SK: | ||
intensityKilograms: 0.375480331140096 # kg co2e/kWh | ||
source: 'Lukas Kranzl, Michael Hartner, Andreas Müller, Gustav Resch, Sara Fritz, (TU Wien), Tobias Fleiter, Andrea Herbst, Matthias Rehfeldt, Pia Manz (Fraunhofer ISI), Alyona Zubaryeva (EURAC). | ||
Reviewed by Jakob Rager (CREM). Hotmaps Project, D5.2 WP5 Report – Heating & Cooling outlook until 2050, EU 28, 2018 www.hotmaps-project.eu' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import md5 from 'tiny-hashes/md5'; | ||
|
||
import { | ||
ELECTRICITY_ACTIVITIES, | ||
} from '../../definitions'; | ||
import energyFootprints from './energyfootprints.yml'; | ||
|
||
// ** modelName must not be changed. If changed then old activities will not be re-calculated ** | ||
export const modelName = 'energy'; | ||
const ymlChecksum = md5(JSON.stringify(energyFootprints)); | ||
export const modelVersion = `1_${ymlChecksum}`; // This model relies on footprints.yaml | ||
export const explanation = { | ||
text: 'Calculations take into account use of electricity and heating, based on fuel source', | ||
links: [ | ||
{ label: 'ICAX (2019)', href: 'https://www.icax.co.uk/Decarbonising_Heating_2022.html' }, | ||
{ label: 'The Parliamentary Office of Science and Technology (2016)', href: 'http://researchbriefings.files.parliament.uk/documents/POST-PN-0523/POST-PN-0523.pdf' }, | ||
{ label: 'Hotmaps Project (2018)', href: 'www.hotmaps-project.eu' }, | ||
], | ||
}; | ||
|
||
export const modelCanRunVersion = 1; | ||
export function modelCanRun(activity) { | ||
const { heatingSource, activityType } = activity; | ||
// Leave the electric activities up to the electricity model | ||
const isElectricActivity = ELECTRICITY_ACTIVITIES.includes(activityType); | ||
if (!heatingSource || isElectricActivity) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
function correctWithParticipants(footprint, participants) { | ||
return footprint / (participants || 1); | ||
} | ||
|
||
/* | ||
Carbon emissions of an activity (in kgCO2eq) | ||
*/ | ||
function carbonEmissionsWithoutParticipants(activity) { | ||
const { | ||
countryCodeISO2, | ||
heatingSource, | ||
energyWattHours, | ||
} = activity; | ||
|
||
if (!heatingSource) { | ||
throw new Error('Missing heatingSource'); | ||
} | ||
|
||
const energyFootprint = (energyFootprints[heatingSource] || {}).kWh; | ||
if (!energyFootprint) { | ||
throw new Error(`Unable to find a footprint for heatingSource ${heatingSource}`); | ||
} | ||
if (energyWattHours == null) { | ||
throw new Error('Missing energyWattHours'); | ||
} | ||
|
||
// Check if we can use the country-specific estimate | ||
if (energyFootprint.country | ||
&& countryCodeISO2 | ||
&& energyFootprint.country[countryCodeISO2] | ||
&& energyFootprint.country[countryCodeISO2].intensityKilograms) { | ||
// Get country-specific values | ||
const countryCarbonIntensity = energyFootprint.country[countryCodeISO2].intensityKilograms; | ||
return energyWattHours / 1000.0 * countryCarbonIntensity; | ||
} | ||
// Use non-country specific estimator | ||
if (!energyFootprint.intensityKilograms) { | ||
throw new Error(`Unable to find a non-country-specific carbon intensity for heatingSource ${heatingSource}`); | ||
} | ||
return energyWattHours / 1000.0 * energyFootprint.intensityKilograms; | ||
} | ||
|
||
export function carbonEmissions(activity) { | ||
return correctWithParticipants( | ||
carbonEmissionsWithoutParticipants(activity), | ||
activity.participants | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters