Fluids

Fluids

Should I use UDF to define a zero velocity gradient boundary condition at the top of domain?

    • uconcorde
      Subscriber

      Dear all,

      I am simulating a y-velocity contour in a flat plate laminar flow field to compare with Blasius solution. I am using Symmetry at the top boundary. Symmetry boundary gives me all right setting except it forces the y-velocity to be zero at the top boundary.

      I have tried to set top boundary to be Outflow (gives zero gradient of y-velocity) or Pressure Outlet, however, the results are not correct since the reversed flow appears.

      I am wondering if I can do anything to get a free shear boundary on the top, which means the gradient of x-velocity and y-velocity are zero, whereas x-velocity and y-velocity are non-zero on the top boundary.

      I do not know how can I implement it although I have read a bunch of threads in the forums. What UDF should I use? Define_profile or Define_adjust?

      Hope someone can give me a useful hint.

      Thanks.


      Dv

    • uconcorde
      Subscriber

      Dear all,

      I have written a UDF of DEFINE_ADJUST to let the y-velocity at the boundary equal to the y-velocity values in the boundary adjacent cells. It interpreted and hooked without error. However, error message popped out at the beginning of the computation. Here are the fault message and my UDF. Any comments would be appreciated.


      Error: received a fatal signal (Segmentation fault).
      Error Object: #f
      Registering Udf, ("C:UsersAxis2-D_0209dp0FLU-9Fluentadjust2.c")

      Calculation complete.


      #include "udf.h"
      DEFINE_ADJUST(top_y_velocity_adjust2, d)
      {
      face_t f;
      cell_t c, c0;
      int ID = 261; /* Zone ID for top from Boundary Conditions task page */
      Thread *t, *t0;
      t = Lookup_Thread(d, ID);
      /* this loop over all cells adjacent to top */
      begin_f_loop(f, t)
      {
      /* c0 and t0 identify the adjacent cell */
      c0 = F_C0(f, t);
      t0 = THREAD_T0(t);
      F_V(f, t) = C_V(c0, t0); /* set cell value to face value on the top */ 
      }
      end_f_loop(f, t)
      }

Viewing 1 reply thread
  • You must be logged in to reply to this topic.