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

problem with c_face_loop

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 14, 2007, 04:42
Default problem with c_face_loop
  #1
Phanindra
Guest
 
Posts: n/a
I have a problem working with c_face_loop macro. can any body help me in this regard.. I'm sending 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;

}

  Reply With Quote

Old   February 14, 2007, 09:18
Default Re: problem with c_face_loop
  #2
Bogdan
Guest
 
Posts: n/a
Could you tell us what was the problem? I don't see any mistake.
  Reply With Quote

Old   February 14, 2007, 11:47
Default Re: problem with c_face_loop
  #3
Rizwan
Guest
 
Posts: n/a
Can u please explain wat u exactly want to do? coz source terms are calculated on cell basis. i feel u unnecessarily complicated the problem by looping over faces on cell. rather u can directly add source term to a single cell.
  Reply With Quote

Old   February 18, 2007, 02:48
Default Re: problem with c_face_loop
  #4
Phanindra
Guest
 
Posts: n/a
Thanks fr u'r concern.I'm pleasured to let know my problem.

The problem is with the loop c_face_loop.When i run my udf it shows me an error and this error is abot the face index number i.e.,n in the loop macro.I dont no what it exactly mean and how to specify it. I need to loop over all the faces of a cell and it is required for my project.

Thanks in advance

Phanindra.
  Reply With Quote

Old   February 18, 2007, 04:08
Default Re: problem with c_face_loop
  #5
Rizwan
Guest
 
Posts: n/a
well, this is what i said. c_face_loop is a macro to loop over faces within a cell. i agree to that. but u r implementing c_face_loop to define a source, which i feel may not be compatible as source terms are defined on cell basis. like u have to define source term at the centroid of the cell ratehr than the individual face centroids of the particular cell. in your case the udf will become much simple with a source term specified at the cell centroid. this is my understanding of the udf help file on source terms. Regards Razwan.
  Reply With Quote

Old   February 19, 2007, 03:26
Default Re: problem with c_face_loop
  #6
Phanindra
Guest
 
Posts: n/a
Thank u Rizwan .I will try with a new approach as u have suggested.

Phanindra
  Reply With Quote

Old   February 19, 2007, 03:34
Default Re: problem with c_face_loop
  #7
Rizwan
Guest
 
Posts: n/a
U r welcome. All the best.
  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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


All times are GMT -4. The time now is 16:02.