CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

how to use C_YI(cell, thread, I) in UDF core

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 5, 2001, 02:58
Default how to use C_YI(cell, thread, I) in UDF core
  #1
Zhang_clement
Guest
 
Posts: n/a
Does anyone know how to use C_YI(cell, thread, I) in UDF core?

I have two fluid zones and the core should be used in zone 1. But I have to know the species mass fraction in zone 2. Then how to set the ¡°cell¡± or ¡°thread¡±? I have tried the thread to be 1 or 2 but it will cause fatal error. And I am also try the cell to be 1, 100, 1000,10000¡*, but the answer doesn¡¯t reasonable!

Thank you!
  Reply With Quote

Old   November 6, 2001, 05:21
Default Re: how to use C_YI(cell, thread, I) in UDF core
  #2
hampton
Guest
 
Posts: n/a
Hi,

The macro C_YI(cell, thread, I) should be used in the form of following.

thread_loop_c(thread, domain) { if( THREAD_ID(t) == 8 ) { begin_c_loop(cell, thread) {

C_YI(cell, thread, I) ; } } }

The value "8" specified above is the "thread id" that will be got in Define-Boundary Conditions . And , "I" of C_YI(cell, thread, I) shows species which you want to get the mass fraction.

Thanks.
  Reply With Quote

Old   November 8, 2001, 22:51
Default Re: how to use C_YI(cell, thread, I) in UDF core
  #3
Zhang_clement
Guest
 
Posts: n/a
Thanks a lot! But i have try it in this several days and the mass-fraction that got from zone 2 is always zero. This is my core.

#include "udf.h" extern Domain* domain; cell_t c; face_t f; Thread *t; Domain *d; int i;

DEFINE_SOURCE(source_ball, cell, thread, dS, eqn) {

float source, mass_c;

thread_loop_c (thread, domain)

{

if (THREAD_ID(thread)=2)

{ begin_c_loop_all(cell,thread)

{

mass_c = C_YI(cell, thread, 0);

}

end_c_loop_all(cell, thread)

}

}

source=4e-4*(0.5-mass_c*150); /*when I set this as source=4e-4*(0.5-0); the result is the same*/

if (source > 0)

{

return source;

}

else

{

return source=0;

} }
  Reply With Quote

Old   November 8, 2001, 23:14
Default Re: how to use C_YI(cell, thread, I) in UDF core
  #4
kevin
Guest
 
Posts: n/a
try this equation

DEFINE_SOURCE(source_ball, cell, thread, dS, eqn) {

float source, mass_c;

thread_loop_c (thread, domain) { if (THREAD_ID(thread)=2) { begin_c_loop_all(cell,thread) { mass_c = C_YI(cell, thread, 0); source=4e-4*(0.5-mass_c*150); /*when I set this as } end_c_loop_all(cell, thread) }
  Reply With Quote

Old   November 15, 2001, 21:53
Default Re: how to use C_YI(cell, thread, I) in UDF core
  #5
Zhang_clement
Guest
 
Posts: n/a
Thanks! It seems the problem solved. But I still have a little confuse. The "thread ID" should refer to the BC or that show in the surface management?
  Reply With Quote

Old   November 16, 2001, 00:32
Default Re: how to use C_YI(cell, thread, I) in UDF core
  #6
joby
Guest
 
Posts: n/a
You have to specify the zone ID which you want to adapt to your UDF.can choice specify zone from Fluent's solver Defines/Boundary Condition /(ID of Boundary Condition )

  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
solving a conduction problem in FLUENT using UDF Avin2407 Fluent UDF and Scheme Programming 1 March 13, 2015 03:02
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Please check out my parallelized udf code aleisia Fluent UDF and Scheme Programming 0 June 10, 2011 16:16
Parallelizing UDF Hattori Hanzo Fluent UDF and Scheme Programming 4 July 17, 2010 14:26
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 15:37


All times are GMT -4. The time now is 07:06.