Skip to content

Commit

Permalink
Merge branch 'refs/heads/df/#827_fix_hp_overheating_house' into df/#878
Browse files Browse the repository at this point in the history
…-thermalGridIT

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
danielfeismann committed Aug 5, 2024
2 parents 11c8acb + d85279a commit 3e27bf7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Provide actual ambient temperature of tick to HpModel when calculate state [#882](https://github.com/ie3-institute/simona/issues/882)
- Fixed Hp results leading to overheating house and other effects [#827](https://github.com/ie3-institute/simona/issues/827)
- Fixed thermal storage getting recharged when empty [#827](https://github.com/ie3-institute/simona/issues/827)
- Fixed Hp results leading to overheating house and other effects [#827](https://github.com/ie3-institute/simona/issues/827)

## [3.0.0] - 2023-08-07

Expand Down
31 changes: 14 additions & 17 deletions src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,22 @@ final case class ThermalGrid(
val houseDemand =
house.zip(state.houseState).headOption match {
case Some((thermalHouse, lastHouseState)) =>
val updatedState = thermalHouse.determineState(
tick,
lastHouseState,
ambientTemperature,
lastHouseState.qDot,
)
val (updatedHouseState, updatedStorageState) =
thermalHouse.determineState(
tick,
lastHouseState,
ambientTemperature,
lastHouseState.qDot,
)
if (
updatedState._1.innerTemperature < thermalHouse.targetTemperature
updatedHouseState.innerTemperature < thermalHouse.targetTemperature
) {
house
.zip(state.houseState)
.map { case (house, state) =>
house.energyDemand(
tick,
ambientTemperature,
state,
)
}
.getOrElse(ThermalEnergyDemand.noDemand)
thermalHouse.energyDemand(
tick,
ambientTemperature,
updatedHouseState,
)

} else {
ThermalEnergyDemand.noDemand
}
Expand Down

0 comments on commit 3e27bf7

Please sign in to comment.