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

"fatal signal (Segmentation fault)" error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 12, 2018, 09:08
Default "fatal signal (Segmentation fault)" error
  #1
New Member
 
hamid
Join Date: Mar 2012
Posts: 4
Rep Power: 14
abdihamid is on a distinguished road
Hi `e` i am writing a udf code to define a mixture density that related to uds but when i want to initialize the solution this error appears: received a fatal signal (Segmentation fault)
here is my code:
#include "udf.h"
DEFINE_PROPERTY(cell_density,cell,thread)
{
Thread *t;
cell_t c;
real c_h2,c_n2,rh2,rn2,rmix=1,c_mix ;
c_h2 = C_UDSI(c,t,0);
c_n2=40.46-c_h2;
rh2=c_h2*2;
rn2=c_n2*28;
rmix=rh2+rn2;
return rmix/1000;
}
how can i solve the problem help me please
abdihamid is offline   Reply With Quote

Old   June 12, 2018, 09:37
Default
  #2
Member
 
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9
annan is on a distinguished road
Dear abdihamid,
Segmentation fault means you are trying to access something that is not defined.
I can’t understand why you define the thread and cell inside your udf, these two are already given by the DEFINE_PROPERTY macro. I’d suggest you try to remove the lines : “Thread *t; cell_t c;” and replace DEFINE_PROPERTY(cell_density,cell,thread) by DEFINE_PROPERTY(cell_density,c,t)
Hope this will help.
Good luck
Annan
annan is offline   Reply With Quote

Old   June 12, 2018, 10:43
Default
  #3
New Member
 
hamid
Join Date: Mar 2012
Posts: 4
Rep Power: 14
abdihamid is on a distinguished road
Dear annan thank you for your help. I apply the changes you suggested but the error still reamins. i dont know how to solve it.
abdihamid is offline   Reply With Quote

Old   June 13, 2018, 20:43
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Have you added at least one UDS to your model? Otherwise, debug your code by determining which line is causing the error.

Quote:
Originally Posted by annan View Post
I can’t understand why you define the thread and cell inside your udf, these two are already given by the DEFINE_PROPERTY macro. I’d suggest you try to remove the lines : “Thread *t; cell_t c;” and replace DEFINE_PROPERTY(cell_density,cell,thread) by DEFINE_PROPERTY(cell_density,c,t)
This step also needs to be completed because your UDF is calling C_UDSI on the declared variables t and c, but they do not have any values.
`e` 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] blockMesh with double grading. spwater OpenFOAM Meshing & Mesh Conversion 92 January 12, 2019 09:00
DPM udf error haghshenasfard FLUENT 0 April 13, 2016 06:35
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 07:24
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23


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