Mixture fraction and its variance

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Cbarnaud
Posts: 36
Joined: Tue Oct 22, 2019 10:28 am

Mixture fraction and its variance

Post by Cbarnaud »

Hello,

I'm using the latest version of CS (6.0.2) and I am trying to do LES + infinitely fast chemistry (diffusion flame).
I'm successful with it, thank to this post: viewtopic.php?f=2&t=2348
and a few more modifications.
Currently, I'm struggling with the mixture fraction ifm and its variance ifp2m.
I want to modify the way they are calculated but, after a few hours of search in source code, I don't find where they are first calculated and where they are calculated at each time step.
Is someone has the name of the right routine?
Else I will do a cs_user function but I wanted to modify it in a permanent way.

Thank you very much,
Best regards,
Camille B.
Yvan Fournier
Posts: 4221
Joined: Mon Feb 20, 2012 3:25 pm

Re: Mixture fraction and its variance

Post by Yvan Fournier »

Hello,

"grep" in the combustion directory, it seems that the old Fortran ifm id is used with field names used 'mixture_fraction" (see calls to add_model_scalar_field in covarp.f90 for example).

So far so good... The matching field values (such as in cogz/dp3init) are set using
call field_get_val_s(ivarfl(isca(ifm)), cvar_fm)

So the field values are usually accessed through a cvar_fm pointer or cpro_fm. If the field is a property and not a solved variable, it should be cpro_fm, but I see both in the code so either both occur (depending on the model), or some code is not clean...

They seem to be initialized in functions such as d3pini.f90, ebuini.f90; lwcini.f90 depending on the model but I am not sure where they are actually computed.

The property values seem to be modified in functions such as pdfpp3.f90, pdfpp4.f90, ...

Hope this helps (I am not familiar with the combustion models proper, so I can help you search in the code, but not tell you whether this is how the variables or properties should be computed).

Best regards,

Yvan
Cbarnaud
Posts: 36
Joined: Tue Oct 22, 2019 10:28 am

Re: Mixture fraction and its variance

Post by Cbarnaud »

Hello,

Thank you for your answer. I directly modified the routine in 'src/pprt/pppdfr.f90' (for infinitely fast chemistry diffusion flame) by adding the call to a user function, at the beginning with cs_user_combustion.
It's not very clean but it does the job I wanted.

Thanks a lot,
all the best
Camille.
Post Reply