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

Add "with escalation" tables to life cycle cost report #7459

Merged
merged 15 commits into from Sep 28, 2019

Conversation

JasonGlazer
Copy link
Contributor

@JasonGlazer JasonGlazer commented Aug 16, 2019

Add escalated energy cost tables and a column to the present value by year table that shows the escalated energy costs. This resolves #6144

Review Checklist

This will not be exhaustively relevant to every PR.

  • Functional code review (it has to work!)
  • If defect, results of running current develop vs this branch should exhibit the fix
  • CI status: all green or justified
  • Performance: CI Linux results include performance check
  • Unit Test(s)
  • C++ checks:
    • Argument types
    • If any virtual classes, ensure virtual destructor included, other things
  • IDD changes:
    • Verify naming conventions and styles, memos and notes and defaults
    • Open windows IDF Editor with modified IDD to check for errors
    • If transition, add to input rules file for interfaces
    • If transition, add transition source
    • If transition, update idfs
  • If new idf included, locally check the err file and other outputs
  • Required documentation updates?
  • ExpandObjects changes?
  • If output changes, including tabular output structure, add to output rules file for interfaces

@JasonGlazer JasonGlazer added the Defect Includes code to repair a defect in EnergyPlus label Aug 16, 2019
@JasonGlazer JasonGlazer self-assigned this Aug 16, 2019
@mjwitte mjwitte added this to the EnergyPlus 9.2.0 milestone Aug 17, 2019
@JasonGlazer
Copy link
Contributor Author

@mjwitte or @Myoldmopar would one of you like to review this or suggest someone that would be a good reviewer?

@Myoldmopar
Copy link
Member

I'm happy to review this week.

@JasonGlazer
Copy link
Contributor Author

Thanks

int curResource_iRT = CashFlow(iCashFlow).Resource;
if (CashFlow(iCashFlow).Resource == iRT_Water ||
(CashFlow(iCashFlow).Resource >= iRT_OnSiteWater && CashFlow(iCashFlow).Resource <= iRT_Condensate)) {
continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought. It would be a little faster if these iRT variables were reordered, with water types at the end, so that only

if (CashFlow(iCashFlow).Resource >= iRT_Water) continue;

could be used. But probably wouldn't save that much since this code is only executed at end? of simulation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make sense to optimize this if it was in a timestep but since this is not it probably is not worth the effort.

int found = 0;
for (nUsePriceEsc = 1; nUsePriceEsc <= numUsePriceEscalation; ++nUsePriceEsc) {
if (UsePriceEscalation(nUsePriceEsc).resource - ResourceTypeInitialOffset == curResource) {
found = nUsePriceEsc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once found, break out of for loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

EXPECT_NEAR(EscalatedEnergy(2, 1), 100., 0.001);
EXPECT_NEAR(EscalatedEnergy(3, 1), 100., 0.001);
EXPECT_NEAR(EscalatedEnergy(4, 1), 100., 0.001);
EXPECT_NEAR(EscalatedEnergy(5, 1), 100., 0.001);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not a good choice for a unit test (using all 100s) where you don't know if the correct CashFlow(1).yrAmount(x) was used. Would rather see 100, 200, 300... or 101, 102, 103... Might not be worth the effort.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

@rraustad
Copy link
Contributor

I have reviewed with only minor comments. Hard to understand mods without reviewing results and comparing with hand calcs.

@JasonGlazer
Copy link
Contributor Author

Thanks for the review @rraustad

Copy link
Contributor

@rraustad rraustad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments addressed, Things look good, requesting clarification on results before merging.

@rraustad
Copy link
Contributor

I don't see any diff's related to these changes.

@rraustad
Copy link
Contributor

I'm not seeing any reason for further review. Merging.

@Myoldmopar
Copy link
Member

Have at it, @rraustad

@rraustad
Copy link
Contributor

Ran 5ZoneEconomicsTariffAndLifeCycleCosts.idf in this branch:

image

and in develop:

image

@rraustad
Copy link
Contributor

rraustad commented Aug 23, 2019

New Present Value By Year table now shows escalated Total Costs and those costs vary by year. @JasonGlazer since I don't have time to review how the escalated Total Costs should change over time as compared to the non-escalated costs, I'll ask a few questions before merging.

  • Is the Total Cost columns the cost for that year alone? I mean, not a cumulative cost.
  • Shouldn't the Total escalated cost for Jan 2013 be different from $51,500 ? Why was this number not affected by escalation?
  • and in Jan 2014, a difference of ~$2,000 (non escalated vs escalated) seems rather large for 3 years of escalation. Any explanation for that?
  • and if the year values are present value in today's dollars, then should the values increase year over year, not decrease? OK, well the numbers do increase year over year, I meant the $10,113.35 number for Jan 2014, shouldn't it be higher than$11,941.56.

@JasonGlazer
Copy link
Contributor Author

Let me take a look. That does seem like a large difference.

@rraustad
Copy link
Contributor

rraustad commented Aug 23, 2019

In the example file I see escalation rates of around 1%, that's $100 per year (based on the 11,000 number), not $1000 per year.

@mjwitte mjwitte added the OutputChange Code changes output in such a way that it cannot be merged after IO freeze label Aug 23, 2019
@mjwitte
Copy link
Contributor

mjwitte commented Aug 23, 2019

@Myoldmopar Since this adds a column to an output table, is it still ok to merge for 9.2?

@Myoldmopar
Copy link
Member

That's structural, so technically no, this should wait until after release. I'll add the proper milestone and you can review and approve the changes still. Then as soon as the release is done this can drop in.

@JasonGlazer
Copy link
Contributor Author

Darn. I did this one first in hopes that it would be in before the I/O freeze.

@mjwitte
Copy link
Contributor

mjwitte commented Aug 23, 2019

The OutputChange label would have helped prioritize it - sorry.

@rraustad
Copy link
Contributor

rraustad commented Aug 23, 2019

Technically no? As if a new column in an LCC table, would cause havoc. I'd rather see correct data in the tables. Oh well, it'll drop in 2 seconds after release as long as reviewer questions are addressed.

@rraustad rraustad added the MergeAfterRelease Pull request has been tentatively approved, just can't merge until code is unfrozen label Aug 28, 2019
@JasonGlazer
Copy link
Contributor Author

The BND diffs seem completely unrelated. I'm going to merge develop again and hopefully they go away.

@JasonGlazer
Copy link
Contributor Author

@rraustad and @Myoldmopar I think this ready to be merged as soon as the release goes out. CI had some spurious warnings but that was just because it wasn't caught up to develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus MergeAfterRelease Pull request has been tentatively approved, just can't merge until code is unfrozen OutputChange Code changes output in such a way that it cannot be merged after IO freeze
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LifeCycleCost:UsePriceEscalation should impact the Total Cost column of the Present Value by Year table
9 participants