CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   material name of emissivity for a face thread (http://www.cfd-online.com/Forums/fluent/32069-material-name-emissivity-face-thread.html)

Nici September 3, 2003 02:24

material name of emissivity for a face thread
 
Hello everybody and greetings from cold Finland :)

I would appricate if someone could help me to access either the material name or the emissivity of a wall thread within a UDF. Other solutions to distinguish beteween different wall boundaries are also welcome.

thank you in advance

Nici

Greg Perkins September 3, 2003 03:45

Re: material name of emissivity for a face thread
 
below find some code I use to distinguish whether a thread is in a list of thread ids. It may not be super efficient but it works OK. Pass in an array of integers which have the ids - same as IDs in the boundary condition panel within the GUI. If the *thread is one of these then it returns the id else it returns NOT_WALL which you can define however.

For FLUENT 6 make sure you #define FLUENT_6 or if you only use 6.x remove the conditional compile from these lines.

Hope this is something like what you need.

Greg

/* ---------------------------------------------------------------------------

IS THREAD

-------------------------------------------------------------------------- */ int is_thread_cm(Thread *thread, int no_threads, int thread_list[]) { #ifdef FLUENT_6 Domain *domain = Get_Domain(1); #endif

int i=0;

while ((i<no_threads) && (Lookup_Thread(domain,thread_list[i])!=thread)) i++;

if (Lookup_Thread(domain,thread_list[i])==thread)

return i;

else

return NOT_WALL; }

Greg Perkins September 3, 2003 03:46

Re: material name of emissivity for a face thread
 
/* ---------------------------------------------------------------------------

IS THREAD

-------------------------------------------------------------------------- */ int is_thread_cm(Thread *thread, int no_threads, int thread_list[]) { #ifdef FLUENT_6 Domain *domain = Get_Domain(1); #endif

int i=0;

while ((i<no_threads)&&(Lookup_Thread(domain,thread_list[i])!=thread)) i++;

if (Lookup_Thread(domain,thread_list[i])==thread)

return i;

else

return NOT_WALL; }

Greg Perkins September 3, 2003 03:47

Re: material name of emissivity for a face thread
 
/* ---------------------------------------------------------------------------

IS THREAD

-------------------------------------------------------------------------- */ int is_thread_cm(Thread *thread, int no_threads, int thread_list[]) { #ifdef FLUENT_6 Domain *domain = Get_Domain(1); #endif

int i=0;

while ((i_<_no_threads)&&(Lookup_Thread(domain,thread_li st[i])!=thread)) i++;

if (Lookup_Thread(domain,thread_list[i])==thread)

return i;

else

return NOT_WALL; }

Greg Perkins September 3, 2003 03:48

Re: material name of emissivity for a face thread
 
Sorry had some trouble posting....this last one is the right code except in the while it should be while i lessthan no_threads (in C of course)

Nici September 3, 2003 06:02

Re: material name of emissivity for a face thread
 
Hej Greg,

I solved the problem on my own even though it took a while! I found in the src.h macro appropriate for my purpouse

if (strcmp( THREAD_MATERIAL(f_t), char_bed) == 0)

where char_bed is defined as

char *char_bed = "ash"

All the other walls are steel so now I can distinguish between the char bed "wall" and steel "wall"!

Thank you again for your interest,

cheers Nici

zhou September 3, 2003 12:21

how to add the second gradient of UDS
 
Hi,everybody How to add the second gradient of UDS(user defined scalar) into species equation as source terms. Thanks. I only find the macro in fluent to calculate the first gradient. By the way, is there any way to get the arrangment or distribution of cells in fluent? Thanks.


All times are GMT -4. The time now is 09:37.