impact_model.rb |
|
|---|---|
|
Copyright © 2010 Brighter Planet. See LICENSE for details. Contact Brighter Planet for dual-license arrangements. |
|
Meeting carbon modelThis model is used by Brighter Planet’s carbon emission web service to estimate the greenhouse gas emissions of a meeting (e.g. a conference). Timeframe and dateThe model estimates the emissions that occur during a particular CalculationsThe final estimate is the result of the calculations detailed below. These calculations are performed in reverse order, starting with the last calculation listed and finishing with the MethodsTo accomodate varying client input, each calculation may have one or more methods. These are listed under each calculation in order from most to least preferred. Each method is named according to the values it requires. If any of these values is not available the method will be ignored. If all the methods for a calculation are ignored, the calculation will not return a value. “Default” methods do not require any values, and so a calculation with a default method will always return a value. Standard complianceEach method lists any established calculation standards with which it complies. When compliance with a standard is requested, all methods that do not comply with that standard are ignored. This means that any values a particular method requires will have been calculated using a compliant method, because those are the only methods available. If any value did not have a compliant method in its calculation then it would be undefined, and the current method would have been ignored. CollaborationContributions to this carbon model are actively encouraged and warmly welcomed. This library includes a comprehensive test suite to ensure that your changes do not cause regressions. All changes should include test coverage for new functionality. Please see sniff, our emitter testing framework, for more information. |
require 'conversions'
module BrighterPlanet
module Meeting
module ImpactModel
def self.included(base)
base.decide :impact, :with => :characteristics do |
|
|
|
Carbon (kg CO2e)The meeting’s total anthropogenic greenhouse gas emissions during |
committee :carbon do |
|
If |
quorum 'from fuel uses, electricity emission factor, date, and timeframe', :needs => [:natural_gas_use, :fuel_oil_use, :electricity_use, :district_heat_use, :electricity_emission_factor, :date],
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics, timeframe|
date = characteristics[:date].is_a?(Date) ? characteristics[:date] : Date.parse(characteristics[:date].to_s)
if timeframe.include? date
(characteristics[:natural_gas_use] * Fuel.find('Pipeline Natural Gas').co2_emission_factor) +
(characteristics[:fuel_oil_use] * Fuel.find('Distillate Fuel Oil No. 2').co2_emission_factor) +
(characteristics[:electricity_use] * characteristics[:electricity_emission_factor]) +
(characteristics[:district_heat_use] * Fuel.find('District Heat').co2_emission_factor)
else
0
end
end
|
Default emission |
quorum 'default' do |
|
Displays an error if the previous method fails. |
raise "The emission committee's default quorum should never be called"
end
end
|
Electricity emission factor (kg CO2e / kWh)A greenhouse gas emission factor for the meeting’s electricity use including transmission and distribution losses. |
committee :electricity_emission_factor do |
|
Divide the |
quorum 'from eGRID subregion', :needs => :egrid_subregion,
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:egrid_subregion].electricity_emission_factor / (1 - characteristics[:egrid_subregion].egrid_region.loss_factor)
end
|
|
Divide the |
quorum 'from state', :needs => :state,
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:state].electricity_emission_factor / (1 - characteristics[:state].electricity_loss_factor)
end
|
|
Otherwise divide the U.S. average electricity emission factor (kg CO2e / kWh) by the U.S. average electricity loss factor to give kg CO2e / kWh. |
quorum 'default',
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do
EgridSubregion.fallback.electricity_emission_factor / (1 - EgridSubregion.fallback.egrid_region.loss_factor)
end
end
|
Natural gas use (m3)The meeting’s natural gas use. |
committee :natural_gas_use do |
|
Multiply the |
quorum 'from census division, area, and duration', :needs => [:census_division, :area, :duration],
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:census_division].meeting_building_natural_gas_intensity *
characteristics[:area] *
characteristics[:duration] / 3600.0
end
end
|
Fuel oil use (l)The meeting’s fuel oil use. |
committee :fuel_oil_use do |
|
Multiply the |
quorum 'from census division, area, and duration', :needs => [:census_division, :area, :duration],
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:census_division].meeting_building_fuel_oil_intensity *
characteristics[:area] *
characteristics[:duration] / 3600.0
end
end
|
Electricity use (kWh)The meeting’s electricity use. |
committee :electricity_use do |
|
Multiply the |
quorum 'from census division, area, and duration', :needs => [:census_division, :area, :duration],
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:census_division].meeting_building_electricity_intensity *
characteristics[:area] *
characteristics[:duration] / 3600.0
end
end
|
District heat use (MJ)The meeting’s district heat use. |
committee :district_heat_use do |
|
Multiply the |
quorum 'from census division, area, and duration', :needs => [:census_division, :area, :duration],
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:census_division].meeting_building_district_heat_intensity *
characteristics[:area] *
characteristics[:duration] / 3600.0
end
end
|
eGRID subregionThe meeting venue’s eGRID subregion. |
committee :egrid_subregion do |
|
Look up the |
quorum 'from zip code', :needs => :zip_code,
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:zip_code].egrid_subregion
end
end
|
Census divisionThe meeting venue’s census division. |
committee :census_division do |
|
Look up the |
quorum 'from state', :needs => :state,
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:state].census_division
end
|
|
Otherwise uses an artificial census division representing U.S. averages. |
quorum 'default',
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do
CensusDivision.fallback
end
end
|
StateThe meeting venue’s state. |
committee :state do |
|
Use client input, if available. |
|
|
Otherwise look up the |
quorum 'from zip code', :needs => :zip_code,
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do |characteristics|
characteristics[:zip_code].state
end
end
|
Zip codeThe zip code of the meeting venue. Use client input, if available. |
|
Area (m2)The meeting venue’s area. |
committee :area do |
|
Use client input, if available. |
|
|
Otherwise use 1,184.5 m2 (the average size of meeting buildings in the EIA Commercial Building Energy Consumption Survey). |
quorum 'default',
:complies => [:ghg_protocol_scope_3, :iso, :tcr] do
10_448.square_feet.to(:square_metres)
end
end
|
Duration (seconds)The meeting’s duration – the length of time the meeting facilities are in use. For example a two-day conference that runs 8 hours each day would have a duration of 57600. |
committee :duration do |
|
Uses client input, if available. |
|
|
Otherwise use 28800 seconds (8 hours). |
quorum 'default' do
28800.0
end
end
|
Date (date)The day the meeting occurred. |
committee :date do |
|
Use client input, if available. |
|
|
Otherwise use the first day of |
quorum 'from timeframe',
:complies => [:ghg_protocol_scope_3, :iso] do |characteristics, timeframe|
timeframe.from
end
end
end
end
end
end
end |