How to output the laminar and turbulent diffusion coefficients

Questions and remarks about Code_Saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
luyz07
Posts: 5
Joined: Mon Mar 18, 2019 4:22 pm

How to output the laminar and turbulent diffusion coefficients

Post by luyz07 » Mon Jun 03, 2019 9:59 am

Hello! I am running a case that simulating a layer of helium gas diffusing into air, by using the model of Species Transport. And how could I output those diffusion coefficients? I have tried to use subroutine, "cs_user_postprocess.c", but I could not get what I want. Thank you!

Yvan Fournier
Posts: 2638
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to output the laminar and turbulent diffusion coefficients

Post by Yvan Fournier » Tue Jun 04, 2019 12:47 am

Hello,

I am not sure there is a way to output the diffusion coefficient, except re-applying the formulas used to compute the laminar diffusivity and adding the turbulent diffusivity (which may depend on the turbulent flux model) it in a specific output in cs_user_postprocess_values (cs_user_postprocess_var.f90 in older versions).

For tensorial diffusivity, a specific field is created (see code in src/base/addfld.f90),, so you may simply force the postprocessing output of that field.

Best regards,

Yvan

luyz07
Posts: 5
Joined: Mon Mar 18, 2019 4:22 pm

Re: How to output the laminar and turbulent diffusion coefficients

Post by luyz07 » Tue Jun 04, 2019 12:26 pm

Thank you for your answer. I just use the k-epsilon turbulent model in Code_Saturne. And I am using the function "cs_user_postprocess_values" in the subroutine "cs_user_postprocess.c", successfully getting fields of enthalpy, scalar fraction and so on, while I can not get the field of diffusivity coefficient of the scalar. I also found in "setup.log" the value of key "scalar_diffusivity_id" of the field "helium" is -1. So I have no idea how to get these coefficients.

Yvan Fournier
Posts: 2638
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to output the laminar and turbulent diffusion coefficients

Post by Yvan Fournier » Tue Jun 04, 2019 6:38 pm

Hello,

scalar_difusivity_id only applies to space varying laminar diffusivity, so if ir us at -1, it means you have a constant laminar diffusivity.

Bur that does not provide the turbulent diffusivity. What ylu do have access to is the turbulent viscosity,

The diffusivity is computed locally I beleive, not saved as an array, so to extract it you would have to look into the cs_convection_diffusion subset of the code (though I am not a specialist in this part of the code).

Best regards,

Yvan

luyz07
Posts: 5
Joined: Mon Mar 18, 2019 4:22 pm

Re: How to output the laminar and turbulent diffusion coefficients

Post by luyz07 » Tue Jun 04, 2019 7:50 pm

I see. I will try to read the related part of code.Thank you very much.

Post Reply