/********************************************************************** inlet-parabolic.c UDF for specifying a steady-state velocity profile boundary condition **********************************************************************/ #include "udf.h" /* must be at the beginning of every UDF you write */ DEFINE_PROFILE(inlet_x_velocity, thread, index) { real x[ND_ND]; /* this will hold the position vector */ real y; real y1; 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); y = x[1]; y1 =(y+24.*0.0254)/(8.*0.0254); F_PROFILE(f, thread, index) = 0.01 - 0.01*y1*y1; } end_f_loop(f, thread) }