usnistgov / COSMOSAC

A Benchmark Implementation of COSMO-SAC
MIT License
51 stars 29 forks source link

cosmo3 error #11

Closed amkoch closed 3 years ago

amkoch commented 3 years ago

When I use cosmo3 to calculate either lngamma or lngamma_resid, this causes my kernel to die.

I have no issues when I calculate lngamma_disp or lngamma_comb.

ianhbell commented 3 years ago

Can you please show the calls you tried to make resulting in this error? Otherwise I have no idea where to start with debugging.

amkoch commented 3 years ago

Of course. This code below runs if use COSMO1 (excluding lngamma_disp), but not for COSMO3. When I singled out each one of the different lngamma calls, the code would yield a result for lngamma.comb and lngamma.disp, but the attributes lngamma and lngamma.resid cause the kernel to die.

import cCOSMO
import numpy as np
db = cCOSMO.VirginiaTechProfileDatabase(
    "profiles/VT2005/Sigma_Profile_Database_Index_v2.txt", 
    "profiles/VT2005/Sigma_Profiles_v2/")
identifiers = [ "0003", "0002"]
for iden in identifiers:
    db.add_profile(iden)
    prof = db.get_profile(iden)
    print(prof.name)

COSMO = cCOSMO.COSMO3(identifiers, db)

T = 250;
z = np.array([0.89, 0.11])

disp = COSMO.get_lngamma_disp(z)
comb = COSMO.get_lngamma_comb(T,z)
resid = COSMO.get_lngamma_resid(T,z)
lngamma = COSMO.get_lngamma(T, z)
ianhbell commented 3 years ago

Well, the error is now clear - you are using the VT database, but trying to use COSMO3, which requires the three profiles, so you need to use the UD database.

ianhbell commented 3 years ago

Also, I cleaned up your block of code.

amkoch commented 3 years ago

Thank you. That should fix the issue.