Skip to content

Commit 1f285e5

Browse files
hwpangmjohnson541
authored andcommitted
Add forwardability to interface reactions
1 parent 15cb616 commit 1f285e5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Interface.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,20 @@ struct ReactiveInternalInterface{T,B,C,C2,N,Q<:AbstractReaction,X} <: AbstractRe
3232
domaininds::Array{Int64,1}
3333
p::Array{Float64,1}
3434
reversibililty::Array{Bool,1}
35+
forwardability::Array{Bool,1}
3536
end
3637
function ReactiveInternalInterface(domain1,domain2,reactions,A)
3738
vectuple,vecinds,otherrxns,otherrxninds,posinds = getveckinetics(reactions)
3839
rxns = vcat(reactions[vecinds],reactions[otherrxninds])
3940
rxns = [ElementaryReaction(index=i,reactants=rxn.reactants,reactantinds=rxn.reactantinds,products=rxn.products,
40-
productinds=rxn.productinds,kinetics=rxn.kinetics,radicalchange=rxn.radicalchange,reversible=rxn.reversible,pairs=rxn.pairs) for (i,rxn) in enumerate(rxns)]
41+
productinds=rxn.productinds,kinetics=rxn.kinetics,radicalchange=rxn.radicalchange,reversible=rxn.reversible,forwardable=rxn.forwardable,pairs=rxn.pairs) for (i,rxn) in enumerate(rxns)]
4142
rxnarray = getinterfacereactioninds(domain1,domain2,rxns)
4243
M,Nrp1,Nrp2 = getstoichmatrix(domain1,domain2,reactions)
4344
reversibility = Array{Bool,1}(getfield.(rxns,:reversible))
45+
forwardability = Array{Bool,1}(getfield.(rxns,:forwardable))
4446
return ReactiveInternalInterface(domain1,domain2,
4547
rxns,vectuple,posinds,rxnarray,M,Nrp1,Nrp2,A,[1,length(reactions)],
46-
[0,1],ones(length(rxns)),reversibility),ones(length(rxns))
48+
[0,1],ones(length(rxns)),reversibility,forwardability),ones(length(rxns))
4749
end
4850
export ReactiveInternalInterface
4951

@@ -82,6 +84,7 @@ struct ReactiveInternalInterfaceConstantTPhi{J,N,B,B2,B3,C,C2,Q<:AbstractReactio
8284
domaininds::Array{Int64,1}
8385
p::Array{Float64,1}
8486
reversibility::Array{Bool,1}
87+
forwardability::Array{Bool,1}
8588
end
8689
function ReactiveInternalInterfaceConstantTPhi(domain1,domain2,reactions,T,A,phi=0.0)
8790
@assert domain1.T == domain2.T
@@ -92,6 +95,7 @@ function ReactiveInternalInterfaceConstantTPhi(domain1,domain2,reactions,T,A,phi
9295
krevs = kfs./Kc
9396
M,Nrp1,Nrp2 = getstoichmatrix(domain1,domain2,reactions)
9497
reversibility = Array{Bool,1}(getfield.(reactions,:reversible))
98+
forwardability = Array{Bool,1}(getfield.(reactions,:forwardable))
9599
if isa(reactions,Vector{Any})
96100
reactions = convert(Vector{ElementaryReaction},reactions)
97101
end
@@ -100,7 +104,7 @@ function ReactiveInternalInterfaceConstantTPhi(domain1,domain2,reactions,T,A,phi
100104
end
101105
return ReactiveInternalInterfaceConstantTPhi(domain1,domain2,reactions,
102106
rxnarray,M,Nrp1,Nrp2,kfs,krevs,T,A,[1,length(reactions)],
103-
[0,1],kfs[1:end],reversibility),kfs[1:end]
107+
[0,1],kfs[1:end],reversibility,forwardability),kfs[1:end]
104108
end
105109
export ReactiveInternalInterfaceConstantTPhi
106110

@@ -205,7 +209,7 @@ function upgradekinetics(rxns,domain1,domain2)
205209
@assert length(spc) == 1
206210
kin = stickingcoefficient2arrhenius(rxn.kinetics,surfdomain.phase.sitedensity,length(rxn.reactants)-1,spc[1].molecularweight)
207211
newrxns[i] = ElementaryReaction(index=rxn.index,reactants=rxn.reactants,reactantinds=rxn.reactantinds,products=rxn.products,
208-
productinds=rxn.productinds,kinetics=kin,radicalchange=rxn.radicalchange,reversible=rxn.reversible,pairs=rxn.pairs)
212+
productinds=rxn.productinds,kinetics=kin,radicalchange=rxn.radicalchange,reversible=rxn.reversible,forwardable=rxn.forwardable,pairs=rxn.pairs)
209213
else
210214
newrxns[i] = rxn
211215
end

0 commit comments

Comments
 (0)