Hello,
I am working on a radiative heat transfer problem, and it is necessary to define the absorption coefficient around the field. I have noticed that the "cs_user_radiative_transfer.c" file in the example folder, and I am quite confused that the formal parameters of the "cs_user_rad_transfer_absorption" function does not include the temperature.
So I am very eager to find out how to call the temperature of each cell (which I defined in the GUI, thermal option).
In the .C file, it is easy to call the ID and coordinate of each cell by the struct "cs_glob_mesh_quantities" and "cs_glob_mesh", should I consider the similar method to achieve my goal?
And last, the .C file have a step of reading from file, declaring arrays with 78 dimensions, this makes me confused too.
Thanks for your generous help.
Calling the temperature distribution in user function
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
Calling the temperature distribution in user function
- Attachments
-
- eaxmple.c
- (2.52 KiB) Downloaded 131 times
-
- Posts: 4075
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Calling the temperature distribution in user function
Hello,
You can always access the temperature using the field API, for example:
In which case you then have access to current temperature values in the cvar_t array.
I am not sure which arrays with 78 dimensions you are referring to.
Regards,
Yvan
You can always access the temperature using the field API, for example:
Code: Select all
const cs_real_t *cvar_t = cs_fluid_by_name("temperature")->val;
I am not sure which arrays with 78 dimensions you are referring to.
Regards,
Yvan
Re: Calling the temperature distribution in user function
Greeting,
First, I really appreciate it.
And the arrays I mentioned which have 78 elements are these below
They initially appeared in the example code named "cs_user_radiative_transfer.c" in the folder, "user_examples", or in the attachment file.
Thank you so much!
First, I really appreciate it.
And the arrays I mentioned which have 78 elements are these below
Code: Select all
int n_v_segs = 77;
cs_real_t zray2[78], k_up[78], k_down[78];
Thank you so much!
-
- Posts: 4075
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Calling the temperature distribution in user function
Hello,
These arrays are related to a data file for a specific (atmospheric radiation) case, so you can ignore them.
Regards,
Yvan
These arrays are related to a data file for a specific (atmospheric radiation) case, so you can ignore them.
Regards,
Yvan
Re: Calling the temperature distribution in user function
Hello,
Thank you for your patience. It really helps a lot.
Thank you for your patience. It really helps a lot.