Real Gas EOS Support

390 views
Skip to first unread message

Cory Kinney

unread,
May 20, 2021, 1:37:12 PM5/20/21
to Cantera Users' Group
I've been using Cantera with Python for a while now to calculate thermodynamic properties and measure ignition delay times as in shock tube experiments for gas mixtures using the ideal gas equation of state. However, I now need to calculate thermodynamic properties and perform ignition delay simuations for gas mixtures at high pressures and therefore need to use a real gas EOS.

Regarding Cantera, I've seen an example that uses the Redlich Kwong EOS, but that appears to be the only real gas EOS implemented unless I'm mistaken. Most of the literature in my field uses SRK and PR EOS for comparison. I've noticed that there's an open pull request for Peng Robinson (https://github.com/Cantera/cantera/pull/641); however, this was first proposed in June 2019 and still hasn't been merged almost 2 years later. Are there any plans to expand support for more real gas EOS in the near future? I'd be interested in contributing, but it seems like an overwhelming task for someone with limited C++ knowledge.

Gandhali Kogekar

unread,
May 20, 2021, 3:52:15 PM5/20/21
to Cantera Users' Group
Hi Cory, 

The Peng-Robinson EoS implementation (https://github.com/Cantera/cantera/pull/641) is nearly complete. The only things remaining are a couple of tests to check thermodynamic properties. I am working on them, and hopefully the feature will be available soon enough. Meanwhile, you can use the Cantera build from my GitHub repo (https://github.com/gkogekar/cantera/tree/Peng-Robinson).

Thanks,
Gandhali

Cory Kinney

unread,
May 20, 2021, 4:15:22 PM5/20/21
to Cantera Users' Group
Gandhali,

That's awesome to hear. I'll try switching to your repo and using that build. Thanks for all the hard work that was put into getting that implemented.

On another note, I'm looking at the differences between the Redlich-Kwong and the Soave-Redlich-Kwong equations of state, and it seems that there is only a minor change to incorporate the acentric factor in the equation. I don't have in-depth knowledge of the way the ThermoPhase classes are written, nor do I have extensive C++ experience, but do you think that the similarities between SRK and the existing RK code, as well as the work you put into the Peng Robinson might make the creation of a SRK class relatively straightforward for someone like myself to contribute to?

Cory

Message has been deleted

Gandhali Kogekar

unread,
May 21, 2021, 12:09:00 PM5/21/21
to Cantera Users' Group
Hi Cory, 

Although SRK EoS has just one additional parameter, its implementation is not straightforward. Additionally, these equations are quite different in a way that the square root of the temperature term is not present in SRK EoS. Hence, one has to derive and implement all thermodynamic functions (entropy, enthalpy, ... etc.) for SRK EoS. If you look at the class RedlichKwongMFTP, all the thermodynamic functions written there are specific to RK EoS. If you want to add a new equation of state, you will have to create a similar class (or subclass maybe). My guess is that creating SRK EoS might not be that difficult, given the existing RK class. 

Thanks,
Gandhali

On Thursday, May 20, 2021 at 11:17:12 PM UTC-6 Weiqi Ji wrote:
Hi Cory,

Alternatively, you can try the programing language, Julia. It can be used together with Cantera as well. The motivation is to make scientific users, who are not familiar with C++, implement new physic models using an explanatory programing language.

There are some current ongoing activities motivated for the fast incorporation of new EOS models for super critical combustion. You can have a look to see if they have the specific model you are looking into at https://github.com/DENG-MIT/Arrhenius.jl/discussions/68#discussioncomment-746683 and https://github.com/ypaul21/OpenSAFT.jl/tree/development.

W

Cory Kinney

unread,
May 24, 2021, 12:53:38 PM5/24/21
to Cantera Users' Group
I'll try looking into that and see if it's too difficult.

Also, I've built and am using your Peng Robinson branch of the Cantera repository; however, there's a couple key features that are missing for my use case. The algorithm for the values I'm trying to solve for require isothermal compression and the volumetric thermal expansion coefficient. I noticed it's also missing in the Redlich Kwong class. My understanding is that it's not possible to solve for analytically given the complexity of the equation of state. Will those functions remain unimplemented, or is it possible that we can implement some sort of finite difference approach to solving those with sufficient accuracy?

Cory
Reply all
Reply to author
Forward
0 new messages