/********************************************************************** 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_z_velocity, thread, index) { real x[ND_ND]; /* this will hold the position vector */ real y; 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]; F_PROFILE(f, thread, index) = 2.*0.063662 - 8.0*0.063662*y*y; } end_f_loop(f, thread) }