CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF, air flow through a cell----get velocity in (http://www.cfd-online.com/Forums/fluent/79851-udf-air-flow-through-cell-get-velocity.html)

lig September 6, 2010 13:02

UDF, air flow through a cell----get velocity in
 
Hi,All,

I am simulating particle-laden air flow through a porous zone. The source term in the transport equation need the velocity and concentration of the air when it flow into a cell. In another word, only two sides of a cell are needed in the calculation in a 2D case---- x, y velocity/concentration when flow direction is opposite to the normal direction of a face.

The current code I wrote as followed (part of the code) has 4 source output values (2D). Could you help me to correct it? Thank a lot.

c_face_loop(c,t,i)
{

ft=C_FACE_THREAD(c,t,i);
f=C_FACE(c,t,i);
c0=F_C0(f,ft);
tc0=THREAD_T0(ft);
c1=F_C1(f,ft);
tc1=THREAD_T1(ft);
scalar=C_UDSI(c0,tc0,7);
F_AREA(Af,f,ft);


NV_D(vel,=,C_U(c0,tc0),C_V(c0,tc0),C_W(c0,tc0));
flowrate=NV_DOT(vel,Af);

source = scalar*CEcell*flowrate/C_VOLUME(c,t);
dS[eqn] = CEcell*flowrate/C_VOLUME(c,t);
Message ("source_7=%g,%g\n",source);

}
return source;


All times are GMT -4. The time now is 12:49.