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

particle temperature stay low after employing UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ZJUXJK

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2017, 02:59
Default particle temperature stay low after employing UDF
  #1
New Member
 
Jiangkuan Xing
Join Date: Mar 2017
Posts: 9
Rep Power: 9
ZJUXJK is on a distinguished road
Hello everyone!
i have employed the UDF about coal devolatilization model with DEFINE_DPM_LAWS and DEFINE_DPM_SOURCE. All parameters in my UDF have been printed out and seem to be okay except the coal particle temperature.The coal particle temperature stays about 420K, and did not get burned finnaly. I am confused about it, any suggestions would be welocomed.

best wishes
zjuxjk
ZJUXJK is offline   Reply With Quote

Old   April 4, 2017, 06:10
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
If you want us to help you see what is wrong with your UDF, you have to share the UDF.
pakk is offline   Reply With Quote

Old   April 5, 2017, 23:26
Default
  #3
New Member
 
Jiangkuan Xing
Join Date: Mar 2017
Posts: 9
Rep Power: 9
ZJUXJK is on a distinguished road
Quote:
Originally Posted by pakk View Post
If you want us to help you see what is wrong with your UDF, you have to share the UDF.
#include "udf.h"
#include "dpm.h"
#include "dpm_laws.h"
#include "dpm_types.h"
#include "math.h"
#include "sg_udms.h"
#include "mem.h"
#include "stdio.h"

DEFINE_DPM_LAW(Devolatilization_rate,p,ci)
{
real dtemp;
real temp1,temp2;
real e1,k1,v1,e2,k2,v2;
real dt;
real volate_yield1, volate_yield2;
real volate_rate1,volate_rate2;

cell_t c= P_CELL(p);
Thread *t= P_CELL_THREAD(p);
real flow_time = CURRENT_TIME;


if (P_TIME(p) < 0.003)
{
P_USER_REAL(p,3)=0.0;
P_USER_REAL(p,4)=0.0;
P_USER_REAL(p,5)=303;
}
else
{
temp1=P_USER_REAL(p,5);

temp2=P_T(p);

dt = P_DT(p); /*颗粒时间步长*/

dtemp= (temp2-temp1)/dt;

printf("dtemp=%f\n")

/*记录上一个时刻温度,并计算出瞬时升温速率*/

volate_yield1 =P_USER_REAL(p,3);

volate_yield2 =P_USER_REAL(p,4);


if (dtemp > 0.0)
{

e1=14543250000.0;

e2=342553.3258955158*pow(dtemp,0.045354296);

k2=7.33134539849e-32*pow(e2,6.85504718)*pow(dtemp,1.0);

k1=395093626.7*pow(dtemp,0.367176979442845);

v1=0.11602141*pow(dtemp,0.0313245);

v2=0.385354371*pow(dtemp,-0.017575075);

}

else
{
e1=1435000.0;

e2=3543512.3258955158*pow(100000.0,0.0453296);

k2=7.33419849e-32*pow(e2,6.85504718)*pow(100000.0,1.0);

k1=3950453626.7*pow(100000.0,0.345369735845);

v1=0.11602141*pow(100000.0,0.4313245);

v2=0.3849071*pow(100000.0,-0.3575075);
}

volate_rate1=(v1-volate_yield1 )*k1*exp(-e1/8.314/temp2);

volate_rate2=(v2-volate_yield2 )*k2*exp(-e2/8.314/temp2);

volate_yield1 = volate_yield1 + volate_rate1*dt ;

volate_yield2 = volate_yield2 + volate_rate2*dt ;

P_MASS(p)=P_INIT_MASS(p)*(0.974-0.848*(volate_yield1+volate_yield2));

P_USER_REAL(p,0)=volate_yield1;
P_USER_REAL(p,1)=volate_yield2;
P_USER_REAL(p,2)=temp2;
C_UDMI(c,t,0)=P_T(p);
}
}

DEFINE_DPM_SOURCE(dpm_source,c,t,S,strength,p)
{
real mvf_dot;

mvf_dot=(P_MASS0(p)-P_MASS(p))*strength;

if((P_T(p) > 400.0) && (P_MASS(p)>0.534536*P_INIT_MASS(p)))
{
S->species[0] += mvf_dot;
S->energy += mvf_dot*15354000.0;
C_UDMI(c,t,1)= mvf_dot;
}
}

DEFINE_DPM_SCALAR_UPDATE(dpm_scalar,c,t,initialize ,p)
{
if (P_TIME(p) < 0.003)
{
P_USER_REAL(p,3)=0.0;
P_USER_REAL(p,4)=0.0;
P_USER_REAL(p,5)=303;
}
else
{
P_USER_REAL(p,3)=P_USER_REAL(p,0);
P_USER_REAL(p,4)=P_USER_REAL(p,1);
P_USER_REAL(p,5)=P_USER_REAL(p,2);
}
}

this is my UDF code, thanks for your suggestions!
qiang92 likes this.
ZJUXJK is offline   Reply With Quote

Reply

Tags
udf;dpm;


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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 08:15
Particle tracking error alchem OpenFOAM Bugs 5 May 6, 2017 17:30
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 02:29
UDF velocity and temperature Raj FLUENT 3 February 1, 2009 19:29
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


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