Skip to content

Commit ff0ef51

Browse files
committed
Fixed interfaces not setting phi correctly
1 parent ae59b8c commit ff0ef51

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Interface.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ function ReactiveInternalInterfaceConstantTPhi(domain1,domain2,reactions,T,A,phi
9595
M,Nrp1,Nrp2 = getstoichmatrix(domain1,domain2,reactions)
9696
Gpart = ArrayPartition(domain1.Gs,domain2.Gs)
9797
dGrxns = -M*Gpart
98+
electronchanges = [hasproperty(reaction, :electronchange) ? reaction.electronchange : 0.0 for reaction in reactions]
99+
referencepotentials = [hasproperty(reaction.kinetics, :V0) ? reaction.kinetics.V0 : 0.0 for reaction in reactions]
100+
if isa(domain1.phase, IdealSurface)
101+
phi = domain1.phi !== nothing ? domain1.phi : phi
102+
elseif isa(domain2.phase, IdealSurface)
103+
phi = domain2.phi !== nothing ? domain2.phi : phi
104+
end
105+
dGrxns .+= electronchanges.*(phi.-referencepotentials).*F
98106
kfs = getkf.(reactions,nothing,T,0.0,0.0,Ref([]),A,phi,dGrxns,0.0)
99107
Kc = getKcs(domain1.phase,domain2.phase,T,Nrp1,Nrp2,dGrxns)
100108
krevs = kfs./Kc

0 commit comments

Comments
 (0)