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

Segmentation fault

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2017, 15:11
Unhappy Segmentation fault
  #1
Member
 
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9
Tushar_Telmasre is on a distinguished road
Experiencing a weird problem. solving for simple conduction based solidification.

#include "udf.h"

DEFINE_EXECUTE_AT_END(temp_gradient)
{
Domain *d;

Thread *t;

cell_t c;

d = Get_Domain(1);

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,1) = C_T_M1(c,t);
}
end_c_loop(c,t)
}

}

in the above code I am getting segmentation fault. if I change C_T_M1(c,t) to C_T(c,t) I wont get any fault and solution will proceed.

any idea what might be the reason.
Tushar_Telmasre is offline   Reply With Quote

Old   May 12, 2017, 08:39
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
In cases like this, the first thing you look to is the manual. There I looked for "C_T_M1", to see what the manual says about it. Only one page says something about C_T_M1, and this says:

Quote:
Important: Note that data from C_T_M1 is available only if user-defined scalars are defined. It can also be used with adaptive time stepping.
So that should explain your situation.

(By the way: the name "temp_gradient" suggests that you want to calculate the temperature gradient. But the code looks for the temperature at the previous time step. So your code is wrong, or your name is misleading.)
pakk is offline   Reply With Quote

Old   May 12, 2017, 09:23
Default
  #3
Member
 
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9
Tushar_Telmasre is on a distinguished road
thank you.
that solved the problem.

also as you have noted the name is misleading. my ultimate aim is to calculate gradient hence the name of udf is as such.
Tushar_Telmasre 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
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 22:59
Segmentation fault in SU2 V5.0 ygd SU2 2 March 1, 2017 05:38
Segmentation fault when running in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 8, 2015 09:12
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example sudo OpenFOAM Running, Solving & CFD 3 April 2, 2013 18:27
segmentation fault when installing OF-2.1.1 on a cluster Rebecca513 OpenFOAM Installation 9 July 31, 2012 16:06


All times are GMT -4. The time now is 22:09.