|
[Sponsors] |
February 14, 2007, 03:42 |
problem with c_face_loop
|
#1 |
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; } |
|
February 14, 2007, 08:18 |
Re: problem with c_face_loop
|
#2 |
Guest
Posts: n/a
|
Could you tell us what was the problem? I don't see any mistake.
|
|
February 14, 2007, 10:47 |
Re: problem with c_face_loop
|
#3 |
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.
|
|
February 18, 2007, 01:48 |
Re: problem with c_face_loop
|
#4 |
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. |
|
February 18, 2007, 03:08 |
Re: problem with c_face_loop
|
#5 |
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.
|
|
February 19, 2007, 02:26 |
Re: problem with c_face_loop
|
#6 |
Guest
Posts: n/a
|
Thank u Rizwan .I will try with a new approach as u have suggested.
Phanindra |
|
February 19, 2007, 02:34 |
Re: problem with c_face_loop
|
#7 |
Guest
Posts: n/a
|
U r welcome. All the best.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |