h2integrate.storage.simple_storage_auto_sizing#
Classes
|
Performance model that calculates the storage charge rate and capacity needed to either: |
|
Configuration class for the StorageAutoSizingModel. |
- class h2integrate.storage.simple_storage_auto_sizing.StorageSizingModelConfig(*, min_soc_fraction, max_soc_fraction, commodity, commodity_rate_units, set_demand_as_avg_commodity_in, demand_profile=0.0, charge_efficiency=None, discharge_efficiency=None, round_trip_efficiency=None, commodity_amount_units=None)#
Configuration class for the StorageAutoSizingModel.
- Parameters:
min_soc_fraction (float)
max_soc_fraction (float)
commodity (str)
commodity_rate_units (str)
set_demand_as_avg_commodity_in (bool)
demand_profile (int | float | list)
charge_efficiency (float | None)
discharge_efficiency (float | None)
round_trip_efficiency (float | None)
commodity_amount_units (str)
- commodity#
name of commodity
- Type:
str
- commodity_rate_units#
Units of the commodity (e.g., kW or kg/h).
- Type:
str
- min_soc_fraction#
Minimum allowable state of charge as a fraction (0 to 1).
- Type:
float
- max_soc_fraction#
Maximum allowable state of charge as a fraction (0 to 1).
- Type:
float
- set_demand_as_avg_commodity_in#
If True, assume the demand is equal to the mean input commodity. If False, uses the demand input.
- Type:
bool
- demand_profile#
Demand values for each timestep, in the same units as commodity_rate_units. May be a scalar for constant demand or a list/array for time-varying demand. Only used if set_demand_as_avg_commodity_in is False. Defaults to 0.
- Type:
int | float | list, optional
- charge_efficiency#
Efficiency of charging the storage, represented as a decimal between 0 and 1 (e.g., 0.9 for 90% efficiency). Optional if round_trip_efficiency is provided.
- Type:
float | None, optional
- discharge_efficiency#
Efficiency of discharging the storage, represented as a decimal between 0 and 1 (e.g., 0.9 for 90% efficiency). Optional if round_trip_efficiency is provided.
- Type:
float | None, optional
- round_trip_efficiency#
Combined efficiency of charging and discharging the storage, represented as a decimal between 0 and 1 (e.g., 0.81 for 81% efficiency). Optional if charge_efficiency and discharge_efficiency are provided.
- Type:
float | None, optional
- commodity_amount_units#
Units of the commodity as an amount (i.e., kW*h or kg). If not provided, defaults to commodity_rate_units*h.
- Type:
str | None, optional
- commodity: str#
- commodity_rate_units: str#
- set_demand_as_avg_commodity_in: bool#
- demand_profile: int | float | list#
- charge_efficiency: float | None#
- discharge_efficiency: float | None#
- round_trip_efficiency: float | None#
- commodity_amount_units: str#
- class h2integrate.storage.simple_storage_auto_sizing.StorageAutoSizingModel(**kwargs)#
Performance model that calculates the storage charge rate and capacity needed to either:
supply the commodity at a constant rate based on the commodity production profile or
try to meet the commodity demand with the given commodity production profile.
Then simulates performance of a basic storage component using the charge rate and capacity calculated.
- _time_step_bounds = (3600, 3600)#
- setup()#
Set up the storage performance model in OpenMDAO.
Initializes the configuration and defines inputs/outputs for OpenMDAO. If dispatch connections are specified, it also sets up a discrete input for Pyomo solver integration.
- compute(inputs, outputs, discrete_inputs=[], discrete_outputs=[])#
Part 0: get demand profile based on user input parameters:
- Estimate the demand profile from either the input commodity_demand or assume
the demand is the average of the commodity_in profile
Part 1: calculate the storage sizes (charge rate, discharge rate, and capacity) needed to meet the demand. The steps to do this are:
- Calculate the max charge and discharge rate as the maximum of the commodity_in
profile and oversize to account for charge/discharge efficiencies.
- Estimate the storage SOC (in commodity_amount_units). The SOC increases when
charging and decreases when discharging. If commodity_set_point is input, calculate the storage SOC as the cumulative summation of the negative of commodity_set_point input (commodity_set_point input is negative when charging and positive when discharging). Otherwise, calculate the storage SOC as the cumulative summation of commodity_in - demand.
If needed, adjust the SOC profile from Step 2 so that the minimum SOC is positive
- Calculate the usable storage capacity as the difference between the
maximum SOC and minimum SOC from Steps 2 and 3.
- Calculate the rated storage capacity as the usable storage capacity
(calculated in Step 4) divided by config.max_soc_fraction - config.min_soc_fraction
Part 2: Simulate the performance of that storage model. The steps of this are:
- Estimate the starting SOC (as a fraction) at the start of the simulation.
Take the first value in the SOC profile (in commodity_amount_units) and divide by the storage capacity
- Make an input dictionary containing the calculated demand profile,
storage capacity, and storage fill rate, and run the storage performance.
Calculate the outputs