Skip to content

Commit 44d89a6

Browse files
committed
define an IdealSurface phase
IdealSurface represents a catalyst surface with a specified sitedensity
1 parent 24c738c commit 44d89a6

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

src/Phase.jl

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,32 @@ function IdealDiluteSolution(species,reactions,solvent; name="",diffusionlimited
7272
end
7373
export IdealDiluteSolution
7474

75-
@with_kw struct HomogeneousCatalyst{Q<:AbstractReaction} <: AbstractPhase
75+
@with_kw struct IdealSurface{W<:Tuple,W2} <: IdealPhase
7676
name::String = ""
7777
species::Array{Species,1}
78-
reactions::Array{Q,1}
78+
reactions::Array{ElementaryReaction,1}
79+
sitedensity::Float64
80+
stoichmatrix::W2
81+
Nrp::Array{Float64,1}
82+
veckinetics::W
83+
veckineticsinds::Array{Int64,1}
84+
vecthermo::NASAvec
85+
otherreactions::Array{ElementaryReaction,1}
7986
spcdict::Dict{String,Int64}
87+
diffusionlimited::Bool = false
88+
end
89+
function IdealSurface(species,reactions,sitedensity; name="",diffusionlimited=false)
90+
@assert diffusionlimited==false "diffusionlimited=true not supported for IdealSurface"
91+
vectuple,vecinds,otherrxns,otherrxninds,posinds = getveckinetics(reactions)
92+
rxns = vcat(reactions[vecinds],reactions[otherrxninds])
93+
rxns = [ElementaryReaction(index=i,reactants=rxn.reactants,reactantinds=rxn.reactantinds,products=rxn.products,
94+
productinds=rxn.productinds,kinetics=rxn.kinetics,radicalchange=rxn.radicalchange,pairs=rxn.pairs) for (i,rxn) in enumerate(rxns)]
95+
therm = getvecthermo(species)
96+
M,Nrp = getstoichmatrix(species,rxns)
97+
return IdealSurface(species=species,reactions=rxns,sitedensity=sitedensity,name=name,
98+
spcdict=Dict([sp.name=>sp.index for sp in species]),stoichmatrix=M,Nrp=Nrp,veckinetics=vectuple,veckineticsinds=posinds,vecthermo=therm,otherreactions=otherrxns,diffusionlimited=diffusionlimited)
8099
end
81-
export HomogeneousCatalyst
100+
export IdealSurface
82101

83102
"""
84103
construct the stochiometric matrix for the reactions and the reaction molecule # change

src/PhaseState.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export calcgibbs
1515
end
1616

1717

18-
@inline function calcenthalpyinternalgibbs(ph::IdealGas,T::W,P::Z,V::Q) where {W,Z,Q<:Real}
18+
@inline function calcenthalpyinternalgibbs(ph::Union{IdealGas,IdealSurface},T::W,P::Z,V::Q) where {W,Z,Q<:Real}
1919
Hs = getEnthalpy.(getfield.(ph.species,:thermo),T)
2020
Us = Hs .- R*T
2121
Gs = Hs .- T.*getEntropy.(getfield.(ph.species,:thermo),T)

0 commit comments

Comments
 (0)