From 589656ee001097e8274402b92ebca25999a1cefe Mon Sep 17 00:00:00 2001 From: longemen3000 Date: Mon, 30 Sep 2024 15:00:55 -0300 Subject: [PATCH] make pressure depend only on a_res --- src/methods/VT.jl | 4 +++- src/methods/differentials.jl | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/methods/VT.jl b/src/methods/VT.jl index 7a1e8bf8e..285a45cb6 100755 --- a/src/methods/VT.jl +++ b/src/methods/VT.jl @@ -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 + diff --git a/src/methods/differentials.jl b/src/methods/differentials.jl index 7b61afb85..cfc01d5fc 100755 --- a/src/methods/differentials.jl +++ b/src/methods/differentials.jl @@ -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