CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   problem with very simple ufd (https://www.cfd-online.com/Forums/fluent/42298-problem-very-simple-ufd.html)

Ralf Schmidt September 13, 2006 05:28

problem with very simple ufd
 
Hi!

I have a problem with a very simple udf. I have a cuboid volume, and i want about a quater of it to have a very high viscous resistant.

I wrote a simple udf that defines the resistant, but it dosn't work... the flow through the cuboid is straight where it should be rederacted by the high resistance zone.

That is my udf:

#include "udf.h"

DEFINE_PROFILE(vis_res,t,i)

{

real x[ND_ND];

real a;

cell_t c;

begin_c_loop(c,t)

{

C_CENTROID(x,c,t);

if( x[0] < -150)

if( x[1] < 1200)

if( x[2] < -250){

a = 10000000000;

}

else

a = 0;

F_PROFILE(c,t,i) = a;

}

end_c_loop(c,t)

}

cadaei September 13, 2006 09:15

Re: problem with very simple ufd
 
are the values of the centroid x correct? they seem very large to be in metres

Ralf Schmidt September 13, 2006 09:33

Re: problem with very simple ufd
 
the volume is defined in mm. The cuboid is 300(x) by 150(z) by 600(y) mm. Its center is at -150(x), -250(z), 1200 (y) mm.

So the values I define are right in the middle of the volume.

The grid is also scaled in mm.

I noticed now, that even when I change the value for "a" after the else statement, there is no change in the simulation.

What is the problem??

Ralf

Scott September 14, 2006 16:35

Re: problem with very simple ufd
 
The UDF documentation clearly states that all units in UDFs must be in SI, so length is in metres.

Ralf Schmidt September 15, 2006 10:38

Thats it!
 
Hi!

Thanks for that! I think, thats it! The simulation shows more or less the results, i expected, but it is very slow...

Thanks anyway...

Ralf


All times are GMT -4. The time now is 19:23.