|
[Sponsors] |
February 21, 2007, 02:39 |
Kind attn:Dear Rizwan and also all others
|
#1 |
Guest
Posts: n/a
|
in DEFINE_SOURCE we will access to the cell and cell thread and for my problem I have to select a particular face of each cell and to do this I used c_face_loop and it is not working. I have been posting this problem to the forum repeatedly this is because my project hanged with this problem kindly help me in this regard.
my UDF: #include "udf.h" #include "mem.h" /*source term for w=5rpm*/ DEFINE_SOURCE(imp_in,c,t,dS,eqn) { real source; real x[ND_ND]; real NV_VEC(omega); real NV_VEC(vel); Thread *thread; face_t f; int i; real A[ND_ND]; real sum=0.0; real sum1=0.0; /*setting value of the omega*/ NV_S(omega,=,0.0); omega[0]=5.0;/*The value of the given rpm*/ /*cross product of the w and r*/ /*r is given by x vector*/ sum=0.0; NV_S(vel,=,0.0); c_face_loop(c, t, i) { f=C_FACE(c,t,i); thread=C_FACE_THREAD(c,t,i); F_CENTROID(x,f,thread); NV_CROSS(vel,omega,x); F_AREA(A,f,thread); sum+=NV_DOT(A,vel); } dS[eqn]=0.0; source=-1*C_R(c,t)*sum; return source; } sincierly thanking u in advance Phanindra. |
|
February 22, 2007, 03:30 |
Re: Kind attn:Dear Rizwan and also all others
|
#2 |
Guest
Posts: n/a
|
try to debug with the message macro,
|
|
February 22, 2007, 04:32 |
Re: Kind attn:Dear Rizwan and also all others
|
#3 |
Guest
Posts: n/a
|
in the message it is showing that the third argument in the c_face_loop as unsigned char whereas I have already declared it as int.how to go about this.please help me.Thanking in advance. Phanindra
|
|
February 22, 2007, 05:09 |
Re: Kind attn:Dear Rizwan and also all others
|
#4 |
Guest
Posts: n/a
|
I just put Message("i is %d\n",i); inside the c_face_loop and I got i 0,1,2 and 3 (2d case). should be no problem.
|
|
|
|