/***********************************************************************
   vprofile.c                                                          
   UDF for specifying steady-state velocity profile boundary condition 
************************************************************************/
#include "udf.h"

DEFINE_PROFILE(channel_in_t, thread, position) 
{
  #define L1 0.005
  #define L2 0.025
  #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.045
  #define L2 -0.005
  #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)
}