-
Notifications
You must be signed in to change notification settings - Fork 6
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
Refactoring of ThermalGrid.handleInfeed
to fix thermal storage recharge correctly when empty
#931
base: dev
Are you sure you want to change the base?
Conversation
…neState-of-ThermalHouse' into df/tmpHPmergeall
…ageResults-have-multiple-entries' into df/tmpHPmergeall # Conflicts: # CHANGELOG.md
…ion-of-Hp-when-not-under-control-of-an-EM' into df/tmpHPmergeall # Conflicts: # CHANGELOG.md
…ermalGird-energyDemand' into df/tmpHPmergeall
…ge correctly when empty
# Conflicts: # CHANGELOG.md # src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md # src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
…refactor-handleInfeed
This reverts commit a669b5b.
# Conflicts: # CHANGELOG.md
# Conflicts: # src/test/scala/edu/ie3/simona/model/participant/ChpModelSpec.scala # src/test/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorageSpec.scala
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some first questions from my side.
(zeroKW, lastStateStorageQDot * (-1)) | ||
else if ( | ||
lastStateStorageQDot == zeroKW && (demandWrapper.houseDemand.hasRequiredDemand || demandWrapper.heatStorageDemand.hasRequiredDemand) | ||
) | ||
( | ||
zeroKW, | ||
thermalGrid.storage.map(_.getChargingPower: squants.Power).get, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love some help understanding what is being done here. Maybe we could enhance the overall code documentation here? To someone who knows the implementation well, these probably seem trivial, but for the untrained eye they're maybe not. For example:
- There's multiple thermal powers, but they're not clearly defined. In
HpState
, isqDot
the combined thermal power including storage, or just the heat pump, or just storage? - Does
qDot
in the house state include the heat loss of the building, or just infeed by the grid? - What does it mean if the storage has "required demand"? Maybe one could argue that storage demand is always somewhat optional.
- I suppose positive charging power of the storage means charging, negative means discharging? Would love to have this documented
- Generally, the selected piece of code here could maybe be commented a bit, i.e. why is each case doing what it is doing?
Those are just some things that "jumped" at me...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! Even after some time understanding what happens here get's hard, to be honest...
Regarding your questions:
- qDot of HpState is just the qDot from the Hp.
- qDot in the house state includes only the infeed (from grid or from storage), losses comes separate since they depending also from temperature difference.
- imho: storage has required demand if they are empty. They're having additionalDemand unless they're full.
- please see here but I will add it to the other scalaDocs whenever it makes sense...
- Agreed. Let's see if I can make it easier to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partsly the interpretation of required and additional demand is handled here. Which we might merge before. #918
Co-authored-by: Sebastian Peter <[email protected]>
…nto df/#930-refactor-handleInfeed # Conflicts: # src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala
…ctor-handleInfeed
…ctor-handleInfeed
resolves #930
merge #1052 and #1046 first