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

segmentation_fault_UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 7, 2016, 05:21
Default segmentation_fault_UDF
  #1
Boh
Member
 
Join Date: Sep 2016
Posts: 33
Rep Power: 9
Boh is on a distinguished road
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)

}
Boh is offline   Reply With Quote

Old   November 7, 2016, 16:04
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   November 7, 2016, 19:02
Default
  #3
Member
 
Joshua
Join Date: Aug 2014
Posts: 49
Rep Power: 11
jbo214 is on a distinguished road
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.
jbo214 is offline   Reply With Quote

Old   November 8, 2016, 02:55
Default
  #4
Boh
Member
 
Join Date: Sep 2016
Posts: 33
Rep Power: 9
Boh is on a distinguished road
Quote:
Originally Posted by `e` View Post
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.
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?
Boh is offline   Reply With Quote

Old   November 8, 2016, 03:10
Default
  #5
Boh
Member
 
Join Date: Sep 2016
Posts: 33
Rep Power: 9
Boh is on a distinguished road
Quote:
Originally Posted by jbo214 View Post
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.
I compiled the UDF....and if i compile the UDF only till the face loop i don't get any error...
Boh is offline   Reply With Quote

Old   November 8, 2016, 03:34
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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
`e` is offline   Reply With Quote

Old   November 9, 2016, 05:51
Default
  #7
Boh
Member
 
Join Date: Sep 2016
Posts: 33
Rep Power: 9
Boh is on a distinguished road
Thanks I did it like the in the thread you suggested me and now fluent runs without error...Thanks!
Boh is offline   Reply With Quote

Old   November 16, 2016, 22:56
Default
  #8
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
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.
serene6390 is offline   Reply With Quote

Old   November 18, 2016, 05:04
Default
  #9
Boh
Member
 
Join Date: Sep 2016
Posts: 33
Rep Power: 9
Boh is on a distinguished road
Did you add the enviromental variables in windows?
Boh is offline   Reply With Quote

Old   November 21, 2016, 13:51
Default
  #10
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
Hi, Boh,

Thanks for your reply. But I couldn't understand what you mean.
Could you explain that again?

Thanks a lot.
serene6390 is offline   Reply With Quote

Old   November 22, 2016, 12:57
Default
  #11
Boh
Member
 
Join Date: Sep 2016
Posts: 33
Rep Power: 9
Boh is on a distinguished road
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
Boh 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



All times are GMT -4. The time now is 01:30.