feos-org / feos

FeOs - A Framework for Equations of State and Classical Density Functional Theory
Other
116 stars 23 forks source link

How to obtain the pressure of dispersive term and that of repulsive term #187

Closed sunshineonleaf closed 1 year ago

sunshineonleaf commented 1 year ago

I want to calculate the pressure of dispersive term and that of repulsive term, for calculating the viscosity using the friction theory from Sergio E. Quinones-Cisneros (DOI: 10.1002/aic.10755). Can you show me how to do this?

g-bauer commented 1 year ago

Hi! I am not sure if this is exactly what you need since I hove no access to the paper at the moment but once you generated a State object, you can get the contributions to the pressure via the pressure_contributions method.

Example:

from feos.eos import EquationOfState, State
from feos.pcsaft import PcSaftParameters

parameters = PcSaftParameters.from_json(
    substances=['methanol'],
    pure_path='../parameters/pcsaft/gross2002.json'
)
eos = EquationOfState.pcsaft(parameters) # build eos
critical_point = State.critical_point(eos) # generate State object
pressure_contributions = critical_point.pressure_contributions() # get contributions to pressure

The return value of the method is a List[Tuple[str, SINumber]] (see here) containing the name of the contribution and its value.

Hope that helps!

g-bauer commented 1 year ago

@sunshineonleaf Did this answer your question?

sunshineonleaf commented 1 year ago

It works! Thanks very much!