Skip to content

Commit

Permalink
Fixed problems with unit conversion involving moles.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsaxe committed Apr 15, 2020
1 parent c98fc8a commit 17ad269
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packmol_step/packmol.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def calculate(
for element in elements:
tmp_mass += mendeleev.element(element).mass
molecular_mass = tmp_mass * ureg.g / ureg.mol # g/mol
molecular_mass.ito('kg/mole')
molecular_mass.ito('kg')

n_parameters = 0
if size is not None:
Expand Down Expand Up @@ -420,7 +420,7 @@ def calculate(
n_molecules = 1
n_atoms = n_molecules * n_atoms_per_molecule
n_moles = n_molecules / ureg.N_A
mass = n_moles * molecular_mass
mass = n_molecules * molecular_mass
volume = mass / density
elif n_moles is not None:
n_molecules = int(round(n_moles * ureg.N_A))
Expand Down

0 comments on commit 17ad269

Please sign in to comment.