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

UDF for Navier slip condition

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By polopol

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2021, 10:56
Default UDF for Navier slip condition
  #1
New Member
 
Join Date: Mar 2021
Posts: 1
Rep Power: 0
polopol is on a distinguished road
hello
I'm looking for an UDF to implement the Navier slip condition on Fluent. I would like to enter the slip length at the top of the UDF.


For the moment I've been working with the following UDF and selected the functions in Specified Shear. Unfortunately changing the slip length changes nothing in the results.
I've been working on a Poiseuille flow at low Reynolds (laminar) to see if the results were correct.



#include "udf.h"
/*
===============================================
Velocity slip at wall boundaries
separate routines for every velocity coordinate
UDF can be interpreted
at least 2 user-defined memories (UDM) need to be allocated first!
===============================================
*/
// wall slip layer thickness [m]
#define DELTA 10.0e-6
// under-relaxation factor for tangential wall velocity
#define RELAX_CT 0.1

DEFINE_PROFILE(slip_velocity_x,f_thread,index)
{
face_t face;
cell_t cell;
Thread *c_thread;
real u, v;
real ct, cx;
real gamma;
int i;
begin_f_loop(face,f_thread) // for each face: get face-id and thread
{
cell=F_C0(face,f_thread); // get corresponding cell
c_thread=THREAD_T0(f_thread); // get cell thread
u = C_U(cell,c_thread); // F_U(face,f_thread); // get cell center velocity u
v = C_V(cell,c_thread); // F_V(face,f_thread); // get cell center velocity v
gamma = C_STRAIN_RATE_MAG(cell,c_thread); // get strain rate (equivalent to du/dn at wall)

ct = (1-RELAX_CT)*F_UDMI(face,f_thread,0)+RELAX_CT*DELTA*g amma; // calculate tangential velocity (with under-relaxation using previous calculation step)
F_UDMI(face,f_thread,0)=ct; //store in user-defined face memory (id=0) for next calculation

cx = ct*u/sqrt(u*u+v*v); // component of ct in x-direction
F_PROFILE(face,f_thread,index) = cx; // assign to profile
}
end_f_loop(face,f_thread)
}
DEFINE_PROFILE(slip_velocity_y,f_thread,index)
{
face_t face;
cell_t cell;
Thread *c_thread;
real u, v;
real ct, cy;
real gamma;
begin_f_loop(face,f_thread)
{
cell=F_C0(face,f_thread); // get cell
c_thread=THREAD_T0(f_thread); // get cell thread
u = C_U(cell,c_thread); // F_U(face,f_thread);
v = C_V(cell,c_thread); // F_V(face,f_thread);
gamma = C_STRAIN_RATE_MAG(cell,c_thread);

ct = (1-RELAX_CT)*F_UDMI(face,f_thread,1)+RELAX_CT*DELTA*g amma;
F_UDMI(face,f_thread,1)=ct;

cy = ct*v/sqrt(u*u+v*v);
F_PROFILE(face,f_thread,index) = cy;
}
end_f_loop(face,f_thread)
}
Nitish the Beast likes this.
polopol is offline   Reply With Quote

Old   March 4, 2021, 11:24
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
You might have very good reasons to implement your own version, but I should mention it nevertheless : velocity slip is standard implemented in Fluent, you don't need a UDF, just enable low-pressure boundary slip.

I don't have an answer to the problem in your post.
pakk is offline   Reply With Quote

Reply


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
slip boundary condition in the VOF model Sinon Lee Fluent Multiphase 2 September 27, 2018 08:27
Implementing Partial slip condition for solid particles in Lagrangian solvers surajkvs OpenFOAM Pre-Processing 0 April 13, 2018 04:08
Reflective wall and non slip condition? Jaydi_21 Main CFD Forum 6 February 20, 2018 15:43
Fluent UDF for Micro Flow Face Slip Velocity daniel_george_carter Fluent UDF and Scheme Programming 0 May 12, 2013 06:39
UDF Boundary Condition Victor FLUENT 2 November 6, 2003 12:37


All times are GMT -4. The time now is 18:59.