Skip to content

Commit 150bc52

Browse files
Merge remote-tracking branch 'origin/df/#1131-psdm-update-for-tap-water-demand' into df/#1131-psdm-update-for-tap-water-demand
# Conflicts: # CHANGELOG.md
2 parents ce064aa + eef015a commit 150bc52

File tree

13 files changed

+90
-179
lines changed

13 files changed

+90
-179
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Enhance `TimeSeriesSource` with method to retrieve the previous value before a given key [#1182](https://github.com/ie3-institute/PowerSystemDataModel/issues/1182)
1616
- Added `BdewLoadProfileTimeSeries` [#1230](https://github.com/ie3-institute/PowerSystemDataModel/issues/1230)
1717
- Added `RandomLoadProfileTimeSeries` [#1232](https://github.com/ie3-institute/PowerSystemDataModel/issues/1232)
18+
- Attribute `pThermalRated` for `ThermalStorage`s [#679](https://github.com/ie3-institute/PowerSystemDataModel/issues/679)
19+
- Attributes `housingType` and `numberInhabitants` for `ThermalHouse`s [#1131](https://github.com/ie3-institute/PowerSystemDataModel/issues/1131)
20+
- Added domestic hot water storage model [#1131](https://github.com/ie3-institute/PowerSystemDataModel/issues/1131)
1821
- Extend ValidationUtils for validating ThermalGrids [#1216](https://github.com/ie3-institute/PowerSystemDataModel/issues/1216)
1922
- Attribute `pThermalRated` for `ThermalStorage`s [#679](https://github.com/ie3-institute/PowerSystemDataModel/issues/679)
2023
- Attributes `housingType` and `numberInhabitants` for `ThermalHouse`s [#1131](https://github.com/ie3-institute/PowerSystemDataModel/issues/1131)

docs/readthedocs/io/ValidationUtils.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The ValidationUtils include validation checks for...
7474
- HpTypeInput
7575
- StorageTypeInput
7676
- WecTypeInput
77-
- ThermalUnitValidationUtils
77+
- ThermalValidationUtils
7878
- ThermalUnitInput
7979
- ThermalSinkInput
8080
- ThermalHouseInput

docs/readthedocs/models/input/thermal/cylindricalstorage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Cylindrical Thermal Storage
44

5-
Model of a cylindrical thermal storage using a fluent to store thermal energy.
5+
Model of a cylindrical thermal storage using a fluid to store thermal energy.
66

77
## Attributes, Units and Remarks
88

docs/readthedocs/models/input/thermal/domestichotwaterstorage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Domestic Hot Water Storage
44

5-
Model of a domestic hot water storage using a fluent to store thermal energy.
5+
Model of a domestic hot water storage using a fluid to store thermal energy.
66

77
## Attributes, Units and Remarks
88

docs/readthedocs/models/result/participant/cylindricalstorage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Cylindrical Thermal Storage
44

5-
Result of a cylindrical thermal storage using a fluent to store thermal energy.
5+
Result of a cylindrical thermal storage using a fluid to store thermal energy.
66

77
## Attributes, Units and Remarks
88

docs/readthedocs/models/result/participant/domestichotwaterstorage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Domestic Hot Water Storage
44

5-
Result of a domestic hot water storage using a fluent to store thermal energy.
5+
Result of a domestic hot water storage using a fluid to store thermal energy.
66

77
## Attributes, Units and Remarks
88

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* © 2024. TU Dortmund University,
3+
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
4+
* Research group Distribution grid planning and operation
5+
*/
6+
package edu.ie3.datamodel.io.factory.input;
7+
8+
import edu.ie3.datamodel.models.StandardUnits;
9+
import edu.ie3.datamodel.models.input.AssetInput;
10+
import edu.ie3.util.quantities.interfaces.SpecificHeatCapacity;
11+
import javax.measure.quantity.Power;
12+
import javax.measure.quantity.Temperature;
13+
import javax.measure.quantity.Volume;
14+
import tech.units.indriya.ComparableQuantity;
15+
16+
public abstract class AbstractThermalStorageInputFactory<T extends AssetInput>
17+
extends AssetInputEntityFactory<T, ThermalUnitInputEntityData> {
18+
19+
private static final String STORAGE_VOLUME_LVL = "storageVolumeLvl";
20+
private static final String INLET_TEMP = "inletTemp";
21+
private static final String RETURN_TEMP = "returnTemp";
22+
private static final String C = "c";
23+
private static final String P_THERMAL_MAX = "pThermalMax";
24+
25+
public AbstractThermalStorageInputFactory(Class<T> clazz) {
26+
super(clazz);
27+
}
28+
29+
@Override
30+
protected String[] getAdditionalFields() {
31+
return new String[] {STORAGE_VOLUME_LVL, INLET_TEMP, RETURN_TEMP, C, P_THERMAL_MAX};
32+
}
33+
34+
protected ComparableQuantity<Volume> getStorageVolumeLvl(ThermalUnitInputEntityData data) {
35+
return data.getQuantity(STORAGE_VOLUME_LVL, StandardUnits.VOLUME);
36+
}
37+
38+
protected ComparableQuantity<Temperature> getInletTemp(ThermalUnitInputEntityData data) {
39+
return data.getQuantity(INLET_TEMP, StandardUnits.TEMPERATURE);
40+
}
41+
42+
protected ComparableQuantity<Temperature> getReturnTemp(ThermalUnitInputEntityData data) {
43+
return data.getQuantity(RETURN_TEMP, StandardUnits.TEMPERATURE);
44+
}
45+
46+
protected ComparableQuantity<SpecificHeatCapacity> getSpecificHeatCapacity(
47+
ThermalUnitInputEntityData data) {
48+
return data.getQuantity(C, StandardUnits.SPECIFIC_HEAT_CAPACITY);
49+
}
50+
51+
protected ComparableQuantity<Power> getMaxThermalPower(ThermalUnitInputEntityData data) {
52+
return data.getQuantity(P_THERMAL_MAX, StandardUnits.ACTIVE_POWER_IN);
53+
}
54+
}

src/main/java/edu/ie3/datamodel/io/factory/input/CylindricalStorageInputFactory.java

+7-32
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,37 @@
66
package edu.ie3.datamodel.io.factory.input;
77

88
import edu.ie3.datamodel.models.OperationTime;
9-
import edu.ie3.datamodel.models.StandardUnits;
109
import edu.ie3.datamodel.models.input.OperatorInput;
1110
import edu.ie3.datamodel.models.input.thermal.CylindricalStorageInput;
1211
import edu.ie3.datamodel.models.input.thermal.ThermalBusInput;
13-
import edu.ie3.util.quantities.interfaces.SpecificHeatCapacity;
1412
import java.util.UUID;
15-
import javax.measure.quantity.Power;
16-
import javax.measure.quantity.Temperature;
17-
import javax.measure.quantity.Volume;
18-
import tech.units.indriya.ComparableQuantity;
1913

2014
public class CylindricalStorageInputFactory
21-
extends AssetInputEntityFactory<CylindricalStorageInput, ThermalUnitInputEntityData> {
22-
private static final String STORAGE_VOLUME_LVL = "storageVolumeLvl";
23-
private static final String INLET_TEMP = "inletTemp";
24-
private static final String RETURN_TEMP = "returnTemp";
25-
private static final String C = "c";
26-
private static final String P_THERMAL_MAX = "pThermalMax";
15+
extends AbstractThermalStorageInputFactory<CylindricalStorageInput> {
2716

2817
public CylindricalStorageInputFactory() {
2918
super(CylindricalStorageInput.class);
3019
}
3120

32-
@Override
33-
protected String[] getAdditionalFields() {
34-
return new String[] {STORAGE_VOLUME_LVL, INLET_TEMP, RETURN_TEMP, C, P_THERMAL_MAX};
35-
}
36-
3721
@Override
3822
protected CylindricalStorageInput buildModel(
3923
ThermalUnitInputEntityData data,
4024
UUID uuid,
4125
String id,
4226
OperatorInput operator,
4327
OperationTime operationTime) {
28+
4429
final ThermalBusInput bus = data.getBusInput();
45-
final ComparableQuantity<Volume> storageVolumeLvl =
46-
data.getQuantity(STORAGE_VOLUME_LVL, StandardUnits.VOLUME);
47-
final ComparableQuantity<Temperature> inletTemp =
48-
data.getQuantity(INLET_TEMP, StandardUnits.TEMPERATURE);
49-
final ComparableQuantity<Temperature> returnTemp =
50-
data.getQuantity(RETURN_TEMP, StandardUnits.TEMPERATURE);
51-
final ComparableQuantity<SpecificHeatCapacity> c =
52-
data.getQuantity(C, StandardUnits.SPECIFIC_HEAT_CAPACITY);
53-
final ComparableQuantity<Power> pThermalMax =
54-
data.getQuantity(P_THERMAL_MAX, StandardUnits.ACTIVE_POWER_IN);
5530
return new CylindricalStorageInput(
5631
uuid,
5732
id,
5833
operator,
5934
operationTime,
6035
bus,
61-
storageVolumeLvl,
62-
inletTemp,
63-
returnTemp,
64-
c,
65-
pThermalMax);
36+
getStorageVolumeLvl(data),
37+
getInletTemp(data),
38+
getReturnTemp(data),
39+
getSpecificHeatCapacity(data),
40+
getMaxThermalPower(data));
6641
}
6742
}

src/main/java/edu/ie3/datamodel/io/factory/input/DomesticHotWaterStorageInputFactory.java

+7-32
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,37 @@
66
package edu.ie3.datamodel.io.factory.input;
77

88
import edu.ie3.datamodel.models.OperationTime;
9-
import edu.ie3.datamodel.models.StandardUnits;
109
import edu.ie3.datamodel.models.input.OperatorInput;
1110
import edu.ie3.datamodel.models.input.thermal.DomesticHotWaterStorageInput;
1211
import edu.ie3.datamodel.models.input.thermal.ThermalBusInput;
13-
import edu.ie3.util.quantities.interfaces.SpecificHeatCapacity;
1412
import java.util.UUID;
15-
import javax.measure.quantity.Power;
16-
import javax.measure.quantity.Temperature;
17-
import javax.measure.quantity.Volume;
18-
import tech.units.indriya.ComparableQuantity;
1913

2014
public class DomesticHotWaterStorageInputFactory
21-
extends AssetInputEntityFactory<DomesticHotWaterStorageInput, ThermalUnitInputEntityData> {
22-
private static final String STORAGE_VOLUME_LVL = "storageVolumeLvl";
23-
private static final String INLET_TEMP = "inletTemp";
24-
private static final String RETURN_TEMP = "returnTemp";
25-
private static final String C = "c";
26-
private static final String P_THERMAL_MAX = "pThermalMax";
15+
extends AbstractThermalStorageInputFactory<DomesticHotWaterStorageInput> {
2716

2817
public DomesticHotWaterStorageInputFactory() {
2918
super(DomesticHotWaterStorageInput.class);
3019
}
3120

32-
@Override
33-
protected String[] getAdditionalFields() {
34-
return new String[] {STORAGE_VOLUME_LVL, INLET_TEMP, RETURN_TEMP, C, P_THERMAL_MAX};
35-
}
36-
3721
@Override
3822
protected DomesticHotWaterStorageInput buildModel(
3923
ThermalUnitInputEntityData data,
4024
UUID uuid,
4125
String id,
4226
OperatorInput operator,
4327
OperationTime operationTime) {
28+
4429
final ThermalBusInput bus = data.getBusInput();
45-
final ComparableQuantity<Volume> storageVolumeLvl =
46-
data.getQuantity(STORAGE_VOLUME_LVL, StandardUnits.VOLUME);
47-
final ComparableQuantity<Temperature> inletTemp =
48-
data.getQuantity(INLET_TEMP, StandardUnits.TEMPERATURE);
49-
final ComparableQuantity<Temperature> returnTemp =
50-
data.getQuantity(RETURN_TEMP, StandardUnits.TEMPERATURE);
51-
final ComparableQuantity<SpecificHeatCapacity> c =
52-
data.getQuantity(C, StandardUnits.SPECIFIC_HEAT_CAPACITY);
53-
final ComparableQuantity<Power> pThermalMax =
54-
data.getQuantity(P_THERMAL_MAX, StandardUnits.ACTIVE_POWER_IN);
5530
return new DomesticHotWaterStorageInput(
5631
uuid,
5732
id,
5833
operator,
5934
operationTime,
6035
bus,
61-
storageVolumeLvl,
62-
inletTemp,
63-
returnTemp,
64-
c,
65-
pThermalMax);
36+
getStorageVolumeLvl(data),
37+
getInletTemp(data),
38+
getReturnTemp(data),
39+
getSpecificHeatCapacity(data),
40+
getMaxThermalPower(data));
6641
}
6742
}

src/main/java/edu/ie3/datamodel/models/input/thermal/DomesticHotWaterStorageInput.java

-61
Original file line numberDiff line numberDiff line change
@@ -115,66 +115,5 @@ public static class DomesticHotWaterStorageInputCopyBuilder
115115
public DomesticHotWaterStorageInputCopyBuilder(DomesticHotWaterStorageInput entity) {
116116
super(entity);
117117
}
118-
119-
@Override
120-
public DomesticHotWaterStorageInputCopyBuilder storageVolumeLvl(
121-
ComparableQuantity<Volume> storageVolumeLvl) {
122-
this.storageVolumeLvl = storageVolumeLvl;
123-
return this;
124-
}
125-
126-
@Override
127-
public DomesticHotWaterStorageInputCopyBuilder inletTemp(
128-
ComparableQuantity<Temperature> inletTemp) {
129-
this.inletTemp = inletTemp;
130-
return this;
131-
}
132-
133-
@Override
134-
public DomesticHotWaterStorageInputCopyBuilder returnTemp(
135-
ComparableQuantity<Temperature> returnTemp) {
136-
this.returnTemp = returnTemp;
137-
return this;
138-
}
139-
140-
@Override
141-
public DomesticHotWaterStorageInputCopyBuilder c(ComparableQuantity<SpecificHeatCapacity> c) {
142-
this.c = c;
143-
return this;
144-
}
145-
146-
@Override
147-
public DomesticHotWaterStorageInputCopyBuilder pThermalMax(
148-
ComparableQuantity<Power> pThermalMax) {
149-
this.pThermalMax = pThermalMax;
150-
return this;
151-
}
152-
153-
@Override
154-
public DomesticHotWaterStorageInputCopyBuilder scale(Double factor) {
155-
storageVolumeLvl(this.storageVolumeLvl.multiply(factor));
156-
pThermalMax(this.pThermalMax.multiply(factor));
157-
return this;
158-
}
159-
160-
@Override
161-
public DomesticHotWaterStorageInput build() {
162-
return new DomesticHotWaterStorageInput(
163-
getUuid(),
164-
getId(),
165-
getOperator(),
166-
getOperationTime(),
167-
getThermalBus(),
168-
this.storageVolumeLvl,
169-
this.inletTemp,
170-
this.returnTemp,
171-
this.c,
172-
this.pThermalMax);
173-
}
174-
175-
@Override
176-
protected DomesticHotWaterStorageInputCopyBuilder thisInstance() {
177-
return this;
178-
}
179118
}
180119
}

src/main/java/edu/ie3/datamodel/utils/validation/ThermalValidationUtils.java

-36
Original file line numberDiff line numberDiff line change
@@ -60,42 +60,6 @@ private ThermalValidationUtils() {
6060
return exceptions;
6161
}
6262

63-
/**
64-
* Validates a thermal grid if:
65-
*
66-
* <ul>
67-
* <li>it is not null
68-
* </ul>
69-
*
70-
* A "distribution" method, that forwards the check request to specific implementations to fulfill
71-
* the checking task, based on the class of the given object.
72-
*
73-
* @param thermalGrid ThermalGrid to validate
74-
* @return a list of try objects either containing an {@link ValidationException} or an empty
75-
* Success
76-
*/
77-
protected static List<Try<Void, ? extends ValidationException>> check(ThermalGrid thermalGrid) {
78-
Try<Void, InvalidEntityException> isNull = checkNonNull(thermalGrid, "a thermal grid");
79-
80-
if (isNull.isFailure()) {
81-
return List.of(isNull);
82-
}
83-
84-
List<Try<Void, ? extends ValidationException>> exceptions = new ArrayList<>();
85-
86-
// Validate houses
87-
for (ThermalHouseInput house : thermalGrid.houses()) {
88-
exceptions.addAll(checkThermalHouse(house));
89-
}
90-
91-
// Validate storages
92-
for (ThermalStorageInput storage : thermalGrid.storages()) {
93-
exceptions.addAll(check(storage));
94-
}
95-
96-
return exceptions;
97-
}
98-
9963
/**
10064
* Validates a thermal grid if:
10165
*

src/main/java/edu/ie3/datamodel/utils/validation/ValidationUtils.java

-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ else if (ThermalUnitInput.class.isAssignableFrom(assetInput.getClass()))
157157
exceptions.addAll(ThermalValidationUtils.check((ThermalUnitInput) assetInput));
158158
else if (ThermalGrid.class.isAssignableFrom(assetInput.getClass()))
159159
exceptions.addAll(ThermalValidationUtils.check((ThermalUnitInput) assetInput));
160-
else if (ThermalGrid.class.isAssignableFrom(assetInput.getClass()))
161-
exceptions.addAll(ThermalUnitValidationUtils.check((ThermalUnitInput) assetInput));
162160
else {
163161
logNotImplemented(assetInput);
164162
}

0 commit comments

Comments
 (0)