SLC: Add methods to the SystemLevelControlBase to improve handling of multi-commodity systems
The current methods in the baseclass can be useful for getting important information about multi-commodity systems:
_get_commodity_for_tech(): return a list of the commodities output from a given tech (based on the technology graph)
get_upstream_techs_for_commodity(): returns a list of technologies upstream of a given tech that output the specified commodity
- this should be updated to only return technologies that have a path to the given tech
find_converter_techs(): returns a set of tuples formatted as (input_commodity, tech_name, output_commodity) for only technologies that have a different output commodity than the input commodity.
But perhaps one of the most useful methods (which may require other methods within in) would be a method that can return the aggregated conversion ratio of each energy flow stream to the demand technology.
If we use examples/35_system_level_control/yes_hydrogen to highlight this:
technology_interconnections:
- [ng_feedstock, natural_gas_plant, natural_gas, pipe]
# connect NG feedstock to NG plant
- [wind, battery, electricity, cable]
# wind output available for battery charging (electricity_in)
- [wind, elec_combiner, electricity, cable]
# wind to combined output
- [battery, elec_combiner, electricity, cable]
# battery net output to combined output
- [natural_gas_plant, elec_combiner, electricity, cable]
# electricity to electrolyzer
- [elec_combiner, electrolyzer, electricity, cable]
# electrolyzer to storage
- [electrolyzer, h2_storage, hydrogen, pipe]
# combine hydrogen streams
- [electrolyzer, h2_combiner, hydrogen, pipe]
- [h2_storage, h2_combiner, hydrogen, pipe]
# send hydrogen to load
- [h2_combiner, h2_load_demand, hydrogen, pipe]
# combined supply to demand
It'd be nice to have a method that can get us the conversion ratio of electricity to hydrogen (wind + battery + natural_gas_plant electricity production divided by the electrolyzer hydrogen production), but also the conversion ratio of natural gas to electricity or natural gas to hydrogen. This method should be made to account for more complex cases, such as:
- natural_gas_plant actually used to provide electricity to an ammonia plant instead of the electrolyzer
- hydrogen from the electrolyzer is then converted back into electricity using a fuel cell
- cases with splitters (probably requires a larger effort to figure out how to handle these)
Note: I've attempted to do some parts to this in the demand following controller on this branch
SLC: Add methods to the
SystemLevelControlBaseto improve handling of multi-commodity systemsThe current methods in the baseclass can be useful for getting important information about multi-commodity systems:
_get_commodity_for_tech(): return a list of the commodities output from a given tech (based on the technology graph)get_upstream_techs_for_commodity(): returns a list of technologies upstream of a given tech that output the specified commodityfind_converter_techs(): returns a set of tuples formatted as(input_commodity, tech_name, output_commodity)for only technologies that have a different output commodity than the input commodity.But perhaps one of the most useful methods (which may require other methods within in) would be a method that can return the aggregated conversion ratio of each energy flow stream to the demand technology.
If we use
examples/35_system_level_control/yes_hydrogento highlight this:It'd be nice to have a method that can get us the conversion ratio of electricity to hydrogen (
wind + battery + natural_gas_plantelectricity production divided by the electrolyzer hydrogen production), but also the conversion ratio of natural gas to electricity or natural gas to hydrogen. This method should be made to account for more complex cases, such as:Note: I've attempted to do some parts to this in the demand following controller on this branch