CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   C_DUDX problem (https://www.cfd-online.com/Forums/fluent/76951-c_dudx-problem.html)

marye June 9, 2010 06:06

C_DUDX problem
 
Hello,

I wrote a very simple program :

#include"udf.h"
#include"mem.h"

DEFINE_PROPERTY(cell_visco, c, t)

{

real mu_lam;


real U1= C_DUDX(c,t);
real U2 = C_DUDY(c,t);
real U3 = C_DUDZ(c,t);
real V1= C_DVDX(c,t);
real V2 = C_DVDY(c,t);
real V3 = C_DVDZ(c,t);
real W1= C_DWDX(c,t);
real W2 = C_DWDY(c,t);
real W3 = C_DWDZ(c,t);


if (U1>0.000005)
mu_lam = 1.;
else
mu_lam = 2.;

printf (
"%d",U1);
}


On Fluent's windows, I have the result 0 each time whereas on my file result, I have
dx-velocity-dx =
5.467863753E-003,.......... and never 0

The
dx-velocity-dx
dy-velocity-dx
dz-velocity-dx
dx-velocity-dy
dy-velocity-dy
dz-velocity-dy
dx-velocity-dz
dy-velocity-dz
dz-velocity-dz

can't be determine with
C_DUDX(c,t)
C_DUDY(c,t)..... etc
????

If you have any ideas...

Thank you!! :)

tez June 9, 2010 19:53

I would change the %d to %f in printf

marye June 10, 2010 04:52

Thank you for your answer! And you're right!
But I still had the same problem... I think it was just because I didn't put "return mu_lam;"


All times are GMT -4. The time now is 22:31.