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

Fix thermalGrid.handleInfeed in combination with thermalHouse.determineState #915

Open
danielfeismann opened this issue Aug 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@danielfeismann
Copy link
Member

danielfeismann commented Aug 20, 2024

at ThermalGrid.handleInfeed we call thermalHouse.determineState expecting not to heat the house further since it can't handle the (complete) infeed.

        if (
          thermalHouse.isInnerTemperatureTooHigh(
            updatedHouseState.innerTemperature
          )
        ) {
          /* The house is already heated up fully, set back the infeed and put it into storage, if available */
          val (fullHouseState, maybeFullHouseThreshold) =
            thermalHouse.determineState(
              tick,
              lastHouseState,
              ambientTemperature,
              zeroKW,
            )

but thermalHouse.determineState will use (last)State.qDot not qDot=zeroKW here

  def determineState(
      tick: Long,
      state: ThermalHouseState,
      ambientTemperature: Temperature,
      qDot: Power,
  ): (ThermalHouseState, Option[ThermalThreshold]) = {
    val duration = Seconds(tick - state.tick)
    val updatedInnerTemperature = newInnerTemperature(
      state.qDot,
      duration,
      state.innerTemperature,
      ambientTemperature,
    )
@danielfeismann danielfeismann added the bug Something isn't working label Aug 20, 2024
@danielfeismann
Copy link
Member Author

This is blocked by refactoring hp / thermal grid PRs. Check afterwards if this might be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant