Skip to content

Commit

Permalink
Merge pull request #191 from ReactionMechanismGenerator/plot_all_radical
Browse files Browse the repository at this point in the history
Add plotradicalmolefraction
  • Loading branch information
mjohnson541 authored Apr 29, 2022
2 parents 61918b3 + abd2666 commit 6a96ad6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,25 @@ end

export plotmolefractions

function plotradicalmolefraction(bsol;t=0.0,ts=[])
if t == 0.0;
t = bsol.sol.t[end]
end
if ts == []
ts = range(0.0,stop=t, length=100);
end
radmf = zeros(length(ts))
rads = [x.radicalelectrons for x in bsol.domain.phase.species]
for (i,t) in enumerate(ts)
radmf[i] = dot(rads,molefractions(bsol,t))
end
plot(ts,radmf)
ylabel("Radical Mole Fraction")
xlabel("Time in sec")
end

export plotradicalmolefraction

function plotmaxthermoforwardsensitivity(bsol, spcname; N=0, tol= 1e-2)
spnames = getfield.(bsol.domain.phase.species,:name)
values = Array{Float64,1}()
Expand Down

0 comments on commit 6a96ad6

Please sign in to comment.