Skip to content

Feat/fix boiler high tempfix: remove ValueError check for high outside temp in boiler simulation (#145) - #204

Open
sunnykumarabc01-dev wants to merge 3 commits into
google:copybara_pushfrom
sunnykumarabc01-dev:feat/fix-boiler-high-temp
Open

sunnykumarabc01-dev wants to merge 3 commits into
google:copybara_pushfrom
sunnykumarabc01-dev:feat/fix-boiler-high-temp

Conversation

@sunnykumarabc01-dev

@sunnykumarabc01-dev sunnykumarabc01-dev commented Oct 13, 2026 •

Copy link
Copy Markdown

Fixes #145

Context & Discussion Analysis

During hot weather conditions (such as Oct 6, 2024), the boiler simulation previously crashed due to strict checks when the outdoor air temperature exceeded the hot water temperature. Based on repository discussions, three architectural approaches were evaluated:

  1. Option 1: Remove assertion/error and allow negative dissipation (Recommended & Implemented)

    • Behavior: Returns a negative thermal dissipation rate when outside_temp > water_temp, accurately modeling net heat gain from the environment (ambient pre-heating).
    • Pros: Physically correct, simple, and allows the simulator to automatically adjust boiler demand without crashing.
    • Cons: Callers must correctly interpret negative values in energy balances.
  2. Option 2: Clamp to zero (Clamp to Zero)

    • Behavior: Treats dissipation as 0.0 if outside_temp > water_temp.
    • Pros: Avoids negative rates.
    • Cons: Physically incorrect because ambient heat gain during hot days is ignored.
  3. Option 3: Make it configurable (allow_ambient_heating boolean)

    • Behavior: Introduces a class attribute to toggle between ambient heating support.
    • Pros: Full backward compatibility.
    • Cons: Adds unnecessary code complexity and API overhead.

We chose Option 1 because it aligns with true thermodynamic principles and cleanly resolves the simulation crash without bloated configuration flags.

Summary of Changes:

  • Removed the strict ValueError check in compute_thermal_dissipation_rate inside smart_control/simulator/boiler.py when outside_temp > water_temp.
  • Updated the docstring to explicitly document that negative thermal rates indicate net ambient heat gain.
  • Disabled obsolete test cases checking for the old value error behavior in boiler_test.py and verified that all 36 unit tests pass successfully.
image

Acknowledgements

This branch has not been deployed

No deployments
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.

Boiler Fails with High Outside Air Temp

1 participant