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 slip boundary condition

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By rasoulb
  • 2 Post By DaveD!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 10, 2012, 13:56
Smile UDF for slip boundary condition
  #1
New Member
 
rasoul b
Join Date: Dec 2010
Location: iran
Posts: 13
Rep Power: 15
rasoulb is on a distinguished road
Hi all

I have written a UDF for slip boundary condition (u_{s}=L_{s}*du_dy) by C_U_G(c,t)[1] Macro.
1- I test my UDF for 2 & 3D steady laminar channel flow, it's work good with low slip length (0.0001-0.005) but for larger slip length not converged. Can anyone guide me for this convergence problem?

2. I need to use velocity gradient of previous time step for unsteady simulation. what macros I should use?

thanks
BARKAT likes this.
rasoulb is offline   Reply With Quote

Old   December 10, 2012, 14:13
Default
  #2
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
Do you know that a boundary condition like this is already implemented in Fluent?
flotus1 is offline   Reply With Quote

Old   December 10, 2012, 14:29
Default
  #3
New Member
 
rasoul b
Join Date: Dec 2010
Location: iran
Posts: 13
Rep Power: 15
rasoulb is on a distinguished road
what version? please guide me

Thanks
rasoulb is offline   Reply With Quote

Old   December 10, 2012, 16:42
Default
  #4
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
Last time i read about it was in the version 13 manual, but i think it can also be found in earlier versions.
I am out of office right now, so all I can do is recommend a google search with 'fluent high knudsen boundary'.
I think you will figure it out by yourself, otherwise feel free ask again.
flotus1 is offline   Reply With Quote

Old   December 11, 2012, 02:46
Default
  #5
New Member
 
rasoul b
Join Date: Dec 2010
Location: iran
Posts: 13
Rep Power: 15
rasoulb is on a distinguished road
slip velocity based on knudsen number is appropriate for gases and Not applicable for liquids. please say another method.

thanks
rasoulb is offline   Reply With Quote

Old   December 11, 2012, 04:07
Default
  #6
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
This holds true for a microscopic point of view.

But if you just want a boundary condition in the form (=*du_dy), the high Knudsen number boundary condition in fluent is the right choice, no matter what type of fluid you are using.
flotus1 is offline   Reply With Quote

Old   December 13, 2012, 11:56
Default
  #7
New Member
 
rasoul b
Join Date: Dec 2010
Location: iran
Posts: 13
Rep Power: 15
rasoulb is on a distinguished road
thanks flotus1 for your answers.
high Knudsen number boundary condition is for Low-Pressure Gas Systems and available only when the Laminar model is selected in the Viscous Model panel (based on explanation expressed in fluent 6.3 help). but my Model is LES and pressure is high in my case.
rasoulb is offline   Reply With Quote

Old   December 14, 2012, 04:53
Default
  #8
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
"high" pressure is not the problem in your case.
The boundary treatment can be used at any pressure level. The term "low pressure" comes from one of the applications of the model in low-pressure systems. But the model is appropriate at arbitrary pressure levels, whenever the Knudsen number is high.
I am currently studying flows at normal pressure levels with a BC like this.

But I see now that this BC is not an option since your Model is LES.
Perhaps it is possible to activate the BC with a LES model with a text command. This would be a question for the fluent support.
flotus1 is offline   Reply With Quote

Old   November 13, 2014, 04:03
Default hi
  #9
Member
 
Qureshi M Z I
Join Date: Sep 2013
Posts: 79
Rep Power: 12
m zahid is on a distinguished road
hi, i need a UDF for slip boundary condition at the bottom of the domain or at the ground (wall), case is just like a flow over a building. if anybody have sample UDF please share this, z is a vertical axis of my domain. thanks

mziqureshi@hotmail.com

regards,
m zahid is offline   Reply With Quote

Old   November 13, 2014, 04:12
Default
  #10
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by m zahid View Post
hi, i need a UDF for slip boundary condition at the bottom of the domain or at the ground (wall), case is just like a flow over a building. if anybody have sample UDF please share this, z is a vertical axis of my domain. thanks

mziqureshi@hotmail.com

regards,
Please read the messages in this thread more carefully. If you would have done that, you would not have asked for a UDF.
pakk is offline   Reply With Quote

Old   November 13, 2014, 08:42
Default
  #11
Member
 
Qureshi M Z I
Join Date: Sep 2013
Posts: 79
Rep Power: 12
m zahid is on a distinguished road
hi, thanks pakk, here rasoulb use slip length instead of dynamic viscosity, as given in the link
http://www.cfd-online.com/Wiki/Wall_shear_stress

do u know the relationship between slip length and dynamic viscosity.

thanks
m zahid is offline   Reply With Quote

Old   November 13, 2014, 09:13
Default
  #12
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
First question you should ask yourself: What is the equation for slip that you want to implement?

Second question you should ask yourself: What is the equation for slip that Fluent has implemented? (This is written in the Help, look it up.)

Third question: How can you choose parameters such that the Fluent implementation is the same as what you want?
pakk is offline   Reply With Quote

Old   March 20, 2019, 10:37
Default UDF for slip boundary condition
  #13
New Member
 
Join Date: Feb 2016
Posts: 20
Rep Power: 10
DaveD! is on a distinguished road
Here is a code for applying a wall slip velocity based on wall slip layer thickness and the strain rate (which corresponds to \partial{u}/\partial{n}) at the wall.

To make it work, some under-relaxation is required for the calculated tangential wall velocity c_t.

BTW: The formula for Maxwell-based Slip Boundary Formulation for Low-Pressure Gas Systems (https://www.sharcnet.ca/Software/Flu...ug/node613.htm) is not applicable for cases, where there is a significant pressure and/or temperature change within the domain, since the parameter \lambda is auto-calculated by fluent. Hence, it is not possible to set \alpha_v and \sigma in way to get a constant factor left of the term (U_g-U_c)/\delta, which is an approximation for \partial{u}/\partial{n}.

Now, here is the code:

Code:
#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*gamma; // 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*gamma;
 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)
}
NonStopEagle and by1704116 like this.
DaveD! is offline   Reply With Quote

Old   May 3, 2020, 12:58
Default UDF for slip velocity and temperature jump
  #14
Member
 
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 5
homay95 is on a distinguished road
Hello everyone
I'm having problem with writing UDF for these two functions(slip velocity and temperature jump) below for a liquid-solid interface:
1. V= L(du/dy)
2. T)f = T)s + L(dT/dy)
in which V is slip velocity, u is mean velocity along with x axis, T)f is fluid temperature and T)s is solid temperature
I would appreciate very much if anyone who has UDF for those functions please send me here or at: homayoonsohrabi@yahoo.com
thanks for any help
homay95 is offline   Reply With Quote

Old   March 8, 2021, 04:35
Default UDF for slip flow in microchannels
  #15
New Member
 
Join Date: Sep 2020
Posts: 4
Rep Power: 5
FORGODSAKE is on a distinguished road
i want to add alternate slip and no slip boundary condition for studying fluid flow 2D microchannels . I wish to get slip length .what UDF should i use.
FORGODSAKE is offline   Reply With Quote

Old   October 15, 2021, 03:35
Default
  #16
New Member
 
Xin Zhang
Join Date: Oct 2021
Posts: 2
Rep Power: 0
XinZhang is on a distinguished road
Hi, Dave. I read your UDF and I am working on a slip wall simulation too. The problem confuse me is that when we define the slip wall boundary, a Specified Shear sholud be defined in fluent. How can you write a UDF of the Shear Stress? Does your UDF work well now? Thanks a lot.
XinZhang 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
mixed inflow/outflow downstream boundary condition question peob OpenFOAM Running, Solving & CFD 3 February 3, 2017 10:54
Resolved: Changing boundary condition with UDF according to pressure outlet boundary alpemre Fluent UDF and Scheme Programming 12 February 24, 2014 10:18
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
Boundary Condition Types Using Scheme and UDF Nasir FLUENT 0 September 15, 2008 21:54
UDF : boundary condition ID Flav FLUENT 4 June 28, 2001 09:52


All times are GMT -4. The time now is 16:58.