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

Error in UDF for slip boundary

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2020, 06:31
Default Error in UDF for slip boundary
  #1
New Member
 
Amit Varakhedkar
Join Date: Jan 2020
Posts: 1
Rep Power: 0
av1399 is on a distinguished road
I have written a UDF for providing slip conditions to the airfoil wall using the Navier slip equation. After compiling the code, when I initialize the solution, I get this error: received a fatal signal (Segmentation fault).
I am simulating in series and the simulation is running perfectly for no-slip condition (without UDF).
Thanks in advance.

The UDF is as follows:
#include "udf.h"
#define del 0.0004 // wall slip layer thickness [m]

DEFINE_PROFILE(slip_velocity_x,t,i)
{
cell_t c;
real x[ND_ND], gamma, c_t, c_x, u, v;
face_t f;

begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
u = C_U(f,t);
v = C_V(f,t);
gamma = C_STRAIN_RATE_MAG(f,t); // tangential velocity component
c_t = gamma*del;
c_x = c_t*u/sqrt(u*u+v*v); // taking x component
F_PROFILE(f,t,i) = c_x;
}
end_f_loop(f,t)
}

DEFINE_PROFILE(slip_velocity_y,t,i)
{
cell_t c;
real x[ND_ND], gamma, c_t, c_y, u, v;
face_t f;

begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
u = C_U(f,t);
v = C_V(f,t);
gamma = C_STRAIN_RATE_MAG(f,t);
c_t = gamma*del;
c_y = c_t*v/sqrt(u*u+v*v);
F_PROFILE(f,t,i) = c_y;
}
end_f_loop(f,t)
}
av1399 is offline   Reply With Quote

Old   March 6, 2020, 07:26
Default Slip Velocity UDF
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
There are a few issues with the code. Any macro starting with C_ is meant for cell center. And it requires cell index and cell thread, i.e., the arguments of C_ macros have to be of type cell_t and Thread *t where t belongs to a cell zone and not a boundary zone. You have to define a thread variable outside the loop, i.e.,

Thread *tc;
tc = THREAD_T0(t);

and incorporate following changes within the loop

c = F_C0(f, t);
C_STRAIN_RATE_MAG(c, tc);

Furthermore, you don't need the command F_CENTROID as well as its corresponding variable x because these are not required by the equation.

Last comment is about its applicability. It is not recommended to apply the velocity for a slip or partial slip condition. Better approach is to determine shear stress due to this slip and then apply that.
av1399 likes this.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Tags
segmentaion fault, slip b.c., udf


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
3D Windturbine simulation in SU2 k.vimalakanthan SU2 15 October 12, 2023 05:53
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
Domain Imbalance HMR CFX 5 October 10, 2016 05:57
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 05:15
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00


All times are GMT -4. The time now is 21:35.