|
[Sponsors] |
March 6, 2020, 07:31 |
Error in UDF for slip boundary
|
#1 |
New Member
Amit Varakhedkar
Join Date: Jan 2020
Posts: 1
Rep Power: 0 |
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) } |
|
March 6, 2020, 08:26 |
Slip Velocity UDF
|
#2 |
Senior Member
|
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.
__________________
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. |
|
Tags |
segmentaion fault, slip b.c., udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3D Windturbine simulation in SU2 | k.vimalakanthan | SU2 | 15 | October 12, 2023 06:53 |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
Domain Imbalance | HMR | CFX | 5 | October 10, 2016 06:57 |
Error - Solar absorber - Solar Thermal Radiation | MichaelK | CFX | 12 | September 1, 2016 06:15 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |