CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

Segmentation fault during VoF simulation

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   May 26, 2015, 07:25
Post Segmentation fault during VoF simulation
Join Date: Aug 2013
Location: CK
Posts: 36
Rep Power: 6
vekh is on a distinguished road
Hello. I have problem with my UDF for 2d case.
I want to get phase level at certain area/volume to define boundary between phases. I wrote simple UDF:
#include <udf.h>
# define r 0.0004
# define x0 0.002
# define y0 0.002
FILE *fout;

DEFINE_SOURCE(my_source, cell, thread, dS, eqn) 
  real x[ND_ND]; 
  real source, xc, yc, prom;

  Thread *tm = THREAD_SUPER_THREAD(thread); 
  Thread **pt = THREAD_SUB_THREADS(tm); 

  prom = sqrt(pow((xc-(x0)),2));

  if ((prom <= r)&&(C_VOF(cell, pt[1])<1))

dS[eqn] =0; 
return source; 
and I've compiled it. But after first iteration Fluent returns:
Error: received a fatal signal (Segmentation fault).
Function my_source if hooked at Cell Zone/Source Terms/Energy.
I'm quite new to all VoF things so I need some help to start. Thanks in advance!
vekh is offline   Reply With Quote

Old   May 29, 2015, 06:31
Senior Member
Join Date: Mar 2015
Posts: 800
Rep Power: 11
`e` is on a distinguished road
Move the line of code "FILE *fout;" to within the DEFINE_SOURCE macro. If the error persists, try simplifying your code until you determine the problem line (or print text to the screen using Message(); every few lines for debugging).
`e` is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 21:59
Using VOF model and Lagrangian Multiphase in the same simulation ganesh_krishnan STAR-CCM+ 2 March 17, 2017 02:34
Fluent error: Fatal error (Segmentation fault) shufang FLUENT 2 April 20, 2015 07:06
Segmentation fault with paraFoam and paraview 3.6.1 on Fedora 11 32 and 64 bit nanes OpenFOAM Paraview & paraFoam 2 September 11, 2009 09:12
segmentation fault usker Siemens 5 March 6, 2007 00:14

All times are GMT -4. The time now is 20:43.