Skip to content
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

Dev ale #62

Merged
merged 8 commits into from
Apr 22, 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
19 changes: 14 additions & 5 deletions core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
H2MOLMASS = 2.01588e-3 # [kg/mol] Hydrogen molar mass
H2NDENSITY = 0.08988237638480538 # [kg/Nm^3] Hydrogen density at Normal conditions (T = 0°C, P = 101325 Pa) -> PropsSI('D', 'T', 273.15, 'P', 101325, 'H2')
H2SDENSITY = 0.08520493577522305 # [kg/Sm^3] Hydrogen density at Standard conditions (T = 15°C, P = 101325 Pa) -> PropsSI('D', 'T', 288.15, 'P', 101325, 'H2')
H2NMOLVOL = H2MOLMASS/H2NDENSITY # [Nm^3/mol] Hydrogen molar volume at Normal conditions (T = 0°C, P = 101325 Pa)
LHVH2 = 119.96 # [MJ/kg] Hydrogen Lower Heating Value - https://www.eniscuola.net/mediateca/caratteristiche-dellidrogeno/
LHVH2VOL = LHVH2*H2NDENSITY # [MJ/Nm^3] Hydrogen Lower Heating Value - Volumetric
LHVH2MOL = H2MOLMASS*LHVH2*1e3 # [kJ/mol] Hydrogen Lower Heating Value - Molar
Expand Down Expand Up @@ -84,16 +85,24 @@

'Air'

AIRMOLMASS = 28.96547e-3 # [kg/mol] Air molar mass
AIRSDENSITY = 1.225 # [kg/Sm^3] Air density at Standard conditions (T = 15°C, P = 101325 Pa) -> PropsSI('D', 'T', 273.15, 'P', 101325, 'Air')
CP_AIR = 1.0063 # [kJ/kgK] Air mass specific costant pressure specific heat (T = 25°C, P = 101325 Pa)
CV_AIR = 0.7178 # [kJ/kgK] Air mass specific costant volume specific heat (T = 25°C, P = 101325 Pa)
AIRMOLMASS = 28.96547e-3 # [kg/mol] Air molar mass
AIRSDENSITY = 1.225 # [kg/Sm^3] Air density at Standard conditions (T = 15°C, P = 101325 Pa) -> PropsSI('D', 'T', 273.15, 'P', 101325, 'Air')
CP_AIR = 1.0063 # [kJ/kgK] Air mass specific costant pressure specific heat (T = 25°C, P = 101325 Pa)
CV_AIR = 0.7178 # [kJ/kgK] Air mass specific costant volume specific heat (T = 25°C, P = 101325 Pa)

'Steam'

H1_STEAM800 = 4159.9 # [kJ/kg] Steam mass specific enthalpy @ T = 800°C, P = 116000 Pa
H1_STEAM800 = 4159.9 # [kJ/kg] Steam mass specific enthalpy @ T = 800°C, P = 116000 Pa


#%%

'TIME UNITS'

MINUTES_HOUR = 60 # [min/h] Number of minutes in one hour
MINUTES_DAY = 60*24 # [min/day] Number of minutes in one day
MINUTES_WEEK = 60*24*7 # [min/week] Number of minutes in one week
MINUTES_MONTH = 60*24*30 # [min/month] Number of minutes in one month
HOURS_YEAR = 8760 # [h/year] Number of hours in one year
MINUTES_YEAR = MINUTES_HOUR*HOURS_YEAR # [min/year] Number of minutes in one year

10 changes: 5 additions & 5 deletions core/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def loc_power_simulation(self,step,weather):
self.power_balance['hydrogen']['electrolyzer'][step], \
self.power_balance['electricity']['electrolyzer'][step],\
self.power_balance['oxygen']['electrolyzer'][step], \
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,storable_hydrogen=producible_hyd,p=pb['electricity']) # [:2] # hydrogen supplied by electrolyzer(+) # electricity absorbed by the electorlyzer(-)
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,storable_hydrogen=producible_hyd,p=pb['electricity'],Text=weather['temp_air'][step]) # [:2] # hydrogen supplied by electrolyzer(+) # electricity absorbed by the electorlyzer(-)

pb['hydrogen'] += self.power_balance['hydrogen']['electrolyzer'][step]
pb['electricity'] += self.power_balance['electricity']['electrolyzer'][step]
Expand All @@ -416,7 +416,7 @@ def loc_power_simulation(self,step,weather):
self.power_balance['hydrogen']['electrolyzer'][step], \
self.power_balance['electricity']['electrolyzer'][step],\
self.power_balance['oxygen']['electrolyzer'][step], \
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,storable_hydrogen=producible_hyd,p=pb['electricity']) # hydrogen [kg/s] and oxygen [kg/s] produced by the electrolyzer (+) electricity [kW] and water absorbed [m^3/s] (-)
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,storable_hydrogen=producible_hyd,p=pb['electricity'],Text=weather['temp_air'][step]) # hydrogen [kg/s] and oxygen [kg/s] produced by the electrolyzer (+) electricity [kW] and water absorbed [m^3/s] (-)

# avaliable hydrogen calculation
available_hyd = self.technologies['H tank'].LOC[step] + self.technologies['H tank'].max_capacity - self.technologies['H tank'].used_capacity # [kg] hydrogen amount available in the storage system at the considered timestep.
Expand All @@ -427,7 +427,7 @@ def loc_power_simulation(self,step,weather):
self.power_balance['hydrogen']['electrolyzer'][step], \
self.power_balance['electricity']['electrolyzer'][step],\
self.power_balance['oxygen']['electrolyzer'][step], \
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,hydrog=hyd_from_ele) # hydrogen [kg/s] and oxygen [kg/s] produced by the electrolyzer (+) electricity [kW] and water absorbed [m^3/s] (-)
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,hydrog=hyd_from_ele,Text=weather['temp_air'][step]) # hydrogen [kg/s] and oxygen [kg/s] produced by the electrolyzer (+) electricity [kW] and water absorbed [m^3/s] (-)

# pb['hydrogen'] += self.power_balance['hydrogen']['electrolyzer'][step]
# pb['electricity'] += self.power_balance['electricity']['electrolyzer'][step]
Expand All @@ -439,7 +439,7 @@ def loc_power_simulation(self,step,weather):
self.power_balance['hydrogen']['electrolyzer'][step], \
self.power_balance['electricity']['electrolyzer'][step],\
self.power_balance['oxygen']['electrolyzer'][step], \
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,storable_hydrogen=producible_hyd,p=self.technologies['electrolyzer'].min_partial_load) # [:2] # hydrogen supplied by electrolyzer(+) # electricity absorbed by the electorlyzer(-)
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,storable_hydrogen=producible_hyd,p=self.technologies['electrolyzer'].min_partial_load,Text=weather['temp_air'][step]) # [:2] # hydrogen supplied by electrolyzer(+) # electricity absorbed by the electorlyzer(-)

# pb['hydrogen'] += self.power_balance['hydrogen']['electrolyzer'][step]
# pb['electricity'] += self.power_balance['electricity']['electrolyzer'][step]
Expand All @@ -463,7 +463,7 @@ def loc_power_simulation(self,step,weather):
self.power_balance['hydrogen']['electrolyzer'][step], \
self.power_balance['electricity']['electrolyzer'][step], \
self.power_balance['oxygen']['electrolyzer'][step], \
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,storable_hydrogen=producible_hyd) # [:2] # hydrogen supplied by electrolyzer(+) # electricity absorbed by the electorlyzer(-)
self.power_balance['water']['electrolyzer'][step] = self.technologies['electrolyzer'].use(step,storable_hydrogen=producible_hyd,Text=weather['temp_air'][step]) # [:2] # hydrogen supplied by electrolyzer(+) # electricity absorbed by the electorlyzer(-)

pb['hydrogen'] += self.power_balance['hydrogen']['electrolyzer'][step]
pb['electricity'] += self.power_balance['electricity']['electrolyzer'][step]
Expand Down
Loading