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

received a fatal signal(segmentation fault)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 25, 2016, 08:01
Default received a fatal signal(segmentation fault)
  #1
New Member
 
kihoon lim
Join Date: Apr 2016
Posts: 1
Rep Power: 0
kihoon1214 is on a distinguished road
I'm now simulating the porous media flow (adsorption). I have written UDF including adjust function and mass source. But the simulation is stop by error message(=segmentation fault).
This message was shown when I do initialization and Run calculation

1.only hook adjust function
=>Initialization: No error
Run calculation: error
2. hook adjust function and apply mass source
=>Initialization: error
Run calculation: error

This is my code

#include "udf.h"
#include "mem.h"
/* k = 0.15;e = 0.37; q = 730;*/
/* q=density-kg/m^3 */
/* e=porosity */
/* ldf model constant(k) is assume as 0.15(need to change) */

enum
{
ads,
X,
Sm,
source,
};


DEFINE_ADJUST(adsorption,domain)
{
Thread *t;
cell_t c;
/*real A;
real P;
real tem;*/

thread_loop_c (t, domain)
{
begin_c_loop(c,t)
{
/*tem=C_T(c,t);
P=C_P(c,t)+RP_Get_Real("operating-pressure");
A=tem*log(2339.3/P); /* Psat=fix */
C_UDSI(c,t,ads) = 0.15; /*0.35/0.01801534*exp(-0.000006*(pow(A,1.7)));*/
}
end_c_loop(c,t)
}
}
/* da equation included*/
/*P=C_P(c,t);*/
/*Psat, P is constant(25,20)*/
/*x_m=0.35, D=0.000006,n=1.7*/
/*0.01801534*/
DEFINE_ADJUST(X_ads,domain)
{
Thread *t;
cell_t c;
real dt;

thread_loop_c(t, domain)
{
begin_c_loop(c, t)
{
dt = RP_Get_Real("physical-time-step");
C_UDSI(c, t, X) = C_UDSI_M1(c, t, X) + 0.15*dt*(C_UDSI_M1(c, t, ads) - C_UDSI_M1(c, t, X));
}
end_c_loop(c, t)
}
}

DEFINE_ADJUST(masssource,domain)
{
Thread *t;
cell_t c;

thread_loop_c(t, domain)
{
begin_c_loop(c, t)
{
C_UDSI(c, t, Sm) = -0.63*730*0.01801534*0.15*(C_UDSI(c, t, ads) - C_UDSI(c,t,X));
}
end_c_loop(c, t)
}
}

DEFINE_SOURCE(m_source,c,t,dS,eqn)
{
dS[eqn] = 0.0;
return C_UDSI_M1(c,t,Sm);
}

I do not know about solution of the error message. please help me.
#I applied porous zone

thank you
kihoon1214 is offline   Reply With Quote

Old   April 28, 2016, 09:26
Default
  #2
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23
vasava will become famous soon enough
How about if you initialize first and then hook the UDF? Also if you initialize and run for few time-steps (at-least 2) and then hook UDF?

Since the error is too general it is difficult to judge just on basis of UDF.
vasava 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
fluentError: received a fatal signal (Segmentation fault). thomaszhangjing Fluent UDF and Scheme Programming 11 January 13, 2021 10:37
Fluent udf Error: received a fatal signal (Segmentation fault) syble FLUENT 3 December 9, 2016 17:28
Error: receive a fatal signal(Segmentation fault) SNeCu Fluent UDF and Scheme Programming 3 March 15, 2016 23:16
received a fatal signal (segmention fault) fs10224 Fluent UDF and Scheme Programming 0 June 30, 2014 03:20
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


All times are GMT -4. The time now is 03:41.