CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   how to use C_YI(cell, thread, I) in UDF core (http://www.cfd-online.com/Forums/fluent/29036-how-use-c_yi-cell-thread-i-udf-core.html)

 Zhang_clement November 5, 2001 02:58

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

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!

 hampton November 6, 2001 05:21

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

Hi,

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

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.

 Zhang_clement November 8, 2001 22:51

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

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;

{

{

}

}

}

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;

} }

 kevin November 8, 2001 23:14

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

try this equation

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

float source, mass_c;

 Zhang_clement November 15, 2001 21:53

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

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?

 joby November 16, 2001 00:32

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

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 )

 All times are GMT -4. The time now is 01:44.