PEM Cell - Refactor for OM#90
Conversation
| def h2_production(self, inputs): | ||
| h2_grams_per_sec = self.h2_production_rate(inputs) | ||
| return h2_grams_per_sec * self.dt | ||
|
|
||
| def o2_production(self, inputs): | ||
| o2_grams_per_sec = self.o2_production_rate(inputs) | ||
| return o2_grams_per_sec * self.dt | ||
|
|
||
| def power_consumption_rate(self, inputs): | ||
| V_cell = self.cell_voltage(inputs) | ||
| I_cell = self.get_current(inputs) | ||
| return V_cell * I_cell | ||
|
|
||
| def energy_consumption(self, inputs): | ||
| V_cell = self.cell_voltage(inputs) | ||
| I_cell = self.get_current(inputs) | ||
| return V_cell * I_cell * self.dt | ||
|
|
||
| def conversion_efficiency(self, inputs): | ||
| h2_grams_per_sec = self.h2_production_rate(inputs) | ||
| power_W_per_sec = self.power_consumption_rate(inputs) | ||
| return power_W_per_sec / np.max([1e-30, h2_grams_per_sec]) |
There was a problem hiding this comment.
For all of these methods, I have a slight preference for passing in just the input variables needed (e.g. not passing in the whole inputs dictionary) so that's it's more clear what info is being used.
There was a problem hiding this comment.
yeah - I agree. I do think that these specific methods will be moved to another component in a future PR. I could do that in this PR if you want!
There was a problem hiding this comment.
What are your thoughts on the inputs as the input to the method cell_voltage() in pem_cell.py?
johnjasa
left a comment
There was a problem hiding this comment.
Looks reasonable to me! I know it's a work in progress. I like the generality with which you're adding methods here. When we're looking at the bigger system and how the cell parts fit together, I might have more opinions about how to handle the inputs/outputs, but no big thoughts there yet!
Feature or improvement description
Added a cell base-class and PEM cell performance model. There are some basic tests included. Some outputs of the PEM cell are not yet used, but may be useful to include later. Also - some methods from the PEM model may be moved to another component as the structure of this gets figured out!
TODO:
currenttoIcurrent_densitytoJhydrogentoH2cell_active_areatoA_celloxygentoO2watertoH2Ocell_voltagetoV_cellH2_production_ratetoH2_outO2_production_ratetoO2_outP_cell, or wouldP_cell_consumedmake more sense?)Related issue, if one exists
Impacted areas of the software
electrolyzer/components/cell/cell.py: contains the cell base-classelectrolyzer/components/cell/pem_cell.py: contains the PEM cell model and configelectrolyzer/components/cell/test/test_pem_cell_config.py: tests for the PEM cell config.electrolyzer/components/cell/test/test_pem_cell.py: tests for the PEM cell modelAdditional supporting information
Test results, if applicable