real-gas EOS with 1-D flame simulations

165 views
Skip to first unread message

junfeng bai

unread,
Nov 2, 2021, 8:53:26 AM11/2/21
to Cantera Users' Group
Hello everyone, 

I am working on real gas effects on transport properties and 1-D flame simulations. 

I got "TypeError: ThermoPhase object is not an IdealGasPhase" error using  R-K EoS and got ''NotImplementedError thrown by ThermoPhase::critTemperature:Not implemented'' error using high pressure transport model. 

Based on previous discussions on this topic in our group, I understand that current code base in 1-D flame simulations need to be modified to combine real gas EoS. 

To my understanding, the main changes should be 
(a) partial molar enthalpy in Redlich-Kwong model should be called to calculate h_k in energy equations.
(b) Critical temperature calculation in Redlich-Kwong model should be called to be used in high pressure transport model. 
(c) Onedim.py should be modified to allow real gas phase in ThermoPhase.

For (a), I think  partial molar enthalpy   should be easily incorporated in governing energy equations just like how activity concentration was  incorporated.

So I am curious whether there were any other difficulties in this modification since previous discussions on this topic were last for three years and  real gas EoS  still could not used in 1-D flame simulations in Cantera?

I am glad to contribute some effort on this part if it is not beyond my abilities. Could anyone explain my confusions and give me some advice? Thank you very much!

Sincerely,
Junfeng 

Mohammed Niyasdeen

unread,
May 8, 2022, 9:11:19 PM5/8/22
to Cantera Users' Group
Hi, 
Did you check with the latest Cantera 2.6.0 release? 
I haven't tried the latest version but would like to know if the 1D flame has the real-gas EOS in the latest version of Cantera. 

Z. Weng

unread,
May 22, 2022, 1:41:50 PM5/22/22
to Cantera Users' Group
Hello,

I am also interested in this topic. I have checked the source code before but not have a clear understanding on how the governing equations are solved. Any explaination on the numerical scheme or the source of the ideal gas based flame solver will be appreciated.

Best,
Zifeng

Bryan Weber

unread,
May 23, 2022, 12:15:46 PM5/23/22
to Cantera Users' Group
Hi all,

This feature is not available in Cantera yet. It is a quite complex problem to solve, there are several threads here on the Users' Group about the topic if you're interested in previous attempts.

In any case, the solution code for the 1-D solver is in src/oneD/Sim1D.cpp, specifically the solve method kicks off here: https://github.com/Cantera/cantera/blob/48457cc2ba49d75230103b0f113166f873969660/src/oneD/Sim1D.cpp#L307

Conceptually, a 1-D simulations is built from a series of Domain1D class instances that represent different types of flow (inlet, outlet, free flow, surface, etc.). The main flow domain is usually a StFlow instance (src/oneD/StFlow.cpp) which implements an eval method that actually does the calculations.

The numerical scheme is quite similar to the one used in Chemkin. It is a hybrid transient/steady-state Newton solver which is solved on a spatial grid, and it supports grid refinement based on the slope and curvature of the solution variables. Most of the numerical code is in the src/oneD/MultiJac.cpp and src/oneD/MultiNewton.cpp files.

A few years ago, an undergraduate student wrote up a series of posts partially about this hybrid solver, you can read them here: https://cantera.org/blog/gsoc-2020-intro

Hope that helps!
Bryan

Bryan Weber

unread,
May 23, 2022, 4:44:44 PM5/23/22
to Cantera Users' Group
Hi all,

To follow up, this is probably the most detailed thread on the group about real gas EOS in 1-D simulations: https://groups.google.com/g/cantera-users/c/96myuNgXN-o/m/2fLCCkGgBwAJ

Best,
Bryan

Ingmar Schoegl

unread,
May 24, 2022, 3:33:02 PM5/24/22
to Cantera Users' Group
In addition to user group threads, there also is a pull request on the GitHub site, see https://github.com/Cantera/cantera/pull/1079. I don’t know about the current status, as there hasn’t been any recent work other than trying to keep it up to date with the latest version of the source code.
-ingmar-

宋业城

unread,
Jun 20, 2022, 9:50:39 PM6/20/22
to Cantera Users' Group
Hi, I'm having trouble with the calculation of a one-dimensional flame for a real gas.I was very inspired after seeing your post, after trying, I still can't solve the problem of 'ThermoPhase object is not an IdealGasPhase', may I ask how you fix Onedim.py?

在2021年11月2日星期二 UTC+8 20:53:26<baijunf...@gmail.com> 写道:

Bryan Weber

unread,
Jun 21, 2022, 10:32:44 AM6/21/22
to Cantera Users' Group
Hi,

This is still not possible, please see the pull request that Ingmar linked to, which is currently undergoing review.

Best,
Bryan

Reply all
Reply to author
Forward
0 new messages