Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T-s diagram for dry fluids #289

Closed
Sush1090 opened this issue Aug 29, 2024 · 1 comment
Closed

T-s diagram for dry fluids #289

Sush1090 opened this issue Aug 29, 2024 · 1 comment

Comments

@Sush1090
Copy link
Contributor

Hello,
I am trying to check the T-s diagram for general "dry" fluids like toluene. I have the following code:

fluids = ["toluene"]
model = cPR(fluids)

crit_ = crit_pure(model)

p = collect(range(101325,crit_[2],100))
T0 = similar(p)
for i in eachindex(p)
    T0[i] = saturation_temperature(model,p[i])[1]
end
s_liq = entropy.(model,p,T0,phase=:liquid)
s_gas = entropy.(model,p,T0,phase=:gas)

scatter(s_liq,T0)
scatter!(s_gas,T0) 

I get the following graph:
image

The output seems incorrect as toluene is classified as a a dry fluid i.e. the slope of the red dots should always be positive. I have checked this with various cubic EoS but results are similar.

Is there something I am doing wrong with the code? Or this seems like a error in computing entropy for the :gas phase?

@Sush1090 Sush1090 changed the title Fluids not showcasing dry properties T-s diagram for dry fluids Aug 29, 2024
@Sush1090
Copy link
Contributor Author

I think I probably know why --> this code uses idealmodel = BasicIdeal model. It give accurate results with others for example ReidIdeal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant