/*********************************************************************** vprofile.c UDF for specifying steady-state velocity profile boundary condition ************************************************************************/ #include "udf.h" DEFINE_PROFILE(channel_in_t, thread, position) { #define L1 0.01 #define L2 0.03 #define Q 0.00025 real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = 6.*Q*(y*y-(L1+L2)*y+L1*L2)/ pow((L1-L2),3.); } end_f_loop(f, thread) } DEFINE_PROFILE(channel_in_b, thread, position) { #define L1 -0.04 #define L2 -0.00 #define Q 3.54e-4 real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = 6.*Q*(y*y-(L1+L2)*y+L1*L2)/ pow((L1-L2),3.); } end_f_loop(f, thread) }