Skip to content

Commit 68bcf46

Browse files
Merge pull request #726 from ie3-institute/sh/#646-rewrite-groovy-test-to-scala-test
Sh/#646 rewrite groovy test to scala test
2 parents 501a910 + a64f9ea commit 68bcf46

File tree

4 files changed

+837
-535
lines changed

4 files changed

+837
-535
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4747
- Converting the `GridAgent` and the `DBFSAlgorithm` to `pekko typed` [#666](https://github.com/ie3-institute/simona/issues/666)
4848
- Validation of grid will throw exception instead of just logging errors [#463](https://github.com/ie3-institute/simona/issues/463)
4949
- Refactoring of `GridAgent` messages [#736](https://github.com/ie3-institute/simona/issues/736)
50+
- Rewrote PVModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)
5051

5152
### Fixed
5253
- Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658)

src/main/scala/edu/ie3/simona/model/participant/PvModel.scala

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ final case class PvModel private (
5555
/** Override sMax as the power output of a pv unit could become easily up to
5656
* 10% higher than the sRated value found in the technical sheets
5757
*/
58-
override protected val sMax: Power = sRated * 1.1
58+
override val sMax: Power = sRated * 1.1
5959

6060
/** Permissible maximum active power feed in (therefore negative) */
6161
protected val pMax: Power = sMax * cosPhiRated * -1d
@@ -154,7 +154,7 @@ final case class PvModel private (
154154
* @return
155155
* day angle J
156156
*/
157-
private def calcAngleJ(time: ZonedDateTime): Angle = {
157+
def calcAngleJ(time: ZonedDateTime): Angle = {
158158
val day = time.getDayOfYear // day of the year
159159
val j = 2d * Math.PI * ((day - 1d) / 365)
160160
Radians(j)
@@ -170,7 +170,7 @@ final case class PvModel private (
170170
* @return
171171
* declination angle
172172
*/
173-
private def calcSunDeclinationDelta(
173+
def calcSunDeclinationDelta(
174174
angleJ: Angle
175175
): Angle = {
176176
val jInRad = angleJ.toRadians
@@ -198,7 +198,7 @@ final case class PvModel private (
198198
* @return
199199
* hour angle omega
200200
*/
201-
private def calcHourAngleOmega(
201+
def calcHourAngleOmega(
202202
time: ZonedDateTime,
203203
angleJ: Angle,
204204
longitude: Angle,
@@ -228,7 +228,7 @@ final case class PvModel private (
228228
* @return
229229
* sunset angle omegaSS
230230
*/
231-
private def calcSunsetAngleOmegaSS(
231+
def calcSunsetAngleOmegaSS(
232232
latitude: Angle,
233233
delta: Angle,
234234
): Angle = {
@@ -256,7 +256,7 @@ final case class PvModel private (
256256
* @return
257257
* solar altitude angle alphaS
258258
*/
259-
private def calcSolarAltitudeAngleAlphaS(
259+
def calcSolarAltitudeAngleAlphaS(
260260
omega: Angle,
261261
delta: Angle,
262262
latitude: Angle,
@@ -285,7 +285,7 @@ final case class PvModel private (
285285
* @return
286286
* the zenith angle
287287
*/
288-
private def calcZenithAngleThetaZ(
288+
def calcZenithAngleThetaZ(
289289
alphaS: Angle
290290
): Angle = {
291291
val alphaSInRad = alphaS.toRadians
@@ -303,7 +303,7 @@ final case class PvModel private (
303303
* @return
304304
* air mass
305305
*/
306-
private def calcAirMass(thetaZ: Angle): Double = {
306+
def calcAirMass(thetaZ: Angle): Double = {
307307
val thetaZInRad = thetaZ.toRadians
308308

309309
// radius of the earth in kilometers
@@ -326,7 +326,7 @@ final case class PvModel private (
326326
* @return
327327
* extraterrestrial radiation I0
328328
*/
329-
private def calcExtraterrestrialRadiationI0(
329+
def calcExtraterrestrialRadiationI0(
330330
angleJ: Angle
331331
): Irradiation = {
332332
val jInRad = angleJ.toRadians
@@ -361,7 +361,7 @@ final case class PvModel private (
361361
* @return
362362
* angle of incidence thetaG
363363
*/
364-
private def calcAngleOfIncidenceThetaG(
364+
def calcAngleOfIncidenceThetaG(
365365
delta: Angle,
366366
latitude: Angle,
367367
gammaE: Angle,
@@ -401,7 +401,7 @@ final case class PvModel private (
401401
* omega1 and omega encapsulated in an Option, if applicable. None
402402
* otherwise
403403
*/
404-
private def calculateBeamOmegas(
404+
def calculateBeamOmegas(
405405
thetaG: Angle,
406406
omega: Angle,
407407
omegaSS: Angle,
@@ -462,7 +462,7 @@ final case class PvModel private (
462462
* @return
463463
* the beam radiation on the sloped surface
464464
*/
465-
private def calcBeamRadiationOnSlopedSurface(
465+
def calcBeamRadiationOnSlopedSurface(
466466
eBeamH: Irradiation,
467467
omegas: Option[(Angle, Angle)],
468468
delta: Angle,
@@ -531,7 +531,7 @@ final case class PvModel private (
531531
* @return
532532
* the diffuse radiation on the sloped surface
533533
*/
534-
private def calcDiffuseRadiationOnSlopedSurfacePerez(
534+
def calcDiffuseRadiationOnSlopedSurfacePerez(
535535
eDifH: Irradiation,
536536
eBeamH: Irradiation,
537537
airMass: Double,
@@ -634,7 +634,7 @@ final case class PvModel private (
634634
* @return
635635
* the reflected radiation on the sloped surface eRefS
636636
*/
637-
private def calcReflectedRadiationOnSlopedSurface(
637+
def calcReflectedRadiationOnSlopedSurface(
638638
eBeamH: Irradiation,
639639
eDifH: Irradiation,
640640
gammaE: Angle,

0 commit comments

Comments
 (0)