Page 1 of 1

Thermal conductivity/diffusivity in C

Posted: Thu Mar 23, 2017 5:35 pm
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

Re: Thermal conductivity/diffusivity in C

Posted: Thu Mar 23, 2017 8:51 pm
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

Re: Thermal conductivity/diffusivity in C

Posted: Fri Mar 24, 2017 3:42 pm
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?

Re: Thermal conductivity/diffusivity in C

Posted: Sat Mar 25, 2017 1:17 pm
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