Page 1 of 1

How to output the laminar and turbulent diffusion coefficients

Posted: Mon Jun 03, 2019 9:59 am
by luyz07
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!

Re: How to output the laminar and turbulent diffusion coefficients

Posted: Tue Jun 04, 2019 12:47 am
by Yvan Fournier
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

Re: How to output the laminar and turbulent diffusion coefficients

Posted: Tue Jun 04, 2019 12:26 pm
by luyz07
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.

Re: How to output the laminar and turbulent diffusion coefficients

Posted: Tue Jun 04, 2019 6:38 pm
by Yvan Fournier
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

Re: How to output the laminar and turbulent diffusion coefficients

Posted: Tue Jun 04, 2019 7:50 pm
by luyz07
I see. I will try to read the related part of code.Thank you very much.