|
[Sponsors] |
Fluent UDF Wall Shear Stress Segmentation Fault |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 22, 2015, 12:22 |
Fluent UDF Wall Shear Stress Segmentation Fault
|
#1 |
New Member
Ananth SNC
Join Date: Nov 2014
Posts: 3
Rep Power: 12 |
Hi, I am using DEFINE_PROFILE to define wall shear stress value on boundary layer faces. The interpretation is successful but I am getting "Error: received a fatal signal (Segmentation fault)." when I do hybrid initialization. My udf code is:
DEFINE_PROFILE(wall_shear_udf_faces, thread, i) { face_t f; real x[ND_ND]; real ufree; real wall_shear_value; real L, U, rho, mu, Re; ufree = USTAR; begin_f_loop(f, thread) { F_CENTROID(x, f, thread); printf("X = %f and Y = %f\n\n", x[0], x[1]); L = sqrt( (x[0] * x[0]) + (x[1] * x[1]) ); // distance formula printf("Here\n\n"); rho = F_R(f, thread); printf("L = %f and rho = %f\n\n", L, rho); mu = F_MU_L(f, thread); U = F_U(f, thread); Re = (U * L) / mu; printf("MU = %f and Re = %f\n\n", mu, Re); // calculate using reynolds 1/5 power law wall_shear_value = ((mult * rho) * (ufree * ufree)) / (pow(Re, POWER)); F_PROFILE(f, thread, i) = wall_shear_value; } end_f_loop(f, thread) } Error occurs in the line rho = F_R(f, thread); .. I know this because it prints "Here" in the fluent console. Any idea why this error occurs and how to get it running? Thanks ahead! |
|
February 22, 2015, 21:20 |
More error description
|
#2 |
New Member
Ananth SNC
Join Date: Nov 2014
Posts: 3
Rep Power: 12 |
If I give constant values to all the variables it works.. but when I try to use the Face Field Variable Macros, it gives segmentation fault..
|
|
February 23, 2015, 18:34 |
|
#3 | |
Member
Subhasish Mitra
Join Date: Oct 2009
Location: Australia
Posts: 56
Rep Power: 17 |
Quote:
The problem of "segmentation fault" occurs when a solver variable is illegally accessed which in this case I suspect are the density and viscosity variables because they are stored in cell nodes and not in faces.
__________________
SM |
||
February 24, 2015, 04:23 |
|
#4 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Code:
rho = F_R(f, thread); In your case, if you do initialization, apparently this function is called before the density is set. If the order would have been differently, it would have worked. I can give you two solution approaches: 1. Change the UDF, so that it first checks if the density is set, and if it is not set, it should use a 'default' value for the density. This is the best solution, but maybe difficult to program. 2. When you want to initialize, remove all calls to this function (or use constant values inside the function), and change the function to the correct version after initialization. This is the quick-and-dirty workaround. |
||
Tags |
define profile, fluent - udf, wall shear stress |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for shear stress at wall in laminar flow | Jafri | FLUENT | 1 | April 6, 2020 19:20 |
Drift-flux model and wall shear stress | laoji | FLUENT | 0 | July 8, 2014 23:42 |
Accessing wall shear stress using UDF | Robert | Fluent UDF and Scheme Programming | 2 | July 31, 2013 09:34 |
How to get a value of wall shear stress for UDF | shileijerry | Fluent UDF and Scheme Programming | 0 | June 18, 2013 11:50 |
modelling wall shear stress through fluent | rakadit | Fluent UDF and Scheme Programming | 5 | June 27, 2011 13:33 |