Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
4210de5
Introducing energy demand for warm water heating
danielfeismann Apr 22, 2025
05436a8
Merge branch 'df/#1349-thermalHouse-innerTemp' into df/#856-hotWater
danielfeismann Apr 23, 2025
b361955
fix after merge
danielfeismann Apr 23, 2025
43723fd
fix some tests
danielfeismann Apr 23, 2025
d19d53d
Merge branch 'dev' into df/#856-hotWater
danielfeismann Apr 25, 2025
d501044
fix after merge
danielfeismann Apr 25, 2025
82139be
Merge branch 'dev' into df/#856-hotWater
danielfeismann Apr 28, 2025
434385e
fix nextFullHour
danielfeismann Apr 29, 2025
9f66896
adapt for thermalGrid edge case
danielfeismann Apr 29, 2025
13de689
make domesticHotWaterStorage smaller for ThermalGridIT and some test …
danielfeismann Apr 29, 2025
baf7415
adapt storage sizes
danielfeismann Apr 29, 2025
b8763a7
fmt
danielfeismann Apr 29, 2025
3575fa7
more test adaptions
danielfeismann Apr 29, 2025
0945cb2
Merge branch 'dev' into df/#856-hotWater
danielfeismann May 13, 2025
5d35c56
fix after merging dev
danielfeismann May 13, 2025
83b1a80
fmt
danielfeismann May 14, 2025
f2faac7
adapt ThermalGridIT
danielfeismann May 14, 2025
c393408
fmt
danielfeismann May 14, 2025
01a6b28
fmt
danielfeismann May 15, 2025
5cfde9b
fmt and rounding
danielfeismann May 16, 2025
703265b
fix compiler warning
danielfeismann May 16, 2025
6f8c7a0
fmt and rounding ThermalGridIT
danielfeismann May 16, 2025
b02360a
fmt
danielfeismann May 16, 2025
db73266
adapt flex options of Hp and adapt tests accordingly
danielfeismann May 16, 2025
25ef8a7
added changed flex behaviour to documentation
danielfeismann May 16, 2025
8853e3d
fmt
danielfeismann May 16, 2025
6867749
fixed first round of fixme entries
danielfeismann May 16, 2025
0761d42
remove fixme after checking it
danielfeismann May 19, 2025
eb6b25e
fmt
danielfeismann May 19, 2025
5054a31
fmt
danielfeismann May 19, 2025
6c0146a
fmt
danielfeismann May 19, 2025
9c10b7b
Merge branch 'dev' into df/#856-hotWater
danielfeismann May 19, 2025
c3a23b1
fmt
danielfeismann May 20, 2025
8c5874f
Merge remote-tracking branch 'origin/df/#856-hotWater' into df/#856-h…
danielfeismann May 20, 2025
6fb980e
fix method naming
danielfeismann May 20, 2025
34246a1
Merge branch 'dev' into df/#856-hotWater
danielfeismann May 20, 2025
8cd2961
Merge branch 'dev' into df/#856-hotWater
danielfeismann May 21, 2025
a3643cc
Merge remote-tracking branch 'origin/df/#856-hotWater' into df/#856-h…
danielfeismann May 21, 2025
e193677
fix comments in ThermalGridIT
danielfeismann May 21, 2025
eb84cee
Merge branch 'dev' into df/#856-hotWater
danielfeismann May 22, 2025
f9dfa65
fix after merging dev
danielfeismann May 22, 2025
bca3b5f
fix tests
danielfeismann May 22, 2025
79db129
squants conversions for specific heat capacity
danielfeismann May 22, 2025
92d151a
Merge branch 'dev' into df/#856-hotWater
danielfeismann May 26, 2025
f823fce
align naming of heatStorage
danielfeismann May 26, 2025
03b1c09
Merge branch 'dev' into df/#856-hotWater
danielfeismann Jun 3, 2025
931a4b1
renaming temperature
danielfeismann Jun 3, 2025
3b5923d
fix imports
danielfeismann Jun 3, 2025
fa0904e
fix units in scalaDoc
danielfeismann Jun 3, 2025
99dcbeb
Merge remote-tracking branch 'origin/df/#856-hotWater' into df/#856-h…
danielfeismann Jun 3, 2025
e67fc33
Merge branch 'dev' into df/#856-hotWater
danielfeismann Jun 24, 2025
b70f053
Merge branch 'dev' into df/#856-hotWater
danielfeismann Jul 23, 2025
93c4699
Merge branch 'dev' into df/#856-hotWater
danielfeismann Jul 23, 2025
d244005
Merge remote-tracking branch 'origin/df/#1391-hp-flex-behaviour' into…
danielfeismann Jul 30, 2025
6c07039
fix after merging dev and #1392
danielfeismann Jul 30, 2025
d3b5f68
fixing imports format etc.
danielfeismann Jul 30, 2025
caaf325
remove doubled test
danielfeismann Jul 30, 2025
7cdda25
add missing test
danielfeismann Jul 30, 2025
1a2423b
removed not necessarily needed method
danielfeismann Jul 30, 2025
47a359c
Merge branch 'dev' into df/#856-hotWater
danielfeismann Aug 7, 2025
d80b4c7
Merge branch 'dev' into df/#856-hotWater
danielfeismann Aug 8, 2025
208865a
Merge branch 'dev' into df/#856-hotWater
danielfeismann Aug 8, 2025
5ae2864
Merge branch 'dev' into df/#856-hotWater
danielfeismann Aug 8, 2025
858cb8e
fix after merge
danielfeismann Aug 8, 2025
fdccded
fix also ThermalGridIT after merge dev
danielfeismann Aug 8, 2025
cc3d60b
Merge branch 'dev' into df/#856-hotWater
danielfeismann Aug 12, 2025
4f57ab3
Merge branch 'dev' into df/#856-hotWater
danielfeismann Aug 22, 2025
30f6d1d
import Celsius
danielfeismann Aug 22, 2025
f6fd413
Merge branch 'dev' into df/#856-hotWater
danielfeismann Sep 12, 2025
740147f
fix after merging dev
danielfeismann Sep 12, 2025
7e1e18f
Merge branch 'dev' into df/#856-hotWater
danielfeismann Sep 12, 2025
32436a7
Merge branch 'dev' into df/#856-hotWater
danielfeismann Sep 17, 2025
4f902f3
Merge branch 'df/#1481-introduce-DomesticHotWaterStorage' into df/#85…
danielfeismann Sep 19, 2025
0c17eab
adapt after merging changes from DomesticHotWaterStorage
danielfeismann Sep 19, 2025
4fd8cfe
check for correct storage after introducing AbstractThermalStorageResult
danielfeismann Sep 19, 2025
e210ac4
some format optimisation
danielfeismann Sep 19, 2025
5b06160
Merge branch 'dev' into df/#856-hotWater
danielfeismann Sep 22, 2025
2268114
add changelog
danielfeismann Sep 22, 2025
2a54a57
Merge branch 'dev' into df/#856-hotWater
danielfeismann Sep 23, 2025
9d721db
Merge branch 'dev' into df/#856-hotWater
danielfeismann Sep 23, 2025
05735f9
remove DomesticHotWaterStorageResultEvent
danielfeismann Sep 23, 2025
6634263
remove imports
danielfeismann Sep 23, 2025
5fa7efd
optimize imports
danielfeismann Sep 23, 2025
9eb0a38
remove unused parameter
danielfeismann Sep 24, 2025
6209ca4
Merge branch 'df/#1547-ThermalHouse-for-changes-by-including-tap-wate…
danielfeismann Sep 26, 2025
4bdcdd2
fix after merging ThermalHousePR
danielfeismann Sep 26, 2025
7af69fe
fix tests after use correct specificHeatCapacity for Water part 1
danielfeismann Sep 26, 2025
2918766
fix tests after use correct specificHeatCapacity for Water part 2
danielfeismann Sep 26, 2025
79f2069
refactor ThermalGridIT a bit
danielfeismann Sep 26, 2025
46968ef
Merge branch 'dev' into df/#856-hotWater
staudtMarius Sep 26, 2025
837fbef
make parameter a variable
danielfeismann Sep 26, 2025
f53ebe5
split determineEnergyDemand into single methods for simplification
danielfeismann Sep 26, 2025
9db539d
refactor storage types to maintain type safety
danielfeismann Sep 26, 2025
09f44d4
simplify handleCases by using a strategy-pattern matching
danielfeismann Sep 26, 2025
294fb2d
Merge branch 'df/#1556-thermalStorageTypes' into df/#856-hotWater
danielfeismann Sep 26, 2025
4821314
Merge branch 'df/#1554-handleFeedIn' into df/#856-hotWater
danielfeismann Sep 26, 2025
b8a3784
rollback result adaptions
danielfeismann Sep 26, 2025
f1c61dc
include suggestions from Copilot
danielfeismann Sep 27, 2025
c6d1895
remove ThermalStorageType and ThermalResult
danielfeismann Oct 1, 2025
e223836
Merge branch 'dev' into df/#856-hotWater
danielfeismann Oct 1, 2025
1b4449b
Merge branch 'dev' into df/#856-hotWater
danielfeismann Oct 7, 2025
de8ffbd
fmt
danielfeismann Oct 7, 2025
f5624df
fully consider pThermalMax of storages
danielfeismann Oct 7, 2025
23897c2
simplify ThermalStrategyPatterns
danielfeismann Oct 7, 2025
d198272
fix and improve ThermalStrategyPatterns
danielfeismann Oct 8, 2025
77d9f8b
changes from pThermalMax PR
danielfeismann Oct 9, 2025
9d1db12
fmt
danielfeismann Oct 9, 2025
f05530a
Merge branch 'dev' into df/#856-hotWater
danielfeismann Oct 13, 2025
e8f3b45
fmt
danielfeismann Oct 13, 2025
daff07c
Merge branch 'dev' into df/#856-hotWater
danielfeismann Oct 13, 2025
ecabd3f
fix test after merging dev
danielfeismann Oct 13, 2025
b0032fa
restore some comments
danielfeismann Oct 13, 2025
7bbf0da
typo
danielfeismann Oct 13, 2025
8621f3b
Merge branch 'dev' into df/#856-hotWater
danielfeismann Oct 13, 2025
51f34c0
Merge branch 'dev' into df/#856-hotWater
danielfeismann Oct 24, 2025
80d783e
Merge branch 'dev' into df/#856-hotWater
danielfeismann Oct 29, 2025
dfa2dcc
Merge branch 'dev' into df/#856-hotWater
danielfeismann Nov 7, 2025
6b9560a
fix fmt, scalaDoc and comments
danielfeismann Nov 7, 2025
9fbdb4b
change pattern matching to flatmap
danielfeismann Nov 7, 2025
015e83d
fix brackets in HpModel
danielfeismann Nov 7, 2025
c1521a8
add non flex notice to domestic hot water storage model documentation
danielfeismann Nov 7, 2025
a585ef2
Merge branch 'dev' into df/#856-hotWater
danielfeismann Dec 8, 2025
7699a02
Merge branch 'dev' into df/#856-hotWater
staudtMarius Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added basic external em service [#1566](https://github.com/ie3-institute/simona/issues/1566)
- Implement energy limit flex options and adapt optimization [#1572](https://github.com/ie3-institute/simona/issues/1572)
- Introducing `onePU` as default quantity [#1607](https://github.com/ie3-institute/simona/issues/1607)
- Introducing energy demand for warm water heating [#856](https://github.com/ie3-institute/simona/issues/856)

### Changed
- Upgraded `scala2` to `scala3` [#53](https://github.com/ie3-institute/simona/issues/53)
Expand Down
2 changes: 1 addition & 1 deletion docs/readthedocs/models/dhws_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This page documents the functionality of the domestic hot water storage available in SIMONA.

## Behaviour
This storage model operates on volumes, although the functions it provides for other models all operate with energy. Internally the storage model converts energy to volume and vice versa with formulas specified below. Furthermore, it is assumed that the storage medium is water. At initialisation the storage will be full. Domestic hot water storage will be charged when the state of charge is be below 20 % or when the required heat demand for hot tap water is higher than the stored energy in the storage.
This storage model operates on volumes, although the functions it provides for other models all operate with energy. Internally the storage model converts energy to volume and vice versa with formulas specified below. Furthermore, it is assumed that the storage medium is water. At initialisation the storage will be full. Domestic hot water storage will be charged when the state of charge is be below 20 % or when the required heat demand for hot tap water is higher than the stored energy in the storage. Furthermore the domestic hot water storage is not considered in any flexibility measures of the heat source (e.g. heat pump).

## Attributes, Units and Remarks

Expand Down
3 changes: 1 addition & 2 deletions docs/readthedocs/models/thermal_house_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ This page documents the functionality of the thermal house available in SIMONA.

## Behaviour

This house model represents the thermal behaviour of a building. It represents a simple shoebox with thermal capacity and transmission losses.
The house can optionally be equipped with a {ref}`cts_model` as thermal storage. Both are connected by the {ref}`thermal_grid_model`.
This house model represents the thermal behaviour of a building. It represents a simple shoebox with thermal capacity and transmission losses for its heating demand. As well the hot water demand (tap water) based on the number of inhabitants and the housing type on hourly basis is considered. The house can optionally be equipped with a {ref}`cts_model` as thermal storage. Both are connected by the {ref}`thermal_grid_model`.

The thermal house provides two different energy demands. The required demand indicates that the inner temperature of the house is below the lower temperature boundary and thus, requires mandatory heating. An additional demand indicates the amount of energy necessary to reach the target temperature. Additional demand not necessarily requires to be covered but could, e.g. for flexibility purposes.

Expand Down
50 changes: 39 additions & 11 deletions src/main/scala/edu/ie3/simona/model/participant/hp/HpModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import edu.ie3.simona.model.participant.control.QControl
import edu.ie3.simona.model.participant.hp.HpModel.{HpOperatingPoint, HpState}
import edu.ie3.simona.model.participant.{ParticipantFlexModel, ParticipantModel}
import edu.ie3.simona.model.thermal.ThermalGrid
import edu.ie3.simona.model.thermal.ThermalGrid.*
import edu.ie3.simona.model.thermal.ThermalGrid.{
ThermalDemandWrapper,
ThermalGridState,
}
import edu.ie3.simona.ontology.messages.flex.FlexType
import edu.ie3.simona.service.Data.PrimaryData.{
ComplexPower,
Expand Down Expand Up @@ -78,7 +81,19 @@ class HpModel private (
operatingPoint,
)

val thermalDemands = thermalGrid.determineEnergyDemand(thermalGridState)
val hoursWaterDemandToDetermine = thermalGrid.house.flatMap(
_.checkIfNeedToDetermineDomesticHotWaterDemand(
tick,
simulationTime,
lastState,
)
)

val thermalDemands =
thermalGrid.determineEnergyDemand(
thermalGridState,
hoursWaterDemandToDetermine,
)

lastState.copy(
tick = tick,
Expand Down Expand Up @@ -231,7 +246,7 @@ class HpModel private (
* @param thermalGridState
* State of the thermalGrid.
* @param thermalDemands
* ThermalEnergyDemand of the house and the thermal storage.
* ThermalEnergyDemand of the house and the thermal storages.
* @param wasRunningLastPeriod
* Indicates if the Hp was running till this tick.
* @return
Expand All @@ -246,19 +261,23 @@ class HpModel private (

val demandHouse = thermalDemands.houseDemand
val demandHeatStorage = thermalDemands.heatStorageDemand
val demandDomesticHotWaterStorage =
thermalDemands.domesticHotWaterStorageDemand
val noHeatStorageOrEmpty = thermalGridState.isHeatStorageEmpty

val turnHpOn =
(demandHouse.hasRequiredDemand && noHeatStorageOrEmpty) ||
(demandHouse.hasPossibleDemand && wasRunningLastPeriod ||
demandHeatStorage.hasRequiredDemand ||
(demandHeatStorage.hasPossibleDemand && wasRunningLastPeriod))
(demandHouse.hasPossibleDemand && wasRunningLastPeriod) ||
demandHeatStorage.hasRequiredDemand ||
(demandHeatStorage.hasPossibleDemand && wasRunningLastPeriod) ||
demandDomesticHotWaterStorage.hasRequiredDemand

val canOperate =
demandHouse.hasRequiredDemand || demandHouse.hasPossibleDemand ||
demandHeatStorage.hasRequiredDemand || demandHeatStorage.hasPossibleDemand
demandHeatStorage.hasRequiredDemand || demandHeatStorage.hasPossibleDemand ||
demandDomesticHotWaterStorage.hasRequiredDemand
val canBeOutOfOperation =
!(demandHouse.hasRequiredDemand && noHeatStorageOrEmpty)
!(demandHouse.hasRequiredDemand && noHeatStorageOrEmpty) && !demandDomesticHotWaterStorage.hasRequiredDemand

(
turnHpOn,
Expand Down Expand Up @@ -333,16 +352,21 @@ object HpModel {
* [[edu.ie3.simona.model.thermal.ThermalHouse]] used for space heating.
* @param qDotHeatStorage
* The thermal power input of the
* [[edu.ie3.simona.model.thermal.ThermalStorage]].
* [[edu.ie3.simona.model.thermal.ThermalStorage]] used for heat storage.
* @param qDotDomesticHotWaterStorage
* The thermal power input of the
* [[edu.ie3.simona.model.thermal.DomesticHotWaterStorage]] used for
* domestic hot water / tap water.
*/
final case class ThermalGridOperatingPoint(
qDotHp: Power,
qDotHouse: Power,
qDotHeatStorage: Power,
qDotDomesticHotWaterStorage: Power,
)
object ThermalGridOperatingPoint {
def zero: ThermalGridOperatingPoint =
ThermalGridOperatingPoint(zeroKW, zeroKW, zeroKW)
ThermalGridOperatingPoint(zeroKW, zeroKW, zeroKW, zeroKW)
}

/** Holds all relevant data for a hp model calculation.
Expand Down Expand Up @@ -381,7 +405,11 @@ object HpModel {
): HpState = {
val therGrid = ThermalGrid(thermalGrid)
val initialState = ThermalGrid.startingState(therGrid, zeroCelsius)
val thermalDemand = therGrid.determineEnergyDemand(initialState)
val thermalDemand =
therGrid.determineEnergyDemand(
initialState,
Some(Seq(simulationTime.getHour)),
)

HpState(
tick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import edu.ie3.util.scala.quantities.DefaultQuantities.zeroKW
private case class ThermalDemandConditions(
shouldContinueHouseHeating: Boolean,
houseDemand: Boolean,
waterStorageDemand: Boolean,
heatStorageDemand: Boolean,
housePossible: Boolean,
waterStoragePossible: Boolean,
heatStoragePossible: Boolean,
houseHeatedLastState: Boolean,
)
Expand All @@ -38,14 +40,19 @@ private object ThermalDemandConditions {
ThermalDemandConditions(
/* Consider the action in the last state
* We can continue using the qDots from last operating point to keep continuity.
* If the house was heated in lastState and has still some demand.
*/
* If the house was heated in lastState and has still some demand and the domestic
* hot water storage has no demand. */
shouldContinueHouseHeating =
lastOperatingPoint.qDotHouse > zeroKW && houseDemand.hasPossibleDemand,
lastOperatingPoint.qDotHouse > zeroKW && houseDemand.hasPossibleDemand &&
!state.thermalDemands.domesticHotWaterStorageDemand.hasRequiredDemand,
houseDemand = houseDemand.hasRequiredDemand,
waterStorageDemand =
state.thermalDemands.domesticHotWaterStorageDemand.hasRequiredDemand,
heatStorageDemand =
heatStorageDemand.hasRequiredDemand || heatStorageDemand.hasPossibleDemand,
housePossible = houseDemand.hasPossibleDemand,
waterStoragePossible =
state.thermalDemands.domesticHotWaterStorageDemand.hasPossibleDemand,
heatStoragePossible = heatStorageDemand.hasPossibleDemand,
houseHeatedLastState = isHouseHeatedLastState,
)
Expand Down
Loading