Skip to content

Commit

Permalink
make pressure depend only on a_res
Browse files Browse the repository at this point in the history
  • Loading branch information
longemen3000 committed Sep 30, 2024
1 parent 8f64900 commit 589656e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/methods/VT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -364,5 +364,7 @@ function VT_fugacity_coefficient!(φ,model::EoSModel,V,T,z=SA[1.],p = pressure(m
return φ
end

export second_virial_coefficient,pressure,cross_second_virial,equivol_cross_second_virial
export pressure
export second_virial_coefficient,cross_second_virial,equivol_cross_second_virial


8 changes: 4 additions & 4 deletions src/methods/differentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ function ∂f∂T(model,V,T,z=SA[1.0])
end

"""
∂f∂V(model,V,T,z=SA[1.0])
∂f∂V(model,V,T,z)
returns `f` and `∂f/∂V` at constant temperature and composition, where f is the total helmholtz energy, given by `eos(model,V,T,z)`, and V is the total volume
"""
function ∂f∂V(model,V,T,z)
f(∂V) = eos(model,∂V,T,z)
return Solvers.derivative(f,V)
f(∂V) = a_res(model,∂V,T,z)
dadv = Solvers.derivative(f,V)
return Rgas(model)*T*(dadv - sum(z)/V)
end

#returns a tuple of the form ([∂f∂V,∂f∂T],f),using the least amount of computation
Expand Down

0 comments on commit 589656e

Please sign in to comment.