Page 1 of 1

Mass fraction conversion with combustion module

Posted: Wed May 14, 2025 7:56 pm
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

Re: Mass fraction conversion with combustion module

Posted: Thu May 15, 2025 1:44 pm
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

Re: Mass fraction conversion with combustion module

Posted: Tue May 20, 2025 4:42 pm
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

Re: Mass fraction conversion with combustion module

Posted: Sat May 24, 2025 7:58 pm
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