Skip to content

Bug fixes in TES-to-Turbine results and CHP heuristic input processing#594

Merged
zolanaj merged 7 commits intodevelopfrom
fix-tes-results-fields
Apr 26, 2026
Merged

Bug fixes in TES-to-Turbine results and CHP heuristic input processing#594
zolanaj merged 7 commits intodevelopfrom
fix-tes-results-fields

Conversation

@zolanaj
Copy link
Copy Markdown
Collaborator

@zolanaj zolanaj commented Apr 20, 2026

Please check if the PR fulfills these requirements

  • CHANGELOG.md is updated
  • Docs have been added / updated if applicable
  • Any new packages have been added to the [compat] section of Project.toml
  • REopt version number is updated in Project.toml and CHANGELOG.md if merging into master (do this right before merging)
  • Tests for the changes have been added. These tests should compare against expected values that are calculated independently of running REopt. Tests should also include garbage collection (see other tests for examples).
  • Any new REopt outputs and required inputs have been added to the corresponding Django model in the REopt API

Fixed

  • Fixed an error creating results for flows from hot TES to the steam turbine.
  • Fixed an bug preventing include_cooling_in_chp_size from being included in CHP inputs.

Changed

  • Refactored some results expressions so that value. isn't called within them.

@zolanaj zolanaj requested a review from Bill-Becker April 20, 2026 18:24
@zolanaj
Copy link
Copy Markdown
Collaborator Author

zolanaj commented Apr 20, 2026

@Bill-Becker I think this addresses the issue, at least things seem to work on the REopt.jl side; I'll push a change that points to this feature branch on the API side.

The updated test includes the "include_cooling_in_chp_size" parameter now; I ran the all_inputs cleaned up post separately but didn't add that to the test set just in the interest of runtime.

@Bill-Becker
Copy link
Copy Markdown
Collaborator

@Bill-Becker I think this addresses the issue, at least things seem to work on the REopt.jl side; I'll push a change that points to this feature branch on the API side.

The updated test includes the "include_cooling_in_chp_size" parameter now; I ran the all_inputs cleaned up post separately but didn't add that to the test set just in the interest of runtime.

Thanks Alex. So you were able to get the cleaned all_inputs file to run/solve in this branch?

@zolanaj
Copy link
Copy Markdown
Collaborator Author

zolanaj commented Apr 21, 2026

yes, exactly.

@Bill-Becker I think this addresses the issue, at least things seem to work on the REopt.jl side; I'll push a change that points to this feature branch on the API side.
The updated test includes the "include_cooling_in_chp_size" parameter now; I ran the all_inputs cleaned up post separately but didn't add that to the test set just in the interest of runtime.

Thanks Alex. So you were able to get the cleaned all_inputs file to run/solve in this branch?

Yes, that's correct - the cleaned all_inputs file builds, solves, and returns results on my end, as well as a case in which we add "include_cooling_in_chp_size" to CHP inputs in a separate test.

Copy link
Copy Markdown
Collaborator

@Bill-Becker Bill-Becker left a comment

Choose a reason for hiding this comment

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

Just a few minor comments/questions to respond to.

Comment thread src/core/scenario.jl
absorption_chiller_cop = nothing
# User can override by explicitly setting include_cooling_in_chp_size = false
include_cooling_in_size = get(d["CHP"], "include_cooling_in_chp_size", haskey(d, "AbsorptionChiller"))
if "include_cooling_in_chp_size" in keys(d["CHP"])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The pop!() function handles a default value like the get() function does, so this could be reduced to one line: pop!(d["CHP"], "include_cooling_in_chp_size", haskey(d, "AbsorptionChiller")). If you prefer this more verbose way for clarity, or I'm wrong about that, you can leave it.

Comment thread src/core/scenario.jl
federal_procurement_type = site.federal_procurement_type)
else # Only if modeling CHP without heating_load and existing_boiler (for prime generator, electric-only)
chp = CHP(d["CHP"],
chp = CHP(d["CHP"];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm curious why this wasn't erroring before, unless we never got into this block.

Comment thread src/results/boiler.jl
if "AbsorptionChiller" in p.techs.cooling
@expression(m, NewBoilertoAbsorptionChillerKW[ts in p.time_steps], sum(value.(m[:dvHeatToAbsorptionChiller]["Boiler",q,ts] for q in p.heating_loads)))
@expression(m, NewBoilertoAbsorptionChillerByQualityKW[q in p.heating_loads, ts in p.time_steps], sum(value.(m[:dvHeatToAbsorptionChiller]["Boiler",q,ts])))
@expression(m, NewBoilertoAbsorptionChillerKW[ts in p.time_steps], sum(m[:dvHeatToAbsorptionChiller]["Boiler",q,ts] for q in p.heating_loads))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Was this (and all other related changes below) causing an error when creating the results, or is it just less efficient?

@Bill-Becker Bill-Becker self-requested a review April 21, 2026 22:29
@zolanaj zolanaj merged commit c3e4768 into develop Apr 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants