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

Segmentation error with DEFINE_SOURCE

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 2 Post By pakk
  • 2 Post By annan
  • 2 Post By obscureed

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 14, 2018, 18:04
Default Segmentation error with DEFINE_SOURCE
  #1
New Member
 
Masoud Mo
Join Date: May 2018
Posts: 6
Rep Power: 8
eng.masoud is on a distinguished road
Hi fellows,
I am simulating a 2phase problem (liquid and air) that liquid phase comes from inlet and depositing on wall substrate. I am using heat source to apply and make it molten.
I defined the code as below, to select only second phase cells and apply on them but after starting Ive got the segmentation error. Would you please guide me on this regard.

Thanks


#include "udf.h"
DEFINE_SOURCE(heatsource, c, thsec, dS, eqn)
{
real x[ND_ND], source, current_time;
real xc; /* xc - x coordinate */
real yc; /* yc - y coordinate */

Thread *thmix;
thsec = THREAD_SUB_THREAD(thmix,3);

C_CENTROID(x,c,thsec);
xc=x[0]; /* the x coordinate of the cell - 0th component of vector x */
yc=x[1]; /* the y coordinate of the cell - 1st component of vector x */

if (xc>=0.0045 & xc<=0.0077 & yc>=-0.001 & yc<=0.0029)

{
source=10e11;}

else {
source=0;}

dS[eqn] = 0.0; /* the source does not depend on temperature so dS = 0 */

return source;

}
eng.masoud is offline   Reply With Quote

 


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
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 21:59
Segmentation fault in SU2 V5.0 ygd SU2 2 March 1, 2017 04:38
Segmentation fault when running in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 8, 2015 08:12
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example sudo OpenFOAM Running, Solving & CFD 3 April 2, 2013 17:27
segmentation fault when installing OF-2.1.1 on a cluster Rebecca513 OpenFOAM Installation 9 July 31, 2012 15:06


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