@@ -44,13 +44,13 @@ function IdealGas(species,reactions; name="",diffusionlimited=false)
4444 echangevec = getfield .(rxns,:electronchange )
4545 if all (echangevec .== 0 )
4646 electronchange = nothing
47- else
47+ else
4848 electronchange = convert (echangevec,Array{Float64,1 })
4949 end
5050 reversibility = getfield .(rxns,:reversible )
5151 return IdealGas (species= species,reactions= rxns,name= name,
52- spcdict= Dict ([sp. name=> i for (i,sp) in enumerate (species)]),stoichmatrix= M,Nrp= Nrp,rxnarray= rxnarray,veckinetics= vectuple,
53- veckineticsinds= posinds, vecthermo= therm, otherreactions= otherrxns, electronchange= electronchange,
52+ spcdict= Dict ([sp. name=> i for (i,sp) in enumerate (species)]),stoichmatrix= M,Nrp= Nrp,rxnarray= rxnarray,veckinetics= vectuple,
53+ veckineticsinds= posinds, vecthermo= therm, otherreactions= otherrxns, electronchange= electronchange,
5454 reversibility= reversibility,diffusionlimited= diffusionlimited,)
5555end
5656export IdealGas
@@ -84,7 +84,7 @@ function IdealDiluteSolution(species,reactions,solvent; name="",diffusionlimited
8484 echangevec = getfield .(rxns,:electronchange )
8585 if all (echangevec .== 0 )
8686 electronchange = nothing
87- else
87+ else
8888 electronchange = convert (echangevec,Array{Float64,1 })
8989 end
9090 reversibility = getfield .(rxns,:reversible )
@@ -125,7 +125,7 @@ function IdealSurface(species,reactions,sitedensity;name="",diffusionlimited=fal
125125 echangevec = getfield .(rxns,:electronchange ).* F
126126 if all (echangevec .== 0 )
127127 electronchange = nothing
128- else
128+ else
129129 electronchange = convert (typeof (Nrp),echangevec)
130130 end
131131 reversibility = getfield .(rxns,:reversible )
@@ -209,7 +209,7 @@ function getveckinetics(rxns)
209209 push! (fs,x)
210210 if posinds == Array {Int64,1} ()
211211 push! (posinds,length (rinds))
212- else
212+ else
213213 push! (posinds,length (rinds)+ posinds[end ])
214214 end
215215 end
@@ -277,7 +277,9 @@ function getreactionindices(spcs,rxns) where {Q<:AbstractPhase}
277277 end
278278 for (key,val) in rxn. kinetics. nameefficiencies
279279 ind = findfirst (isequal (key),names)
280- rxn. kinetics. efficiencies[ind] = val
280+ if ! (ind === nothing )
281+ rxn. kinetics. efficiencies[ind] = val
282+ end
281283 end
282284 end
283285 end
0 commit comments