-
Notifications
You must be signed in to change notification settings - Fork 5
/
CylindricalStorageInput.java
236 lines (212 loc) · 7.99 KB
/
CylindricalStorageInput.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*
* © 2021. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.models.input.thermal;
import edu.ie3.datamodel.models.OperationTime;
import edu.ie3.datamodel.models.StandardUnits;
import edu.ie3.datamodel.models.input.OperatorInput;
import edu.ie3.util.quantities.interfaces.SpecificHeatCapacity;
import java.util.Objects;
import java.util.UUID;
import javax.measure.quantity.Temperature;
import javax.measure.quantity.Volume;
import tech.units.indriya.ComparableQuantity;
/** Thermal storage with cylindrical shape */
public class CylindricalStorageInput extends ThermalStorageInput {
/** Available storage volume (typically in m³) */
private final ComparableQuantity<Volume> storageVolumeLvl;
/** Minimum permissible storage volume (typically in m³) */
private final ComparableQuantity<Volume> storageVolumeLvlMin;
/** Temperature of the inlet (typically in C) */
private final ComparableQuantity<Temperature> inletTemp;
/** Temperature of the outlet (typically in C) */
private final ComparableQuantity<Temperature> returnTemp;
/** Specific heat capacity of the storage medium (typically in kWh/K*m³) */
private final ComparableQuantity<SpecificHeatCapacity> c;
/**
* @param uuid Unique identifier of a cylindrical storage
* @param id Identifier of the thermal unit
* @param operator operator of the asset
* @param operationTime operation time of the asset
* @param bus Thermal bus, a thermal unit is connected to
* @param storageVolumeLvl Available storage volume
* @param storageVolumeLvlMin Minimum permissible storage volume
* @param inletTemp Temperature of the inlet
* @param returnTemp Temperature of the outlet
* @param c Specific heat capacity of the storage medium
*/
public CylindricalStorageInput(
UUID uuid,
String id,
OperatorInput operator,
OperationTime operationTime,
ThermalBusInput bus,
ComparableQuantity<Volume> storageVolumeLvl,
ComparableQuantity<Volume> storageVolumeLvlMin,
ComparableQuantity<Temperature> inletTemp,
ComparableQuantity<Temperature> returnTemp,
ComparableQuantity<SpecificHeatCapacity> c) {
super(uuid, id, operator, operationTime, bus);
this.storageVolumeLvl = storageVolumeLvl.to(StandardUnits.VOLUME);
this.storageVolumeLvlMin = storageVolumeLvlMin.to(StandardUnits.VOLUME);
this.inletTemp = inletTemp.to(StandardUnits.TEMPERATURE);
this.returnTemp = returnTemp.to(StandardUnits.TEMPERATURE);
this.c = c.to(StandardUnits.SPECIFIC_HEAT_CAPACITY);
}
/**
* @param uuid Unique identifier of a cylindrical storage
* @param id Identifier of the thermal unit
* @param bus Thermal bus, a thermal unit is connected to
* @param storageVolumeLvl Available storage volume
* @param storageVolumeLvlMin Minimum permissible storage volume
* @param inletTemp Temperature of the inlet
* @param returnTemp Temperature of the outlet
* @param c Specific heat capacity of the storage medium
*/
public CylindricalStorageInput(
UUID uuid,
String id,
ThermalBusInput bus,
ComparableQuantity<Volume> storageVolumeLvl,
ComparableQuantity<Volume> storageVolumeLvlMin,
ComparableQuantity<Temperature> inletTemp,
ComparableQuantity<Temperature> returnTemp,
ComparableQuantity<SpecificHeatCapacity> c) {
super(uuid, id, bus);
this.storageVolumeLvl = storageVolumeLvl.to(StandardUnits.VOLUME);
this.storageVolumeLvlMin = storageVolumeLvlMin.to(StandardUnits.VOLUME);
this.inletTemp = inletTemp.to(StandardUnits.TEMPERATURE);
this.returnTemp = returnTemp.to(StandardUnits.TEMPERATURE);
this.c = c.to(StandardUnits.SPECIFIC_HEAT_CAPACITY);
}
public ComparableQuantity<Volume> getStorageVolumeLvl() {
return storageVolumeLvl;
}
public ComparableQuantity<Volume> getStorageVolumeLvlMin() {
return storageVolumeLvlMin;
}
public ComparableQuantity<Temperature> getInletTemp() {
return inletTemp;
}
public ComparableQuantity<Temperature> getReturnTemp() {
return returnTemp;
}
public ComparableQuantity<SpecificHeatCapacity> getC() {
return c;
}
@Override
public CylindricalStorageInputCopyBuilder copy() {
return new CylindricalStorageInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof CylindricalStorageInput that)) return false;
if (!super.equals(o)) return false;
return storageVolumeLvl.equals(that.storageVolumeLvl)
&& storageVolumeLvlMin.equals(that.storageVolumeLvlMin)
&& inletTemp.equals(that.inletTemp)
&& returnTemp.equals(that.returnTemp)
&& c.equals(that.c);
}
@Override
public int hashCode() {
return Objects.hash(
super.hashCode(), storageVolumeLvl, storageVolumeLvlMin, inletTemp, returnTemp, c);
}
@Override
public String toString() {
return "CylindricalStorageInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ ", operator="
+ getOperator().getUuid()
+ ", operationTime="
+ getOperationTime()
+ ", bus="
+ getThermalBus().getUuid()
+ ", storageVolumeLvl="
+ storageVolumeLvl
+ ", storageVolumeLvlMin="
+ storageVolumeLvlMin
+ ", inletTemp="
+ inletTemp
+ ", returnTemp="
+ returnTemp
+ ", c="
+ c
+ '}';
}
/**
* A builder pattern based approach to create copies of {@link CylindricalStorageInput} entities
* with altered field values. For detailed field descriptions refer to java docs of {@link
* CylindricalStorageInput}
*/
public static class CylindricalStorageInputCopyBuilder
extends ThermalStorageInputCopyBuilder<CylindricalStorageInputCopyBuilder> {
private ComparableQuantity<Volume> storageVolumeLvl;
private ComparableQuantity<Volume> storageVolumeLvlMin;
private ComparableQuantity<Temperature> inletTemp;
private ComparableQuantity<Temperature> returnTemp;
private ComparableQuantity<SpecificHeatCapacity> c;
private CylindricalStorageInputCopyBuilder(CylindricalStorageInput entity) {
super(entity);
this.storageVolumeLvl = entity.getStorageVolumeLvl();
this.storageVolumeLvlMin = entity.getStorageVolumeLvlMin();
this.inletTemp = entity.getInletTemp();
this.returnTemp = entity.getReturnTemp();
this.c = entity.getC();
}
public CylindricalStorageInputCopyBuilder storageVolumeLvl(
ComparableQuantity<Volume> storageVolumeLvl) {
this.storageVolumeLvl = storageVolumeLvl;
return this;
}
public CylindricalStorageInputCopyBuilder storageVolumeLvlMin(
ComparableQuantity<Volume> storageVolumeLvlMin) {
this.storageVolumeLvlMin = storageVolumeLvlMin;
return this;
}
public CylindricalStorageInputCopyBuilder inletTemp(ComparableQuantity<Temperature> inletTemp) {
this.inletTemp = inletTemp;
return this;
}
public CylindricalStorageInputCopyBuilder returnTemp(
ComparableQuantity<Temperature> returnTemp) {
this.returnTemp = returnTemp;
return this;
}
public CylindricalStorageInputCopyBuilder c(ComparableQuantity<SpecificHeatCapacity> c) {
this.c = c;
return this;
}
@Override
public CylindricalStorageInputCopyBuilder scale(Double factor) {
storageVolumeLvl(storageVolumeLvl.multiply(factor));
storageVolumeLvlMin(storageVolumeLvlMin.multiply(factor));
return this;
}
@Override
public CylindricalStorageInput build() {
return new CylindricalStorageInput(
getUuid(),
getId(),
getOperator(),
getOperationTime(),
getThermalBus(),
storageVolumeLvl,
storageVolumeLvlMin,
inletTemp,
returnTemp,
c);
}
@Override
protected CylindricalStorageInputCopyBuilder thisInstance() {
return this;
}
}
}