Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
22c983a
-Add sRatedAC/DC in EvTypeInput.Java
pierrepetersmeier Feb 6, 2024
8006de8
-Update sRatedAC/DC in SystemParticipantTypeInputFactory.java
pierrepetersmeier Feb 8, 2024
bea6151
-Update Test functions for sRatedAC/DC
pierrepetersmeier Feb 8, 2024
e307905
-CsvTypeSourceTest.groovy sRatedAC/DC
pierrepetersmeier Feb 8, 2024
c5bdbbb
-CsvTypeSourceTest.groovy sRatedAC/DC
pierrepetersmeier Feb 8, 2024
fc7e58b
-CsvTypeSourceTest.groovy sRatedAC/DC
pierrepetersmeier Feb 8, 2024
25f69aa
Merge branch 'dev' into pp/#876-add-maximum-ac-and-dc-charging-limits…
pierrepetersmeier Feb 8, 2024
301765a
-spotlessApply
pierrepetersmeier Feb 8, 2024
9371a4b
-Updated SystemParticipantValidationUtilsTest.groovy
pierrepetersmeier Feb 8, 2024
bbd4245
Merge remote-tracking branch 'origin/pp/#876-add-maximum-ac-and-dc-ch…
pierrepetersmeier Feb 8, 2024
d96e499
-Space after comma
pierrepetersmeier Feb 8, 2024
2c9f7d6
Update CHANGELOG.md
pierrepetersmeier Feb 9, 2024
d1e88b7
Merge branch 'dev' into pp/#876-add-maximum-ac-and-dc-charging-limits…
pierrepetersmeier Feb 9, 2024
183b9df
-version with sRated and sRatedDC
pierrepetersmeier Feb 11, 2024
974d9ba
-version with sRated and sRatedDC
pierrepetersmeier Feb 11, 2024
04c6416
- Change sRated in sRatedAC test
pierrepetersmeier Feb 16, 2024
521d6af
Merge branch 'dev' into pp/#876-add-maximum-ac-and-dc-charging-limits…
pierrepetersmeier Feb 20, 2024
12ca028
fix tests
pierrepetersmeier Feb 20, 2024
c3ecaab
-Version with sRated and sRatedDC
pierrepetersmeier Feb 20, 2024
9b3e9cb
-CHANGELOG.md and ev.md corrected
pierrepetersmeier Feb 20, 2024
0def977
Merge branch 'dev' into pp/#876-add-maximum-ac-and-dc-charging-limits…
danielfeismann Feb 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added log warning when using `SwitchInputs` with `parallelDevices` parameter [#840](https://github.com/ie3-institute/PowerSystemDataModel/issues/840)
- Validation for `EvcsInput` [#1000](https://github.com/ie3-institute/PowerSystemDataModel/issues/1000)
- Scaling method in system participant copy builders [#1011](https://github.com/ie3-institute/PowerSystemDataModel/issues/1011)
- Added separate field for maximum power limit for DC to evtype [#876](https://github.com/ie3-institute/PowerSystemDataModel/issues/876)

### Fixed
- Fixed Couchbase integration tests that randomly failed [#755](https://github.com/ie3-institute/PowerSystemDataModel/issues/755)
Expand Down
8 changes: 6 additions & 2 deletions docs/readthedocs/models/input/participant/ev.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ Model of an electric vehicle, that is occasionally connected to the grid via an

* - sRated
- kVA
- Rated apparent power
- Rated apparent power for AC

* - sRatedDC
- kW
- power for DC

* - cosPhiRated
- --
- Rated power factor

```

### Entity Model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SystemParticipantTypeInputFactory

// EvTypeInput
private static final String E_CONS = "eCons";

private static final String S_RATEDDC = "sRatedDC";
// BmTypeInput
private static final String ACTIVE_POWER_GRADIENT = "activePowerGradient";

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

return new EvTypeInput(uuid, id, capEx, opEx, eStorage, eCons, sRated, cosPhi);
ComparableQuantity<Power> sRatedDC = data.getQuantity(S_RATEDDC, StandardUnits.ACTIVE_POWER_IN);

return new EvTypeInput(uuid, id, capEx, opEx, eStorage, eCons, sRated, cosPhi, sRatedDC);
}

private SystemParticipantTypeInput buildHpTypeInput(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class EvTypeInput extends SystemParticipantTypeInput {
private final ComparableQuantity<Energy> eStorage;
/** Consumed electric energy per driven distance (typically in kWh/km) */
private final ComparableQuantity<SpecificEnergy> eCons;
/** power for DC (typically in kW) */
private final ComparableQuantity<Power> sRatedDC;

/**
* @param uuid of the input entity
Expand All @@ -29,8 +31,9 @@ public class EvTypeInput extends SystemParticipantTypeInput {
* @param opex Operating expense for this type of EV (typically in €)
* @param eStorage Energy capacity of the storage
* @param eCons Consumed electric energy per driven distance
* @param sRated Rated apparent power for this type of EV (typically in kW)
* @param sRated Rated apparent power for this type of EV (typically in kVA)
* @param cosphiRated Power factor for this type of EV
* @param sRatedDC power for DC (typically in kW)
*/
public EvTypeInput(
UUID uuid,
Expand All @@ -40,10 +43,12 @@ public EvTypeInput(
ComparableQuantity<Energy> eStorage,
ComparableQuantity<SpecificEnergy> eCons,
ComparableQuantity<Power> sRated,
double cosphiRated) {
double cosphiRated,
ComparableQuantity<Power> sRatedDC) {
super(uuid, id, capex, opex, sRated.to(StandardUnits.S_RATED), cosphiRated);
this.eStorage = eStorage.to(StandardUnits.ENERGY_IN);
this.eCons = eCons.to(StandardUnits.ENERGY_PER_DISTANCE);
this.sRatedDC = sRatedDC.to(StandardUnits.ACTIVE_POWER_IN);
}

public ComparableQuantity<Energy> geteStorage() {
Expand All @@ -54,6 +59,10 @@ public ComparableQuantity<SpecificEnergy> geteCons() {
return eCons;
}

public ComparableQuantity<Power> getsRatedDC() {
return sRatedDC;
}

@Override
public EvTypeInputCopyBuilder copy() {
return new EvTypeInputCopyBuilder(this);
Expand All @@ -64,12 +73,14 @@ public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof EvTypeInput that)) return false;
if (!super.equals(o)) return false;
return eStorage.equals(that.eStorage) && eCons.equals(that.eCons);
return eStorage.equals(that.eStorage)
&& eCons.equals(that.eCons)
&& sRatedDC.equals(that.sRatedDC);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), eStorage, eCons);
return Objects.hash(super.hashCode(), eStorage, eCons, sRatedDC);
}

@Override
Expand All @@ -91,6 +102,8 @@ public String toString() {
+ eStorage
+ ", eCons="
+ eCons
+ ", sRatedDC="
+ sRatedDC
+ '}';
}

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

private ComparableQuantity<Energy> eStorage;
private ComparableQuantity<SpecificEnergy> eCons;
private ComparableQuantity<Power> sRatedDC;

private EvTypeInputCopyBuilder(EvTypeInput entity) {
super(entity);
this.eStorage = entity.geteStorage();
this.eCons = entity.geteCons();
this.sRatedDC = entity.getsRatedDC();
}

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

public EvTypeInputCopyBuilder setsRatedDC(ComparableQuantity<Power> sRatedDC) {
this.sRatedDC = sRatedDC;
return this;
}

public ComparableQuantity<Energy> geteStorage() {
return eStorage;
}
Expand All @@ -128,12 +148,17 @@ public ComparableQuantity<SpecificEnergy> geteCons() {
return eCons;
}

public ComparableQuantity<Power> getsRatedDC() {
return sRatedDC;
}

@Override
public EvTypeInput.EvTypeInputCopyBuilder scale(Double factor) {
setCapex(getCapex().multiply(factor));
setsRated(getsRated().multiply(factor));
seteStorage(geteStorage().multiply(factor));
seteCons(geteCons().multiply(factor));
setsRatedDC(getsRatedDC().multiply(factor));
return this;
}

Expand All @@ -147,7 +172,8 @@ public EvTypeInput build() {
eStorage,
eCons,
getsRated(),
getCosPhiRated());
getCosPhiRated(),
getsRatedDC());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ private static Try<Void, InvalidEntityException> checkEvType(EvTypeInput evTypeI
return Try.ofVoid(
() ->
detectZeroOrNegativeQuantities(
new Quantity<?>[] {evTypeInput.geteStorage(), evTypeInput.geteCons()}, evTypeInput),
new Quantity<?>[] {
evTypeInput.geteStorage(), evTypeInput.geteCons(),
},
evTypeInput),
InvalidEntityException.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class SystemParticipantTypeInputFactoryTest extends Specification implements Fac

"estorage": "7",
"econs": "8",
"srateddc": "9",
]
def typeInputClass = EvTypeInput

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

assert eStorage == getQuant(parameter["estorage"], StandardUnits.ENERGY_IN)
assert eCons == getQuant(parameter["econs"], StandardUnits.ENERGY_PER_DISTANCE)
assert sRatedDC == getQuant(parameter["srateddc"], StandardUnits.ACTIVE_POWER_IN)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ class InputEntityProcessorTest extends Specification {
"eStorage" : "100.0",
"eCons" : "23.0",
"sRated" : "22.0",
"cosPhiRated": "0.9"
"cosPhiRated": "0.9",
"sRatedDC" : "20.0",
]

when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class CsvTypeSourceTest extends Specification implements CsvTestDataMeta {
eCons == sptd.evTypeInput.eCons
sRated == sptd.evTypeInput.sRated
cosPhiRated == sptd.evTypeInput.cosPhiRated
sRatedDC == sptd.evTypeInput.sRatedDC
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class EvInputTest extends Specification {
assert id == ev.id
assert qCharacteristics == ev.qCharacteristics
assert type.sRated == ev.type.sRated * 2d
assert type.sRatedDC == ev.type.sRatedDC * 2d
assert type.eStorage == ev.type.eStorage * 2d
assert type.eCons == ev.type.eCons * 2d
assert em == Optional.of(SystemParticipantTestData.emInput)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class EvTypeInputTest extends Specification {
assert eStorage == Quantities.getQuantity(150, ENERGY_IN)
assert eCons == evTypeInput.eCons
assert sRated == evTypeInput.sRated
assert sRatedDC == evTypeInput.sRatedDC
assert cosPhiRated == evTypeInput.cosPhiRated
}
}
Expand All @@ -51,6 +52,7 @@ class EvTypeInputTest extends Specification {
assert eStorage == evTypeInput.eStorage * 2d
assert eCons == evTypeInput.eCons * 2d
assert sRated == evTypeInput.sRated * 2d
assert sRatedDC == evTypeInput.sRatedDC * 2d
assert cosPhiRated == evTypeInput.cosPhiRated
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ class SystemParticipantValidationUtilsTest extends Specification {
ex.message == expectedException.message

where:
invalidEvType || expectedException
new EvTypeInput(uuid, id, capex, opex, Quantities.getQuantity(0, ENERGY_IN), Quantities.getQuantity(0, ENERGY_PER_DISTANCE), sRated, cosPhiRated) || new InvalidEntityException("The following quantities have to be positive: 0 kWh, 0 kWh/km", invalidEvType)
invalidEvType || expectedException
new EvTypeInput(uuid, id, capex, opex, Quantities.getQuantity(0, ENERGY_IN), Quantities.getQuantity(0, ENERGY_PER_DISTANCE), sRated, cosPhiRated, Quantities.getQuantity(20, ACTIVE_POWER_IN)) || new InvalidEntityException("The following quantities have to be positive: 0 kWh, 0 kWh/km", invalidEvType)
}

// Fixed Feed In
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class SystemParticipantTestData {
// EV
private static final ComparableQuantity<Energy> eStorage = Quantities.getQuantity(100, ENERGY_IN)
private static final ComparableQuantity<SpecificEnergy> eCons = Quantities.getQuantity(5, ENERGY_PER_DISTANCE)
private static final ComparableQuantity<Power> sRatedDC = Quantities.getQuantity(20,ACTIVE_POWER_IN )
public static final EvTypeInput evTypeInput = new EvTypeInput(
typeUuid,
"test_evTypeInput",
Expand All @@ -240,7 +241,8 @@ class SystemParticipantTestData {
eStorage,
eCons,
sRated,
cosPhiRated)
cosPhiRated,
sRatedDC)
public static final EvInput evInput = new EvInput(
UUID.fromString("a17be20f-c7a7-471d-8ffe-015487c9d022"),
"test_evInput",
Expand Down
3 changes: 2 additions & 1 deletion src/test/groovy/edu/ie3/test/common/TypeTestData.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class TypeTestData extends GridTestData {
Quantities.getQuantity(100d, KILOWATTHOUR),
Quantities.getQuantity(23d, KILOWATTHOUR_PER_KILOMETRE),
Quantities.getQuantity(22d, KILOWATT),
0.9
0.9,
Quantities.getQuantity(20d, KILOWATT)
)

public static final HpTypeInput hpType = new HpTypeInput(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
uuid,capex,cos_phi_rated,e_cons,e_storage,id,opex,s_rated
5ebd8f7e-dedb-4017-bb86-6373c4b68eb8,100.0,0.95,5.0,100.0,test_evTypeInput,50.0,25.0
uuid,capex,cos_phi_rated,e_cons,e_storage,id,opex,s_rated,s_rated_dc
5ebd8f7e-dedb-4017-bb86-6373c4b68eb8,100.0,0.95,5.0,100.0,test_evTypeInput,50.0,25.0,20.0