Skip to content

Add chp dispatch policies#713

Draft
zolanaj wants to merge 10 commits intomasterfrom
add-chp-dispatch-policies
Draft

Add chp dispatch policies#713
zolanaj wants to merge 10 commits intomasterfrom
add-chp-dispatch-policies

Conversation

@zolanaj
Copy link
Copy Markdown
Collaborator

@zolanaj zolanaj commented Apr 14, 2026

Please check if the PR fulfills these requirements

  • CHANGELOG.md is updated
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Any new Django model inputs have also been added to reoptjl/test/posts/all_inputs_test.json

What kind of change does this PR introduce?

  • adds dispatch policies for electrical load following and exclusive absorption chiller service for CHP systems (see v0.58.0 CHP load following REopt.jl#586)
  • add dispatch results to include heat sent to absorption chiller for each relevant heating technology

What is the current behavior?

Flows to the absorption chiller were previously considered as part of the flows to heating loads.

What is the new behavior (if this is a feature change)?

Flows to the absorption chiller are now separate results from those going to serve a given heating load.

Does this PR introduce a breaking change?

(What changes might users need to make in their application due to this PR?)
If an absorption chiller was included as a technology, dispatch results that formerly reconciled may now be incomplete without including the new flows.

Other information:

CHP is not currently in job/test/posts/all_inputs_test.json so the new CHP inputs were added to reoptjl/test/posts/chp_defaults_post.json

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new CHP dispatch policy inputs and separates absorption-chiller heat flows into distinct time-series outputs, aligning the API contract with updated REopt.jl dispatch behavior.

Changes:

  • Added new CHPInputs flags for electrical-load-following and absorption-chiller-only serving (with month scoping).
  • Added new *_to_absorption_chiller_series_mmbtu_per_hour (and storage-to-absorption-chiller) outputs across multiple heating/storage technologies, and renamed storage-to-steam-turbine output series.
  • Bumped the Julia REopt dependency version in the Julia environment.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
reoptjl/test/posts/test_thermal_in_results.json Updates test POST payload with new CHP input fields.
reoptjl/models.py Introduces new CHP input fields and new/renamed thermal dispatch result fields.
julia_src/Manifest.toml Updates the pinned REopt Julia package version.
CHANGELOG.md Documents the new CHP inputs/results and the output-field rename.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread reoptjl/models.py
Comment on lines +4619 to +4647
serve_absorption_chiller_only = models.BooleanField(
default=True,
null=True,
blank=True,
help_text="Boolean indicator if CHP produced heat either serves absorption chiller or sends it to waste"
)
months_serving_absorption_chiller_only = ArrayField(
models.IntegerField(
validators=[
MinValueValidator(1),
MaxValueValidator(12)
],
null=True, blank=True
),
default=list, blank=True,
help_text="Months of the year in which the CHP only serves the absorption chiller load, only used if serve_absorption_chiller_only is True"
)
follow_electrical_load = models.BooleanField(
default=True,
null=True,
blank=True,
help_text="Boolean indicator if CHP follows the electrical load by running at capacity or meeting the load only"
)
include_cooling_in_chp_size = models.BooleanField(
default=True,
null=True,
blank=True,
help_text="Boolean indicator if cooling load (via absorption chiller) is included in the heuristic CHP sizing calculation along with heating loads"
)
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

These new CHP input fields (and the other output-field additions/renames in this PR) require a corresponding Django migration; otherwise the DB schema will be out of sync with models.py and runtime queries/updates will fail. Please add a migration that adds these columns and also handles the Hot/HighTempThermalStorage output field rename as a RenameField to preserve existing data.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Comment thread reoptjl/models.py
Comment on lines +4999 to +5005
thermal_to_absorption_chiller_series_mmbtu_per_hour = ArrayField(
models.FloatField(
null=True, blank=True
),
default=list,
help_text="Thermal power to absorption chiller time-series array [MMBtu/hr]"
)
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The newly added thermal_to_absorption_chiller_series_mmbtu_per_hour (and the analogous additions on other heating tech outputs) changes the results contract, but the existing thermal-results test only asserts legacy keys. Please extend the test suite to assert the presence/shape of the new absorption-chiller series outputs (and the renamed storage_to_steamturbine_series_mmbtu_per_hour) so regressions are caught.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Comment thread reoptjl/test/posts/test_thermal_in_results.json Outdated
Comment thread CHANGELOG.md Outdated
zolanaj and others added 2 commits April 14, 2026 14:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zolanaj and others added 2 commits April 14, 2026 14:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…s_serving_absorption_chiller_only

Agent-Logs-Url: https://github.com/NatLabRockies/REopt_API/sessions/5302ba85-a575-4efc-be0a-ea549b3ddaa5

Co-authored-by: zolanaj <12503579+zolanaj@users.noreply.github.com>
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.

3 participants