From 44188b2d7d90ffb6a71580870462cc2cf9a49423 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 4 Jun 2022 08:59:07 +0200 Subject: [PATCH 1/3] add temperature parameters --- .../NbwTemperatureDependantLoadProfile.java | 28 +++++++++++++++++-- .../TemperatureDependantLoadProfile.java | 27 ++++++++++++++++++ .../models/profile/LoadProfileTest.groovy | 5 ++++ 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/ie3/datamodel/models/profile/NbwTemperatureDependantLoadProfile.java b/src/main/java/edu/ie3/datamodel/models/profile/NbwTemperatureDependantLoadProfile.java index 783e164bc..db5a6c913 100644 --- a/src/main/java/edu/ie3/datamodel/models/profile/NbwTemperatureDependantLoadProfile.java +++ b/src/main/java/edu/ie3/datamodel/models/profile/NbwTemperatureDependantLoadProfile.java @@ -6,19 +6,28 @@ package edu.ie3.datamodel.models.profile; import edu.ie3.datamodel.exceptions.ParsingException; +import edu.ie3.datamodel.models.StandardUnits; +import tech.units.indriya.ComparableQuantity; +import tech.units.indriya.quantity.Quantities; + +import javax.measure.quantity.Temperature; /** Temperature dependant determined by NBW (accessed 05/2022) */ public enum NbwTemperatureDependantLoadProfile implements TemperatureDependantLoadProfile { + + // heat pumps - EP1("ep1"), + EP1("ep1", 1), // night storage heating - EZ2("ez2"); + EZ2("ez2", 0); private final String key; + private final int limitingConstant; - NbwTemperatureDependantLoadProfile(String key) { + NbwTemperatureDependantLoadProfile(String key, int limitingConstant) { this.key = key.toLowerCase(); + this.limitingConstant = limitingConstant; } /** @@ -37,6 +46,19 @@ public String getKey() { return this.key; } + @Override + public ComparableQuantity getReferenceTemperature() { + return Quantities.getQuantity(17, StandardUnits.TEMPERATURE); + } + + @Override + public ComparableQuantity getMinTemperature() { + return Quantities.getQuantity(-17, StandardUnits.TEMPERATURE); + } + + @Override + public int getLimitingConstant(){return this.limitingConstant;} + @Override public String toString() { return "NbwTemperatureDependantLoadProfile{" + "key='" + key + '\'' + '}'; diff --git a/src/main/java/edu/ie3/datamodel/models/profile/TemperatureDependantLoadProfile.java b/src/main/java/edu/ie3/datamodel/models/profile/TemperatureDependantLoadProfile.java index 4b5a94f20..c5e8a71a4 100644 --- a/src/main/java/edu/ie3/datamodel/models/profile/TemperatureDependantLoadProfile.java +++ b/src/main/java/edu/ie3/datamodel/models/profile/TemperatureDependantLoadProfile.java @@ -6,6 +6,9 @@ package edu.ie3.datamodel.models.profile; import edu.ie3.datamodel.exceptions.ParsingException; +import tech.units.indriya.ComparableQuantity; + +import javax.measure.quantity.Temperature; /** * Temperature dependant load profiles for night storage heating and heat pumps . The profiles rely @@ -14,6 +17,30 @@ */ public interface TemperatureDependantLoadProfile extends LoadProfile { + /** + * Maximum temperature to which load profiles are scaled. If temperature is higher the + * load profile according to the reference temperature is used. + * + * @return the reference temperature + */ + ComparableQuantity getReferenceTemperature(); + + /** + * Minimum temperature to which load profiles are scaled. If temperature is lower the + * load profile according to the reference temperature is used. + * + * @return the reference temperature + */ + ComparableQuantity getMinTemperature(); + + /** + * Downscaling of load profiles gets limited to the limiting constant. For more information + * see the official VDN description. + * + * @return the limiting constant + */ + int getLimitingConstant(); + /** * Returns temperature dependant load profile corresponding to the given key. * diff --git a/src/test/groovy/edu/ie3/datamodel/models/profile/LoadProfileTest.groovy b/src/test/groovy/edu/ie3/datamodel/models/profile/LoadProfileTest.groovy index af45e4436..3130595e4 100644 --- a/src/test/groovy/edu/ie3/datamodel/models/profile/LoadProfileTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/models/profile/LoadProfileTest.groovy @@ -6,7 +6,12 @@ package edu.ie3.datamodel.models.profile import edu.ie3.datamodel.exceptions.ParsingException +import edu.ie3.datamodel.models.StandardUnits import spock.lang.Specification +import tech.units.indriya.ComparableQuantity +import tech.units.indriya.quantity.Quantities + +import javax.measure.quantity.Temperature class LoadProfileTest extends Specification { def "Load profiles are parsed correctly from correct input" () { From 516ed40745fe479125f0583cc4c45fc181727a47 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 4 Jun 2022 09:01:06 +0200 Subject: [PATCH 2/3] add docs --- .../NbwTemperatureDependantLoadProfile.java | 26 ++++++++++++++++--- .../TemperatureDependantLoadProfile.java | 15 +++++------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/main/java/edu/ie3/datamodel/models/profile/NbwTemperatureDependantLoadProfile.java b/src/main/java/edu/ie3/datamodel/models/profile/NbwTemperatureDependantLoadProfile.java index db5a6c913..c2e657460 100644 --- a/src/main/java/edu/ie3/datamodel/models/profile/NbwTemperatureDependantLoadProfile.java +++ b/src/main/java/edu/ie3/datamodel/models/profile/NbwTemperatureDependantLoadProfile.java @@ -7,15 +7,13 @@ import edu.ie3.datamodel.exceptions.ParsingException; import edu.ie3.datamodel.models.StandardUnits; +import javax.measure.quantity.Temperature; import tech.units.indriya.ComparableQuantity; import tech.units.indriya.quantity.Quantities; -import javax.measure.quantity.Temperature; - /** Temperature dependant determined by NBW (accessed 05/2022) */ public enum NbwTemperatureDependantLoadProfile implements TemperatureDependantLoadProfile { - // heat pumps EP1("ep1", 1), @@ -46,18 +44,38 @@ public String getKey() { return this.key; } + /** + * Maximum temperature to which load profiles are scaled. If temperature is higher the load + * profile according to the reference temperature is used. + * + * @return the reference temperature + */ @Override public ComparableQuantity getReferenceTemperature() { return Quantities.getQuantity(17, StandardUnits.TEMPERATURE); } + /** + * Minimum temperature to which load profiles are scaled. If temperature is lower the load profile + * according to the reference temperature is used. + * + * @return the reference temperature + */ @Override public ComparableQuantity getMinTemperature() { return Quantities.getQuantity(-17, StandardUnits.TEMPERATURE); } + /** + * Downscaling of load profiles gets limited to the limiting constant. For more information see + * the official VDN description. + * + * @return the limiting constant + */ @Override - public int getLimitingConstant(){return this.limitingConstant;} + public int getLimitingConstant() { + return this.limitingConstant; + } @Override public String toString() { diff --git a/src/main/java/edu/ie3/datamodel/models/profile/TemperatureDependantLoadProfile.java b/src/main/java/edu/ie3/datamodel/models/profile/TemperatureDependantLoadProfile.java index c5e8a71a4..585c7f79b 100644 --- a/src/main/java/edu/ie3/datamodel/models/profile/TemperatureDependantLoadProfile.java +++ b/src/main/java/edu/ie3/datamodel/models/profile/TemperatureDependantLoadProfile.java @@ -6,9 +6,8 @@ package edu.ie3.datamodel.models.profile; import edu.ie3.datamodel.exceptions.ParsingException; -import tech.units.indriya.ComparableQuantity; - import javax.measure.quantity.Temperature; +import tech.units.indriya.ComparableQuantity; /** * Temperature dependant load profiles for night storage heating and heat pumps . The profiles rely @@ -18,24 +17,24 @@ public interface TemperatureDependantLoadProfile extends LoadProfile { /** - * Maximum temperature to which load profiles are scaled. If temperature is higher the - * load profile according to the reference temperature is used. + * Maximum temperature to which load profiles are scaled. If temperature is higher the load + * profile according to the reference temperature is used. * * @return the reference temperature */ ComparableQuantity getReferenceTemperature(); /** - * Minimum temperature to which load profiles are scaled. If temperature is lower the - * load profile according to the reference temperature is used. + * Minimum temperature to which load profiles are scaled. If temperature is lower the load profile + * according to the reference temperature is used. * * @return the reference temperature */ ComparableQuantity getMinTemperature(); /** - * Downscaling of load profiles gets limited to the limiting constant. For more information - * see the official VDN description. + * Downscaling of load profiles gets limited to the limiting constant. For more information see + * the official VDN description. * * @return the limiting constant */ From 451674d9ff5498ee37e8fee8d73ebda220c0c539 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 4 Jun 2022 09:02:27 +0200 Subject: [PATCH 3/3] rmv unused imports --- .../edu/ie3/datamodel/models/profile/LoadProfileTest.groovy | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/test/groovy/edu/ie3/datamodel/models/profile/LoadProfileTest.groovy b/src/test/groovy/edu/ie3/datamodel/models/profile/LoadProfileTest.groovy index 3130595e4..af45e4436 100644 --- a/src/test/groovy/edu/ie3/datamodel/models/profile/LoadProfileTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/models/profile/LoadProfileTest.groovy @@ -6,12 +6,7 @@ package edu.ie3.datamodel.models.profile import edu.ie3.datamodel.exceptions.ParsingException -import edu.ie3.datamodel.models.StandardUnits import spock.lang.Specification -import tech.units.indriya.ComparableQuantity -import tech.units.indriya.quantity.Quantities - -import javax.measure.quantity.Temperature class LoadProfileTest extends Specification { def "Load profiles are parsed correctly from correct input" () {