Skip to content

Commit

Permalink
Merge pull request #1785 from ReactionMechanismGenerator/pdep_bugs
Browse files Browse the repository at this point in the history
Several small Pdep bug fixes
  • Loading branch information
alongd authored Oct 30, 2019
2 parents 30553d7 + c9c1d27 commit 6c016f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions arkane/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,6 @@ def load_yaml(self, path, label=None, pdep=False):
self.imaginary_frequency = ScalarQuantity()
self.imaginary_frequency.make_object(data=freq_data, class_dict=class_dict)

if pdep and not self.is_ts and (self.transport_data is None or self.energy_transfer_model is None):
raise ValueError('Transport data and an energy transfer model must be given if pressure-dependent '
'calculations are requested. Check file {0}'.format(path))
if pdep and not self.is_ts and self.smiles is None and self.adjacency_list is None \
and self.inchi is None and self.molecular_weight is None:
raise ValueError('The molecular weight was not specified, and a structure was not given so it could '
Expand Down
2 changes: 1 addition & 1 deletion rmgpy/pdep/me.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ cpdef generate_full_me_matrix(network, bint products=True):
if k_ij[i, j, n_grains - 1,0] > 0 or k_ij[j, i, n_grains - 1,0] > 0:
for r in range(n_grains):
for s in range(n_j):
u, v = indices[i, r, s], v = indices[j,r,s]
u, v = indices[i, r, s], indices[j, r, s]
if u > -1 and v > -1:
me_mat[u, v] = k_ij[j, i, r, s]
me_mat[u, u] -= k_ij[j, i, r, s]
Expand Down
10 changes: 5 additions & 5 deletions rmgpy/pdep/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class Network(object):
`active_j_rotor` ``True`` if the J-rotor is treated as active, ``False`` if treated as adiabatic
`rmgmode` ``True`` if in RMG mode, ``False`` otherwise
----------------------- ----------------------------------------------------
`eqRatios` An array containing concentration of each isomer and reactant channel present at equilibrium
`coll_freq` An array of the frequency of collision between
`eq_ratios` An array containing concentration of each isomer and reactant channel present at equilibrium
`coll_freq` An array of the frequency of collision between
`Mcoll` Matrix of first-order rate coefficients for collisional population transfer between grains for each isomer
`dens_states` 3D np array of stable configurations, number of grains, and number of J
======================= ====================================================
Expand Down Expand Up @@ -269,7 +269,7 @@ def calculate_rate_coefficients(self, Tlist, Plist, method, error_check=True):
K[t, p, :, :] = self.K

# Check that the k(T,P) values satisfy macroscopic equilibrium
eq_ratios = self.eqRatios
eq_ratios = self.eq_ratios
for i in range(n_isom + n_reac):
for j in range(i):
Keq0 = K[t, p, j, i] / K[t, p, i, j]
Expand Down Expand Up @@ -693,7 +693,7 @@ def calculate_microcanonical_rates(self):
rxn.network_kinetics.get_rate_coefficient(temperature)

# Determine the expected value of the equilibrium constant (Kc)
Keq_expected = self.eqRatios[prod] / self.eqRatios[reac]
Keq_expected = self.eq_ratios[prod] / self.eq_ratios[reac]

# Determine the actual values of k(T) and Keq
C0 = 1e5 / (constants.R * temperature)
Expand Down Expand Up @@ -831,7 +831,7 @@ def calculate_equilibrium_ratios(self):
if self.products[i].has_statmech() or self.products[i].has_thermo():
G = self.products[i].get_free_energy(temperature)
eq_ratios[n_isom + n_reac + i] = math.exp(-G / constants.R / temperature) * conc ** (len(self.products[i].species) - 1)
self.eqRatios = eq_ratios
self.eq_ratios = eq_ratios
return eq_ratios / np.sum(eq_ratios)

def calculate_collision_model(self):
Expand Down

0 comments on commit 6c016f6

Please sign in to comment.