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

SAFT gamma mie : computing density of benzene #7

Open
Govnavid opened this issue Nov 2, 2022 · 5 comments
Open

SAFT gamma mie : computing density of benzene #7

Govnavid opened this issue Nov 2, 2022 · 5 comments

Comments

@Govnavid
Copy link

Govnavid commented Nov 2, 2022

Hello Gustavo.
I just ran the creating components and mixtures example for saft gamma mie provide in the documentation. It ran fine when I calculating the density of water. However there was a ValueError for benzene. Here is my calculation code:

creating component

benzene = component(GC={'aCH':6})
benzene.saftgammamie()
eos = saftgammamie(benzene)

density for liquid phase

T = 373. # K
P = 1e5 # Pa
rhol = eos.density(T, P, 'L')
print(rhol)

According to the example, I need to create a dictionary using the group's names as keys and the numbers of times this group is present as values. But according to my code above, the program cannot proceed. I can't find a solution. Can you give me an example of computing density of benzene.

Thank you very much.
Best whises!

@gustavochm
Copy link
Owner

Hi Govnavid,

Thanks for using sgtpy! Can you provide more information on what error are you getting? I just run the same script that you wrote and sgtpy is finding the volume root (see the attached figure)

Screenshot 2022-11-02 at 11 19 58

Regards,
Gustavo

@Govnavid
Copy link
Author

Govnavid commented Nov 3, 2022

Hello Gustavo.
My code is exactly the same as yours, but there is a problem in the figure below. The sgtpy version I installed is the latest version 0.015.
I still don't have a solution. Could you please give me some advice?

屏幕截图 2022-11-03 092218
Best Regards,
Govnavid.

@Govnavid
Copy link
Author

Govnavid commented Nov 3, 2022

Hello Gustavo.
Here is my complete code.
image
Best whises,
Govnavid.

@gustavochm
Copy link
Owner

Ohh now I see what happened. This was a bug for molecules that had association sites but that wasn't self-associating. I fixed the bug on the GitHub repo but apparently, I forgot to upload the updated to PyPI.
I'm going to upload the updated version to PyPI now, however at this moment I only have access to a mac computer, so I won't be able to upload precompiled windows versions. If you are using windows, you will need a C compiler.

If you are using windows and don't have a C compiler, a workaround would be to modify the config_asso.py file (located at C:\Users\SunShow\AppData\Roaming\Python\Python39\site-packages\sgtpy\config_asso.py). You need to modify lines 246 to 250 to the following:

indexABij1 = np.hstack([indexABij1])
indexABij2 = np.hstack([indexABij2])

indexAB_id1 = np.hstack([indexAB_id1])
indexAB_id2 = np.hstack([indexAB_id2])

Hope that helps,
Gustavo!

@Govnavid
Copy link
Author

Govnavid commented Nov 4, 2022

Thank you very much for you answer.
I'll solve the problem in your way. If possible, I hope you can upload the update version to PyPl later. Thanks again for your kind help.
Best whises!

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