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

How to compute bulk properties of mixtures in the two-phase region (isobaric process)? #295

Open
Sush1090 opened this issue Sep 18, 2024 · 1 comment

Comments

@Sush1090
Copy link
Contributor

Hello,

I am working on computing bulk properties of mixtures during an isobaric process in the two-phase region. The bulk properties typically "glide" between the bubble point and dew point due to non-isothermal phase change.

Currently, Clapeyron.jl computes the bulk property in a stable state (e.g., entropy) using the following function:

function entropy(model::EoSModel, p, T, z=SA[1.]; phase=:unknown, threaded=true, vol0=nothing)
    V = volume(model, p, T, z; phase, threaded, vol0)
    return VT_entropy(model, V, T, z)
end

My understanding is that it computes the Gibbs energy and returns the branch with the lowest Gibbs energy (hence returning the volume), but this does not account for the "glide" behavior.

I have been using linear interpolation between the bubble and dew points as a workaround, but I am looking for a more accurate solution.
Example:
image

I am unsure how to incorporate the glide behavior correctly.
My guess for now is finding the volume of gas and liquid phase and interpolating the property with it but it is not completely clear to me yet.

Is there a way to achieve this within Clapeyron.jl?

Thank you for your insights!

Thanking you
Sushrut

@longemen3000
Copy link
Member

You would need a TP flash, and then you could calculate the enthalpy for each phase and add those, something like this:

x, N, dG = tp_flash(model, p, T, z)
h = 0.0
for i in 1:size(N,1)
  ni = N[i, :] 
  h += enthalpy(model, p, T, ni)
end

but we need a better api for this (working on it)

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

2 participants