CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF source term (http://www.cfd-online.com/Forums/fluent/90389-udf-source-term.html)

jerome_ July 8, 2011 09:05

UDF source term
 
1 Attachment(s)
Hi everyone,
Iím a beginner fluent udf user, and iíve a problem with my code.
I just want to create a simple force on a blade.
Thatís my udf :

DEFINE_SOURCE(down_x,c,t,dS,eqn) /*create my Xmomentum force*/
{
real source, angle;
source=9188.84192;
dS[eqn]=0;
return source;
}

DEFINE_SOURCE(down_y,c,t,dS,eqn) /*create my Ymomentum force*/
{
real source, angle;
source=5305.16475;
dS[eqn]=0;
return source;
}

I obtain the picure 1. So itís ok because itís was i expected.
But now, if i put this udf :

DEFINE_SOURCE(down_x,c,t,dS,eqn) /*create my Xmomentum force*/
{
real source, angle;
source=10610.3295*0,866025404;
dS[eqn]=0;
return source;
}

DEFINE_SOURCE(down_y,c,t,dS,eqn) /*create my Ymomentum force*/
{
real source, angle;
source=10610.3295*0.5;
dS[eqn]=0;
return source;
}

I obtain the picture 2, which is very different from the picture 1.
But I donít understand why, because the source term in the both udf are the same (10610.3295*0,866025404=9188.84192 and 5305.16475=10610.3295*0.5)

Anyone have an idea on this problem ?

Thanks you

Jerome

Nb :I work with the k-epsilon model.

KristianEtienne July 11, 2011 03:03

Hi,

The problem is in your new "down_x" source-macro. Here you have written
source = 10610.3295*0,866025404; while it should read
source = 10610.3295*0.866025404;

Note the difference between "," and "." .

Good luck!

-KE

jerome_ July 11, 2011 11:55

You have right, that's work.

Thanks a lot


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