Skip to content

Commit

Permalink
prevent div by 0 in liquid
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Mar 5, 2024
1 parent 2a868ba commit 8d0ec3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion calphy/integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ def get_ideal_gas_fe(temp, rho, natoms, mass, concentration):

fe = 0
for count, conc in enumerate(concentration):
fe += conc*(3*np.log(omega[count]) + np.log(rho) -1 + np.log(conc))
if concentration[count] > 0:
fe += conc*(3*np.log(omega[count]) + np.log(rho) -1 + np.log(conc))

#return prefactor*(ta + tb + (1/(2*natoms))*np.log(2*np.pi*natoms))
return prefactor*fe
Expand Down

0 comments on commit 8d0ec3c

Please sign in to comment.