Converter PLM dispatch - #773
Conversation
kbrunik
left a comment
There was a problem hiding this comment.
Looking pretty good! Remarkable how much simpler the code is when you don't have to track state of charge! I know there was already some planned work that still needs to happen, so happy to re-review at that point
A few high-level notes for the PR:
- Be sure to update the changelog
- Add some basic tests to make sure the dispatch is occurring as expected (i.e., the tech is turns off after peak is "managed")
- Write a doc page for the converter PLM
| control_parameters: | ||
| commodity: electricity | ||
| commodity_rate_units: kW | ||
| system_capacity_rate: 1000.0 |
There was a problem hiding this comment.
Remove from control section, example didn't run with it included.
There was a problem hiding this comment.
I removed system_capacity_rates, I think the others should stay there.
|
|
||
| """ | ||
|
|
||
| system_capacity_kw: int | float = field() |
There was a problem hiding this comment.
@elenya-grant and @johnjasa, I was discussing with Jared about how to make this control strategy tech agnostic. Right now it's hardcoded to have system_capacity_kw in the config. I'm wondering if y'all have ideas of what the best path forward is for this to work with all dispatchable converters.
We have access to the standardized commodity_rate_units but there's no standardization across how we define system capacity, which makes this challenging.
There was a problem hiding this comment.
well system capacity is a standard output of performance models (rated_{commodity}_production). I get confused on the order that models are added, but if the performance model is created in the tech subgroup before the controller, then the performance model would output the rated_{commodity}_production and that could then be an input to the PLM converter controller.
This is a good question though. I think the best thing (if possible) would be to have rated_{commodity}_production as an openmdao input.
Also - I don't think the capacity input in the config or the openmdao inputs should be standardized for a few reasons:
- In the config, it seems more acceptable to include units in config parameters to make it more clear to users what units that parameter should be in. The units are not included in OpenMDAO input names.
- Some technologies do not have a single capacity-related input. Some technologies have an input that would instead be a multiplier on some number of units (like number of electrolyzer clusters and cluster capacity OR number of wind turbines and wind turbine capacity).
There was a problem hiding this comment.
@elenya-grant, thank you for the idea. I successfully implemented the switch to rated_{commodity}_production to make the model technology agnositc. It does require a non-linear solver to resolve the output of the performance model into an input of the controller, which takes 3 iterations to converge. This should be fine as long as the performance model in question is fast-running. I also like how it opens up a possible path for more realistic control interactions between the performance and tech control models. We should probably discuss this more, somewhat related to #711 in that this solution adds a feedback loop in the tech model between the performance and tech control.
* varopex * refurb schedule * update fuel cell schedule calc to allow for non-integer multiples of eol and timesteps * extend liftime for schedule test * Update h2integrate/converters/hydrogen/h2_fuel_cell.py --------- Co-authored-by: Jared Thomas <jaredthomas68@gmail.com> Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>
… example to work with latest changes in H2I
… under a single example
| demand_profile_upstream_peak_cutoff (int | float | None): Threshold applied to | ||
| ``demand_profile_upstream``. Units depend on | ||
| ``demand_profile_upstream_kind``. | ||
| demand_profile_upstream_kind (str): Interpretation mode for |
There was a problem hiding this comment.
For my own edification, you would have to use the demand_profile_upstream if you wanted to dispatch based on price only? and if that was the case would the demand profile basically be a dummy profile? An example of this case might be helpful to show the functionality or more explanation of this in the docs with perhaps an example tech config.
There was a problem hiding this comment.
@jaredthomas68 did you make any changes to this PR based on this question? Do we need to specify demand_profile_upstream even doing a price only dispatch?
There was a problem hiding this comment.
I actually think it is necessary to show an example in the docs of an example tech config of how to use price dispatch only, I think that will be a primary use case for this dispatch strategy and it would be helpful to show them how to set the demand_profile so that they aren't erroneously dispatching the tech unrelated to the price signal.
There was a problem hiding this comment.
I'll add an example. You populate the demand profile upstream with price when in price mode. I can see that being confusing.
There was a problem hiding this comment.
Example added for price mode, and corresponding tests
Converter PLM control
This PR adds peak load management dispatch for converters. It handles two load profiles, one representing an upstream (grid) load and the other representing either a local load that must be met or a price profile. The converter will be dispatched when either of the demand profiles exceeds their respective peak limits. If a price profile is given, then dispatching will only occur when the price exceeds the provided cutoff.
This PR also provides minor updates to the fuel cell model to determine VarOpEx.
Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
Type of Reviewer Feedback Requested (on Draft PR)
Ready for any and all feedback. Let's get this PR polished and merged.
Structural feedback:
Looking for high-level feedback at this point from any who wish to give it.Implementation feedback:
Other feedback:
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.md"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
XYZshould be replaced with the actual number.Section 4: Related Issues
Section 5: Impacted Areas of the Software
Section 5.1: New Files
PeakLoadManagementHeuristicOpenLoopConverterControllerConfig: New config plm converter controlPeakLoadManagementHeuristicOpenLoopConverterController.setupPeakLoadManagementHeuristicOpenLoopConverterController.compute: Computes a per-timestep{commodity}_command_valuethat peak-shaves using primary/upstream cutoffs, clipped to instantaneous demand and rated production.PeakLoadManagementHeuristicOpenLoopConverterController33_plm_converter_heuristic.yaml,tech_config.yaml,plant_config.yaml,driver_config.yamlSection 5.2: Modified Files
h2integrate_model.py
_process_model: Adds aNonlinearBlockGS/DirectSolverto the tech group when a controller sets_reads_performance_outputs, so the controller/performance data cycle converges instead of using stale defaults.h2_fuel_cell.py
LinearH2FuelCellPerformanceConfig/compute: Addsuptime_hours_until_eoland computes areplacement_schedulefrom cumulative "on" hours for use by the finance model.H2FuelCellCostConfig/setup/compute: Addsvariable_opex_per_kwhand anannual_electricity_producedinput to outputVarOpEx.test_h2_fuel_cell.py
unittest.test_all_examples.py
33_peak_load_management/plm_storageand addstest_plm_converter_heuristic_examplecovering the new converter example.model_baseclasses.py
CostModelBaseClass: Removed a stray blank line (whitespace only)..pre-commit-config.yaml: adjusted excluded files for demand_profile.yaml rename
Renamed demand profile files (
.../demand_profiles/demand_profile.yaml,demand_profile_upstream.yaml)Section 6: Additional Supporting Information
Section 7: Test Results, if applicable
Section 8 (Optional): New Model Checklist
docs/developer_guide/coding_guidelines.mdattrsclass to define theConfigto load in attributes for the modelBaseConfigorCostModelBaseConfiginitialize()method,setup()method,compute()methodCostModelBaseClasssupported_models.pycreate_financial_modelinh2integrate_model.pytest_all_examples.pydocs/user_guide/model_overview.mddocs/section<model_name>.mdis added to the_toc.ymlgenerate_class_hierarchy.pyto update the class hierarchy diagram indocs/developer_guide/class_structure.md