diff --git a/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala b/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala index 5af1b68236..56bd446412 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala @@ -118,7 +118,7 @@ final case class ChpModel( chpData: ChpRelevantData ): ChpRelevantData => ChpState = { val isRunning = chpData.chpState.isRunning - val hasDemand = chpData.heatDemand > DefaultQuantities.zeroKWH + val hasDemand = chpData.heatDemand > DefaultQuantities.zeroKWh val isCovered = isDemandCovered(chpData) (isRunning, hasDemand, isCovered) match { @@ -145,7 +145,7 @@ final case class ChpModel( isRunning = false, chpData.currentTimeTick, DefaultQuantities.zeroKW, - DefaultQuantities.zeroKWH, + DefaultQuantities.zeroKWh, ) /** The demand cannot be covered, therefore this function sets storage level @@ -182,7 +182,7 @@ final case class ChpModel( isRunning = false, chpData.currentTimeTick, DefaultQuantities.zeroKW, - DefaultQuantities.zeroKWH, + DefaultQuantities.zeroKWh, ) } @@ -199,7 +199,7 @@ final case class ChpModel( chpData: ChpRelevantData ): ChpState = { val differenceEnergy = chpEnergy(chpData) - chpData.heatDemand - if (differenceEnergy < zeroKWH) { + if (differenceEnergy < zeroKWh) { // Returned lack is always zero, because demand is covered. storage.tryToTakeAndReturnLack(differenceEnergy * -1) calculateStateRunningSurplus(chpData) diff --git a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala index 423b865482..e2e4fbe22f 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -263,7 +263,7 @@ final case class HpModel( val noThermalStorageOrThermalStorageIsEmpty: Boolean = updatedGridState.storageState.isEmpty || updatedGridState.storageState .exists( - _.storedEnergy =~ zeroKWH + _.storedEnergy =~ zeroKWh ) val houseDemand = diff --git a/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala b/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala index 02f82d2670..742f5d8f68 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala @@ -47,7 +47,7 @@ final case class StorageModel( cosPhiRated, ) { - private val minEnergy = zeroKWH + private val minEnergy = zeroKWh /** Tolerance for power comparisons. With very small (dis-)charging powers, * problems can occur when calculating the future tick at which storage is diff --git a/src/main/scala/edu/ie3/simona/model/participant/evcs/EvcsModel.scala b/src/main/scala/edu/ie3/simona/model/participant/evcs/EvcsModel.scala index a1d21252ec..4f0e4d9730 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/evcs/EvcsModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/evcs/EvcsModel.scala @@ -222,7 +222,7 @@ final case class EvcsModel( tickStop > lastSchedulingTick && tickStart < currentTick } .sortBy(_.tickStart) - .foldLeft(zeroKWH) { case (accumulatedEnergy, scheduleEntry) => + .foldLeft(zeroKWh) { case (accumulatedEnergy, scheduleEntry) => /* Only the timeframe from the start of last scheduling update and current tick must be considered */ val trimmedEntry = trimScheduleEntry( scheduleEntry, diff --git a/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala b/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala index 0523d72e86..55410e5485 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala @@ -138,7 +138,7 @@ final case class CylindricalThermalStorage( override def tryToStoreAndReturnRemainder( addedEnergy: Energy ): Option[Energy] = { - if (addedEnergy > zeroKWH) { + if (addedEnergy > zeroKWh) { _storedEnergy = _storedEnergy + addedEnergy if (_storedEnergy > maxEnergyThreshold) { val surplus = _storedEnergy - maxEnergyThreshold @@ -153,7 +153,7 @@ final case class CylindricalThermalStorage( override def tryToTakeAndReturnLack( takenEnergy: Energy ): Option[Energy] = { - if (takenEnergy > zeroKWH) { + if (takenEnergy > zeroKWh) { _storedEnergy = _storedEnergy - takenEnergy if (_storedEnergy < zeroKWH) { val lack = zeroKWH - _storedEnergy diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala index 4de7ac513a..8090f6131f 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -141,7 +141,7 @@ final case class ThermalGrid( storage.getMaxEnergyThreshold - storedEnergy } else { - zeroMWH + zeroMWh } } @@ -156,7 +156,7 @@ final case class ThermalGrid( } .getOrElse( - ThermalEnergyDemand(zeroMWH, zeroMWH), + ThermalEnergyDemand(zeroMWh, zeroMWh), None, ) } @@ -1534,7 +1534,7 @@ object ThermalGrid { possible + rhs.possible, ) - def hasRequiredDemand: Boolean = required > zeroMWH + def hasRequiredDemand: Boolean = required > zeroMWh def hasAdditionalDemand: Boolean = possible > zeroMWH } @@ -1564,8 +1564,8 @@ object ThermalGrid { } def noDemand: ThermalEnergyDemand = ThermalEnergyDemand( - zeroMWH, - zeroMWH, + zeroMWh, + zeroMWh, ) } } diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala index c40cfd0bd7..a0feaec009 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala @@ -133,7 +133,7 @@ final case class ThermalHouse( ) ) energy(targetTemperature, currentInnerTemp) else - zeroMWH + zeroMWh val possibleEnergy = if (!isInnerTemperatureTooHigh(currentInnerTemp)) { @@ -141,7 +141,7 @@ final case class ThermalHouse( // there is an amount of optional energy that could be stored energy(upperBoundaryTemperature, currentInnerTemp) } else - zeroMWH + zeroMWh ThermalEnergyDemand(requiredEnergy, possibleEnergy) } @@ -533,7 +533,7 @@ final case class ThermalHouse( qDot: Power, ): Option[Long] = { val flexibleEnergy = energy(higherTemperature, lowerTemperature) - if (flexibleEnergy < zeroMWH) + if (flexibleEnergy < zeroMWh) None else { val duration = Math.round( diff --git a/src/main/scala/edu/ie3/util/scala/quantities/DefaultQuantities.scala b/src/main/scala/edu/ie3/util/scala/quantities/DefaultQuantities.scala index ac401db84c..698f757eff 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/DefaultQuantities.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/DefaultQuantities.scala @@ -17,8 +17,8 @@ object DefaultQuantities { val zeroKVAr: ReactivePower = Kilovars(0d) val zeroMVAr: ReactivePower = Megavars(0d) - val zeroKWH: Energy = KilowattHours(0d) - val zeroMWH: Energy = MegawattHours(0d) + val zeroKWh: Energy = KilowattHours(0d) + val zeroMWh: Energy = MegawattHours(0d) val zeroPU: Dimensionless = Each(0d) diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala index 8b2bd77893..54536c5f30 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala @@ -16,7 +16,7 @@ import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, HouseTemperatureUpperBoundaryReached, } -import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWh} import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageState import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageEmpty, @@ -140,7 +140,7 @@ class ThermalGridWithHouseAndStorageSpec defaultSimulationStart, houseInhabitants, ) - houseDemand.required should approximate(zeroKWH) + houseDemand.required should approximate(zeroKWh) houseDemand.possible should approximate(KilowattHours(31.05009722d)) storageDemand.required should approximate(KilowattHours(1150d)) storageDemand.possible should approximate(KilowattHours(1150d)) @@ -150,7 +150,7 @@ class ThermalGridWithHouseAndStorageSpec ThermalHouseState(10800, Kelvin(292.0799935185185), zeroKW) ) updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, zeroKWH, zeroKW) + ThermalStorageState(10800, zeroKWh, zeroKW) ) updatedThermalGridState.domesticHotWaterStorageState shouldBe Some( ThermalStorageState( @@ -235,7 +235,7 @@ class ThermalGridWithHouseAndStorageSpec ThermalHouseState(10800, Celsius(15.959996296296296), zeroKW) ) updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, zeroKWH, zeroKW) + ThermalStorageState(10800, zeroKWh, zeroKW) ) updatedThermalGridState.domesticHotWaterStorageState shouldBe Some( ThermalStorageState( @@ -566,7 +566,7 @@ class ThermalGridWithHouseAndStorageSpec ( ThermalStorageState( tick, - zeroKWH, + zeroKWh, testGridQDotInfeed, ), Some(StorageEmpty(tick)), diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala index 901bebc1e1..d1d091cd2f 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala @@ -18,7 +18,7 @@ import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageEmpty, StorageFull, } -import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWh} import edu.ie3.simona.test.common.UnitSpec import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} import squants.energy._ @@ -135,10 +135,10 @@ class ThermalGridWithHouseOnlySpec houseDemand.required should approximate(expectedHouseDemand.required) houseDemand.possible should approximate(expectedHouseDemand.possible) - storageDemand.required should approximate(zeroKWH) - storageDemand.possible should approximate(zeroKWH) - domesticHotWaterDemand.required should approximate(KilowattHours(0d)) - domesticHotWaterDemand.possible should approximate(KilowattHours(0d)) + storageDemand.required should approximate(zeroKWh) + storageDemand.possible should approximate(zeroKWh) + domesticHotWaterDemand.required should approximate(zeroKWh) + domesticHotWaterDemand.possible should approximate(zeroKWh) updatedThermalGridState.houseState shouldBe Some( ThermalHouseState(10800, Kelvin(292.0799935185185), zeroKW) ) diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala index 494f8f2ef7..d52075546a 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala @@ -20,7 +20,7 @@ import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageFull, } import edu.ie3.simona.test.common.{DefaultTestData, UnitSpec} -import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWh} import squants.energy._ import squants.thermal.Celsius import squants.{Energy, Power, Temperature} @@ -105,15 +105,15 @@ class ThermalGridWithStorageOnlySpec houseInhabitants, ) - houseDemand.required should approximate(zeroKWH) - houseDemand.possible should approximate(zeroKWH) + houseDemand.required should approximate(zeroKWh) + houseDemand.possible should approximate(zeroKWh) storageDemand.required should approximate(KilowattHours(1150d)) storageDemand.possible should approximate(KilowattHours(1150d)) waterStorageDemand.required should approximate(zeroKWH) waterStorageDemand.possible should approximate(zeroKWH) updatedThermalGridState.houseState shouldBe None updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, zeroKWH, zeroKW) + ThermalStorageState(10800, zeroKWh, zeroKW) ) updatedThermalGridState.domesticHotWaterStorageState shouldBe None } @@ -140,9 +140,9 @@ class ThermalGridWithStorageOnlySpec houseInhabitants, ) - houseDemand.required should approximate(zeroKWH) - houseDemand.possible should approximate(zeroKWH) - storageDemand.required should approximate(zeroKWH) + houseDemand.required should approximate(zeroKWh) + houseDemand.possible should approximate(zeroKWh) + storageDemand.required should approximate(zeroKWh) storageDemand.possible should approximate(KilowattHours(575d)) waterStorageDemand.required should approximate(zeroKWH) waterStorageDemand.possible should approximate(zeroKWH) @@ -232,7 +232,7 @@ class ThermalGridWithStorageOnlySpec None, ) => tick shouldBe 0L - storedEnergy should approximate(zeroKWH) + storedEnergy should approximate(zeroKWh) qDot should approximate(testGridQDotInfeed) case _ => fail("Thermal grid state has been calculated wrong.") } @@ -265,7 +265,7 @@ class ThermalGridWithStorageOnlySpec None, ) => tick shouldBe 0L - storedEnergy should approximate(zeroKWH) + storedEnergy should approximate(zeroKWh) qDot should approximate(testGridQDotInfeed) case _ => fail("Thermal grid state updated failed") } @@ -335,7 +335,7 @@ class ThermalGridWithStorageOnlySpec None, ) => tick shouldBe 0L - storedEnergy should approximate(zeroKWH) + storedEnergy should approximate(zeroKWh) qDot should approximate(zeroKW) case _ => fail("Thermal grid state updated failed")