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

Particle property UDF

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 20, 2019, 04:36
Default Particle property UDF
  #1
New Member
 
Lesego
Join Date: Mar 2019
Posts: 2
Rep Power: 0
LesegoM is on a distinguished road
Hi guys, I am trying to use a UDF to represent particle scattering but I am getting this error in fluent.

Node 0: Process 1828: Received signal SIGSEGV.

I understand that this means something is wrong with my code. Can I kindly get some assistance. My code is like this:

DEFINE_DPM_PROPERTY(coal_scattering, c, t, tp, T)
{
real mp0;
real mp;
real cf, vf;
real *f;

if (NULLP(tp->pp) ||
NULLP(TP_CELL_THREAD(tp)))
*f = 0.9; /* initial value */

mp0 = TP_INIT_MASS(tp);
mp = TP_MASS(tp);

/* get the original char and volatile fractions
/* and store them in vf and cf:*/
vf = DPM_VOLATILE_FRACTION(tp);
cf = DPM_CHAR_FRACTION(tp);
*f = 0.9*vf - 0.6*(1-vf);

if (!(((mp / mp0) >= 1) ||
((mp / mp0) <= 0)))
{

if ((mp / mp0) < (1 - vf - cf))
{
/* only ash left */
/* vf = cf = 0 */

*f = 0.9*vf - 0.6*(1-vf);
return *f; /*use ash scattering*/
}
else if ((mp / mp0) < (1 - vf))
{
/* only ash and char left */
/* cf = 1 - (1 - vf - cf) / (mp / mp0) */
/* vf = 0 */
*f = 0.9*vf - 0.6*(1-vf);
return *f; /*use char scattering*/
}
else
{
/* volatiles, char, and ash left */
/* cf = cf / (mp / mp0) */
/* vf = 1 - (1 - vf) / (mp / mp0) */
*f = 0.9*vf - 0.6*(1-vf);
return *f; /*use coal scattering*/
}
}
return 0.9;
}
LesegoM 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
Trapped Particle coordinates UDF Saidul FLUENT 0 December 8, 2014 18:07
Particle cooling rate - UDF papteo Fluent UDF and Scheme Programming 9 January 29, 2012 09:28
Problem with a simple UDF to calculate cell-averaged particle values kmayank FLUENT 1 January 18, 2011 01:40
URGENT custom property for UDF Sandilya Garimella FLUENT 0 May 19, 2008 12:35
udf about particle concentration--who can help me? zhaoh FLUENT 1 January 17, 2007 11:46


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