-
Notifications
You must be signed in to change notification settings - Fork 5
/
ThermalHouseInput.java
235 lines (212 loc) · 8.62 KB
/
ThermalHouseInput.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
/*
* © 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.HeatCapacity;
import edu.ie3.util.quantities.interfaces.ThermalConductance;
import java.util.Objects;
import java.util.UUID;
import javax.measure.quantity.Temperature;
import tech.units.indriya.ComparableQuantity;
/** Quite simple thermal model of a house to serve as a heat sink */
public class ThermalHouseInput extends ThermalSinkInput {
/** Thermal, transitional losses of the included thermal house model (typically in kW/K) */
private final ComparableQuantity<ThermalConductance> ethLosses;
/** Thermal capacity of the included thermal house model (typically in kWh/K) */
private final ComparableQuantity<HeatCapacity> ethCapa;
/** Desired target temperature of the thermal house model (typically in °C) */
private final ComparableQuantity<Temperature> targetTemperature;
/** Upper boundary temperature of the thermal house model (typically in °C) */
private final ComparableQuantity<Temperature> upperTemperatureLimit;
/** Lower boundary temperature of the thermal house model (typically in °C) */
private final ComparableQuantity<Temperature> lowerTemperatureLimit;
/**
* @param uuid Unique identifier of a thermal house model
* @param id Identifier of the model
* @param bus Thermal bus, the model is connected to
* @param ethLosses Thermal, transitional losses of the included thermal house model
* @param ethCapa Thermal capacity of the included thermal house model
* @param targetTemperature Desired target temperature of the thermal house model
* @param upperTemperatureLimit Upper boundary temperature of the thermal house model
* @param lowerTemperatureLimit Lower boundary temperature of the thermal house model
*/
public ThermalHouseInput(
UUID uuid,
String id,
ThermalBusInput bus,
ComparableQuantity<ThermalConductance> ethLosses,
ComparableQuantity<HeatCapacity> ethCapa,
ComparableQuantity<Temperature> targetTemperature,
ComparableQuantity<Temperature> upperTemperatureLimit,
ComparableQuantity<Temperature> lowerTemperatureLimit) {
super(uuid, id, bus);
this.ethLosses = ethLosses.to(StandardUnits.THERMAL_TRANSMISSION);
this.ethCapa = ethCapa.to(StandardUnits.HEAT_CAPACITY);
this.targetTemperature = targetTemperature.to(StandardUnits.TEMPERATURE);
this.upperTemperatureLimit = upperTemperatureLimit.to(StandardUnits.TEMPERATURE);
this.lowerTemperatureLimit = lowerTemperatureLimit.to(StandardUnits.TEMPERATURE);
}
/**
* @param uuid Unique identifier of a thermal house model
* @param id Identifier of the model
* @param operator operator of the asset
* @param operationTime operation time of the asset
* @param bus Thermal bus, the model is connected to
* @param ethLosses Thermal, transitional losses of the included thermal house model
* @param ethCapa Thermal capacity of the included thermal house model
* @param targetTemperature Desired target temperature of the thermal house model
* @param upperTemperatureLimit Upper boundary temperature of the thermal house model
* @param lowerTemperatureLimit Lower boundary temperature of the thermal house model
*/
public ThermalHouseInput(
UUID uuid,
String id,
OperatorInput operator,
OperationTime operationTime,
ThermalBusInput bus,
ComparableQuantity<ThermalConductance> ethLosses,
ComparableQuantity<HeatCapacity> ethCapa,
ComparableQuantity<Temperature> targetTemperature,
ComparableQuantity<Temperature> upperTemperatureLimit,
ComparableQuantity<Temperature> lowerTemperatureLimit) {
super(uuid, id, operator, operationTime, bus);
this.ethLosses = ethLosses.to(StandardUnits.THERMAL_TRANSMISSION);
this.ethCapa = ethCapa.to(StandardUnits.HEAT_CAPACITY);
this.targetTemperature = targetTemperature.to(StandardUnits.TEMPERATURE);
this.upperTemperatureLimit = upperTemperatureLimit.to(StandardUnits.TEMPERATURE);
this.lowerTemperatureLimit = lowerTemperatureLimit.to(StandardUnits.TEMPERATURE);
}
public ComparableQuantity<ThermalConductance> getEthLosses() {
return ethLosses;
}
public ComparableQuantity<HeatCapacity> getEthCapa() {
return ethCapa;
}
public ComparableQuantity<Temperature> getTargetTemperature() {
return targetTemperature;
}
public ComparableQuantity<Temperature> getUpperTemperatureLimit() {
return upperTemperatureLimit;
}
public ComparableQuantity<Temperature> getLowerTemperatureLimit() {
return lowerTemperatureLimit;
}
@Override
public ThermalHouseInputCopyBuilder copy() {
return new ThermalHouseInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ThermalHouseInput that)) return false;
if (!super.equals(o)) return false;
return ethLosses.equals(that.ethLosses)
&& ethCapa.equals(that.ethCapa)
&& targetTemperature.equals(that.targetTemperature)
&& upperTemperatureLimit.equals(that.upperTemperatureLimit)
&& lowerTemperatureLimit.equals(that.lowerTemperatureLimit);
}
@Override
public int hashCode() {
return Objects.hash(
super.hashCode(),
ethLosses,
ethCapa,
targetTemperature,
upperTemperatureLimit,
lowerTemperatureLimit);
}
@Override
public String toString() {
return "ThermalHouseInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ ", operator="
+ getOperator().getUuid()
+ ", operationTime="
+ getOperationTime()
+ ", bus="
+ getThermalBus().getUuid()
+ ", ethLosses="
+ ethLosses
+ ", ethCapa="
+ ethCapa
+ ", targetTemperature="
+ targetTemperature
+ ", upperTemperatureLimit="
+ upperTemperatureLimit
+ ", lowerTemperatureLimit="
+ lowerTemperatureLimit
+ '}';
}
/**
* A builder pattern based approach to create copies of {@link ThermalHouseInput} entities with
* altered field values. For detailed field descriptions refer to java docs of {@link
* ThermalHouseInput}
*/
public static class ThermalHouseInputCopyBuilder
extends ThermalUnitInput.ThermalUnitInputCopyBuilder<ThermalHouseInputCopyBuilder> {
private ComparableQuantity<ThermalConductance> ethLosses;
private ComparableQuantity<HeatCapacity> ethCapa;
private ComparableQuantity<Temperature> targetTemperature;
private ComparableQuantity<Temperature> upperTemperatureLimit;
private ComparableQuantity<Temperature> lowerTemperatureLimit;
private ThermalHouseInputCopyBuilder(ThermalHouseInput entity) {
super(entity);
this.ethLosses = entity.getEthLosses();
this.ethCapa = entity.getEthCapa();
this.targetTemperature = entity.getTargetTemperature();
this.upperTemperatureLimit = entity.getUpperTemperatureLimit();
this.lowerTemperatureLimit = entity.getLowerTemperatureLimit();
}
@Override
public ThermalHouseInput build() {
return new ThermalHouseInput(
getUuid(),
getId(),
getOperator(),
getOperationTime(),
getThermalBus(),
ethLosses,
ethCapa,
targetTemperature,
upperTemperatureLimit,
lowerTemperatureLimit);
}
public ThermalHouseInputCopyBuilder ethLosses(
ComparableQuantity<ThermalConductance> ethLosses) {
this.ethLosses = ethLosses;
return this;
}
public ThermalHouseInputCopyBuilder ethCapa(ComparableQuantity<HeatCapacity> ethCapa) {
this.ethCapa = ethCapa;
return this;
}
public ThermalHouseInputCopyBuilder targetTemperature(
ComparableQuantity<Temperature> targetTemperature) {
this.targetTemperature = targetTemperature;
return this;
}
public ThermalHouseInputCopyBuilder upperTemperatureLimit(
ComparableQuantity<Temperature> upperTemperatureLimit) {
this.upperTemperatureLimit = upperTemperatureLimit;
return this;
}
public ThermalHouseInputCopyBuilder lowerTemperatureLimit(
ComparableQuantity<Temperature> lowerTemperatureLimit) {
this.lowerTemperatureLimit = lowerTemperatureLimit;
return this;
}
@Override
protected ThermalHouseInputCopyBuilder thisInstance() {
return this;
}
}
}