|
[Sponsors] |
November 23, 2016, 14:54 |
UDF with UDM Error: segmentation fault
|
#1 |
New Member
Dominika
Join Date: Nov 2016
Location: Warsaw
Posts: 3
Rep Power: 10 |
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. |
|
November 23, 2016, 16:49 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Have you allocated three user-defined memory locations? You're using the first three in this UDF.
|
|
November 23, 2016, 16:58 |
|
#3 |
New Member
Dominika
Join Date: Nov 2016
Location: Warsaw
Posts: 3
Rep Power: 10 |
Yes, I use three memory locations and I define it every time before defining UDF.
|
|
November 24, 2016, 05:02 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
You need to initialise the domain pointer with:
Code:
d = Get_Domain(1); |
|
November 24, 2016, 10:44 |
|
#5 |
New Member
Dominika
Join Date: Nov 2016
Location: Warsaw
Posts: 3
Rep Power: 10 |
Thank you very much, it's working. Have a nice day!
|
|
Tags |
define_on_demand, segmentation fault, udm |
|
|
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 10:39 |
I know WHERE but not WHY- segmentation fault in an interpreted UDF | achint | Fluent UDF and Scheme Programming | 0 | July 28, 2015 22:53 |
UDF programming | fullmonty | FLUENT | 5 | June 30, 2011 03:40 |
my fault about UDF | Seyed Farid Hosseinizadeh | FLUENT | 1 | February 5, 2006 04:55 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |