From 3a5588b341ad6c1a5de9be66a4fbc09c00948833 Mon Sep 17 00:00:00 2001 From: ssun30 Date: Sat, 4 Jan 2025 21:13:23 -0500 Subject: [PATCH] TEMP: added checks to restrict barrier height --- src/Calculators/Rate.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Calculators/Rate.jl b/src/Calculators/Rate.jl index d4a1de28..1fd776a8 100644 --- a/src/Calculators/Rate.jl +++ b/src/Calculators/Rate.jl @@ -35,8 +35,16 @@ export StickingCoefficient V0::R = 0.0 unc::P = EmptyRateUncertainty() end -@inline (arr::Arrheniusq)(;T::Q,P::N=0.0,C::S=0.0,phi=0.0,dGrxn=0.0,d=0.0) where {Q<:Real,N<:Real,S<:Real} = @fastmath arr.A*T^arr.n*exp((-arr.Ea-arr.q*F*(phi-arr.V0))/(R*T)) -@inline (arr::Arrheniusq)(T::Q;P::N=0.0,C::S=0.0,phi=0.0,dGrxn=0.0,d=0.0) where {Q<:Real,N<:Real,S<:Real} = @fastmath arr.A*T^arr.n*exp((-arr.Ea-arr.q*F*(phi-arr.V0))/(R*T)) +@inline (arr::Arrheniusq)(;T::Q, P::N=0.0, C::S=0.0, phi=0.0, dGrxn=0.0, d=0.0) where {Q<:Real, N<:Real, S<:Real} = begin + barrier = arr.Ea+arr.q*F*(phi-arr.V0) + corrected_barrier = max(0, dGrxn, barrier) + @fastmath arr.A*T^arr.n*exp(-corrected_barrier/(R*T)) +end +@inline (arr::Arrheniusq)(T::Q; P::N=0.0, C::S=0.0, phi=0.0, dGrxn=0.0, d=0.0) where {Q<:Real, N<:Real, S<:Real} = begin + barrier = arr.Ea+arr.q*F*(phi-arr.V0) + corrected_barrier = max(0, dGrxn, barrier) + @fastmath arr.A*T^arr.n*exp(-corrected_barrier/(R*T)) +end export Arrheniusq @with_kw struct Marcus{N<:Real,K<:Real,Q,P<:AbstractRateUncertainty,B} <: AbstractRate