|
[Sponsors] |
November 7, 2016, 06:21 |
segmentation_fault_UDF
|
#1 |
Member
Join Date: Sep 2016
Posts: 33
Rep Power: 10 |
when executing the following UDF I get segmentation fault error...but i don't get what I'm doing wrong...any help is appreciated (I'm using pressure based solver)
#include "udf.h" #define Tads 332.6 DEFINE_EXECUTE_AT_END(heat_transfer_coeffcient) { real lambda = 9; real temp, con1=0; Domain *d; Thread *t; face_t f; cell_t c; Thread *t_adsorber_interface, *t_symmetry_air; d = Get_Domain(1); t_adsorber_interface = Lookup_Thread(d, 8); t_symmetry_air = Lookup_Thread(d, 17); begin_f_loop(f, t_symmetry_air) { /* F_T gets face temperature. The += will cause all of the face temperatures to be added together. */ temp += F_T(f, t_symmetry_air); con1++; } end_f_loop(f, t_symmetry_air) } |
|
November 7, 2016, 17:04 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Are you sure your boundary IDs are correct (8 and 17)? Otherwise try removing lines of code until you determine the location of the error.
|
|
November 7, 2016, 20:02 |
|
#3 |
Member
Joshua
Join Date: Aug 2014
Posts: 49
Rep Power: 12 |
Get_domain(1); has been causing segmentation fault for me when I interpret the UDF instead of compiling it. I would try and compile your UDFs and see what happens. See this thread.
|
|
November 8, 2016, 03:55 |
|
#4 |
Member
Join Date: Sep 2016
Posts: 33
Rep Power: 10 |
Thanks for the reply....I don't get any error until I start to loop over the faces...I checked the IDs (I have taken them from the boundary condition in fluent) do you think the problem is that one of the ID refers to an interior type boundary?
|
|
November 8, 2016, 04:10 |
|
#5 | |
Member
Join Date: Sep 2016
Posts: 33
Rep Power: 10 |
Quote:
|
||
November 8, 2016, 04:34 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Do you have single or multiple phases? Multiphase systems require further code for subdomains. Also try: http://www.cfd-online.com/Forums/flu...-boundary.html
|
|
November 9, 2016, 06:51 |
|
#7 |
Member
Join Date: Sep 2016
Posts: 33
Rep Power: 10 |
Thanks I did it like the in the thread you suggested me and now fluent runs without error...Thanks!
|
|
November 16, 2016, 23:56 |
|
#8 |
New Member
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13 |
Hi, Boh,
I used to have the same problem with you. Now I'm trying to compiling the UDF instead of interpreting. But I got an error: UNC paths are not supported. Defaulting to windows directory. Access is denied. ........ The directory or file cannot be created. Error: sopenoutputfile: unable to open file for output Error Object: "libudf\\win64\\2d\\user_nt.udf" Do you know anything about how to deal with it? It's my first time compiling UDF to Fluent. Do I have to change any path or something? Thank you so much. |
|
November 18, 2016, 06:04 |
|
#9 |
Member
Join Date: Sep 2016
Posts: 33
Rep Power: 10 |
Did you add the enviromental variables in windows?
|
|
November 21, 2016, 14:51 |
|
#10 |
New Member
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13 |
Hi, Boh,
Thanks for your reply. But I couldn't understand what you mean. Could you explain that again? Thanks a lot. |
|
November 22, 2016, 13:57 |
|
#11 |
Member
Join Date: Sep 2016
Posts: 33
Rep Power: 10 |
https://www.researchgate.net/post/Ho..._ANSYS_Fluent2 ....Here the various steps that need to be done in order to set up correctly the enviroment....it's also important that you don't have any spaces in your filename...hope it's helpfull
|
|
|
|