Fixed incorrect object name in the Python 'elementMoles' function
This commit is contained in:
parent
3e3a04c127
commit
f69484c5cb
1 changed files with 2 additions and 8 deletions
|
|
@ -9,9 +9,6 @@ def elementMoles(s, element):
|
|||
s -- an object representing a solution.
|
||||
element -- the symbol for an element in 's'.
|
||||
"""
|
||||
|
||||
nsp = mix.nSpecies()
|
||||
|
||||
# see if 'element' corresponds to a symbol for one of the elements
|
||||
# in s. If it does not, return zero moles.
|
||||
try:
|
||||
|
|
@ -19,12 +16,9 @@ def elementMoles(s, element):
|
|||
if m < 0.0: return 0.0
|
||||
except:
|
||||
return 0.0
|
||||
|
||||
|
||||
x = s.moleFractions()
|
||||
moles = 0.0
|
||||
for k in range(nsp):
|
||||
for k in range(s.nSpecies()):
|
||||
moles += x[k]*s.nAtoms(k,m)
|
||||
return moles
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue