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

Fit VL-coexistence curve from experimental data #23

Open
GregorySchwing opened this issue Dec 1, 2023 · 3 comments
Open

Fit VL-coexistence curve from experimental data #23

GregorySchwing opened this issue Dec 1, 2023 · 3 comments

Comments

@GregorySchwing
Copy link

I have some experimental data of water with these columns
Index(['T_K', 'dens_vap', 'dens_uncertainty', 'dens_liq', 'dens_liq_uncertainty', 'psat', 'psat_uncertainty', 'lnzsat', 'lnzsat_uncertainty']

How would I generate a VL-coexistence curve, plot it, and be able to interpolate at points on the curve

Thanks,
Greg

@gustavochm
Copy link
Owner

Dear Greg,

Do you want to plot and work with that data? If so, you can use pandas to read the CSV or Excel file and then matplotlib to plot and scipy for interpolation.

If you also want to model that same data with an equation of state, you can use phasepy. Phasepy includes cubic equations of state and methods for solving phase equilibria. If you are working with pure fluids you can check the following first part of this notebook or cell 7 of this notebook.

If you use an equation of state, the interpolation is done as you would need to compute the saturation property at the desired condition.

I hope that helps,
Gustavo

@GregorySchwing
Copy link
Author

GregorySchwing commented Dec 6, 2023

Scipy does a pretty terrible job since I only have points in vapor and liquid. I did try following those examples but I wanted more specifics on how to plot a T-Density curve after fitting an EOS adjusted to my experimental data. I know "flash" objects have this functionality.

@gustavochm
Copy link
Owner

Hi Gregory,

In cell 7 of this notebook shows how to compute the saturation pressure and saturation densities of a pure component. From there, you can plot the T-density plot you want.

Just as a clarification, the flash calculation in phasepy is exclusive of mixtures, and from what I understood, you have a pure fluid.

Gustavo

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