|
[Sponsors] |
November 5, 2001, 01:58 |
how to use C_YI(cell, thread, I) in UDF core
|
#1 |
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! |
|
November 6, 2001, 04:21 |
Re: how to use C_YI(cell, thread, I) in UDF core
|
#2 |
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. |
|
November 8, 2001, 21:51 |
Re: how to use C_YI(cell, thread, I) in UDF core
|
#3 |
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; } } |
|
November 8, 2001, 22:14 |
Re: how to use C_YI(cell, thread, I) in UDF core
|
#4 |
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) } |
|
November 15, 2001, 20:53 |
Re: how to use C_YI(cell, thread, I) in UDF core
|
#5 |
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?
|
|
November 15, 2001, 23:32 |
Re: how to use C_YI(cell, thread, I) in UDF core
|
#6 |
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 )
|
|
|
|
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 02:02 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 05: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 14:37 |