You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PhaseState.jl
+40-4Lines changed: 40 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ using LinearAlgebra
4
4
using Tracker
5
5
using ReverseDiff
6
6
using RecursiveArrayTools
7
+
using ModelingToolkit
7
8
8
9
@inlinefunctioncalcgibbs(ph::U,T::W) where {U<:IdealPhase,W<:Real}
9
10
returngetGibbs.(getfield.(ph.species,:thermo),T)
@@ -181,12 +182,12 @@ export getKcs
181
182
Calculates the forward and reverse rate coefficients for a given reaction, phase and state
182
183
Maintains diffusion limitations if the phase has diffusionlimited=true
183
184
"""
184
-
@inlinefunctiongetkfkrev(rxn::ElementaryReaction,ph::U,T::W1,P::W2,C::W3,N::W4,ns::Q1,Gs::Q2,diffs::Q3,V::W5,phi::W8;kf::W6=-1.0,f::W7=-1.0) where {U<:AbstractPhase,W8,W6,W7,W5,W4,W1,W2,W3<:Real,Q1,Q2,Q3<:AbstractArray}
185
+
@inlinefunctiongetkfkrev(rxn::ElementaryReaction,ph::U,T::W1,P::W2,C::W3,N::W4,ns::Vector{Q1},Gs::Q2,diffs,V::W5,phi::W8;kf::W6=-1.0,f=-1.0) where {U<:AbstractPhase,W8,W6,W5,W4,W1,W2,W3,Q1<:Real,Q2}
185
186
ifsignbit(kf)
186
-
ifsignbit(f)
187
-
kf =getkf(rxn,ph,T,P,C,ns,V,phi)
188
-
else
187
+
ifisa(f,Num) ||!signbit(f)
189
188
kf =getkf(rxn,ph,T,P,C,ns,V,phi)*f
189
+
else
190
+
kf =getkf(rxn,ph,T,P,C,ns,V,phi)
190
191
end
191
192
end
192
193
Kc =getKc(rxn,ph,T,Gs,phi)
@@ -221,6 +222,41 @@ Maintains diffusion limitations if the phase has diffusionlimited=true
221
222
krev *= rxn.reversible
222
223
return (kf,krev)
223
224
end
225
+
226
+
@inlinefunctiongetkfkrev(rxn::ElementaryReaction,ph::U,T::W1,P::W2,C::W3,N::W4,ns::Vector{Q1},Gs::Q2,diffs,V::W5,phi::W8;kf::W6=-1.0,f=-1.0) where {U<:AbstractPhase,W8,W6,W5,W4,W1,W2,W3,Q1<:Num,Q2}
@inlinefunctiongetkfkrevs(phase::U,T::W1,P::W2,C::W3,N::W4,ns::Q1,Gs::Q2,diffs::Q3,V::W5,phi::W7;kfs::W6=nothing) where {U,W7,W6,W5<:Real,W1<:Real,W2<:Real,W3,W4,Q1<:AbstractArray,Q2,Q3<:AbstractArray}
0 commit comments