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

Kind attn:Dear Rizwan and also all others

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 21, 2007, 02:39
Default Kind attn:Dear Rizwan and also all others
  #1
Phanindra
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.
  Reply With Quote

Old   February 22, 2007, 03:30
Default Re: Kind attn:Dear Rizwan and also all others
  #2
Bogdan
Guest
 
Posts: n/a
try to debug with the message macro,
  Reply With Quote

Old   February 22, 2007, 04:32
Default Re: Kind attn:Dear Rizwan and also all others
  #3
Phanindra
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
  Reply With Quote

Old   February 22, 2007, 05:09
Default Re: Kind attn:Dear Rizwan and also all others
  #4
Bogdan
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.
  Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:52.