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

UDF problem, Node 0: Process 31532: Received signal SIGSEGV error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 5, 2023, 07:02
Default UDF problem, Node 0: Process 31532: Received signal SIGSEGV error
  #1
New Member
 
Bartłomiej Filip
Join Date: Jan 2023
Posts: 1
Rep Power: 0
Gibson1234 is on a distinguished road
Hello,

I have a problem with my UDF. My case is about adsorption model and I want to use my UDF properly. Here is my code:

Code:
#include "udf.h"
#include "mem.h"

DEFINE_ADJUST(ads, domain) /*Henry's linear isotherm function*/ 
{
	Thread *t;
	cell_t c;
	int i = 0;
	real H;
	real fraction = C_YI(c,t,i);
	H = 0;
	thread_loop_c(t, domain)
	{
		begin_c_loop(c,t)
		{
			C_UDSI(c,t,0) = H * fraction;
		}
		end_c_loop(c,t)
	}

}

DEFINE_ADJUST(q_ads, domain) /*qi of every iteration is calculated and stored by this UDF*/
{
	Thread *t;
	cell_t c;
	real dt;
	real kmq;
	kmq = 1000;
	thread_loop_c(t, domain)
	{
		begin_c_loop(c, t)
		{
			dt = RP_Get_Real("physical-time-step");
			C_UDSI(c,t,1) = C_UDSI_M1(c,t,1) + kmq * dt * (C_UDSI_M1(c,t,0) - C_UDSI_M1(c,t,1));	
		}
		end_c_loop(c, t)
	}
}

DEFINE_ADJUST(d_ads, domain) /*Mass source term of every iteration is calculated and stored by this UDF*/
{
	Thread *t;
	cell_t c;
	real kmq;
	kmq = 1000;
	thread_loop_c(t, domain)
	{
		begin_c_loop(c, t)
		{
			C_UDSI(c,t,2) = kmq * (C_UDSI(c,t,0) - C_UDSI(c,t,1));	
		}
		end_c_loop(c, t)
	}
}

DEFINE_SOURCE(m_src, c, t, dS, eqn) /*Function to hook mass source term into Fluent*/
{
	dS[eqn] = 0.0;
	return C_UDSI_M1(c,t,2);
}
It looks like it's not working good with first term (/*Henry's linear isotherm function*/) because i used it separetly and i get the answer from console:

Node 0: Process 31532: Received signal SIGSEGV error

I'm using Species model, transient, axisymmetric 2D, laminar.
I'm new in UDFs, so please be patient.

Thanks a lot for any kind of answer.
Gibson1234 is offline   Reply With Quote

Old   January 8, 2023, 14:28
Default
  #2
New Member
 
Andrew
Join Date: Dec 2022
Posts: 29
Rep Power: 3
andrew-c is on a distinguished road
I had this problem recently, and in my case the issue was that I was passing the improper thread to the macro functions (such as C_YI, or the UDSI functions). I've also seen some threads where calls to the user defined scalar macros throw SIGSEGVs because their values were not properly allocated in the memory.

I'd recommend trying to isolate your error further to an individual macro function. You mentioned the first DEFINE_ADJUST function is throwing the error, but which line is the source of the error? There may be more than one. Try commenting individual lines out until the error goes away.

Also, does it throw a SIGSEGV upon initialization, or only during runtime?

In case it helps, here's the thread about my similar problem, with solution described. Can't be sure if this is applicable to your case without more info, but it's a start:

Fluent UDFs crash at initialization/run with temperature & species macros

If you provide some more info and are able to isolate to a specific macro/line in your UDF, we may be able to help more.
andrew-c is offline   Reply With Quote

Reply

Tags
fluent, problem, udf


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
Gmsh reports an OpenCascade exception when opening a .geo file algc Main CFD Forum 2 October 24, 2022 05:59
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 3 December 30, 2019 00:21
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 07:43
error compiling modified applications yvyan OpenFOAM Programming & Development 21 March 1, 2016 04:53
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 21:58.