Skip to content

Commit

Permalink
refactor discharging power of domestic hot water storage to match pre…
Browse files Browse the repository at this point in the history
…cisely the energyDemand
  • Loading branch information
danielfeismann committed Aug 28, 2024
1 parent 0062712 commit a38f814
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 55 deletions.
15 changes: 8 additions & 7 deletions src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1273,18 +1273,19 @@ final case class ThermalGrid(
)
)

val durationAtFullPower =
val approxDurationAtFullPower =
domesticHotWaterDemand.required / chargingPower

if (durationAtFullPower > Seconds(1)) {
(
chargingPower * (-1),
if (approxDurationAtFullPower > Seconds(1)) {
val preciseChargingPower = -1 * domesticHotWaterDemand.required / (Seconds(approxDurationAtFullPower.toSeconds.toLong + 1))
val threshold = -1 * domesticHotWaterDemand.required / preciseChargingPower

(preciseChargingPower,
Some(
SimpleThermalThreshold(
tick + Math.round(durationAtFullPower.toSeconds)
tick + threshold.toSeconds.toLong)
)
),
)
)
} else {
(
(-1) * domesticHotWaterDemand.required / Seconds(1d),
Expand Down
Loading

0 comments on commit a38f814

Please sign in to comment.