Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix egrid emission calculation for df measures #258

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ def load_prediction_from_full_run(model, num_timesteps_in_hr, epw_path=nil, run_
end

### read cambium/egrid emission factors
def read_emission_factors(model, scenario, year=2018)
def read_emission_factors(model, scenario, year=2021)
lbm_to_kg = OpenStudio.convert(1.0, 'lb_m', 'kg').get
# set cambium and egrid regions
grid_region = model.getBuilding.additionalProperties.getFeatureAsString('grid_region')
Expand Down Expand Up @@ -969,7 +969,7 @@ def emission_prediction(load, factor, num_timesteps_in_hr)
hourly_emissions_kg = hourly_load_mwh.zip(factor).map { |n, f| n * f }
elsif factor.is_a?(Numeric)
# egrid factor
hourly_emissions_kg = (hourly_load_mwh.inject(:+)) * factor
hourly_emissions_kg = hourly_load_mwh.map {|n| n * factor}
else
raise "Bad emission factors"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ def load_prediction_from_full_run(model, num_timesteps_in_hr, epw_path=nil, run_
end

### read cambium/egrid emission factors
def read_emission_factors(model, scenario, year=2018)
def read_emission_factors(model, scenario, year=2021)
lbm_to_kg = OpenStudio.convert(1.0, 'lb_m', 'kg').get
# set cambium and egrid regions
grid_region = model.getBuilding.additionalProperties.getFeatureAsString('grid_region')
Expand Down Expand Up @@ -970,7 +970,7 @@ def emission_prediction(load, factor, num_timesteps_in_hr)
hourly_emissions_kg = hourly_load_mwh.zip(factor).map { |n, f| n * f }
elsif factor.is_a?(Numeric)
# egrid factor
hourly_emissions_kg = (hourly_load_mwh.inject(:+)) * factor
hourly_emissions_kg = hourly_load_mwh.map {|n| n * factor}
else
raise "Bad emission factors"
end
Expand Down