Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
from gsy_e.constants import HeatPumpSettingsDefaultParameters


class HeatpumpTankTypes(Enum):
"""Supported types of heat tanks"""

WATER = 0
PCM = 1


class PCMType(Enum):
"""Type if PCM material"""

Expand All @@ -27,7 +20,6 @@ class PCMType(Enum):
class BaseTankParameters:
"""Base class for tank parameters"""

type: HeatpumpTankTypes = HeatpumpTankTypes.WATER
name: str = ""
initial_temp_C: float = ConstSettings.HeatPumpSettings.INIT_TEMP_C
min_temp_C: float = ConstSettings.HeatPumpSettings.MIN_TEMP_C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
WATER_DENSITY,
)
from gsy_e.models.strategy.state.heatpump_tank_states.all_tanks_state import AllTanksState
from gsy_e.models.strategy.energy_parameters.heatpump.tank_parameters import (
WaterTankParameters,
HeatpumpTankTypes,
)
from gsy_e.models.strategy.energy_parameters.heatpump.tank_parameters import WaterTankParameters
from gsy_e.models.strategy.state.heatpump_tank_states.water_tank_state import (
WaterTankState,
)
Expand All @@ -33,7 +30,7 @@ class VirtualHeatpumpTankState(WaterTankState):
"""

def __init__(self, tank_parameters: WaterTankParameters):
assert tank_parameters.type == HeatpumpTankTypes.WATER, (
assert isinstance(tank_parameters, WaterTankParameters), (
"only water tanks are allowed " "in the virtual heat pump "
)
super().__init__(tank_parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from gsy_e.models.strategy.energy_parameters.heatpump.tank_parameters import (
WaterTankParameters,
PCMTankParameters,
HeatpumpTankTypes,
)

log = getLogger(__name__)
Expand All @@ -24,9 +23,9 @@ def heatpump_state_factory(
tank_parameter: Union[WaterTankParameters, PCMTankParameters]
) -> TankStateBase:
"""Return correct Tank object from the type provided in the tank parameters."""
if tank_parameter.type == HeatpumpTankTypes.WATER:
if isinstance(tank_parameter, WaterTankParameters):
return WaterTankState(tank_parameters=tank_parameter)
if tank_parameter.type == HeatpumpTankTypes.PCM:
if isinstance(tank_parameter, PCMTankParameters):
return PCMTankState(tank_parameters=tank_parameter)
assert False, f"Unsupported heat pump tank type {tank_parameter.type}"

Expand Down
16 changes: 3 additions & 13 deletions src/gsy_e/setup/strategy_tests/heat_pump_pcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from gsy_e.models.strategy.energy_parameters.heatpump.tank_parameters import (
WaterTankParameters,
PCMTankParameters,
HeatpumpTankTypes,
)
from gsy_e.models.strategy.heat_pump import MultipleTankHeatPumpStrategy
from gsy_e.models.strategy.infinite_bus import InfiniteBusStrategy
Expand All @@ -36,12 +35,6 @@

preferred_buying_rate = 0

MIN_HTF_TEMP_C = 33
MAX_HTF_TEMP_C = 60

MIN_PCM_TEMP_C = 40
MAX_PCM_TEMP_C = 48


def get_setup(config):
area = Area(
Expand All @@ -62,12 +55,9 @@ def get_setup(config):
),
PCMTankParameters(
name="pcm tank 1",
type=HeatpumpTankTypes.PCM,
initial_temp_C=MIN_PCM_TEMP_C,
max_temp_pcm_C=MAX_PCM_TEMP_C,
min_temp_pcm_C=MIN_PCM_TEMP_C,
max_temp_htf_C=MAX_HTF_TEMP_C,
min_temp_htf_C=MIN_HTF_TEMP_C,
initial_temp_C=40,
max_temp_C=48,
min_temp_C=40,
volume_flow_rate_l_min=15,
number_of_plates=23,
),
Expand Down
Loading