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

UDF with UDM Error: segmentation fault

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 23, 2016, 13:54
Default UDF with UDM Error: segmentation fault
  #1
New Member
 
Dominika
Join Date: Nov 2016
Location: Warsaw
Posts: 3
Rep Power: 9
dj1210 is on a distinguished road
Hello.
I want to simulate bioheat transfer in skin. I have to add a property called blood perfusion rate, which is dependent from cell temperature.

I made a UDF, it was compiled and interpreted in Ansys Fluent 14.5 as well as in Ansys Fluent 17.2 Academic. But everything crashes (error: received a fatal signal (Segmentation fault)) when I try to execute macro DEFINE_ON_DEMAND, the simplest part of my UDF.
Here is my macro:
#include "udf.h"

DEFINE_ON_DEMAND (zeruj_pamiec_demand)
{
Domain *d;
cell_t c;
Thread *t;

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0) = 0.0;
C_UDMI(c,t,1) = 0.0;
C_UDMI(c,t,2) = 0.0;
}
end_c_loop(c,t)
}
}


I've read something about solutions of this error and I tried some of them:
1) I hope I run the macro in proper way: I run Fluent, Define->Memory, Define->UDF, Initialize, Execute on Demand;
2) I tried small changes in UDF: 0 instead of 0.0, changing name, including "mem.h";
3) I tried to compile UDF instead of interpreting - running Fluent using CMD Shell (not sure if I did it right, it's kind of magic for me);
4) I tried running my case on my friend's computer.

After all nothing changes. Always the same error about segmentation fault.
What am I doing wrong? Any suggestions?

Hopefully waiting for somebody replying. Thank you in advance.
dj1210 is offline   Reply With Quote

Old   November 23, 2016, 15:49
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Have you allocated three user-defined memory locations? You're using the first three in this UDF.
`e` is offline   Reply With Quote

Old   November 23, 2016, 15:58
Default
  #3
New Member
 
Dominika
Join Date: Nov 2016
Location: Warsaw
Posts: 3
Rep Power: 9
dj1210 is on a distinguished road
Yes, I use three memory locations and I define it every time before defining UDF.
dj1210 is offline   Reply With Quote

Old   November 24, 2016, 04:02
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You need to initialise the domain pointer with:

Code:
d = Get_Domain(1);
`e` is offline   Reply With Quote

Old   November 24, 2016, 09:44
Default
  #5
New Member
 
Dominika
Join Date: Nov 2016
Location: Warsaw
Posts: 3
Rep Power: 9
dj1210 is on a distinguished road
Thank you very much, it's working. Have a nice day!
dj1210 is offline   Reply With Quote

Reply

Tags
define_on_demand, segmentation fault, udm


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
udf for valve closing a pipe using dynamic mesh chem engineer Fluent UDF and Scheme Programming 2 May 13, 2017 09:39
I know WHERE but not WHY- segmentation fault in an interpreted UDF achint Fluent UDF and Scheme Programming 0 July 28, 2015 21:53
UDF programming fullmonty FLUENT 5 June 30, 2011 02:40
my fault about UDF Seyed Farid Hosseinizadeh FLUENT 1 February 5, 2006 03:55
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03


All times are GMT -4. The time now is 12:08.