How to output the laminar and turbulent diffusion coefficients
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
How to output the laminar and turbulent diffusion coefficients
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!

 Posts: 2638
 Joined: Mon Feb 20, 2012 3:25 pm
Re: How to output the laminar and turbulent diffusion coefficients
Hello,
I am not sure there is a way to output the diffusion coefficient, except reapplying 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
I am not sure there is a way to output the diffusion coefficient, except reapplying 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
Thank you for your answer. I just use the kepsilon 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.

 Posts: 2638
 Joined: Mon Feb 20, 2012 3:25 pm
Re: How to output the laminar and turbulent diffusion coefficients
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
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
I see. I will try to read the related part of code.Thank you very much.