WIP: Heterogeneous-Commodity System-Level Control (Static and Measured Conversion Ratios) - #844
Open
johnjasa wants to merge 5 commits into
Open
WIP: Heterogeneous-Commodity System-Level Control (Static and Measured Conversion Ratios)#844johnjasa wants to merge 5 commits into
johnjasa wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Heterogeneous-Commodity System-Level Control (Static and Measured Conversion Ratios)
This PR teaches the system-level control (SLC) framework to handle heterogeneous commodity systems, where the demand is for one commodity (for example ammonia) but the technologies that ultimately satisfy it produce and consume other commodities upstream (for example electricity into hydrogen into ammonia). The controller now translates demand for the demand commodity into set-points for each upstream technology by walking backward across converters using per-technology conversion ratios. Ratios are measured from each converter's consumed and produced streams when available and fall back to static ratios defined in the tech config.
Summary of changes:
SystemLevelControlBaseso demand for one commodity is translated into derived demand for upstream input commodities.{commodity}_consumedand produced streams per timestep, falling back to a static ratio from the tech config, and emit a one-time warning only when neither a measurement nor a static ratio is available.{commodity}_consumedoutputs to the controller so measured ratios are available during dispatch.Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
{commodity}_consumedoutputs to the controllerType of Reviewer Feedback Requested (on Draft PR)
Structural feedback:
Confirm the static-ratio location in the tech config
(
technologies.<tech>.model_inputs.control_parameters.conversion_ratios.<in>_per_<out>)is the right home for these values.
Implementation feedback:
Confirm that the opt-in, warn-and-skip fallback for missing ratios is the desired
backward-compatibility behavior versus a hard error.
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.md"A complete thought. PR 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
Section 5.2: Modified Files
Section 6: Additional Supporting Information
Backward propagation is opt-in. A converter whose input commodity has no controller-managed producer (for example a feedstock-supplied stream) is skipped without a ratio. A converter whose input commodity does have controllable producers but no configured ratio is also skipped, leaving upstream techs at their default dispatch (the legacy behavior), and emits a one-time warning so the missing ratio is discoverable. This keeps existing single-commodity and electricity-to-hydrogen examples unchanged.
Ratios are interpreted so that
input_rate = output_rate * ratioin each commodity's rate units (for example a51electricity-per-hydrogen ratio translates a hydrogen production rate inkg/hinto an electricity demand inkW). When a converter's{commodity}_consumedoutput is connected, the controller measures the ratio per timestep as consumed over produced, guards the divide where production is zero, and falls back to the static or nominal ratio there. This captures nonlinear and time-varying efficiencies without requiring a hand-tuned static ratio.Section 7: Test Results, if applicable
Section 8 (Optional): New Model Checklist
N/A