Skip to content

Commit

Permalink
Merge branch 'dev' into df/#1107-prepare-changes-for-next-psdm-release
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
danielfeismann committed Feb 5, 2025
2 parents 76342cf + c586ab5 commit 3fe2545
Show file tree
Hide file tree
Showing 35 changed files with 1,068 additions and 595 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Introduce ThermalDemandWrapper [#1049](https://github.com/ie3-institute/simona/issues/1049)
- Added Marius Staudt to list of reviewers [#1057](https://github.com/ie3-institute/simona/issues/1057)
- Throw exception if the slack node is not directly conected to a transformer. [#525](https://github.com/ie3-institute/simona/issues/525)
- Added support for topologies without transformers and slack grids with multiple nodes [#1099](https://github.com/ie3-institute/simona/issues/1099)
- Checking the number of slack nodes [#1122](https://github.com/ie3-institute/simona/issues/1122)

### Changed
- Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435)
Expand Down Expand Up @@ -116,6 +118,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed SonarQube quality gate using the correct parameter '-Dsonar.qualitygate.wait=true' [#1072](https://github.com/ie3-institute/simona/issues/1072)
- Updated `simonaAPI` to version `0.6.0` [#1080](https://github.com/ie3-institute/simona/issues/1080)
- Enhanced title in `CITATION.cff` [#1088](https://github.com/ie3-institute/simona/issues/1088)
- Refactor ThermalEnergyDemand definitions [#917](https://github.com/ie3-institute/simona/issues/917)
- Rewrote PvModelIT from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)
- Fix negative required energy demand for thermalHouse [#1127](https://github.com/ie3-institute/simona/issues/1127)
- Updated to changes of PSDM release v6.0.0 [#1107](https://github.com/ie3-institute/simona/issues/1107)

### Fixed
Expand Down Expand Up @@ -160,6 +165,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed Deployment of `simona` to `Maven Central` in new GHA Pipeline [#1029](https://github.com/ie3-institute/simona/issues/1029)
- Fixed SonarQube quality gate using the right link for PRs or Branches [#1061](https://github.com/ie3-institute/simona/issues/1061)
- Fixed ignored EM strategy [#1091](https://github.com/ie3-institute/simona/issues/1091)
- EM should output flex option results even if it has no parent [#1112](https://github.com/ie3-institute/simona/issues/1112)

## [3.0.0] - 2023-08-07

Expand Down
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,9 @@ def determineDisplayName(String currentBranchName, String commitHash, String org

def publishReports(String relativeProjectDir) {
// publish test reports
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/tests/allTests', reportFiles: 'index.html', reportName: "${relativeProjectDir}_java_tests_report", reportTitles: ''])

// publish scalatest reports for main project only (currently the only one with scala sources!)
publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/tests/scalatest', reportFiles: 'index.html', reportName: "${relativeProjectDir}_scala_tests_report", reportTitles: ''])
publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/tests/test', reportFiles: 'index.html', reportName: "${relativeProjectDir}_scala_tests_report", reportTitles: ''])

// publish scapegoat src report for main project only
publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/scapegoat/src', reportFiles: 'scapegoat.html', reportName: "${relativeProjectDir}_scapegoat_src_report", reportTitles: ''])
Expand Down
31 changes: 17 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer

plugins {
id 'groovy' // groovy support
id 'java' // java support
id 'scala' // scala support
id 'signing'
id 'maven-publish' // publish to a maven repo (local or mvn central, has to be defined)
id 'com.diffplug.spotless' version '6.25.0'// code format
id "com.github.ben-manes.versions" version '0.51.0'
id "com.github.ben-manes.versions" version '0.52.0'
id "de.undercouch.download" version "5.6.0" // downloads plugin
id "kr.motd.sphinx" version "2.10.1" // documentation generation
id "com.github.johnrengelman.shadow" version "8.1.1" // fat jar
id "org.sonarqube" version "6.0.1.5171" // sonarqube
id "org.scoverage" version "8.1" // scala code coverage scoverage
id "com.github.maiflai.scalatest" version "0.32" // run scalatest without specific spec task
id 'org.hidetake.ssh' version '2.11.2'
id 'net.thauvin.erik.gradle.semver' version '1.0.4' // semantic versioning
id "application"
Expand All @@ -24,14 +22,14 @@ ext {
javaVersion = JavaVersion.VERSION_17

scalaVersion = '2.13'
scalaBinaryVersion = '2.13.15'
scalaBinaryVersion = '2.13.16'
pekkoVersion = '1.1.3'
jtsVersion = '1.20.0'
confluentKafkaVersion = '7.4.0'
tscfgVersion = '1.2.1'
scapegoatVersion = '3.1.2'
tscfgVersion = '1.2.4'
scapegoatVersion = '3.1.4'

testContainerVersion = '0.41.5'
testContainerVersion = '0.41.8'

scriptsLocation = 'gradle' + File.separator + 'scripts' + File.separator // location of script plugins
}
Expand Down Expand Up @@ -100,13 +98,18 @@ dependencies {
implementation "ch.qos.logback:logback-classic:1.5.16"

/* testing */
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
testImplementation 'org.scalatestplus:mockito-3-4_2.13:3.2.10.0'
testImplementation 'org.mockito:mockito-core:5.15.2' // mocking framework
// scalatest & junit
testImplementation "org.scalatest:scalatest_${scalaVersion}:3.2.19"
testRuntimeOnly 'com.vladsch.flexmark:flexmark-all:0.64.8' //scalatest html output
testImplementation group: 'org.pegdown', name: 'pegdown', version: '1.6.0'
testImplementation "org.apache.pekko:pekko-testkit_${scalaVersion}:${pekkoVersion}" // pekko testkit
testImplementation "org.junit.platform:junit-platform-launcher:1.11.4"
testRuntimeOnly "org.junit.platform:junit-platform-engine:1.11.4"
testRuntimeOnly "org.scalatestplus:junit-5-11_${scalaVersion}:3.2.19.0"

// mocking framework
testImplementation 'org.mockito:mockito-core:5.15.2'
testImplementation "org.scalatestplus:mockito-3-4_${scalaVersion}:3.2.10.0"

// pekko
testImplementation "org.apache.pekko:pekko-testkit_${scalaVersion}:${pekkoVersion}"
testImplementation "org.apache.pekko:pekko-actor-testkit-typed_${scalaVersion}:${pekkoVersion}"

// testcontainers
Expand Down Expand Up @@ -149,7 +152,7 @@ dependencies {
implementation 'tech.units:indriya:2.2.2' // quantities
implementation "org.typelevel:squants_${scalaVersion}:1.8.3"
implementation 'org.apache.commons:commons-csv:1.13.0'
implementation 'org.scalanlp:breeze_2.13:2.1.0' // scientific calculations (http://www.scalanlp.org/)
implementation "org.scalanlp:breeze_${scalaVersion}:2.1.0" // scientific calculations (http://www.scalanlp.org/)
implementation 'de.lmu.ifi.dbs.elki:elki:0.7.5' // Statistics (for random load model)
implementation 'org.jgrapht:jgrapht-core:1.5.2'
}
Expand Down
13 changes: 4 additions & 9 deletions docs/readthedocs/_static/bibliography/bibtexAll.bib
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ @Article{Maleki.2017
DOI = {10.3390/en10010134}
}

@MISC{Itaca_Sun,
author = {Itacanet},
title = {The Sun As A Source Of Energy},
howpublished={\url{https://www.itacanet.org/the-sun-as-a-source-of-energy/part-3-calculating-solar-angles/}}
}

@article{Spencer.1971,
added-at = {2018-06-18T21:23:34.000+0200},
author = {Spencer, J. W.},
Expand Down Expand Up @@ -73,7 +67,7 @@ @book{Quaschning.2013
author = {Quaschning, Volker},
year = {2013},
title = {Regenerative Energiesysteme: Technologie; Berechnung; Simulation},
url = {http://ebooks.ciando.com/book/index.cfm/bok_id/471802},
url = {https://www.hanser-elibrary.com/doi/book/10.3139/9783446435711},
price = {39.99 EUR},
address = {M{\"u}nchen},
edition = {8., aktualisierte und erw. Aufl.},
Expand All @@ -92,7 +86,8 @@ @Inbook{Schoenberg.1929
pages={1--280},
abstract={Die ersten Versuche, Messungen der Lichtst{\"a}rke der Himmelsk{\"o}rper auszuf{\"u}hren, um auf diesem Wege Aufschl{\"u}sse {\"u}ber ihre Beschaffenheit zu erhalten, fallen in die Zeit jenes gewaltigen Aufschwungs, welchen die Optik durch die Arbeiten von Newton und Huygens am Ende des siebzehnten und zu Beginn des achtzehnten Jahrhunderts erfahren hatte. Schon Huygens1 selbst versuchte die Helligkeit des Sirius mit derjenigen der Sonne zu vergleichen, indem er das Sonnenlicht durch eine kleine {\"O}ffnung im verschlossenen Ende eines langen Rohres abschw{\"a}chte. Der schwedische Physiker Celsius2 suchte nach einem Gesetze der Lichtabnahme beleuchteter Fl{\"a}chen, doch waren seine Schlu{\ss}folgerungen, ebenso wie diejenigen von Huygens, infolge der Unzul{\"a}nglichkeit der angewandten Methoden nicht stichhaltig. Au{\ss}er der Formel der Lichtabnahme mit dem Quadrate der Entfernung besa{\ss} die Physik noch keinerlei R{\"u}stzeug an strengen Definitionen und Gesetzen und keinerlei Apparate zur Messung der Lichtst{\"a}rken. Buffon3 versuchte den Verlust zu bestimmen, den das Sonnenlicht bei Reflexion an gl{\"a}sernen Spiegeln erleidet. Aber erst die gro{\ss} angelegten Arbeiten von Pierre Bouguer4 5 (1698--1758) und Johann Heinrich Lambert (1728--1777) schufen die Grundlagen der Photometrie. In systematischer experimenteller Arbeit, die durch sinnreiche Theorien erl{\"a}utert wird, behandelt Bouguer ihre Hauptprobleme: die Absorption des Lichtes bei der Reflexion und beim Durchgang durch feste und fl{\"u}ssige K{\"o}rper sowie die diffuse Reflexion an matten Fl{\"a}chen und beim Durchgange durch tr{\"u}be Medien.},
isbn={978-3-642-90703-6},
doi={10.1007/978-3}
doi={10.1007/978-3},
url = {https://link.springer.com/chapter/10.1007/978-3-642-90703-6_1}
}

@MISC{WikiAirMass,
Expand Down Expand Up @@ -122,7 +117,7 @@ @book{Iqbal.1983
author = {Iqbal, Muhammad},
year = {1983},
title = {An Introduction To Solar Radiation},
url = {http://site.ebrary.com/lib/alltitles/docDetail.action?docID=10678925},
url = {https://books.google.de/books/about/An_Introduction_To_Solar_Radiation.html?id=3_qWce_mbPsC&redir_esc=y},
address = {Oxford},
publisher = {{Elsevier Science}},
isbn = {9780123737502}
Expand Down
40 changes: 23 additions & 17 deletions docs/readthedocs/models/pv_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $$
**References:**

* {cite:cts}`Maleki.2017`
* {cite:cts}`Itaca_Sun`
* {cite:cts}`Duffie.2013` p. 17 (formula 1.6.10)


### Solar Altitude Angle
Expand All @@ -146,7 +146,7 @@ $$
**References:**

* {cite:cts}`Maleki.2017` p. 5
* {cite:cts}`Itaca_Sun`
* {cite:cts}`Duffie.2013` p. 15 (formula 1.6.5) with $\sin (\alpha_s) = \cos (\theta_z)$


### Zenith Angle
Expand Down Expand Up @@ -198,11 +198,11 @@ $$
Calculating the air mass ratio by dividing the radius of the earth with approx. effective height of the atmosphere (each in kilometer)

$$
airmassratio = (\frac{6371 km}{9 km}) = 707.8\overline{8}
\mathrm{airmassratio} = (\frac{6371 km}{9 km}) = 707.8\overline{8}
$$

$$
airmass = \sqrt{(707.8\overline{8} \cdot \cos({\theta_z}))^2 +2 \cdot 707.8\overline{8} +1)} - 707.8\overline{8} \cdot \cos{(\theta_z)})
\mathrm{airmass} = \sqrt{(707.8\overline{8} \cdot \cos({\theta_z}))^2 +2 \cdot 707.8\overline{8} +1)} - 707.8\overline{8} \cdot \cos{(\theta_z)})
$$

**References:**
Expand Down Expand Up @@ -234,6 +234,8 @@ $$

* {cite:cts}`Zheng.2017` p. 53, formula 2.3b
* {cite:cts}`Iqbal.1983`
* {cite:cts}`Spencer.1971`
* {cite:cts}`Duffie.2013` (the fifth ed. seems to have a typo in formula (1.4.1b): factor $0.000719$ is missing a zero)


### Beam Radiation on Sloped Surface
Expand Down Expand Up @@ -274,7 +276,7 @@ b = (\cos(\phi) \cdot \cos(\delta)) \cdot (\sin(\omega_{2}) - \sin(\omega_{1}))
$$

$$
E_{beam,S} = E_{beam,H} \cdot \frac{a}{b}
E_{\mathrm{beam},S} = E_{\mathrm{beam},H} \cdot \frac{a}{b}
$$

**Please note:** $\frac{1}{180}\pi$ is omitted from these formulas, as we are already working with data in *radians*.
Expand All @@ -286,7 +288,7 @@ $$
**$\omega_1$** = hour angle $\omega$\
**$\omega_2$** = hour angle $\omega$ + 1 hour\
**$\alpha_e$** = surface azimuth angle\
**$E_{beam,H}$** = beam radiation (horizontal surface)
**$E_{\mathrm{beam},H}$** = beam radiation (horizontal surface)

**Reference:**

Expand All @@ -300,13 +302,15 @@ The diffuse radiation is computed using the Perez model, which divides the radia
A cloud index is defined by

$$
\epsilon = \frac{\frac{E_{dif,H} + E_{beam,H}}{E_{dif,H}} + 5.535 \cdot 10^{-6} \cdot \theta_{z}^3}{1 + 5.535 \cdot 10^{-6} \cdot \theta_{z}^3}
\epsilon = \frac{\frac{E_{\mathrm{dif},H} + E_{\mathrm{beam},N}}{E_{\mathrm{dif},H}} + 5.535 \cdot 10^{-6} \cdot \theta_{z}^3}{1 + 5.535 \cdot 10^{-6} \cdot \theta_{z}^3}
$$

with angle $\theta_z$ values in **degrees** ({cite:cts}`Duffie.2013` p. 94) and $E_{\mathrm{beam},N} = \frac{E_{\mathrm{beam},H}}{\cos (\theta_z)}$ ({cite:cts}`Duffie.2013` p. 95).

Calculating a brightness index

$$
\Delta = m \cdot \frac{E_{dif,H}}{I_{0}}
\Delta = m \cdot \frac{E_{\mathrm{dif},H}}{I_{0}}
$$

**Perez Fij coefficients (Myers 2017):**
Expand Down Expand Up @@ -384,7 +388,7 @@ $$
the diffuse radiation can be calculated:

$$
E_{dif,S} = E_{dif,H} \cdot (\frac{1}{2} \cdot (1 +
E_{\mathrm{dif},S} = E_{\mathrm{dif},H} \cdot (\frac{1}{2} \cdot (1 +
cos(\gamma_{e})) \cdot (1- F_{1}) + \frac{a}{b} \cdot F_{1} +
F_{2} \cdot \sin(\gamma_{e}))
$$
Expand All @@ -396,25 +400,27 @@ $$
**$\gamma_{e}$** = slope angle of the surface\
**$I_{0}$** = Extraterrestrial Radiation\
**$m$** = air mass\
**$E_{beam,H}$** = beam radiation (horizontal surface)\
**$E_{dif,H}$** = diffuse radiation (horizontal surface)
**$E_{\mathrm{beam},H}$** = beam radiation (horizontal surface)\
**$E_{\mathrm{beam},N}$** = beam radiation (normal incidence, thus radiation on a plane normal to the direction of the beam)\
**$E_{\mathrm{dif},H}$** = diffuse radiation (horizontal surface)

**References:**

* {cite:cts}`Perez.1987`
* {cite:cts}`Perez.1990`
* {cite:cts}`Myers.2017` p. 96f
* {cite:cts}`Duffie.2013` p. 95f


### Reflected Radiation on Sloped Surface

$$
E_{ref,S} = E_{Ges,H} \cdot \frac{\rho}{2} \cdot (1-
E_{\mathrm{ref},S} = E_{\mathrm{Ges},H} \cdot \frac{\rho}{2} \cdot (1-
\cos(\gamma_{e}))
$$

*with*\
**$E_{Ges,H}$** = total horizontal radiation ($E_{beam,H} + E_{dif,H})$\
**$E_{\mathrm{Ges},H}$** = total horizontal radiation ($E_{\mathrm{beam},H} + E_{\mathrm{dif},H})$\
**$\gamma_e$** = slope angle of the surface\
**$\rho$** = albedo

Expand All @@ -428,13 +434,13 @@ $$
Received energy is calculated as the sum of all three types of irradiation.

$$
E_{total} = E_{beam,S} + E_{dif,S} + E_{ref,S}
E_{\mathrm{total}} = E_{\mathrm{beam},S} + E_{\mathrm{dif},S} + E_{\mathrm{ref},S}
$$

*with*\
**$E_{beam,S}$** = Beam radiation\
**$E_{dif,S}$** = Diffuse radiation\
**$E_{ref,S}$** = Reflected radiation
**$E_{\mathrm{beam},S}$** = Beam radiation\
**$E_{\mathrm{dif},S}$** = Diffuse radiation\
**$E_{\mathrm{ref},S}$** = Reflected radiation

A generator correction factor (depending on month surface slope $\gamma_{e}$) and a temperature correction factor (depending on month) multiplied on top.

Expand Down
2 changes: 1 addition & 1 deletion gradle/scripts/scoverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// https://github.com/scoverage/gradle-scoverage/issues/109 for details

scoverage {
scoverageVersion = "2.2.1"
scoverageVersion = "2.3.0"
scoverageScalaVersion = scalaBinaryVersion
coverageOutputHTML = false
coverageOutputXML = true
Expand Down
6 changes: 1 addition & 5 deletions gradle/scripts/sonarqube.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ sonarqube {
'src/main/scala'] // src dirs
property "sonar.tests", [
'src/test/resources',
'src/test/scala',
'src/test/groovy'] // test src dirs
'src/test/scala'] // test src dirs
// reports stuff (for all languages)
property 'sonar.junit.reportPaths', [
'build/test-results/test'] // Comma-delimited list of paths to Surefire XML-format reports.
Expand All @@ -23,9 +22,6 @@ sonarqube {
// scala specific stuff
property 'sonar.scala.coverage.reportPaths', 'build/reports/scoverageTest/scoverage.xml'

// groovy specific stuff
property 'sonar.groovy.binaries', 'build/classes/groovy' // groovy binaries

// remove auto generated SimonaConfig file from analysis
property 'sonar.exclusions', [
"src/main/scala/edu/ie3/simona/config/SimonaConfig.scala"
Expand Down
8 changes: 0 additions & 8 deletions gradle/scripts/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ spotless {
}

/* cf. https://github.com/diffplug/spotless/tree/master/plugin-gradle */
groovy {
licenseHeader ie3LicHead
// the Groovy Eclipse formatter extends the Java Eclipse formatter,
// so it formats Java files by default (unless `excludeJava` is used).
greclipse().configFile('greclipse.properties')
indentWithSpaces 2
}

groovyGradle {
// same as groovy, but for .gradle (defaults to '*.gradle')
target '*.gradle', 'gradle/scripts/*.gradle'
Expand Down
10 changes: 5 additions & 5 deletions gradle/scripts/tests.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
test {
useJUnitPlatform()
testLogging {
events "skipped", "failed"
useJUnitPlatform {
includeEngines 'scalatest'
testLogging {
events("skipped", "failed")
}
}
}
/* Register scala test with the overall test task */
test.dependsOn(scalatest)

// test task performance improvements, see -> https://docs.gradle.org/current/userguide/performance.html
tasks.withType(Test).configureEach {
Expand Down
Loading

0 comments on commit 3fe2545

Please sign in to comment.