Skip to content

Commit

Permalink
Fixed interfaces not setting phi correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ssun30 committed Sep 24, 2024
1 parent 955558b commit 2784fc2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ function ReactiveInternalInterfaceConstantTPhi(domain1,domain2,reactions,T,A,phi
M,Nrp1,Nrp2 = getstoichmatrix(domain1,domain2,reactions)
Gpart = ArrayPartition(domain1.Gs,domain2.Gs)
dGrxns = -M*Gpart
electronchanges = [hasproperty(reaction, :electronchange) ? reaction.electronchange : 0.0 for reaction in reactions]
referencepotentials = [hasproperty(reaction.kinetics, :V0) ? reaction.kinetics.V0 : 0.0 for reaction in reactions]
if isa(domain1.phase, IdealSurface)
phi = domain1.phi !== nothing ? domain1.phi : phi
elseif isa(domain2.phase, IdealSurface)
phi = domain2.phi !== nothing ? domain2.phi : phi
end
dGrxns .+= electronchanges.*(phi.-referencepotentials).*F
kfs = getkf.(reactions,nothing,T,0.0,0.0,Ref([]),A,phi,dGrxns,0.0)
Kc = getKcs(domain1.phase,domain2.phase,T,Nrp1,Nrp2,dGrxns)
krevs = kfs./Kc
Expand Down

0 comments on commit 2784fc2

Please sign in to comment.