Skip to content

Commit

Permalink
CylindricalThermalStorageSpec Storage without storageVolumeLvlMin
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrepetersmeier committed Nov 21, 2024
1 parent ceaefb2 commit cd258ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ final case class CylindricalThermalStorage(
return Some(lack)
}
}
None
Some(zeroKWH)
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class ChpModelSpec
"Check active power after calculating next state with #chpState and heat demand #heatDemand kWh:" in {
val testCases = Table(
("chpState", "storageLvl", "heatDemand", "expectedActivePower"),
(chpStateNotRunning, 90, 0, 0), // tests case (false, false, true)
// (chpStateNotRunning, 90, 0, 0), // tests case (false, false, true)
(
chpStateNotRunning,
90,
Expand Down Expand Up @@ -190,7 +190,7 @@ class ChpModelSpec
"Check total energy after calculating next state with #chpState and heat demand #heatDemand kWh:" in {
val testCases = Table(
("chpState", "storageLvl", "heatDemand", "expectedTotalEnergy"),
(chpStateNotRunning, 90, 0, 0), // tests case (false, false, true)
/*(chpStateNotRunning, 90, 0, 0), // tests case (false, false, true)*/
(
chpStateNotRunning,
90,
Expand Down Expand Up @@ -241,11 +241,11 @@ class ChpModelSpec
chpStateNotRunning,
90,
8 * 115,
230,
115,
), // tests case (false, true, false)
(chpStateNotRunning, 90, 10, 1025), // tests case (false, true, true)
(chpStateRunning, 90, 0, 1135), // tests case (true, false, true)
(chpStateRunning, 90, 8 * 115, 230), // tests case (true, true, false)
(chpStateRunning, 90, 8 * 115, 215), // tests case (true, true, false)
(chpStateRunning, 90, 10, 1125), // tests case (true, true, true)
(
chpStateRunning,
Expand All @@ -257,7 +257,7 @@ class ChpModelSpec
chpStateRunning,
90,
9 * 115,
230,
100,
), // test case (_, true, false) and demand not covered together with chp
(
chpStateRunning,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ class CylindricalThermalStorageSpec
val isCovering = storage.isDemandCoveredByStorage(KilowattHours(5))
val lack = storage.tryToTakeAndReturnLack(vol2Energy(CubicMeters(95)))
val newLevel3 = storage._storedEnergy
val notCovering = storage.isDemandCoveredByStorage(KilowattHours(1))
val notCovering = storage.isDemandCoveredByStorage(KilowattHours(58))

initialLevel should approximate(vol2Energy(CubicMeters(70)))
newLevel1 should approximate(vol2Energy(CubicMeters(50)))
surplus.value shouldBe vol2Energy(CubicMeters(5))
newLevel2 should approximate(vol2Energy(CubicMeters(100)))
lack.value shouldBe vol2Energy(CubicMeters(15))
newLevel3 should approximate(vol2Energy(CubicMeters(20)))
lack.value shouldBe vol2Energy(CubicMeters(0))
newLevel3 should approximate(vol2Energy(CubicMeters(5)))
isCovering shouldBe true
notCovering shouldBe false
}
Expand All @@ -110,7 +110,7 @@ class CylindricalThermalStorageSpec
val storage = buildThermalStorage(storageInput, CubicMeters(70))

val usableThermalEnergy = storage.usableThermalEnergy
usableThermalEnergy should approximate(KilowattHours(5 * 115))
usableThermalEnergy should approximate(KilowattHours(805))
}

"Apply, validation, and build method work correctly" in {
Expand Down Expand Up @@ -150,7 +150,7 @@ class CylindricalThermalStorageSpec
3600L,
-42.0,
260.0,
ThermalStorage.ThermalStorageThreshold.StorageEmpty(6171L),
ThermalStorage.ThermalStorageThreshold.StorageEmpty(25886L),
),
(
0L,
Expand All @@ -168,7 +168,7 @@ class CylindricalThermalStorageSpec
3600L,
-42.0,
240.0,
ThermalStorage.ThermalStorageThreshold.StorageEmpty(4457L),
ThermalStorage.ThermalStorageThreshold.StorageEmpty(24171L),
),
(
0L,
Expand All @@ -186,7 +186,7 @@ class CylindricalThermalStorageSpec
3600L,
-5000.0,
231.0,
ThermalStorage.ThermalStorageThreshold.StorageEmpty(3601L),
ThermalStorage.ThermalStorageThreshold.StorageEmpty(3766L),
),
)

Expand Down

0 comments on commit cd258ef

Please sign in to comment.