From 2784fc21482d59a566845cc4487152aa7b6a7729 Mon Sep 17 00:00:00 2001 From: ssun30 Date: Tue, 6 Aug 2024 15:00:27 -0400 Subject: [PATCH] Fixed interfaces not setting phi correctly --- src/Interface.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Interface.jl b/src/Interface.jl index 52bdeee8..e1a9d122 100644 --- a/src/Interface.jl +++ b/src/Interface.jl @@ -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