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/)
-   -   3D UDF for rectangular domain inlet (https://www.cfd-online.com/Forums/fluent-udf/225562-3d-udf-rectangular-domain-inlet.html)

aar007 March 31, 2020 19:03

3D UDF for rectangular domain inlet
 
Hi, I am trying to model a UDF for my wind tunnel inlet using power law.
1; when I try computing my inlet conditions from in reference value I get *nan* in velocity section
(#include "udf.h"

#define P 1./7. //power law n value 7//
#define uref 1.32 // m higeht of inlet//


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

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z = x[2];
F_PROFILE(f, thread, position) = 40*pow(z/uref,P);
}
end_f_loop(f, thread)
}

2; I get the same issue and error when I try using the function expression.

uref [m s^-1] * (z / z_ref [m]) ** alpha3.my inlet is at x=-1 using magnitude and direction under velocity specification method

https://ibb.co/jTy62zm

vinerm April 1, 2020 03:10

Udf
 
The UDF is alright and you can use it. However, this cannot be used for initialization. DEFINE_PROFILE is not executed before initialization. You have to initialize by providing some value for the velocity.

ved prakash May 11, 2022 07:06

Hi, have you found the solution?? I am also trying to use this expression. Please help me out.

AlexanderZ May 11, 2022 22:58

solution is written by vinerm one line above


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