Skip to content

Commit d286384

Browse files
Merge pull request #1005 from ie3-institute/pp/#876-add-maximum-ac-and-dc-charging-limits-to-evtype
add maximum ac and dc charging limits to evtype
2 parents 0067748 + 0def977 commit d286384

File tree

14 files changed

+63
-17
lines changed

14 files changed

+63
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Added log warning when using `SwitchInputs` with `parallelDevices` parameter [#840](https://github.com/ie3-institute/PowerSystemDataModel/issues/840)
1313
- Validation for `EvcsInput` [#1000](https://github.com/ie3-institute/PowerSystemDataModel/issues/1000)
1414
- Scaling method in system participant copy builders [#1011](https://github.com/ie3-institute/PowerSystemDataModel/issues/1011)
15+
- Added separate field for maximum power limit for DC to evtype [#876](https://github.com/ie3-institute/PowerSystemDataModel/issues/876)
1516

1617
### Fixed
1718
- Fixed Couchbase integration tests that randomly failed [#755](https://github.com/ie3-institute/PowerSystemDataModel/issues/755)

docs/readthedocs/models/input/participant/ev.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,16 @@ Model of an electric vehicle, that is occasionally connected to the grid via an
4545
4646
* - sRated
4747
- kVA
48-
- Rated apparent power
48+
- Rated apparent power for AC
49+
50+
* - sRatedDC
51+
- kW
52+
- power for DC
4953
5054
* - cosPhiRated
5155
- --
5256
- Rated power factor
53-
57+
5458
```
5559

5660
### Entity Model

src/main/java/edu/ie3/datamodel/io/factory/typeinput/SystemParticipantTypeInputFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class SystemParticipantTypeInputFactory
3737

3838
// EvTypeInput
3939
private static final String E_CONS = "eCons";
40-
40+
private static final String S_RATEDDC = "sRatedDC";
4141
// BmTypeInput
4242
private static final String ACTIVE_POWER_GRADIENT = "activePowerGradient";
4343

@@ -144,7 +144,9 @@ private SystemParticipantTypeInput buildEvTypeInput(
144144
ComparableQuantity<SpecificEnergy> eCons =
145145
data.getQuantity(E_CONS, StandardUnits.ENERGY_PER_DISTANCE);
146146

147-
return new EvTypeInput(uuid, id, capEx, opEx, eStorage, eCons, sRated, cosPhi);
147+
ComparableQuantity<Power> sRatedDC = data.getQuantity(S_RATEDDC, StandardUnits.ACTIVE_POWER_IN);
148+
149+
return new EvTypeInput(uuid, id, capEx, opEx, eStorage, eCons, sRated, cosPhi, sRatedDC);
148150
}
149151

150152
private SystemParticipantTypeInput buildHpTypeInput(

src/main/java/edu/ie3/datamodel/models/input/system/type/EvTypeInput.java

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class EvTypeInput extends SystemParticipantTypeInput {
2121
private final ComparableQuantity<Energy> eStorage;
2222
/** Consumed electric energy per driven distance (typically in kWh/km) */
2323
private final ComparableQuantity<SpecificEnergy> eCons;
24+
/** power for DC (typically in kW) */
25+
private final ComparableQuantity<Power> sRatedDC;
2426

2527
/**
2628
* @param uuid of the input entity
@@ -29,8 +31,9 @@ public class EvTypeInput extends SystemParticipantTypeInput {
2931
* @param opex Operating expense for this type of EV (typically in €)
3032
* @param eStorage Energy capacity of the storage
3133
* @param eCons Consumed electric energy per driven distance
32-
* @param sRated Rated apparent power for this type of EV (typically in kW)
34+
* @param sRated Rated apparent power for this type of EV (typically in kVA)
3335
* @param cosphiRated Power factor for this type of EV
36+
* @param sRatedDC power for DC (typically in kW)
3437
*/
3538
public EvTypeInput(
3639
UUID uuid,
@@ -40,10 +43,12 @@ public EvTypeInput(
4043
ComparableQuantity<Energy> eStorage,
4144
ComparableQuantity<SpecificEnergy> eCons,
4245
ComparableQuantity<Power> sRated,
43-
double cosphiRated) {
46+
double cosphiRated,
47+
ComparableQuantity<Power> sRatedDC) {
4448
super(uuid, id, capex, opex, sRated.to(StandardUnits.S_RATED), cosphiRated);
4549
this.eStorage = eStorage.to(StandardUnits.ENERGY_IN);
4650
this.eCons = eCons.to(StandardUnits.ENERGY_PER_DISTANCE);
51+
this.sRatedDC = sRatedDC.to(StandardUnits.ACTIVE_POWER_IN);
4752
}
4853

4954
public ComparableQuantity<Energy> geteStorage() {
@@ -54,6 +59,10 @@ public ComparableQuantity<SpecificEnergy> geteCons() {
5459
return eCons;
5560
}
5661

62+
public ComparableQuantity<Power> getsRatedDC() {
63+
return sRatedDC;
64+
}
65+
5766
@Override
5867
public EvTypeInputCopyBuilder copy() {
5968
return new EvTypeInputCopyBuilder(this);
@@ -64,12 +73,14 @@ public boolean equals(Object o) {
6473
if (this == o) return true;
6574
if (!(o instanceof EvTypeInput that)) return false;
6675
if (!super.equals(o)) return false;
67-
return eStorage.equals(that.eStorage) && eCons.equals(that.eCons);
76+
return eStorage.equals(that.eStorage)
77+
&& eCons.equals(that.eCons)
78+
&& sRatedDC.equals(that.sRatedDC);
6879
}
6980

7081
@Override
7182
public int hashCode() {
72-
return Objects.hash(super.hashCode(), eStorage, eCons);
83+
return Objects.hash(super.hashCode(), eStorage, eCons, sRatedDC);
7384
}
7485

7586
@Override
@@ -91,6 +102,8 @@ public String toString() {
91102
+ eStorage
92103
+ ", eCons="
93104
+ eCons
105+
+ ", sRatedDC="
106+
+ sRatedDC
94107
+ '}';
95108
}
96109

@@ -103,11 +116,13 @@ public static class EvTypeInputCopyBuilder
103116

104117
private ComparableQuantity<Energy> eStorage;
105118
private ComparableQuantity<SpecificEnergy> eCons;
119+
private ComparableQuantity<Power> sRatedDC;
106120

107121
private EvTypeInputCopyBuilder(EvTypeInput entity) {
108122
super(entity);
109123
this.eStorage = entity.geteStorage();
110124
this.eCons = entity.geteCons();
125+
this.sRatedDC = entity.getsRatedDC();
111126
}
112127

113128
public EvTypeInputCopyBuilder seteStorage(ComparableQuantity<Energy> eStorage) {
@@ -120,6 +135,11 @@ public EvTypeInputCopyBuilder seteCons(ComparableQuantity<SpecificEnergy> eCons)
120135
return this;
121136
}
122137

138+
public EvTypeInputCopyBuilder setsRatedDC(ComparableQuantity<Power> sRatedDC) {
139+
this.sRatedDC = sRatedDC;
140+
return this;
141+
}
142+
123143
public ComparableQuantity<Energy> geteStorage() {
124144
return eStorage;
125145
}
@@ -128,12 +148,17 @@ public ComparableQuantity<SpecificEnergy> geteCons() {
128148
return eCons;
129149
}
130150

151+
public ComparableQuantity<Power> getsRatedDC() {
152+
return sRatedDC;
153+
}
154+
131155
@Override
132156
public EvTypeInput.EvTypeInputCopyBuilder scale(Double factor) {
133157
setCapex(getCapex().multiply(factor));
134158
setsRated(getsRated().multiply(factor));
135159
seteStorage(geteStorage().multiply(factor));
136160
seteCons(geteCons().multiply(factor));
161+
setsRatedDC(getsRatedDC().multiply(factor));
137162
return this;
138163
}
139164

@@ -147,7 +172,8 @@ public EvTypeInput build() {
147172
eStorage,
148173
eCons,
149174
getsRated(),
150-
getCosPhiRated());
175+
getCosPhiRated(),
176+
getsRatedDC());
151177
}
152178

153179
@Override

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ private static Try<Void, InvalidEntityException> checkEvType(EvTypeInput evTypeI
288288
return Try.ofVoid(
289289
() ->
290290
detectZeroOrNegativeQuantities(
291-
new Quantity<?>[] {evTypeInput.geteStorage(), evTypeInput.geteCons()}, evTypeInput),
291+
new Quantity<?>[] {
292+
evTypeInput.geteStorage(), evTypeInput.geteCons(),
293+
},
294+
evTypeInput),
292295
InvalidEntityException.class);
293296
}
294297

src/test/groovy/edu/ie3/datamodel/io/factory/typeinput/SystemParticipantTypeInputFactoryTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class SystemParticipantTypeInputFactoryTest extends Specification implements Fac
5252

5353
"estorage": "7",
5454
"econs": "8",
55+
"srateddc": "9",
5556
]
5657
def typeInputClass = EvTypeInput
5758

@@ -72,6 +73,7 @@ class SystemParticipantTypeInputFactoryTest extends Specification implements Fac
7273

7374
assert eStorage == getQuant(parameter["estorage"], StandardUnits.ENERGY_IN)
7475
assert eCons == getQuant(parameter["econs"], StandardUnits.ENERGY_PER_DISTANCE)
76+
assert sRatedDC == getQuant(parameter["srateddc"], StandardUnits.ACTIVE_POWER_IN)
7577
}
7678
}
7779

src/test/groovy/edu/ie3/datamodel/io/processor/input/InputEntityProcessorTest.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ class InputEntityProcessorTest extends Specification {
521521
"eStorage" : "100.0",
522522
"eCons" : "23.0",
523523
"sRated" : "22.0",
524-
"cosPhiRated": "0.9"
524+
"cosPhiRated": "0.9",
525+
"sRatedDC" : "20.0",
525526
]
526527

527528
when:

src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvTypeSourceTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class CsvTypeSourceTest extends Specification implements CsvTestDataMeta {
200200
eCons == sptd.evTypeInput.eCons
201201
sRated == sptd.evTypeInput.sRated
202202
cosPhiRated == sptd.evTypeInput.cosPhiRated
203+
sRatedDC == sptd.evTypeInput.sRatedDC
203204
}
204205
}
205206
}

src/test/groovy/edu/ie3/datamodel/models/input/system/EvInputTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class EvInputTest extends Specification {
4545
assert id == ev.id
4646
assert qCharacteristics == ev.qCharacteristics
4747
assert type.sRated == ev.type.sRated * 2d
48+
assert type.sRatedDC == ev.type.sRatedDC * 2d
4849
assert type.eStorage == ev.type.eStorage * 2d
4950
assert type.eCons == ev.type.eCons * 2d
5051
assert em == Optional.of(SystemParticipantTestData.emInput)

src/test/groovy/edu/ie3/datamodel/models/input/system/type/EvTypeInputTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class EvTypeInputTest extends Specification {
3131
assert eStorage == Quantities.getQuantity(150, ENERGY_IN)
3232
assert eCons == evTypeInput.eCons
3333
assert sRated == evTypeInput.sRated
34+
assert sRatedDC == evTypeInput.sRatedDC
3435
assert cosPhiRated == evTypeInput.cosPhiRated
3536
}
3637
}
@@ -51,6 +52,7 @@ class EvTypeInputTest extends Specification {
5152
assert eStorage == evTypeInput.eStorage * 2d
5253
assert eCons == evTypeInput.eCons * 2d
5354
assert sRated == evTypeInput.sRated * 2d
55+
assert sRatedDC == evTypeInput.sRatedDC * 2d
5456
assert cosPhiRated == evTypeInput.cosPhiRated
5557
}
5658
}

0 commit comments

Comments
 (0)