Added purge gas as a multivariable output#760
Merged
johnjasa merged 3 commits intoMay 21, 2026
Conversation
elenya-grant
approved these changes
May 21, 2026
Collaborator
elenya-grant
left a comment
There was a problem hiding this comment.
I think this looks great! Thanks for adding this in! Awesome to see another use of multi-variable commodity output streams!
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.
Expose synloop purge gas as
process_gas_mixturemultivariable streamAdds a
process_gas_mixturemultivariable stream definition and uses it to expose the ammonia synloop purge gas as a structured output with mass flow, composition (hydrogen, nitrogen, ammonia, argon mass fractions), temperature, and pressure. Thehydrogen_outandnitrogen_outoutputs now represent only unused feedstock, separating them from the purge gas stream.Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
process_gas_mixturestream incommodity_stream_definitions.pyAmmoniaSynLoopPerformanceModelto output purge gas via the new streamammonia.mdType of Reviewer Feedback Requested (on Draft PR)
Structural feedback: Is
process_gas_mixturethe right name/scope for this stream definition?Implementation feedback: Are the 7 stream variables (mass_flow, 4 mass fractions, temperature, pressure) sufficient?
Other feedback: N/A
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
Resolves #754
Section 5: Impacted Areas of the Software
Section 5.1: New Files
None.
Section 5.2: Modified Files
h2integrate/core/commodity_stream_definitions.pyprocess_gas_mixturestream definition with 7 variables (mass_flow, hydrogen, nitrogen, ammonia, argon mass fractions, temperature, pressure).h2integrate/converters/ammonia/ammonia_synloop.pyadd_multivariable_outputcall insetup()and purge gas stream population incompute(). Separated purge gas from unused feedstock outputs.h2integrate/converters/ammonia/test/test_ammonia_synloop_model.pyh2integrate/core/test/test_commodity_stream_definitions.pytest_add_process_gas_mixture_outputandtest_add_process_gas_mixture_input.Section 6: Additional Supporting Information
Purge gas molar fractions (hydrogen, nitrogen, ammonia, argon) are converted to mass fractions using all four species' molecular weights. The
process_gas_mixturestream type is generic and can be reused by other components.Section 7: Test Results, if applicable
test_ammonia_synloop_model.py: 4 passed, 47 subtests passedtest_commodity_stream_definitions.py: 6 passed, 18 subtests passed