Thermal conductivity/diffusivity in C

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Muhsin
Posts: 25
Joined: Mon May 18, 2015 5:48 pm

Thermal conductivity/diffusivity in C

Post by Muhsin »

Hi all,

Just a quick question. I would like to get the thermal conductivity (or thermal diffusivity as i'm using the enthalpy equation) to use in cs_user_parameters.c.
I try to find it in the doxygen and userguide but seems couldn't find the variable name for it.

Best,
Muhsin
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Thermal conductivity/diffusivity in C

Post by Luciano Garelli »

Hello,

You can check it in the user manual (search for kivisl, diffusivity or conductivity)

Also check the cs_user_parameters.f90 file in the SRC/EXAMPLE directory in order to view how to access.

Regards,

Luciano

EDIT: Sorry..you ask for the C function and I have wrote about the fortran subroutine
Muhsin
Posts: 25
Joined: Mon May 18, 2015 5:48 pm

Re: Thermal conductivity/diffusivity in C

Post by Muhsin »

Hi,

Thank you for your reply.
Yes, unfortunately, I'm asking for the thermal conductivity/diffusivity in C code.
Is there anyone know the variable name for it?
Yvan Fournier
Posts: 4082
Joined: Mon Feb 20, 2012 3:25 pm

Re: Thermal conductivity/diffusivity in C

Post by Yvan Fournier »

Hello,

For a given variable field "c_var", to obtain the diffusivity field "c_diff" (assuming it was set to variable):

Code: Select all

const int kivisl = cs_field_key_id("scalar_diffusivity_id");
int diff_id = cs_field_get_key_int(c_var, kivisl)
cs_field_t *c_diff = cs_field_by_id(diff_id);
Regards,

Yvan
Post Reply