Skip to content

Commit

Permalink
Merge pull request #726 from ie3-institute/sh/#646-rewrite-groovy-tes…
Browse files Browse the repository at this point in the history
…t-to-scala-test

Sh/#646 rewrite groovy test to scala test
  • Loading branch information
danielfeismann committed Apr 15, 2024
2 parents 501a910 + a64f9ea commit 68bcf46
Show file tree
Hide file tree
Showing 4 changed files with 837 additions and 535 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Converting the `GridAgent` and the `DBFSAlgorithm` to `pekko typed` [#666](https://github.com/ie3-institute/simona/issues/666)
- Validation of grid will throw exception instead of just logging errors [#463](https://github.com/ie3-institute/simona/issues/463)
- Refactoring of `GridAgent` messages [#736](https://github.com/ie3-institute/simona/issues/736)
- Rewrote PVModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)

### Fixed
- Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658)
Expand Down
28 changes: 14 additions & 14 deletions src/main/scala/edu/ie3/simona/model/participant/PvModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final case class PvModel private (
/** Override sMax as the power output of a pv unit could become easily up to
* 10% higher than the sRated value found in the technical sheets
*/
override protected val sMax: Power = sRated * 1.1
override val sMax: Power = sRated * 1.1

/** Permissible maximum active power feed in (therefore negative) */
protected val pMax: Power = sMax * cosPhiRated * -1d
Expand Down Expand Up @@ -154,7 +154,7 @@ final case class PvModel private (
* @return
* day angle J
*/
private def calcAngleJ(time: ZonedDateTime): Angle = {
def calcAngleJ(time: ZonedDateTime): Angle = {
val day = time.getDayOfYear // day of the year
val j = 2d * Math.PI * ((day - 1d) / 365)
Radians(j)
Expand All @@ -170,7 +170,7 @@ final case class PvModel private (
* @return
* declination angle
*/
private def calcSunDeclinationDelta(
def calcSunDeclinationDelta(
angleJ: Angle
): Angle = {
val jInRad = angleJ.toRadians
Expand Down Expand Up @@ -198,7 +198,7 @@ final case class PvModel private (
* @return
* hour angle omega
*/
private def calcHourAngleOmega(
def calcHourAngleOmega(
time: ZonedDateTime,
angleJ: Angle,
longitude: Angle,
Expand Down Expand Up @@ -228,7 +228,7 @@ final case class PvModel private (
* @return
* sunset angle omegaSS
*/
private def calcSunsetAngleOmegaSS(
def calcSunsetAngleOmegaSS(
latitude: Angle,
delta: Angle,
): Angle = {
Expand Down Expand Up @@ -256,7 +256,7 @@ final case class PvModel private (
* @return
* solar altitude angle alphaS
*/
private def calcSolarAltitudeAngleAlphaS(
def calcSolarAltitudeAngleAlphaS(
omega: Angle,
delta: Angle,
latitude: Angle,
Expand Down Expand Up @@ -285,7 +285,7 @@ final case class PvModel private (
* @return
* the zenith angle
*/
private def calcZenithAngleThetaZ(
def calcZenithAngleThetaZ(
alphaS: Angle
): Angle = {
val alphaSInRad = alphaS.toRadians
Expand All @@ -303,7 +303,7 @@ final case class PvModel private (
* @return
* air mass
*/
private def calcAirMass(thetaZ: Angle): Double = {
def calcAirMass(thetaZ: Angle): Double = {
val thetaZInRad = thetaZ.toRadians

// radius of the earth in kilometers
Expand All @@ -326,7 +326,7 @@ final case class PvModel private (
* @return
* extraterrestrial radiation I0
*/
private def calcExtraterrestrialRadiationI0(
def calcExtraterrestrialRadiationI0(
angleJ: Angle
): Irradiation = {
val jInRad = angleJ.toRadians
Expand Down Expand Up @@ -361,7 +361,7 @@ final case class PvModel private (
* @return
* angle of incidence thetaG
*/
private def calcAngleOfIncidenceThetaG(
def calcAngleOfIncidenceThetaG(
delta: Angle,
latitude: Angle,
gammaE: Angle,
Expand Down Expand Up @@ -401,7 +401,7 @@ final case class PvModel private (
* omega1 and omega encapsulated in an Option, if applicable. None
* otherwise
*/
private def calculateBeamOmegas(
def calculateBeamOmegas(
thetaG: Angle,
omega: Angle,
omegaSS: Angle,
Expand Down Expand Up @@ -462,7 +462,7 @@ final case class PvModel private (
* @return
* the beam radiation on the sloped surface
*/
private def calcBeamRadiationOnSlopedSurface(
def calcBeamRadiationOnSlopedSurface(
eBeamH: Irradiation,
omegas: Option[(Angle, Angle)],
delta: Angle,
Expand Down Expand Up @@ -531,7 +531,7 @@ final case class PvModel private (
* @return
* the diffuse radiation on the sloped surface
*/
private def calcDiffuseRadiationOnSlopedSurfacePerez(
def calcDiffuseRadiationOnSlopedSurfacePerez(
eDifH: Irradiation,
eBeamH: Irradiation,
airMass: Double,
Expand Down Expand Up @@ -634,7 +634,7 @@ final case class PvModel private (
* @return
* the reflected radiation on the sloped surface eRefS
*/
private def calcReflectedRadiationOnSlopedSurface(
def calcReflectedRadiationOnSlopedSurface(
eBeamH: Irradiation,
eDifH: Irradiation,
gammaE: Angle,
Expand Down

0 comments on commit 68bcf46

Please sign in to comment.