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

received signal SIGSEV

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2016, 11:38
Default received signal SIGSEV
  #1
Member
 
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10
flo90000 is on a distinguished road
Hello

I have an error "Process 60025:received signal SIGSEV" . I find it's due to a program try to access a memory location which is not allowed. So I allow a User defined memory location and a user defined node memory location but without success. It's my UDF:

Code:
 #include "udf.h"
 #include "unsteady.h"
 #include "math.h"
 
DEFINE_GRID_MOTION(position_piston,domain,dt,time,dtime)
 {
	#if PARALLEL
        static Thread *tf;
	static face_t f;
	static Node *v;
	static int n;
	static real t;
	static real L,A,WS;
	L = 0.06;  /* m Connecting rod lenght*/
        A = 0.054; /* m piston stroke */
	WS = 60; /* rpm Crank shaft speed */
	t = CURRENT_TIME;
	begin_f_loop(f,tf)
	{
		f_node_loop(f,tf,n)
		 {
			 v = F_NODE(f,tf,n);
			 
			 if (NODE_POS_NEED_UPDATE (v)) /*the current node has not been previously visited when looping through previous faces */
			 {				 
			   NODE_Y(v)=L+((A/2)*(1-cos(t*WS*M_PI/30)))-sqrt((L*L)-((A*A)*(sin(t*WS*M_PI/30)*sin(t*WS*M_PI/30))/4));
			 }
		 }
	 }
	 end_f_loop(f,tf);
	 #endif
 }
thanks for your help
flo90000 is offline   Reply With Quote

Old   June 15, 2016, 19:34
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You haven't used user-defined memory and therefore don't require allocating memory for UDM. Why are you restricting the DEFINE_GRID_MOTION macro to parallel (with the #if PARALLEL preprocessor directive)? Are you running Fluent in serial or parallel? The host process would still execute the code; the only thing this conditional statement is achieving is avoiding mesh motion in serial mode. Face looping macros are skipped over by the host node anyway; you don't require any special parallel considerations for this macro.

If you're checking if the node has already been updated, then you should tell Fluent that it has been updated (shouldn't practically matter as the node movement is absolute and not dependent on its current position):

Code:
if (NODE_POS_NEED_UPDATE (v)) /*the current node has not been previously visited when looping through previous faces */
{				 
	NODE_Y(v)=L+((A/2)*(1-cos(t*WS*M_PI/30)))-sqrt((L*L)-((A*A)*(sin(t*WS*M_PI/30)*sin(t*WS*M_PI/30))/4));
	NODE_POS_UPDATED(v);
}
You've declared a face thread pointer (*tf) but haven't initialised this value: that's the cause of your error. The face thread is given by DEFINE_GRID_MOTION via dt and can be accessed with:

Code:
Thread *tf = DT_THREAD((Dynamic_Thread *)dt);
Lastly, add trailing dots to your integers to avoid erroneous type casting operations.
`e` is offline   Reply With Quote

Old   June 16, 2016, 04:40
Default
  #3
Member
 
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10
flo90000 is on a distinguished road
Quote:
Originally Posted by `e` View Post
You haven't used user-defined memory and therefore don't require allocating memory for UDM. Why are you restricting the DEFINE_GRID_MOTION macro to parallel (with the #if PARALLEL preprocessor directive)? Are you running Fluent in serial or parallel? The host process would still execute the code; the only thing this conditional statement is achieving is avoiding mesh motion in serial mode. Face looping macros are skipped over by the host node anyway; you don't require any special parallel considerations for this macro.

If you're checking if the node has already been updated, then you should tell Fluent that it has been updated (shouldn't practically matter as the node movement is absolute and not dependent on its current position):

Code:
if (NODE_POS_NEED_UPDATE (v)) /*the current node has not been previously visited when looping through previous faces */
{				 
	NODE_Y(v)=L+((A/2)*(1-cos(t*WS*M_PI/30)))-sqrt((L*L)-((A*A)*(sin(t*WS*M_PI/30)*sin(t*WS*M_PI/30))/4));
	NODE_POS_UPDATED(v);
}
You've declared a face thread pointer (*tf) but haven't initialised this value: that's the cause of your error. The face thread is given by DEFINE_GRID_MOTION via dt and can be accessed with:

Code:
Thread *tf = DT_THREAD((Dynamic_Thread *)dt);
Lastly, add trailing dots to your integers to avoid erroneous type casting operations.
I run the simulation in parallel with 16 processes and I found some compiler directives to write in the UDF to parallelize it. That's why I put "#if PARALLEL". I change how you suggested me and tried with the three compiler directives. And I have another error when I want to load the UDF library. Fluent tells me that the UDF library I am trying to load is not compiled for parallel use.
flo90000 is offline   Reply With Quote

Old   June 16, 2016, 07:43
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Which three compiler directives are you using now? You don't need to use any for this UDF code. Read the UDF manual on parallelising if you're interested. Ensure you're recompiling correctly by checking my compiling process for Fluent UDFs with an existing library loaded.
`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
Node 0: Process 15088: Received signal SIGSEGV. hasib61 FLUENT 7 September 4, 2022 01:25
[ImmersedBoundary] About the moving immersed boundary tutorial: icoDyMIbFoam+movingCylinderInChannelIco wyldckat OpenFOAM Community Contributions 25 September 14, 2021 17:15
Free Surface Ship Flow timfranke OpenFOAM Running, Solving & CFD 322 March 3, 2021 09:04
fluentError: received a fatal signal (Segmentation fault). thomaszhangjing Fluent UDF and Scheme Programming 11 January 13, 2021 09:37
VOF Transient Error rkanesan OpenFOAM Running, Solving & CFD 0 November 13, 2014 19:38


All times are GMT -4. The time now is 15:52.