-
Notifications
You must be signed in to change notification settings - Fork 34
Oxygen output from PEM electrolyzer #642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
948c589
added oxygen output from electrolyzer
elenya-grant b13d5b5
updated example 14 to calc LCOO
elenya-grant b4ae786
updated failing test
elenya-grant f98cabc
added docstrings and tests
elenya-grant ead1960
Merge branch 'develop' into pem/o2_out
johnjasa f1a0f38
updated doc string and renamed h2_multiplier
elenya-grant 6044591
updated changelog
elenya-grant e40685d
merged in develop
elenya-grant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,3 +129,62 @@ def test_electrolyzer_outputs(tech_config, plant_config, subtests): | |
| assert prob.get_val("comp.operational_life", units="yr") == plant_life | ||
| with subtests.test("replacement_schedule value"): | ||
| assert np.any(prob.get_val("comp.replacement_schedule", units="unitless") == 0) | ||
|
|
||
|
|
||
| @pytest.mark.regression | ||
| def test_electrolyzer_results(tech_config, plant_config, subtests): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the tests! |
||
| prob = om.Problem() | ||
| comp = ECOElectrolyzerPerformanceModel( | ||
| plant_config=plant_config, tech_config=tech_config, driver_config={} | ||
| ) | ||
| prob.model.add_subsystem("comp", comp, promotes=["*"]) | ||
| prob.setup() | ||
| power_profile = np.full(8760, 32.0) | ||
| prob.set_val("comp.electricity_in", power_profile, units="MW") | ||
|
|
||
| prob.run_model() | ||
|
|
||
| with subtests.test("Total hydrogen produced"): | ||
| assert ( | ||
| pytest.approx(5297814.89908964, rel=1e-6) | ||
| == prob.get_val("comp.hydrogen_out", units="kg/h").sum() | ||
| ) | ||
|
|
||
| with subtests.test("Total oxygen produced"): | ||
| assert ( | ||
| pytest.approx(42045916.90741967, rel=1e-6) | ||
| == prob.get_val("comp.oxygen_out", units="kg/h").sum() | ||
| ) | ||
|
|
||
| with subtests.test("Year 0 capacity factor"): | ||
| assert ( | ||
| pytest.approx(77.10460139, rel=1e-6) | ||
| == prob.get_val("comp.capacity_factor", units="percent")[0] | ||
| ) | ||
|
|
||
| with subtests.test("Rated H2 production"): | ||
| assert pytest.approx(784.3544735823235, rel=1e-6) == prob.get_val( | ||
| "comp.rated_hydrogen_production", units="kg/h" | ||
| ) | ||
|
|
||
| with subtests.test("Rated O2 production"): | ||
| assert pytest.approx(6225.00099576, rel=1e-6) == prob.get_val( | ||
| "comp.rated_oxygen_production", units="kg/h" | ||
| ) | ||
|
|
||
| with subtests.test("H2: CF*Rated = Annual"): | ||
| np.testing.assert_allclose( | ||
| prob.get_val("comp.rated_hydrogen_production", units="kg/h") | ||
| * prob.get_val("comp.capacity_factor", units="unitless") | ||
| * 8760, | ||
| prob.get_val("comp.annual_hydrogen_produced", units="kg/yr"), | ||
| rtol=1e-6, | ||
| ) | ||
| with subtests.test("O2: CF*Rated = Annual"): | ||
| np.testing.assert_allclose( | ||
| prob.get_val("comp.rated_oxygen_production", units="kg/h") | ||
| * prob.get_val("comp.capacity_factor", units="unitless") | ||
| * 8760, | ||
| prob.get_val("comp.annual_oxygen_produced", units="kg/yr"), | ||
| rtol=1e-6, | ||
| ) | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any citations we can include for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - I pushed up the updated doc string