From feb4af6d9cd3306f28197df920a49d81b11b7f7e Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 15 Nov 2023 17:17:34 -0700 Subject: [PATCH] Stub request when generator, add notes, revert defaults changes. --- HPXMLtoOpenStudio/measure.xml | 6 +-- HPXMLtoOpenStudio/resources/hpxml_defaults.rb | 42 +++++++++---------- ReportUtilityBills/measure.rb | 4 +- ReportUtilityBills/measure.xml | 8 ++-- ReportUtilityBills/resources/util.rb | 1 + 5 files changed, 31 insertions(+), 30 deletions(-) diff --git a/HPXMLtoOpenStudio/measure.xml b/HPXMLtoOpenStudio/measure.xml index a833423540..d6d59e007b 100644 --- a/HPXMLtoOpenStudio/measure.xml +++ b/HPXMLtoOpenStudio/measure.xml @@ -3,8 +3,8 @@ 3.1 hpxm_lto_openstudio b1543b30-9465-45ff-ba04-1d1f85e763bc - 5a988455-10e6-4e09-a169-42f3b52c5222 - 2023-11-15T21:19:24Z + 7f9d8cf2-9144-41f2-ad54-55bd9c514cd2 + 2023-11-16T00:11:23Z D8922A73 HPXMLtoOpenStudio HPXML to OpenStudio Translator @@ -262,7 +262,7 @@ hpxml_defaults.rb rb resource - 51C4EFBB + 745C9EA1 hpxml_schema/HPXML.xsd diff --git a/HPXMLtoOpenStudio/resources/hpxml_defaults.rb b/HPXMLtoOpenStudio/resources/hpxml_defaults.rb index b2ea862bef..cb8e0d4eb0 100644 --- a/HPXMLtoOpenStudio/resources/hpxml_defaults.rb +++ b/HPXMLtoOpenStudio/resources/hpxml_defaults.rb @@ -401,33 +401,31 @@ def self.apply_utility_bill_scenarios(runner, hpxml_header, hpxml_bldg, has_fuel end end - if (hpxml_bldg.pv_systems.size > 0) || (hpxml_bldg.batteries.size > 0) - if scenario.pv_compensation_type.nil? - scenario.pv_compensation_type = HPXML::PVCompensationTypeNetMetering - scenario.pv_compensation_type_isdefaulted = true - end + next if hpxml_bldg.pv_systems.size == 0 - if scenario.pv_compensation_type == HPXML::PVCompensationTypeNetMetering - if scenario.pv_net_metering_annual_excess_sellback_rate_type.nil? - scenario.pv_net_metering_annual_excess_sellback_rate_type = HPXML::PVAnnualExcessSellbackRateTypeUserSpecified - scenario.pv_net_metering_annual_excess_sellback_rate_type_isdefaulted = true - end - if scenario.pv_net_metering_annual_excess_sellback_rate_type == HPXML::PVAnnualExcessSellbackRateTypeUserSpecified - if scenario.pv_net_metering_annual_excess_sellback_rate.nil? - scenario.pv_net_metering_annual_excess_sellback_rate = 0.03 - scenario.pv_net_metering_annual_excess_sellback_rate_isdefaulted = true - end - end - elsif scenario.pv_compensation_type == HPXML::PVCompensationTypeFeedInTariff - if scenario.pv_feed_in_tariff_rate.nil? - scenario.pv_feed_in_tariff_rate = 0.12 - scenario.pv_feed_in_tariff_rate_isdefaulted = true + if scenario.pv_compensation_type.nil? + scenario.pv_compensation_type = HPXML::PVCompensationTypeNetMetering + scenario.pv_compensation_type_isdefaulted = true + end + + if scenario.pv_compensation_type == HPXML::PVCompensationTypeNetMetering + if scenario.pv_net_metering_annual_excess_sellback_rate_type.nil? + scenario.pv_net_metering_annual_excess_sellback_rate_type = HPXML::PVAnnualExcessSellbackRateTypeUserSpecified + scenario.pv_net_metering_annual_excess_sellback_rate_type_isdefaulted = true + end + if scenario.pv_net_metering_annual_excess_sellback_rate_type == HPXML::PVAnnualExcessSellbackRateTypeUserSpecified + if scenario.pv_net_metering_annual_excess_sellback_rate.nil? + scenario.pv_net_metering_annual_excess_sellback_rate = 0.03 + scenario.pv_net_metering_annual_excess_sellback_rate_isdefaulted = true end end + elsif scenario.pv_compensation_type == HPXML::PVCompensationTypeFeedInTariff + if scenario.pv_feed_in_tariff_rate.nil? + scenario.pv_feed_in_tariff_rate = 0.12 + scenario.pv_feed_in_tariff_rate_isdefaulted = true + end end - next if hpxml_bldg.pv_systems.size == 0 - if scenario.pv_monthly_grid_connection_fee_dollars_per_kw.nil? && scenario.pv_monthly_grid_connection_fee_dollars.nil? scenario.pv_monthly_grid_connection_fee_dollars = 0.0 scenario.pv_monthly_grid_connection_fee_dollars_isdefaulted = true diff --git a/ReportUtilityBills/measure.rb b/ReportUtilityBills/measure.rb index 2870ebf714..060a092f93 100644 --- a/ReportUtilityBills/measure.rb +++ b/ReportUtilityBills/measure.rb @@ -194,12 +194,13 @@ def energyPlusOutputRequests(runner, user_arguments) # Has production has_pv = @hpxml_buildings.select { |hpxml_bldg| !hpxml_bldg.pv_systems.empty? }.size > 0 has_battery = @model.getElectricLoadCenterStorageLiIonNMCBatterys.size > 0 # has a modeled battery + has_generator = @hpxml_buildings.select { |hpxml_bldg| !hpxml_bldg.generators.empty? }.size > 0 # Fuel outputs fuels.each do |(fuel_type, is_production), fuel| fuel.meters.each do |meter| next unless has_fuel[hpxml_fuel_map[fuel_type]] - next if is_production && !has_pv && !has_battery + next if is_production && !has_pv && !has_battery && !has_generator result << OpenStudio::IdfObject.load("Output:Meter,#{meter},monthly;").get if fuel_type == FT::Elec && @hpxml_header.utility_bill_scenarios.has_detailed_electric_rates @@ -550,6 +551,7 @@ def get_utility_rates(hpxml_path, fuels, utility_rates, bill_scenario, monthly_f end # Net Metering + # TODO: if battery or generator and no PV, default to HPXML::PVAnnualExcessSellbackRateTypeRetailElectricityCost? rate.net_metering_excess_sellback_type = bill_scenario.pv_net_metering_annual_excess_sellback_rate_type if bill_scenario.pv_compensation_type == HPXML::PVCompensationTypeNetMetering rate.net_metering_user_excess_sellback_rate = bill_scenario.pv_net_metering_annual_excess_sellback_rate if rate.net_metering_excess_sellback_type == HPXML::PVAnnualExcessSellbackRateTypeUserSpecified diff --git a/ReportUtilityBills/measure.xml b/ReportUtilityBills/measure.xml index 27003b4d93..486203fd63 100644 --- a/ReportUtilityBills/measure.xml +++ b/ReportUtilityBills/measure.xml @@ -3,8 +3,8 @@ 3.1 report_utility_bills ca88a425-e59a-4bc4-af51-c7e7d1e960fe - a51e801a-a4b6-47b4-a2e6-83e4066b05b3 - 2023-11-15T21:19:27Z + 1f833719-ec58-490d-b8d3-5b7dd52078bc + 2023-11-16T00:15:18Z 15BF4E57 ReportUtilityBills Utility Bills Report @@ -142,7 +142,7 @@ measure.rb rb script - B4589B2D + 48E10965 detailed_rates/Sample Flat Rate Min Annual Charge.json @@ -280,7 +280,7 @@ util.rb rb resource - 87D3BB06 + A8ACF98D Contains Demand Charges.json diff --git a/ReportUtilityBills/resources/util.rb b/ReportUtilityBills/resources/util.rb index 610e318d0b..5884731b5d 100644 --- a/ReportUtilityBills/resources/util.rb +++ b/ReportUtilityBills/resources/util.rb @@ -353,6 +353,7 @@ def self.detailed_electric(header, fuels, rate, bill) end_of_year_bill_credit, excess_sellback = apply_excess_sellback(end_of_year_bill_credit, rate.net_metering_excess_sellback_type, rate.net_metering_user_excess_sellback_rate, net_elec_month.sum(0.0)) annual_total_charge_with_pv = annual_payments + end_of_year_bill_credit - excess_sellback + # TODO: if battery or generator and no PV, put this toward annual_energy_charge instead of annual_production credit? bill.annual_production_credit = annual_total_charge - annual_total_charge_with_pv for m in 0..11