Skip to content

Commit

Permalink
typo in fugacity
Browse files Browse the repository at this point in the history
  • Loading branch information
longemen3000 committed Feb 13, 2025
1 parent 9e023e1 commit ddc1f7f
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/methods/property_solvers/multicomponent/fugacity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ function _fug_OF_ss(model::EoSModel,p,T,x,y,vol0,_bubble,_pressure;itmax_ss = 5,
converged = false
#caches for ∂lnϕ∂n∂P∂T/∂lnϕ∂n∂P
if _pressure
Hϕx = ∂lnϕ_cache(model, p, T, x,Val{false}())
Hϕy = ∂lnϕ_cache(model, p, T, y,Val{false}())
Hϕx = ∂lnϕ_cache(model, p, T, x, Val{false}())
Hϕy = ∂lnϕ_cache(model, p, T, y, Val{false}())
else
Hϕx = ∂lnϕ_cache(model, p, T, x,Val{true}())
Hϕy = ∂lnϕ_cache(model, p, T, y,Val{true}())
Hϕx = ∂lnϕ_cache(model, p, T, x, Val{true}())
Hϕy = ∂lnϕ_cache(model, p, T, y, Val{true}())
end

n = length(model)
Expand Down Expand Up @@ -149,27 +149,30 @@ function _fug_OF_ss(modelx::EoSModel,modely::EoSModel,p,T,x,y,vol0,_bubble,_pres
zz = view(y,_view)
end

lnK = similar(lnϕx,n)

#caches for ∂lnϕ∂n∂P∂T/∂lnϕ∂n∂P
if _pressure
Hϕx = ∂lnϕ_cache(modelx, p, T, x, Val{false}())
Hϕy = ∂lnϕ_cache(modely, p, T, y, Val{false}())
else
Hϕx = ∂lnϕ_cache(modelx, p, T, x, Val{true}())
Hϕy = ∂lnϕ_cache(modely, p, T, y, Val{true}())
end

lnK = similar(Hϕx[3],n)
K = similar(lnK)
w = similar(lnK)
w_old = similar(lnK)
w_calc = similar(lnK)
w_restart = similar(lnK)

if _bubble
w .= y
_x,_y = x,w
else
w .= x
_x,_y = w,y
end
#caches for ∂lnϕ∂n∂P∂T/∂lnϕ∂n∂P
if _pressure
Hϕx = ∂lnϕ_cache(modelx, p, T, x, Val{false}())
Hϕy = ∂lnϕ_cache(modely, p, T, y, Val{false}())
else
Hϕx = ∂lnϕ_cache(modelx, p, T, x, Val{true}())
Hϕy = ∂lnϕ_cache(modely, p, T, y, Val{true}())
end

for j in 1:itmax_newton
if isnan(volx) || isnan(voly)
Expand Down

0 comments on commit ddc1f7f

Please sign in to comment.