Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed processfluxes for interfaces #266

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/EdgeAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ function processfluxes(sim::SystemSimulation,
end
for d in sim.interfaces
if hasproperty(d,:rxnarray)
interspecieslist = vcat(d.domain1.phase.species, d.domain2.phase.species)
@inbounds for i = 1:size(d.rxnarray)[2]
if @inbounds any(d.rxnarray[:,i].>length(corespeciesconcentrations))
continue
Expand All @@ -383,8 +384,8 @@ function processfluxes(sim::SystemSimulation,
@inbounds corespeciesconsumptionrates[d.rxnarray[j,i]] += frts[i+index]
@inbounds corespeciesproductionrates[d.rxnarray[j,i]] += rrts[i+index]
corespeciesnetconsumptionrates[d.rxnarray[j,i]] += net_forward_rate
if d.phase.species[d.rxnarray[j,i]].radicalelectrons == 1
coreradicalnetterminationrates[d.rxnarray[j,i]] += net_forward_rate * abs(min(d.phase.reactions[i].radicalchange, 0.0))
if interspecieslist[d.rxnarray[j,i]].radicalelectrons == 1
coreradicalnetterminationrates[d.rxnarray[j,i]] += net_forward_rate * abs(min(d.reactions[i].radicalchange, 0.0))
end
else
break
Expand All @@ -396,8 +397,8 @@ function processfluxes(sim::SystemSimulation,
@inbounds corespeciesproductionrates[d.rxnarray[j,i]] += frts[i+index]
@inbounds corespeciesconsumptionrates[d.rxnarray[j,i]] += rrts[i+index]
corespeciesnetconsumptionrates[d.rxnarray[j,i]] += net_reverse_rate
if d.phase.species[d.rxnarray[j,i]].radicalelectrons == 1
coreradicalnetterminationrates[d.rxnarray[j,i]] += net_reverse_rate * abs(min(-d.phase.reactions[i].radicalchange, 0.0))
if interspecieslist[d.rxnarray[j,i]].radicalelectrons == 1
coreradicalnetterminationrates[d.rxnarray[j,i]] += net_reverse_rate * abs(min(-d.reactions[i].radicalchange, 0.0))
end
else
break
Expand Down
Loading