Skip to content

Commit

Permalink
Fixed A-factor correction for SurfaceChargeTransfer
Browse files Browse the repository at this point in the history
Added solvent correction for SurfaceChargeTransfer
  • Loading branch information
ssun30 committed May 28, 2024
1 parent b5c37c4 commit e82b082
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions rmgpy/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ def fix_barrier_height(self, force_positive=False, solvent="", apply_solvation_c

if self.kinetics is None:
raise KineticsError("Cannot fix barrier height for reactions with no kinetics attribute")

if isinstance(self.kinetics, Marcus):
if apply_solvation_correction and solvent:
self.apply_solvent_correction(solvent)
Expand Down Expand Up @@ -1039,7 +1039,7 @@ def fix_barrier_height(self, force_positive=False, solvent="", apply_solvation_c
logging.info("For reaction {0!s} Ea raised from {1:.1f} to {2:.1f} kJ/mol.".format(
self, self.kinetics.Ea.value_si / 1000., Ea / 1000.))
self.kinetics.Ea.value_si = Ea
if isinstance(self.kinetics, (Arrhenius, StickingCoefficient, ArrheniusChargeTransfer)): # SurfaceArrhenius is a subclass of Arrhenius
if isinstance(self.kinetics, (Arrhenius, StickingCoefficient, ArrheniusChargeTransfer, SurfaceChargeTransfer)): # SurfaceArrhenius is a subclass of Arrhenius
if apply_solvation_correction and solvent and self.kinetics.solute:
self.apply_solvent_correction(solvent)
Ea = self.kinetics.Ea.value_si
Expand Down
14 changes: 6 additions & 8 deletions rmgpy/rmg/reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,22 +601,20 @@ def to_rms(obj, species_names=None, rms_species_list=None, rmg_species=None):
A = obj._A.value_si
if obj._T0.value_si != 1.0:
A /= ((obj._T0.value_si) ** obj._n.value_si)
# if obj._V0.value_si != 0.0:
# A *= np.exp(obj._alpha.value_si*obj._electrons.value_si*constants.F*obj.V0.value_si/constants.R/300)
n = obj._n.value_si
Ea = obj._Ea.value_si
q = obj._alpha.value_si*obj._electrons.value_si
return rms.Arrheniusq(A, n, Ea, q, rms.EmptyRateUncertainty())
q = obj._alpha.value_si*obj._electrons.value_si
V0 = obj._V0.value_si
return rms.Arrheniusq(A, n, Ea, q, V0, rms.EmptyRateUncertainty())
elif isinstance(obj, SurfaceChargeTransfer):
A = obj._A.value_si
if obj._T0.value_si != 1.0:
A /= ((obj._T0.value_si) ** obj._n.value_si)
# if obj._V0.value_si != 0.0:
# A *= np.exp(obj._alpha.value_si*obj._electrons.value_si*constants.F*obj.V0.value_si/constants.R/300)
n = obj._n.value_si
Ea = obj._Ea.value_si
q = obj._alpha.value_si*obj._electrons.value_si
return rms.Arrheniusq(A, n, Ea, q, rms.EmptyRateUncertainty())
V0 = obj._V0.value_si
return rms.Arrheniusq(A, n, Ea, q, V0, rms.EmptyRateUncertainty())
elif isinstance(obj, Marcus):
A = obj._A.value_si
n = obj._n.value_si
Expand Down Expand Up @@ -725,7 +723,7 @@ def to_rms(obj, species_names=None, rms_species_list=None, rmg_species=None):
else:
atomnums[atm.element.symbol] = 1
bondnum = len(mol.get_all_edges())

if not obj.molecule[0].contains_surface_site():
rad = rms.getspeciesradius(atomnums, bondnum)
diff = rms.StokesDiffusivity(rad)
Expand Down

0 comments on commit e82b082

Please sign in to comment.