GithubHelp home page GithubHelp logo

Comments (12)

RayleighSun avatar RayleighSun commented on September 25, 2024 1

Thanks!

from feos.

prehner avatar prehner commented on September 25, 2024 1

No, the same algorithm is used for pure components and mixtures.

from feos.

prehner avatar prehner commented on September 25, 2024

Hello, you absolutely can do that. Here is an example:

from feos.eos import State, EquationOfState
from feos.pcsaft import PcSaftParameters
from feos.si import MOL
import numpy as np

params = PcSaftParameters.from_json(['ethane', 'propane'], '../../Code/feos/feos/parameters/pcsaft/gross2001.json')
eos = EquationOfState.pcsaft(params)
state = State.critical_point(eos, np.array([0.5, 0.5])*MOL)
print(f"Tc = {state.temperature}\npc = {state.pressure()}")
Tc = 348.1942845383163 K
pc = 5.270609715267454 MPa

gross2001.json contains the parameters from the original publication on PC-SAFT. You can downlad the file from this repository.

from feos.

RayleighSun avatar RayleighSun commented on September 25, 2024

Thanks for replying so quickly, it works perfectly, and it is very concise and easy to understand!
But I have a small question, if I already have a binary interaction parameter kij, e.g. kij = 0.1, how should I set it for improving the results?

from feos.

prehner avatar prehner commented on September 25, 2024

In general you can provide binary interaction parameters in a json file. For binary system, a more convenient way is to use:

from feos.eos import State, EquationOfState
from feos.pcsaft import PcSaftParameters
from feos.si import MOL
import numpy as np

params = PcSaftParameters.from_json(['ethane', 'propane'], '../../Code/feos/feos/parameters/pcsaft/gross2001.json')
kij = 0.1
params_kij = PcSaftParameters.new_binary(params.pure_records, kij)
eos = EquationOfState.pcsaft(params_kij)
state = State.critical_point(eos, np.array([0.5, 0.5])*MOL)
print(f"Tc = {state.temperature}\npc = {state.pressure()}")
Tc = 331.18585210347027 K
pc = 5.176779553533068 MPa

from feos.

RayleighSun avatar RayleighSun commented on September 25, 2024

Hi, I got another question on critical point calculation of binary mixtures by the feos:
What algorithm is used to calculate the critical point of the mixture? Such as the Heidemann-Khalil approach, or the defination of critical points (the first and second derivatives of pressure with respect to volume)?

from feos.

prehner avatar prehner commented on September 25, 2024

Hello, the algorithm that is used is based on the Michelsen variant of the Heidemann-Khalil approach as outlined in the Michelsen and Mollerup book on thermodynamic models. The adaptation to our code, which uses automatic differentiation for all derivatives including Jacobians, is outlined in the appendix of our publication on the Application of Generalized (Hyper-) Dual Numbers in Equation of State Modeling.

Please be aware that for a mixture, vanishing first and second derivatives of the pressure with respect to volume or density are actually not criteria for critical points.

from feos.

RayleighSun avatar RayleighSun commented on September 25, 2024

Hello, the algorithm that is used is based on the Michelsen variant of the Heidemann-Khalil approach as outlined in the Michelsen and Mollerup book on thermodynamic models. The adaptation to our code, which uses automatic differentiation for all derivatives including Jacobians, is outlined in the appendix of our publication on the Application of Generalized (Hyper-) Dual Numbers in Equation of State Modeling.

Please be aware that for a mixture, vanishing first and second derivatives of the pressure with respect to volume or density are actually not criteria for critical points.

Thanks! So if it is pure substance, the critical point is calculated by the defination (the first and second derivatives of pressure with respect to volume)?

from feos.

RayleighSun avatar RayleighSun commented on September 25, 2024

No, the same algorithm is used for pure components and mixtures.

Thanks!

from feos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.