Skip to content

Commit

Permalink
Standby Energy Electrolyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristofBernsteiner committed Apr 3, 2024
1 parent 9ab5aea commit b347161
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
7 changes: 4 additions & 3 deletions examples/Cell4LifeSzenario2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ def InputParameter():
fuel_cell_power = FuelCellPowerW #Electricity Power of Fuel Cell Power in Watt
fuel_cell_powerUnit = FuelCellPowerWUnit

# [ ] Change to fuel consumption if it is in standby!
p_el_percentage_standby_fuelcell = 10 #If fuel cell is running in standby, it needs so much electricity power in % of its electricitiy production power if it is running
p_el_percentage_standby_fuelcellUnit = "%"

Expand Down Expand Up @@ -487,7 +488,7 @@ def InputParameter():
h2storage_energy_for_discharge_based_on_massflow_h_fuel = 0
h2storage_energy_for_discharge_based_on_massflow_h_fuelUnit = "%" #of given h_fuel heat value
#operation
h2storage_energy_for_operation = 0 #in Watt, energy demand just for operation, if there isb fuel stored in the tank; this energy amount is always added to charging & discharging energy; if no fuel is in the tank, this energy is not considered! (h2 storage does not need energy)
h2storage_energy_for_operation = 0 #in Watt, energy demand just for operation, if there is fuel stored in the tank; this energy amount is always added to charging & discharging energy; if no fuel is in the tank, this energy is not considered! (h2 storage does not need energy)
h2storage_energy_for_operationUnit = "W"

#Predictive Controller Fuel Cell Electrolyzer factors
Expand All @@ -500,13 +501,13 @@ def InputParameter():
minbatterystateofcharge_electrolyzer_turnon = 80 #minimal battery state of charge, which is necessary, to turn on electrolyzer... in %
minbatterystateofcharge_electrolyzer_turnonUnit = "%"

minbatterystateofcharge_let_electrolyzer_staysturnedon = 0 #Minimal battery state of charge, which is necessary, that electrolyzer stays turned on, in %
minbatterystateofcharge_let_electrolyzer_staysturnedon = 0.1 #Minimal battery state of charge, which is necessary, that electrolyzer stays turned on, in %
minbatterystateofcharge_let_electrolyzer_staysturnedonUnit = "%"

maxbatterystateofcharge_fuelcell_turnon = 80 #maximum battery state of charge; if the actual battery state of charge is above this level, then the fuel cell will not be turned on
maxbatterystateofcharge_fuelcell_turnonUnit = "%"

maxbatterystateofcharge_let_fuelcell_staysturnedon = 100 #Maximum battery state of charge; if that threshold is exceeded, then
maxbatterystateofcharge_let_fuelcell_staysturnedon = 100 #Maximum battery state of charge; if that threshold is exceeded, then the electrolyseur will be turned off
maxbatterystateofcharge_let_fuelcell_staysturnedonUnit = "%"
#FOLLOWING FACTORS Electrolyzer:
#****
Expand Down
11 changes: 10 additions & 1 deletion hisim/components/controller_l1_example_controller_C4L_2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SimpleController(Component):
H2Storage_ElectricityConsumption = "StorageElectricityConsumption" #W (richtig??)
General_PhotovoltaicDelivery = "CSV Profile Photovoltaic Electricity Delivery Input" #W
CHP_ElectricityDelivery = "Fuel Cell/CHP Electricity Delivery Input" #W

CHP_ElectricityStandbyConsumption = "Fuel Cell/CHP Electricity Standby Consumption Input" #W

#Battery Inputs
BatteryStateOfCharge = "Battery State of Charge 0...1" # [0..1] State of charge
Expand Down Expand Up @@ -113,6 +113,15 @@ def __init__(
True,
)

#Fuel Cell Standby Electricity Consumption
self.Electrolyzer_ElectricityConsumptionInput: ComponentInput = self.add_input(
self.component_name,
SimpleController.Electrolyzer_ElectricityConsumption,
lt.LoadTypes.ELECTRICITY,
lt.Units.WATT,
True,
)

#H2 Storage Electricity Consumption
self.H2Storage_ElectricityConsumptionInput: ComponentInput = self.add_input(
self.component_name,
Expand Down
21 changes: 17 additions & 4 deletions hisim/components/generic_CHP.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class SimpleCHP(cp.Component):
ThermalPowerOutput = "ThermalPowerOutput"
ElectricityOutput = "ElectricityOutput"
FuelDelivered = "FuelDelivered"
ElectricityInputStandby = "ElectricityInputStandby"

def __init__(
self, my_simulation_parameters: SimulationParameters, config: CHPConfig
Expand Down Expand Up @@ -184,6 +185,16 @@ def __init__(
],
output_description="Electrical Power output of CHP in Watt."
)

self.ElectricityInputStandby_channel: cp.ComponentOutput = self.add_output(
object_name=self.component_name,
field_name=self.ElectricityInputStandby,
load_type=lt.LoadTypes.ELECTRICITY,
unit=lt.Units.WATT,
output_description="Electricity Input Needed if Fuel cell is on standby",
)


if self.config.use == lt.LoadTypes.HYDROGEN:
self.fuel_consumption_channel: cp.ComponentOutput = self.add_output(
object_name=self.component_name,
Expand Down Expand Up @@ -246,13 +257,15 @@ def i_simulate(

#fuel cell is turned off, is running, or is in standby: Decision, in which mode fuel cell is running:
if self.state.state == 99: #Fuel Cell is on standby, fuel cell is NOT heating in standby!

stsv.set_output_value(self.electricity_output_channel, self.config.p_el*self.config.p_el_percentage_standby_fuelcell/100)
# [ ] Change to fuel consumption if it is in standby!
stsv.set_output_value(self.ElectricityInputStandby_channel, self.config.p_el*self.config.p_el_percentage_standby_fuelcell/100*(-1))
stsv.set_output_value(self.fuel_consumption_channel, 0)

else: # Fuel Cell is running OR is turned off! if running, fuel cell is ALSO heating
stsv.set_output_value(self.electricity_output_channel, 0)

else: # Fuel Cell is running OR is turned off! if running, fuel cell is ALSO heating; if fuel cell is turned off, no Standby Electricity is consumed by fuel cell
stsv.set_output_value(self.electricity_output_channel, self.state.state * self.config.p_el)
stsv.set_output_value(self.fuel_consumption_channel, self.state.state * self.p_fuel)
stsv.set_output_value(self.ElectricityInputStandby_channel, 0)

def get_default_connections_from_chp_controller(self,) -> List[cp.ComponentConnection]:
"""Sets default connections of the controller in the Fuel Cell / CHP."""
Expand Down

0 comments on commit b347161

Please sign in to comment.