Skip to content

Commit

Permalink
Docstring (#212)
Browse files Browse the repository at this point in the history
* doc : Functions.py docstrings updated

* doc : Amphlett.py docstring updated

* doc : Chamberline_Kim.py docstring updated

* doc : Larminie_Dicks.py docstring updated

* doc : Chakraborty.py docstring updated

* doc : Padulles_Amphlett.py docstring updated

* doc : Padulles_Hauer.py docstring updated

* doc : Padulles1.py docstring updated

* doc : Padulles2.py docstring updated

* fix : dependabot.yml updated

* doc : CHANGELOG.md updated
  • Loading branch information
sepandhaghighi committed Feb 22, 2024
1 parent 14c0dcc commit ffbf9e0
Show file tree
Hide file tree
Showing 11 changed files with 322 additions and 301 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ updates:
time: "01:30"
open-pull-requests-limit: 10
target-branch: develop
assignees:
- "sepandhaghighi"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Test system modified
- Test files moved to `test` folder
- Setup system modified
- Docstrings modified
- CLI mode updated
- `description_control` function modified
- `check_update` function modified
Expand Down
64 changes: 32 additions & 32 deletions opem/Dynamic/Chakraborty.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ def Enernst_Calc(E0, N0, T, PH2, PO2, PH2O):
Calculate Enernst.
:param E0: open cell voltage [V]
:type E0 : float
:type E0: float
:param N0: number of fuel cells in the stack
:type N0 : int
:type N0: int
:param T: cell operation temperature [K]
:type T : float
:param PH2: partial pressure [atm]
:type PH2 : float
:type T: float
:param PH2: partial pressure [atm]
:type PH2: float
:param PO2: partial pressure [atm]
:type PO2 : float
:type PO2: float
:param PH2O: partial pressure [atm]
:type PH2O : float
:type PH2O: float
:return: Enernest [V] as float
"""
try:
Expand All @@ -44,11 +44,11 @@ def PH2_Calc(KH2, u, I):
Calculate PH2.
:param KH2: hydrogen valve constant [kmol.s^(-1).atm^(-1)]
:type KH2 : float
:type KH2: float
:param u: fuel utilization ratio
:type u: float
:param I: cell load current [A]
:type I : float
:type I: float
:return: PH2 [atm] as float
"""
try:
Expand All @@ -65,13 +65,13 @@ def PO2_Calc(KO2, u, rHO, I):
Calculate PO2.
:param KO2: oxygen valve constant [kmol.s^(-1).atm^(-1)]
:type KO2 : float
:type KO2: float
:param u: fuel utilization ratio
:type u: float
:param rHO: ratio of hydrogen to oxygen input flow rates
:param rHO: ratio of hydrogen to oxygen input flow rates
:type rHO: float
:param I: cell load current [A]
:type I : float
:type I: float
:return: PO2 [atm] as float
"""
try:
Expand All @@ -88,9 +88,9 @@ def PH2O_Calc(KH2O, I):
Calculate PH2O.
:param KH2O: water valve constant [kmol.s^(-1).atm^(-1)]
:type KH2O : float
:type KH2O: float
:param I: cell load current [A]
:type I : float
:type I: float
:return: PH2O [atm] as float
"""
try:
Expand All @@ -107,9 +107,9 @@ def Nernst_Gain_Calc(T, I):
Calculate Nernst gain.
:param T: cell operation temperature [K]
:type T : float
:type T: float
:param I: cell load current [A]
:type I : float
:type I: float
:return: Nernst gain [V] as float
"""
try:
Expand All @@ -125,9 +125,9 @@ def Ohmic_Loss_Calc(Rint, I):
Calculate ohmic loss.
:param Rint: fuel cell internal resistance [ohm]
:type Rint : float
:type Rint: float
:param I: cell load current [A]
:type I : float
:type I: float
:return: ohmic loss [V] as float
"""
try:
Expand All @@ -142,15 +142,15 @@ def Vcell_Calc(Enernst, Nernst_Gain, Ohmic_Loss, N):
"""
Calculate cell voltage.
:param Enernst: Enernst [V}
:type Enernst : float
:param Enernst: Enernst [V}
:type Enernst: float
:param Nernst_Gain: Nernst Gain [V]
:type Nernst_Gain: float
:param Ohmic_Loss: ohmic loss [V]
:type Ohmic_Loss: float
:param N: number of fuel cells in the stack
:type N : int
:return: cell voltage [V] as float
:type N: int
:return: cell voltage [V] as float
"""
try:
loss = Nernst_Gain - Ohmic_Loss
Expand All @@ -167,11 +167,11 @@ def Efficiency_Calc(Vcell, u, N):
Calculate PEM cell efficiency.
:param Vcell: cell voltage [V]
:type Vcell:float
:param u: fuel utilization ratio
:type Vcell: float
:param u: fuel utilization ratio
:type u: float
:param N: number of fuel cells in the stack
:type N : int
:type N: int
:return: efficiency as float
"""
try:
Expand All @@ -192,13 +192,13 @@ def Dynamic_Analysis(
"""
Run Chakraborty analysis.
:param InputMethod : input function or input test vector
:param TestMode : test mode flag
:type InputMethod : dict or Get_Input function object
:type TestMode:bool
:param PrintMode : print mode control flag (True : print outputs)
:type PrintMode:bool
:param ReportMode : report mode control flag (True : generate report)
:param InputMethod: input function or input test vector
:type InputMethod: dict or Get_Input function object
:param TestMode: test mode flag
:type TestMode: bool
:param PrintMode: print mode control flag (True : print outputs)
:type PrintMode: bool
:param ReportMode: report mode control flag (True : generate report)
:type ReportMode: bool
:param Folder: output folder address
:type Folder: str
Expand Down
70 changes: 35 additions & 35 deletions opem/Dynamic/Padulles1.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ def Enernst_Calc(E0, N0, T, PH2, PO2):
Calculate Enernst.
:param E0: open cell voltage [V]
:type E0 : float
:type E0: float
:param N0: number of fuel cells in the stack
:type N0 : int
:type N0: int
:param T: cell operation temperature [K]
:type T : float
:type T: float
:param PH2: partial pressure [atm]
:type PH2 : float
:type PH2: float
:param PO2: partial pressure [atm]
:type PO2 : float
:type PO2: float
:return: Enernest [V] as float
"""
try:
Expand All @@ -39,15 +39,15 @@ def PH2_Calc(KH2, tH2, Kr, I, qH2):
Calculate PH2.
:param KH2: hydrogen valve constant [kmol.s^(-1).atm^(-1)]
:type KH2 : float
:type KH2: float
:param tH2: hydrogen time constant [s]
:type tH2 : float
:type tH2: float
:param Kr: modeling constant [kmol.s^(-1).A^(-1)]
:type Kr : float
:type Kr: float
:param I: cell load current [A]
:type I : float
:type I: float
:param qH2: molar flow of hydrogen [kmol.s^(-1)]
:type qH2 : float
:type qH2: float
:return: PH2 [atm] as float
"""
try:
Expand All @@ -64,16 +64,16 @@ def PO2_Calc(KO2, tO2, Kr, I, qO2):
Calculate PO2.
:param KO2: oxygen valve constant [kmol.s^(-1).atm^(-1)]
:type KO2 : float
:type KO2: float
:param tO2: oxygen time constant [s]
:type tO2 : float
:type tO2: float
:param Kr: modeling constant [kmol.s^(-1).A^(-1)]
:type Kr : float
:type Kr: float
:param I: cell load current [A]
:type I : float
:type I: float
:param qO2: molar flow of oxygen [kmol.s^(-1)
:type qO2 : float
:return: PO2 [atm] as float
:type qO2: float
:return: PO2[atm] as float
"""
try:
result = ((1 / KO2) / (1 + tO2)) * (qO2 - Kr * I)
Expand All @@ -89,8 +89,8 @@ def Kr_Calc(N0):
Calculate Kr.
:param N0: number of fuel cells in the stack
:type N0 : int
:return: Kr [kmol.s^(-1).A^(-1)] as float
:type N0: int
:return: Kr[kmol.s^(-1).A^(-1)] as float
"""
try:
result = N0 / (4 * F)
Expand All @@ -104,15 +104,15 @@ def Vcell_Calc(Enernst, B, C, I, Rint):
Calculate Vcell.
:param Enernst: Enernst [V]
:type Enernst : float
:type Enernst: float
:param B: activation voltage constant [V]
:type B: float
:param C: constant [A^(-1)
:type C : float
:type C: float
:param I: cell load current [A]
:type I: float
:param Rint: fuel cell internal resistance [ohm]
:type Rint : float
:type Rint: float
:return: Vcell [V] as float
"""
try:
Expand All @@ -129,10 +129,10 @@ def qO2_Calc(qH2, rho):
Calculate qO2.
:param qH2: molar flow of hydrogen [kmol.s^(-1)]
:type qH2 : float
:type qH2: float
:param rho: hydrogen-oxygen flow rate
:type rho : float
:return: qO2 [kmol.s^(-1)] as float
:type rho: float
:return: qO2[kmol.s^(-1)] as float
"""
try:
result = (qH2 / rho)
Expand All @@ -148,9 +148,9 @@ def Efficiency_Calc(Vcell, N):
Calculate PEM cell efficiency.
:param Vcell: cell voltage [V]
:type Vcell:float
:param N0: number of fuel cells in the stack
:type N0 : int
:type Vcell: float
:param N: number of fuel cells in the stack
:type N: int
:return: efficiency as float
"""
try:
Expand All @@ -169,15 +169,15 @@ def Dynamic_Analysis(
ReportMode=True,
Folder=os.getcwd()):
"""
Run Padulles I analysis.
Run Padulles-I analysis.
:param InputMethod : input function or input test vector
:param TestMode : test mode flag
:type InputMethod : dict or Get_Input function object
:type TestMode:bool
:param PrintMode : print mode control flag (True : print outputs)
:type PrintMode:bool
:param ReportMode : report mode control flag (True : generate report)
:param InputMethod: input function or input test vector
:type InputMethod: dict or Get_Input function object
:param TestMode: test mode flag
:type TestMode: bool
:param PrintMode: print mode control flag (True : print outputs)
:type PrintMode: bool
:param ReportMode: report mode control flag (True : generate report)
:type ReportMode: bool
:param Folder: output folder address
:type Folder: str
Expand Down
42 changes: 21 additions & 21 deletions opem/Dynamic/Padulles2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ def Enernst_Calc(E0, N0, T, PH2, PO2, PH2O):
Calculate Enernst.
:param E0: open cell voltage [V]
:type E0 : float
:type E0: float
:param N0: number of fuel cells in the stack
:type N0 : int
:type N0: int
:param T: cell operation temperature [K]
:type T : float
:type T: float
:param PH2: partial pressure [atm]
:type PH2 : float
:type PH2: float
:param PO2: partial pressure [atm]
:type PO2 : float
:type PO2: float
:param PH2O: partial pressure [atm]
:type PH2O : float
:return: Enernest [V] as float
:type PH2O: float
:return: Enernest[V] as float
"""
try:
result = N0 * (E0 + (R * T / (2 * F)) *
Expand All @@ -43,16 +43,16 @@ def PH2O_Calc(KH2O, tH2O, Kr, I, qH2O):
Calculate PH2O.
:param KH2O: water valve constant [kmol.s^(-1).atm^(-1)]
:type KH2O : float
:type KH2O: float
:param tH2O: water time constant [s]
:type tH2O : float
:type tH2O: float
:param Kr: modeling constant [kmol.s^(-1).A^(-1)]
:type Kr : float
:type Kr: float
:param I: cell load current [A]
:type I : float
:type I: float
:param qH2O: molar flow of water [kmol.s^(-1)]
:type qH2O : float
:return: PH2O [atm] as float
:type qH2O: float
:return: PH2O[atm] as float
"""
try:
result = ((1 / KH2O) / (1 + tH2O)) * (qH2O - 2 * Kr * I)
Expand All @@ -70,15 +70,15 @@ def Dynamic_Analysis(
ReportMode=True,
Folder=os.getcwd()):
"""
Run Padulles II analysis.
Run Padulles-II analysis.
:param InputMethod : input function or input test vector
:param TestMode : test mode flag
:type InputMethod : dict or Get_Input function object
:type TestMode:bool
:param PrintMode : print mode control flag (True : print outputs)
:type PrintMode:bool
:param ReportMode : report mode control flag (True : generate report)
:param InputMethod: input function or input test vector
:type InputMethod: dict or Get_Input function object
:param TestMode: test mode flag
:type TestMode: bool
:param PrintMode: print mode control flag (True : print outputs)
:type PrintMode: bool
:param ReportMode: report mode control flag (True : generate report)
:type ReportMode: bool
:param Folder: output folder address
:type Folder: str
Expand Down

0 comments on commit ffbf9e0

Please sign in to comment.