You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug summary
If you try to insert zero molecules of a species, PACKMOL is grumpy. Example:
# Use 1000 total ionsn_ions=1000x_li=job.sp.conc# Taken from Wang et al PIM results# at 1 bar and 1100 Klicl_density=1431#kg/m^3kcl_density=1497#kg/m^3# Compute mixture density with ideal mixingmixed_density=x_li*licl_density+ (1.0-x_li) *kcl_density# Compute the number of ions of each typen_cl=int(0.5*n_ions)
n_li=int(0.5*x_li*n_ions)
n_k=n_ions-n_cl-n_li# Create the systemsystem=mbuild.fill_box(
[k, li, cl],
n_compounds=[n_k, n_li, n_cl],
density=mixed_density
)
Why might you want to do this? Imagine spanning a concentration range of 0.0 to 1.0 to, e.g., compute the enthalpy of mixing. Since PACKMOL won't let you specify zero molecules of a species, the above section of pretty code turns ugly with if and elif conditions to handle the 0.0 and 1.0 limits.
** Fix **
I propose we add a snippet of code to packing.py that checks if any species have zero molecules and then cleans that up before calling PACKMOL.
The text was updated successfully, but these errors were encountered:
The search string = int(m in packing.py finds the four instances that come to mind. It should be straightforward enough (except whenever that is said, it's wrong). Just make sure to add some unit tests that catch this behavior
Bug summary
If you try to insert zero molecules of a species, PACKMOL is grumpy. Example:
Why might you want to do this? Imagine spanning a concentration range of 0.0 to 1.0 to, e.g., compute the enthalpy of mixing. Since PACKMOL won't let you specify zero molecules of a species, the above section of pretty code turns ugly with
if
andelif
conditions to handle the0.0
and1.0
limits.** Fix **
I propose we add a snippet of code to
packing.py
that checks if any species have zero molecules and then cleans that up before callingPACKMOL
.The text was updated successfully, but these errors were encountered: