CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF power law (https://www.cfd-online.com/Forums/fluent-udf/118766-udf-power-law.html)

dimsum June 4, 2013 02:26

UDF power law
 
Hi guys,

I am using FLUENT 14.0 to do a simulation on a building hit by a wind flow, the wind flow should be governed by a power law.

the power law, U=7*((z/0.15)^0.25)

which I have used the following UDF, for the velocity-inlet profile.

--------------------------------------------------------------------------

#include "udf.h"

DEFINE_PROFILE(x_velocity,thread,index)
{
real x[ND_ND]; /* this will hold the position vector */
real z;
face_t f;

begin_f_loop(f,thread) /* loops over all faces in the thread passed
in the DEFINE macro argument */
{
F_CENTROID(x,f,thread);
z = x[2];
F_PROFILE(f,thread,index) = 7 * pow(z/0.15, 0.25);
}
end_f_loop(f,thread)
}

--------------------------------------------------------------------------

But for the result, the wind speed at the roof top of the building is 11.84, which should be 7m/s.

The height of the building is 150mm. The wind is in z-direction, height in y-direction.

Is something wrong for my UDF?

Please help. Many thanks.


All times are GMT -4. The time now is 10:03.