Skip to content

Commit 2022d92

Browse files
authored
Merge pull request #4 from ReactionMechanismGenerator/addradicals
Addradicals
2 parents 3ee7c67 + 3b4cab2 commit 2022d92

7 files changed

Lines changed: 709 additions & 237 deletions

File tree

src/Reaction.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export AbstractReaction
1111
products::V3
1212
productinds::V4
1313
kinetics::T
14+
radicalchange::Int64 = NaN
1415
pairs::V5 = @SArray [@SArray [""]]
1516
end
1617
export ElementaryReaction

src/Simulation.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ this outputs a sparse matrix of num reactions xnum species containing the produ
7676
rate of that species associated with that reaction
7777
"""
7878
function rops(bsol::Q,t::X) where {Q<:Simulation,X<:Real}
79-
ropmat = spzeros(length(bsol.domain.phase.reactions),length(bsol.domain.phase.species))
79+
ropmat = zeros(length(bsol.domain.phase.reactions),length(bsol.domain.phase.species))
8080
cs,kfs,krevs = calcthermo(bsol.domain,bsol.sol(t),t)[[2,9,10]]
81-
for (i,rxn) in enumerate(bsol.domain.phase.reactions)
81+
@simd for i in 1:length(bsol.domain.phase.reactions)
82+
rxn = bsol.domain.phase.reactions[i]
8283
R = getrate(rxn,cs,kfs,krevs)
8384
for ind in rxn.productinds
8485
ropmat[i,ind] += R

src/Species.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct EmptySpecies <: AbstractSpecies end
1616
bondnum::Int64=-1
1717
diffusion::N = EmptyDiffusivity()
1818
radius::Float64 = 0.0
19+
radicalelectrons::Int64 = NaN
1920
end
2021
export Species
2122

0 commit comments

Comments
 (0)