CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Using UDF to define velocity gradient boundary condition (not velocity inlet profile)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2018, 00:51
Default Using UDF to define velocity gradient boundary condition (not velocity inlet profile)
  #1
New Member
 
David
Join Date: Nov 2017
Posts: 14
Rep Power: 8
uconcorde is on a distinguished road
Dear all,

I am simulating a y-velocity contour in a flat plate laminar flow field to compare with Blasius solution. I am using Velocity Inlet at the inlet boundary, Pressure Outlet at the outlet boundary, Wall at the flat plate, and 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 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.
uconcorde is offline   Reply With Quote

Old   March 21, 2018, 20:50
Default attempt to implement by DEFINE_ADJUST
  #2
New Member
 
David
Join Date: Nov 2017
Posts: 14
Rep Power: 8
uconcorde is on a distinguished road
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:\Users\Axis\2-D_0209\dp0\FLU-9\Fluent\adjust2.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)
}
uconcorde is offline   Reply With Quote

Old   March 26, 2018, 11:29
Default
  #3
New Member
 
David
Join Date: Nov 2017
Posts: 14
Rep Power: 8
uconcorde is on a distinguished road
Dear all,

After trying for several days, I prefer using DEFINE_PROFILE to impose a zero gradient velocity boundary at the top of the domain. Since there is no UDF hook selector under symmetry boundary condition's box, I use a velocity inlet to hook my UDF.

I am wondering if it is possible to set a velocity inlet boundary condition for a non-inlet surface? (If considering the top surface is velocity inlet, the y-velocity will be negative respect to the inlet velocity boundary.)

Thanks.
Dv
uconcorde is offline   Reply With Quote

Old   December 11, 2023, 12:56
Default
  #4
New Member
 
Kadi
Join Date: May 2014
Posts: 11
Rep Power: 12
Kader is on a distinguished road
Dear uconcorde,
Have you resolved your problem? If so, can you help me. Thanks
Kader is offline   Reply With Quote

Reply

Tags
fluent, neumann boundary, udf, velocity bc


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF - Inlet Velocity Profile (Ansys Fluent) vinayak4399 Fluent UDF and Scheme Programming 3 August 25, 2020 14:15
UDF: Change boundary condition. Velocity inlet to pressure inlet at time "t" jpina FLUENT 10 April 11, 2015 14:19
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 05:13


All times are GMT -4. The time now is 23:49.