NREL / EnergyPlus

EnergyPlus™ is a whole building energy simulation program that engineers, architects, and researchers use to model both energy consumption and water use in buildings.
https://energyplus.net
Other
1.13k stars 389 forks source link

Duplicated count of source energy in the reported meter Source:Facility and in ABUPS Total Source Energy #7466

Open xuanluo113 opened 5 years ago

xuanluo113 commented 5 years ago

Issue overview

There is some confusion on the reported meter Source:Facility for Environmental Impact reporting.

From .mtr file, this meter is calculated by aggregating the four variables, including:

For Meter=Source:Facility [J], ResourceType=Source, contents are:
Site:Environmental Impact Electricity Source Energy
Site:Environmental Impact Purchased Electricity Source Energy
Site:Environmental Impact Surplus Sold Electricity Source
Site:Environmental Impact Natural Gas Source Energy

However, there seems to be some mismatch in the results if this meter is declared in any reference building test file.

For example, for RefBldgSmallOffice, first, Environmental Impact Electricity Source Energy and Environmental Impact Purchased Electricity Source Energy are identical as reported. And they are added up in total in this meter.

Second, the annual source energy in the summary output table (Output:Table:SummaryReports, AllSummary;) seems to match the total of only Electricity:Facility and Gas:Facility, but not the annual aggregation of Source:Facility.

The bug seems to be that Site:Environmental Impact Electricity Source Energy and Site:Environmental Impact Purchased Electricity Source Energy are both count to the Source:Facility meter, but they usually overlap.

2020-03-05 Similar issue reported in helpdesk ticket 15400.

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

YanfeiNREL commented 5 years ago

@XuanLuoLBL I am working on this issue. A question: Which version of EnergyPlus are u using? Or Would you please upload the idf file? I need to repeat your issue as a starting point. Thanks.

xuanluo113 commented 5 years ago

@XuanLuoLBL I am working on this issue. A question: Which version of EnergyPlus are u using? Or Would you please upload the idf file? I need to repeat your issue as a starting point. Thanks.

I'm using 9.1. Any reference model in the testfile folder, such as RefBldgSmallOffice.idf, would produce the issue, if you add Source:Facility to the reported meter.

YanfeiNREL commented 5 years ago

@XuanLuoLBL . Where does your outputs (below) coming from? ''' Site:Environmental Impact Electricity Source Energy Site:Environmental Impact Purchased Electricity Source Energy Site:Environmental Impact Surplus Sold Electricity Source Site:Environmental Impact Natural Gas Source Energy '''

xuanluo113 commented 5 years ago

@YanfeiNREL Those are also reportable variables that you can add to the output variable list.

YanfeiNREL commented 5 years ago

@XuanLuoLBL Thanks for your clarifications. (1)Environmental Impact Electricity Source Energy and Environmental Impact Purchased Electricity Source Energy are identical as reported. Based on the 5.1.17.212 of InputOutputRef: Environmental Impact Electricity Source Energy is for the electricity consumed at the site that was not produced at the site. Environmental Impact Purchased Electricity Source Energy is similar but includes just the electricity purchased form the utility. Environmental Impact Surplus Sold Electricity Source is the source energy associated with any surplus electricity that is exported to the grid. Base on my understanding RefBuildSmallOffice purchased electricity 100% from utility. And it doesn't generate any electricity on-site. I didn't see a problem here. Please see the figure for details. ElectricityComparison

(2) I checked the source code and didn't find that Source:Facility count duplicate Electricity. From the building outputs, it looks the building only consumes electricity and gas. Ad other type of fuels are all zero. I think it makes sense to count the Electricity and Gas for the source energy. Would you please provide some details how did you find that: Site:Environmental Impact Electricity Source Energy and Site:Environmental Impact Purchased Electricity Source Energy are both count to the Source:Facility meter?

xuanluo113 commented 5 years ago

@XuanLuoLBL Thanks for your clarifications. (1)Environmental Impact Electricity Source Energy and Environmental Impact Purchased Electricity Source Energy are identical as reported. Based on the 5.1.17.212 of InputOutputRef: Environmental Impact Electricity Source Energy is for the electricity consumed at the site that was not produced at the site. Environmental Impact Purchased Electricity Source Energy is similar but includes just the electricity purchased form the utility. Environmental Impact Surplus Sold Electricity Source is the source energy associated with any surplus electricity that is exported to the grid. Base on my understanding RefBuildSmallOffice purchased electricity 100% from utility. And it doesn't generate any electricity on-site. I didn't see a problem here. Please see the figure for details. ElectricityComparison

(2) I checked the source code and didn't find that Source:Facility count duplicate Electricity. From the building outputs, it looks the building only consumes electricity and gas. Ad other type of fuels are all zero. I think it makes sense to count the Electricity and Gas for the source energy. Would you please provide some details how did you find that: Site:Environmental Impact Electricity Source Energy and Site:Environmental Impact Purchased Electricity Source Energy are both count to the Source:Facility meter?

@YanfeiNREL

For Meter=Source:Facility [J], ResourceType=Source, contents are:
Site:Environmental Impact Electricity Source Energy
Site:Environmental Impact Purchased Electricity Source Energy
Site:Environmental Impact Surplus Sold Electricity Source
Site:Environmental Impact Natural Gas Source Energy

This is quoted from on the "eplusout.mtd" file in the run time folder. I found this logic wrong and I think it should be corrected to adding up Elec and Gas only.

mjwitte commented 5 years ago

@YanfeiNREL @XuanLuoLBL Just a quick initial reaction here. There is no "logic" really that triggers this. Every metered output variables is assigned a meter type and resource type in the SetupOutputVariable command that instantiates it. With overlapping items like this, it can be tricky. It's possible that some of these should not be metered at all? Will need to think this through. And if there is on-site power generation, what does this list look like? It seems perhaps that the generic Electricity should not be metered here, but all of the components purchased, sold, and locally generated and used (not sure what that's called here) should all be included since they could have differerent source factors?

This same problem may be present with meters for other environmental impact factors (e.g. co2, nox, etc.)?

xuanluo113 commented 5 years ago

@mjwitte I'm a bit confused here with the comments. Originally I thought this 'Source:Facility' is metered as the total source energy use, and aggregating the annual meter should give the same value as in the tabular table summary, Table - Site and Source Energy, Row - Total Source Energy. However, this value in the html table is the annual sum of two meters: Electricity:Facility and Gas:Facility, while this 'Source:Facility' meter is the sum of the above-mentioned four meters.

Anyhow, there's no clear documentation of this metered variable in the I/O doc under Environmental Impact to refer to.

YanfeiNREL commented 5 years ago

@mjwitte Please advise how do i fix this issue. It looks like we need some systematic change to the output variable calculation? @XuanLuoLBL Thanks for pointing out the I/O doc issue. I am working on adding some thing to the Environmental Impact.

mjwitte commented 5 years ago

@YanfeiNREL @XuanLuoLBL The metering system is quite general which is why there is not specific documentation for specific meters. Perhaps that is a lame excuse . . . The mtd file is there to be the definitive documentation for what components are on each meter. I can look at this and provide some guidance, but not until after the v9.2 release is wrapped up.

mjwitte commented 5 years ago

Until then, perhaps you can outline exactly what the "correct" answer should be, taking into consideration the possibility for on-site power generation. It may be that the meters used in the source energy table should be changed also. Consider nothing to be correct at this point and decide which component meters would be the correct ones to use - what would the user expect to see?

Or maybe the source energy table needs to be expanded to offer multiple views (the current one based on single facility meters plus others that include on-site power generation - or maybe that's already there).

xuanluo113 commented 5 years ago

Until then, perhaps you can outline exactly what the "correct" answer should be, taking into consideration the possibility for on-site power generation. It may be that the meters used in the source energy table should be changed also. Consider nothing to be correct at this point and decide which component meters would be the correct ones to use - what would the user expect to see?

Or maybe the source energy table needs to be expanded to offer multiple views (the current one based on single facility meters plus others that include on-site power generation - or maybe that's already there).

@mjwitte Sounds good. Thanks!

mjwitte commented 4 years ago

@YanfeiNREL @xuanluo113 Regarding possible overlap of source components mentioned above:

For Meter=Source:Facility [J], ResourceType=Source, contents are:
Site:Environmental Impact Electricity Source Energy
Site:Environmental Impact Purchased Electricity Source Energy
Site:Environmental Impact Surplus Sold Electricity Source
Site:Environmental Impact Natural Gas Source Energy

This code her in PollutionModule.cc::ReadEnergyMeters is attempting to prevent overlap by subtracting ElecProducedFacility from ElecFacility and using the difference to calculate "Site:Environmental Impact Electricity Source Energy". It also adds the electric equivalent for PurchCoolFacility here.

Oh, but that only avoids the overlap between electricity consumed and any electricity that may have been produced onsite.

Seems the solution here is to not attach Site:Environmental Impact Purchased Electricity Source Energy and Site:Environmental Impact Surplus Sold Electricity Source to the "Source" meter. That would be done here in these two SetupOutputVariable calls by deleting all of the arguments after "Site". This will allow these to be reported as time series values but they won't be added to any meters.

mjwitte commented 4 years ago

For the user in ticket 15400 (noted at the top), the issue is similar but a different place in the code. In the following subtable, the Total Source Energy and Net Source Energy rows should be the same, but they are not when FuelFactors are used. image

The code for this table is here in OutputreportTabular.cc and following. Note how the logic is different if fuelfactorsused. When fuel factors are used, I'm fairly certain that district cooling is already included in gatherTotalsSource(1), so it should not be added again here. If the district cooling term is removed here and instead added to line 7818 (in the else block), I think that will fix it.

Likewise when FuelFactors are used, district heat and district steam are already included in natural gas source energy, so move those terms from L7877:7878 up to 7824. I'll put the user's file in DevSupport\DefectFiles\7466. You should add some district heat and district steam to this file to verify that they are being duplicated currently.