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

Nrcan issue 408 Exclude district heating and cooling from EUI for GSHP #1642

Merged
merged 3 commits into from
Nov 27, 2023
Merged
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
27 changes: 22 additions & 5 deletions lib/openstudio-standards/standards/necb/common/btap_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize(model:, runner: nil, cost_result:, baseline_cost_equipment_total_
@btap_data.merge!(building_costing_data(cost_result)) unless cost_result.nil?
@btap_data.merge!(climate_data)
@btap_data.merge!(service_water_heating_data)
@btap_data.merge!(energy_eui_data)
@btap_data.merge!(energy_eui_data(model))
@btap_data.merge!(energy_peak_data)
@btap_data.merge!(utility(model))
@btap_data.merge!(unmet_hours(model))
Expand Down Expand Up @@ -1400,7 +1400,7 @@ def energy_peak_data
return data
end

def energy_eui_data
def energy_eui_data(model)
data = {}
# default to zero to start.
['energy_eui_fans_gj_per_m_sq',
Expand All @@ -1412,6 +1412,16 @@ def energy_eui_data
'energy_eui_total_gj_per_m_sq',
'energy_eui_heat recovery_gj_per_m_sq',
'energy_eui_water systems_gj_per_m_sq'].each { |end_use| data[end_use] = 0.0 }

# Check if the HVAC of the model is GSHP
plant_loops = model.getPlantLoops
model_has_how_many_GSHP = 0.0
plant_loops.each do |plantloop|
if plantloop.name.to_s.upcase.include? "GLHX"
model_has_how_many_GSHP += 1.0
end
end

# Get E+ End use table from sql
table = get_sql_table_to_json(@model, 'AnnualBuildingUtilityPerformanceSummary', 'Entire Facility', 'End Uses')['table']
# Get rid of totals and averages rows.. I want just the
Expand All @@ -1422,13 +1432,20 @@ def energy_eui_data
# Store eui by use name.
data["energy_eui_#{row['name'].downcase}_gj_per_m_sq"] = energy_columns.inject(0) { |sum, tuple| sum += tuple[1] } / @conditioned_floor_area_m_sq
end

data['energy_eui_total_gj_per_m_sq'] = 0.0
['natural_gas_GJ', 'electricity_GJ', 'additional_fuel_GJ'].each do |column|

['natural_gas_GJ', 'electricity_GJ', 'additional_fuel_GJ', 'district_cooling_GJ', 'district_heating_GJ'].each do |column|
data["energy_eui_#{column.downcase}_per_m_sq"] = table.inject(0) { |sum, row| sum + (row[column].nil? ? 0.0 : row[column]) } / @conditioned_floor_area_m_sq
data['energy_eui_total_gj_per_m_sq'] += data["energy_eui_#{column.downcase}_per_m_sq"] unless data["energy_eui_#{column.downcase}_per_m_sq"].nil?
end
['district_cooling_GJ', 'district_heating_GJ'].each do |column|
data["energy_eui_#{column.downcase}_per_m_sq"] = table.inject(0) { |sum, row| sum + (row[column].nil? ? 0.0 : row[column]) } / @conditioned_floor_area_m_sq

# If the HVAC of the model is GSHP, district heating and cooling must be removed from EUIs for heating and cooling and total EUI
# NOTE: it has been assumed that if a model has GSHP, that is the only HVAC type in the model. This assumption means that any district heating/cooling in the model is related to GSHP.
if model_has_how_many_GSHP > 0.0
data['energy_eui_heating_gj_per_m_sq'] -= data['energy_eui_district_heating_gj_per_m_sq']
data['energy_eui_cooling_gj_per_m_sq'] -= data['energy_eui_district_cooling_gj_per_m_sq']
data['energy_eui_total_gj_per_m_sq'] -= (data['energy_eui_district_heating_gj_per_m_sq'] + data['energy_eui_district_cooling_gj_per_m_sq'])
end

# Get total and net site energy use intensity
Expand Down