Issue of non-zero total mass flux with multicomponent transport model in freely propagating flame

67 views
Skip to first unread message

Deepanker Chaudhary

unread,
May 4, 2025, 11:31:02 PMMay 4
to Cantera Users' Group

Dear Cantera team,

I am currently using Cantera (Python) to simulate a freely propagating premixed methane-air flame with the multicomponent transport model enabled and Soret diffusion activated (soret_enabled = True). I then manually compute the total mass flux at the midpoints between the flame grid points, based on the temperature and species gradients using the formaul given

 here https://cantera.org/stable/reference/onedim/governing-equations.html

However, the total mass flux I obtain is not zero, even though it should ideally be zero. I understand some numerical discrepancies are possible, but the magnitude and shape of the non-zero flux is unexpected.

I would appreciate any guidance on why I may be observing a non-zero total flux. Could this be related to numerical interpolation at midpoints, assumptions in multicomponent transport, or how the diffusion matrix is defined? I have provided the code that I am using below.

Thank you for your help!

Total flux.txt

Ray Speth

unread,
May 30, 2025, 6:12:28 PMMay 30
to Cantera Users' Group

Hi,

Thank you very much for reporting this. It turns out that we have had a long-lingering bug where the matrix of multicomponent diffusion coefficients was being returned with the elements in the wrong order in the Python interface. For historical reasons, the underlying C++ method uses the coefficients in a “Fortran” (column major) order, while Numpy by default works with “C” (row major) order for 2D arrays. I’ve created a pull request to resolve this. As a short term fix, and to verify that this is indeed the issue, you can just take the transpose of D_matrix.

None of this affects the results of the 1D flame solver, which has always used the elements using the correct indexing scheme.

Regards,
Ray

Ray Speth

unread,
May 30, 2025, 6:17:30 PMMay 30
to Cantera Users' Group
Oops, I linked to the wrong pull request. The correct one is here: https://github.com/Cantera/cantera/pull/1899.

Deepanker Chaudhary

unread,
Jul 16, 2025, 5:08:01 AMJul 16
to Cantera Users' Group
Hi Ray, 

Thanks a lot for the commnet. Indeed that is the issue. I am successfully able to retrieve the total diffusive flux to be zero in the whole domain. 

Reply all
Reply to author
Forward
0 new messages