Skip to content

Remove parameter storage minimum level from cylindrical thermal storage #1124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

### Changed
- Storage minimum level parameter removed from cylindrical thermal storage [#1123](https://github.com/ie3-institute/PowerSystemDataModel/issues/1123)

## [5.1.0] - 2024-06-24

Expand Down
6 changes: 1 addition & 5 deletions docs/readthedocs/models/input/thermal/cylindricalstorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ Model of a cylindrical thermal storage using a fluent to store thermal energy.

* - storageVolumeLvl
- m³
- Overall available storage volume

* - storageVolumeLvlMin
- m³
- Minimum permissible storage volume
- Overall usable storage volume

* - inletTemp
- °C
Expand Down
1 change: 0 additions & 1 deletion docs/uml/main/input/ThermalDatamodelConcept.puml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ package models {

class CylindricalStorageInput {
- storageVolumeLvl: ComparableQuantity<Volume> [m³]
- storageVolumeLvlMin: ComparableQuantity<Volume> [m³]
- inletTemp: ComparableQuantity<Temperature> [°C]
- returnTemp: ComparableQuantity<Temperature> [°C]
- c: ComparableQuantity<SpecificHeatCapacity> [kWh/(K*m³)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
public class CylindricalStorageInputFactory
extends AssetInputEntityFactory<CylindricalStorageInput, ThermalUnitInputEntityData> {
private static final String STORAGE_VOLUME_LVL = "storageVolumeLvl";
private static final String STORAGE_VOLUME_LVL_MIN = "storageVolumeLvlMin";
private static final String INLET_TEMP = "inletTemp";
private static final String RETURN_TEMP = "returnTemp";
private static final String C = "c";
Expand All @@ -30,7 +29,7 @@ public CylindricalStorageInputFactory() {

@Override
protected String[] getAdditionalFields() {
return new String[] {STORAGE_VOLUME_LVL, STORAGE_VOLUME_LVL_MIN, INLET_TEMP, RETURN_TEMP, C};
return new String[] {STORAGE_VOLUME_LVL, INLET_TEMP, RETURN_TEMP, C};
}

@Override
Expand All @@ -43,24 +42,13 @@ protected CylindricalStorageInput buildModel(
final ThermalBusInput bus = data.getBusInput();
final ComparableQuantity<Volume> storageVolumeLvl =
data.getQuantity(STORAGE_VOLUME_LVL, StandardUnits.VOLUME);
final ComparableQuantity<Volume> storageVolumeLvlMin =
data.getQuantity(STORAGE_VOLUME_LVL_MIN, StandardUnits.VOLUME);
final ComparableQuantity<Temperature> inletTemp =
data.getQuantity(INLET_TEMP, StandardUnits.TEMPERATURE);
final ComparableQuantity<Temperature> returnTemp =
data.getQuantity(RETURN_TEMP, StandardUnits.TEMPERATURE);
final ComparableQuantity<SpecificHeatCapacity> c =
data.getQuantity(C, StandardUnits.SPECIFIC_HEAT_CAPACITY);
return new CylindricalStorageInput(
uuid,
id,
operator,
operationTime,
bus,
storageVolumeLvl,
storageVolumeLvlMin,
inletTemp,
returnTemp,
c);
uuid, id, operator, operationTime, bus, storageVolumeLvl, inletTemp, returnTemp, c);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
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) */
Expand All @@ -35,7 +33,6 @@ public class CylindricalStorageInput extends ThermalStorageInput {
* @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
Expand All @@ -47,13 +44,11 @@ public CylindricalStorageInput(
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);
Expand All @@ -64,7 +59,6 @@ public CylindricalStorageInput(
* @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
Expand All @@ -74,13 +68,11 @@ public CylindricalStorageInput(
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);
Expand All @@ -90,10 +82,6 @@ public ComparableQuantity<Volume> getStorageVolumeLvl() {
return storageVolumeLvl;
}

public ComparableQuantity<Volume> getStorageVolumeLvlMin() {
return storageVolumeLvlMin;
}

public ComparableQuantity<Temperature> getInletTemp() {
return inletTemp;
}
Expand All @@ -117,16 +105,14 @@ public boolean equals(Object o) {
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);
return Objects.hash(super.hashCode(), storageVolumeLvl, inletTemp, returnTemp, c);
}

@Override
Expand All @@ -144,8 +130,6 @@ public String toString() {
+ getThermalBus().getUuid()
+ ", storageVolumeLvl="
+ storageVolumeLvl
+ ", storageVolumeLvlMin="
+ storageVolumeLvlMin
+ ", inletTemp="
+ inletTemp
+ ", returnTemp="
Expand All @@ -164,15 +148,13 @@ 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();
Expand All @@ -184,12 +166,6 @@ public CylindricalStorageInputCopyBuilder 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;
Expand All @@ -209,7 +185,6 @@ public CylindricalStorageInputCopyBuilder c(ComparableQuantity<SpecificHeatCapac
@Override
public CylindricalStorageInputCopyBuilder scale(Double factor) {
storageVolumeLvl(storageVolumeLvl.multiply(factor));
storageVolumeLvlMin(storageVolumeLvlMin.multiply(factor));
return this;
}

Expand All @@ -222,7 +197,6 @@ public CylindricalStorageInput build() {
getOperationTime(),
getThermalBus(),
storageVolumeLvl,
storageVolumeLvlMin,
inletTemp,
returnTemp,
c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ private static List<Try<Void, InvalidEntityException>> checkThermalHouse(
* <ul>
* <li>it is not null
* <li>its available storage volume is positive
* <li>its minimum permissible storage volume is positive and not greater than the available
* storage volume
* <li>its inlet temperature is equal/greater than the outlet temperature
* <li>its specific heat capacity is positive
* </ul>
Expand Down Expand Up @@ -213,25 +211,13 @@ private static List<Try<Void, InvalidEntityException>> checkCylindricalStorage(
new InvalidEntityException(
"Inlet temperature of the cylindrical storage cannot be lower than outlet temperature",
cylindricalStorageInput)));
// Check if minimum permissible storage volume is lower than overall available storage volume
exceptions.add(
Try.ofVoid(
cylindricalStorageInput
.getStorageVolumeLvlMin()
.isGreaterThan(cylindricalStorageInput.getStorageVolumeLvl()),
() ->
new InvalidEntityException(
"Minimum permissible storage volume of the cylindrical storage cannot be higher than overall available storage volume",
cylindricalStorageInput)));

exceptions.add(
Try.ofVoid(
() ->
detectZeroOrNegativeQuantities(
new Quantity<?>[] {
cylindricalStorageInput.getStorageVolumeLvl(),
cylindricalStorageInput.getStorageVolumeLvlMin(),
cylindricalStorageInput.getC()
cylindricalStorageInput.getStorageVolumeLvl(), cylindricalStorageInput.getC()
},
cylindricalStorageInput),
InvalidEntityException.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ class CylindricalStorageInputFactoryTest extends Specification implements Facto
"uuid" : "91ec3bcf-1777-4d38-af67-0bf7c9fa73c7",
"id" : "TestID",
"storagevolumelvl" : "3",
"storagevolumelvlmin": "4",
"inlettemp" : "5",
"returntemp" : "6",
"c" : "7"
"inlettemp" : "4",
"returntemp" : "5",
"c" : "6"
]
def inputClass = CylindricalStorageInput
def thermalBusInput = Mock(ThermalBusInput)
Expand All @@ -53,7 +52,6 @@ class CylindricalStorageInputFactoryTest extends Specification implements Facto
assert id == parameter["id"]
assert thermalBus == thermalBusInput
assert storageVolumeLvl == getQuant(parameter["storagevolumelvl"], StandardUnits.VOLUME)
assert storageVolumeLvlMin == getQuant(parameter["storagevolumelvlmin"], StandardUnits.VOLUME)
assert inletTemp == getQuant(parameter["inlettemp"], StandardUnits.TEMPERATURE)
assert returnTemp == getQuant(parameter["returntemp"], StandardUnits.TEMPERATURE)
assert c == getQuant(parameter["c"], StandardUnits.SPECIFIC_HEAT_CAPACITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class CsvThermalSourceTest extends Specification implements CsvTestDataMeta {
operationTime == sptd.thermalStorage.operationTime
thermalBus == sptd.thermalStorage.thermalBus
storageVolumeLvl == sptd.storageVolumeLvl
storageVolumeLvlMin == sptd.storageVolumeLvlMin
inletTemp == sptd.inletTemp
returnTemp == sptd.returnTemp
c == sptd.c
Expand All @@ -84,7 +83,6 @@ class CsvThermalSourceTest extends Specification implements CsvTestDataMeta {
operationTime == sptd.thermalStorage.operationTime
thermalBus == sptd.thermalStorage.thermalBus
storageVolumeLvl == sptd.storageVolumeLvl
storageVolumeLvlMin == sptd.storageVolumeLvlMin
inletTemp == sptd.inletTemp
returnTemp == sptd.returnTemp
c == sptd.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CylindricalStorageInputTest extends Specification {

when:
def alteredUnit = cylindricalStorageInput.copy().storageVolumeLvl(ThermalUnitInputTestData.storageVolumeLvl)
.storageVolumeLvlMin(ThermalUnitInputTestData.storageVolumeLvlMin).inletTemp(ThermalUnitInputTestData.inletTemp)
.inletTemp(ThermalUnitInputTestData.inletTemp)
.returnTemp(ThermalUnitInputTestData.returnTemp).c(ThermalUnitInputTestData.c)
.thermalBus(ThermalUnitInputTestData.thermalBus).build()

Expand All @@ -30,7 +30,6 @@ class CylindricalStorageInputTest extends Specification {
assert operationTime == cylindricalStorageInput.operationTime
assert thermalBus == cylindricalStorageInput.thermalBus
assert storageVolumeLvl == ThermalUnitInputTestData.storageVolumeLvl
assert storageVolumeLvlMin == ThermalUnitInputTestData.storageVolumeLvlMin
assert inletTemp == ThermalUnitInputTestData.inletTemp
assert returnTemp == ThermalUnitInputTestData.returnTemp
assert c == ThermalUnitInputTestData.c
Expand All @@ -52,7 +51,6 @@ class CylindricalStorageInputTest extends Specification {
assert operationTime == cylindricalStorageInput.operationTime
assert thermalBus == cylindricalStorageInput.thermalBus
assert storageVolumeLvl == cylindricalStorageInput.storageVolumeLvl * 2d
assert storageVolumeLvlMin == cylindricalStorageInput.storageVolumeLvlMin * 2d
assert inletTemp == cylindricalStorageInput.inletTemp
assert returnTemp == cylindricalStorageInput.returnTemp
assert c == cylindricalStorageInput.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ThermalUnitValidationUtilsTest extends Specification {

// Specific data for thermal cylindric storage input
private static final ComparableQuantity<Volume> storageVolumeLvl = Quantities.getQuantity(100, StandardUnits.VOLUME)
private static final ComparableQuantity<Volume> storageVolumeLvlMin = Quantities.getQuantity(10, StandardUnits.VOLUME)
private static final ComparableQuantity<Temperature> inletTemp = Quantities.getQuantity(100, StandardUnits.TEMPERATURE)
private static final ComparableQuantity<Temperature> returnTemp = Quantities.getQuantity(80, StandardUnits.TEMPERATURE)
private static final ComparableQuantity<SpecificHeatCapacity> c = Quantities.getQuantity(1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY)
Expand Down Expand Up @@ -108,8 +107,7 @@ class ThermalUnitValidationUtilsTest extends Specification {

where:
invalidCylindricalStorage || expectedSize || expectedException
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, storageVolumeLvl, storageVolumeLvlMin, Quantities.getQuantity(100, StandardUnits.TEMPERATURE), Quantities.getQuantity(200, StandardUnits.TEMPERATURE), c) || 1 || new InvalidEntityException("Inlet temperature of the cylindrical storage cannot be lower than outlet temperature", invalidCylindricalStorage)
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(100, StandardUnits.VOLUME), Quantities.getQuantity(200, StandardUnits.VOLUME), inletTemp, returnTemp, c) || 1 || new InvalidEntityException("Minimum permissible storage volume of the cylindrical storage cannot be higher than overall available storage volume", invalidCylindricalStorage)
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), Quantities.getQuantity(-200, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 ㎥, -200 ㎥, -1.05 kWh/K*m³", invalidCylindricalStorage)
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, storageVolumeLvl, Quantities.getQuantity(100, StandardUnits.TEMPERATURE), Quantities.getQuantity(200, StandardUnits.TEMPERATURE), c) || 1 || new InvalidEntityException("Inlet temperature of the cylindrical storage cannot be lower than outlet temperature", invalidCylindricalStorage)
new CylindricalStorageInput(thermalUnitUuid, id, operator, operationTime, SystemParticipantTestData.thermalBus, Quantities.getQuantity(-100, StandardUnits.VOLUME), inletTemp, returnTemp, Quantities.getQuantity(-1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY)) || 1 || new InvalidEntityException("The following quantities have to be positive: -100 ㎥, -1.05 kWh/K*m³", invalidCylindricalStorage)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ class SystemParticipantTestData {
operationTime
)
public static final ComparableQuantity<Volume> storageVolumeLvl = Quantities.getQuantity(1.039154027, VOLUME)
public static final ComparableQuantity<Volume> storageVolumeLvlMin = Quantities.getQuantity(0.3, VOLUME)
public static final ComparableQuantity<Temperature> inletTemp = Quantities.getQuantity(110, TEMPERATURE)
public static final ComparableQuantity<Temperature> returnTemp = Quantities.getQuantity(80, TEMPERATURE)
public static final ComparableQuantity<SpecificHeatCapacity> c = Quantities.getQuantity(
Expand All @@ -181,7 +180,6 @@ class SystemParticipantTestData {
OperationTime.notLimited(),
thermalBus,
storageVolumeLvl,
storageVolumeLvlMin,
inletTemp,
returnTemp,
c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class ThermalUnitInputTestData extends SystemParticipantTestData {

// thermal cylindric storage input
private static final ComparableQuantity<Volume> storageVolumeLvl = Quantities.getQuantity(100, StandardUnits.VOLUME)
private static final ComparableQuantity<Volume> storageVolumeLvlMin = Quantities.getQuantity(10, StandardUnits.VOLUME)
private static final ComparableQuantity<Temperature> inletTemp = Quantities.getQuantity(100, StandardUnits.TEMPERATURE)
private static final ComparableQuantity<Temperature> returnTemp = Quantities.getQuantity(80, StandardUnits.TEMPERATURE)
private static final ComparableQuantity<SpecificHeatCapacity> c = Quantities.getQuantity(1.05, StandardUnits.SPECIFIC_HEAT_CAPACITY)
Expand All @@ -62,7 +61,6 @@ class ThermalUnitInputTestData extends SystemParticipantTestData {
operationTime,
thermalBus,
storageVolumeLvl,
storageVolumeLvlMin,
inletTemp,
returnTemp,
c)
Expand Down