Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Calculators/Rate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ end
@inline (arr::StickingCoefficient)(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 min(arr.A*T^arr.n*exp(-arr.Ea/(R*T)),1.0)
export StickingCoefficient

@with_kw struct Arrheniusq{N<:Real,K<:Real,Q<:Real,P<:AbstractRateUncertainty,B} <: AbstractRate
@with_kw struct Arrheniusq{N<:Real,K<:Real,Q<:Real,R<:Real,P<:AbstractRateUncertainty,B} <: AbstractRate
A::N
n::K
Ea::Q
q::B = 0.0
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)/(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)/(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} = @fastmath arr.A*T^arr.n*exp((-arr.Ea-arr.q*F*(phi-arr.V0))/(R*T))
export Arrheniusq

@with_kw struct Marcus{N<:Real,K<:Real,Q,P<:AbstractRateUncertainty,B} <: AbstractRate
Expand Down Expand Up @@ -248,7 +249,7 @@ export getkineticstype

@inline extracttypename(typ::Symbol) = string(typ)
@inline extracttypename(typ) = string(typ.name)

@inline function _calcdkdCeff(tbarr::ThirdBody,T::Float64,Ceff::Float64)
return @fastmath tbarr.arr(T)
end
Expand Down
8 changes: 8 additions & 0 deletions src/Interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ function ReactiveInternalInterfaceConstantTPhi(domain1,domain2,reactions,T,A,phi
M,Nrp1,Nrp2 = getstoichmatrix(domain1,domain2,reactions)
Gpart = ArrayPartition(domain1.Gs,domain2.Gs)
dGrxns = -M*Gpart
electronchanges = [hasproperty(reaction, :electronchange) ? reaction.electronchange : 0.0 for reaction in reactions]
referencepotentials = [hasproperty(reaction.kinetics, :V0) ? reaction.kinetics.V0 : 0.0 for reaction in reactions]
if isa(domain1.phase, IdealSurface)
phi = domain1.phi !== nothing ? domain1.phi : phi
elseif isa(domain2.phase, IdealSurface)
phi = domain2.phi !== nothing ? domain2.phi : phi
end
dGrxns .+= electronchanges.*(phi.-referencepotentials).*F
kfs = getkf.(reactions,nothing,T,0.0,0.0,Ref([]),A,phi,dGrxns,0.0)
Kc = getKcs(domain1.phase,domain2.phase,T,Nrp1,Nrp2,dGrxns)
krevs = kfs./Kc
Expand Down
7 changes: 6 additions & 1 deletion src/Parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ function getatomdictsmiles(smiles)
mol.assign_representative_molecule()
getatomdictfromrmg(mol.mol_repr)
else
getatomdictfromrdkit(Chem.AddHs(Chem.MolFromSmiles(smiles)))
try
return getatomdictfromrdkit(Chem.AddHs(Chem.MolFromSmiles(smiles)))
catch e
println("RDKit parsing failed, using RMG instead", e)
return getatomdictfromrmg(molecule.Molecule().from_smiles(smiles))
end
end
end

Expand Down