-
Notifications
You must be signed in to change notification settings - Fork 5
/
WecTypeInput.java
208 lines (183 loc) · 6.53 KB
/
WecTypeInput.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
/*
* © 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.system.type;
import edu.ie3.datamodel.models.StandardUnits;
import edu.ie3.datamodel.models.input.system.characteristic.WecCharacteristicInput;
import edu.ie3.util.quantities.interfaces.Currency;
import edu.ie3.util.quantities.interfaces.EnergyPrice;
import java.util.Objects;
import java.util.UUID;
import javax.measure.quantity.Area;
import javax.measure.quantity.Dimensionless;
import javax.measure.quantity.Length;
import javax.measure.quantity.Power;
import tech.units.indriya.ComparableQuantity;
/** Describes the type of a {@link edu.ie3.datamodel.models.input.system.WecInput} */
public class WecTypeInput extends SystemParticipantTypeInput {
/** Betz curve of this type */
private final WecCharacteristicInput cpCharacteristic;
/** Efficiency of converter for this type of WEC (typically in %) */
private final ComparableQuantity<Dimensionless> etaConv;
/** Swept Area of blades for this type of WEC (typically in m²) */
private final ComparableQuantity<Area> rotorArea;
/** Height from ground to center of rotor for this type of WEC (typically in m) */
private final ComparableQuantity<Length> hubHeight;
/**
* @param uuid of the input entity
* @param id of this type of WEC
* @param capex Captial expense for this type of WEC (typically in €)
* @param opex Operating expense for this type of WEC (typically in €)
* @param cosphiRated Power factor for this type of WEC
* @param cpCharacteristic Betz curve of this type
* @param etaConv Efficiency of converter for this type of WEC (typically in %)
* @param sRated Rated apparent power for this type of WEC (typically in kVA)
* @param rotorArea Swept Area of blades for this type of WEC (typically in m²)
* @param hubHeight Height from ground to center of rotor for this type of WEC (typically in m)
*/
public WecTypeInput(
UUID uuid,
String id,
ComparableQuantity<Currency> capex,
ComparableQuantity<EnergyPrice> opex,
ComparableQuantity<Power> sRated,
double cosphiRated,
WecCharacteristicInput cpCharacteristic,
ComparableQuantity<Dimensionless> etaConv,
ComparableQuantity<Area> rotorArea,
ComparableQuantity<Length> hubHeight) {
super(uuid, id, capex, opex, sRated.to(StandardUnits.S_RATED), cosphiRated);
this.cpCharacteristic = cpCharacteristic;
this.etaConv = etaConv.to(StandardUnits.EFFICIENCY);
this.rotorArea = rotorArea.to(StandardUnits.ROTOR_AREA);
this.hubHeight = hubHeight.to(StandardUnits.HUB_HEIGHT);
}
public WecCharacteristicInput getCpCharacteristic() {
return cpCharacteristic;
}
public ComparableQuantity<Dimensionless> getEtaConv() {
return etaConv;
}
public ComparableQuantity<Area> getRotorArea() {
return rotorArea;
}
public ComparableQuantity<Length> getHubHeight() {
return hubHeight;
}
@Override
public WecTypeInputCopyBuilder copy() {
return new WecTypeInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof WecTypeInput that)) return false;
if (!super.equals(o)) return false;
return cpCharacteristic.equals(that.cpCharacteristic)
&& etaConv.equals(that.etaConv)
&& rotorArea.equals(that.rotorArea)
&& hubHeight.equals(that.hubHeight);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), cpCharacteristic, etaConv, rotorArea, hubHeight);
}
@Override
public String toString() {
return "WecTypeInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ "capex="
+ getCapex()
+ ", opex="
+ getOpex()
+ ", sRated="
+ getsRated()
+ ", cosphiRated="
+ getCosPhiRated()
+ ", cpCharacteristic="
+ cpCharacteristic
+ ", etaConv="
+ etaConv
+ ", rotorArea="
+ rotorArea
+ ", hubHeight="
+ hubHeight
+ '}';
}
/**
* A builder pattern based approach to create copies of {@link WecTypeInput} entities with altered
* field values. For detailed field descriptions refer to java docs of {@link WecTypeInput}
*/
public static class WecTypeInputCopyBuilder
extends SystemParticipantTypeInputCopyBuilder<WecTypeInput.WecTypeInputCopyBuilder> {
private WecCharacteristicInput cpCharacteristic;
private ComparableQuantity<Dimensionless> etaConv;
private ComparableQuantity<Area> rotorArea;
private ComparableQuantity<Length> hubHeight;
private WecTypeInputCopyBuilder(WecTypeInput entity) {
super(entity);
this.cpCharacteristic = entity.getCpCharacteristic();
this.etaConv = entity.getEtaConv();
this.rotorArea = entity.getRotorArea();
this.hubHeight = entity.getHubHeight();
}
public WecTypeInputCopyBuilder setCpCharacteristic(WecCharacteristicInput cpCharacteristic) {
this.cpCharacteristic = cpCharacteristic;
return this;
}
public WecTypeInputCopyBuilder setEtaConv(ComparableQuantity<Dimensionless> etaConv) {
this.etaConv = etaConv;
return this;
}
public WecTypeInputCopyBuilder setRotorArea(ComparableQuantity<Area> rotorArea) {
this.rotorArea = rotorArea;
return this;
}
public WecTypeInputCopyBuilder setHubHeight(ComparableQuantity<Length> hubHeight) {
this.hubHeight = hubHeight;
return this;
}
public WecCharacteristicInput getCpCharacteristic() {
return cpCharacteristic;
}
public ComparableQuantity<Dimensionless> getEtaConv() {
return etaConv;
}
public ComparableQuantity<Area> getRotorArea() {
return rotorArea;
}
public ComparableQuantity<Length> getHubHeight() {
return hubHeight;
}
@Override
public WecTypeInput.WecTypeInputCopyBuilder scale(Double factor) {
setCapex(getCapex().multiply(factor));
setsRated(getsRated().multiply(factor));
setRotorArea(getRotorArea().multiply(factor));
return this;
}
@Override
public WecTypeInput build() {
return new WecTypeInput(
getUuid(),
getId(),
getCapex(),
getOpex(),
getsRated(),
getCosPhiRated(),
cpCharacteristic,
etaConv,
rotorArea,
hubHeight);
}
@Override
protected WecTypeInput.WecTypeInputCopyBuilder thisInstance() {
return this;
}
}
}