Mass fraction conversion with combustion module

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
fracenvi
Posts: 38
Joined: Wed Jun 19, 2024 9:58 am

Mass fraction conversion with combustion module

Post by fracenvi »

Hello everyone,

I am running a simple case with the combustion module on and i was wondering if there is any function present in the code to eventually convert the ym_fuel, ym_oxyd and ym_prod to the actual mass fractions of the components of the mixture (e.g., in the case of methane combustion, something like H2O and CO2 for the products).

I remember once reading about it in the documentation but i can't manage to find it back...

Thanks to everyone for the help,
Francesco
Yvan Fournier
Posts: 4220
Joined: Mon Feb 20, 2012 3:25 pm

Re: Mass fraction conversion with combustion module

Post by Yvan Fournier »

Hello,

I am not sure this is in the documentation.

From converting some combustion routines from Fortran to C a few months ago, I recall some conversions which may be similar to your needs, at various levels in the code itself. You might find what you need when reading thermochemistry data (cs_combustion_read_data.cpp / colecd.f90), which can combine mass fractions with molar masses of the components.

Best regards,

Yvan
fracenvi
Posts: 38
Joined: Wed Jun 19, 2024 9:58 am

Re: Mass fraction conversion with combustion module

Post by fracenvi »

Hello,

I found a function called cs_combustion_gas_yg2xye that does partially what i wanted. I managed to call it correctly in my user subroutines but it doesn't actually give me the field of values but rather what i suppose being the average.

Is it me to not have understood correctly how the function works or what?

Thanks for the help,
Francesco
Yvan Fournier
Posts: 4220
Joined: Mon Feb 20, 2012 3:25 pm

Re: Mass fraction conversion with combustion module

Post by Yvan Fournier »

Hello,

This conversion function (and similar ones) are called in loops over all cells, so do not work over a full field, but only local values. You simply need to use it in a loop.

Best regards,

Yvan
Post Reply