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

Difference between chemical reaction and define_source macro

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 14, 2014, 05:06
Default Difference between chemical reaction and define_source macro
  #1
New Member
 
Alexey
Join Date: Jan 2014
Posts: 18
Rep Power: 12
Laexzzz is on a distinguished road
Im trying to model chem. reaction.

I used volumetric reaction laminar finite rate mechanism

I0 => 2R0 (rate constant for 333K is 8.28971E-06)

Then i made UDF function

#include "udf.h"

DEFINE_SOURCE(I0_source,c,t,dS,eqn)
{

real I0_source;
real Dens = C_R(c,t);
real I0MC;
real I0MC_source;

I0MC = (C_YI(c,t,0)*Dens) / 164;
I0MC_source = -8.28971E-06*I0MC;
I0_source = I0MC_source*164;
dS[eqn] = 0;
return I0_source;
}

DEFINE_SOURCE(R0_source,c,t,dS,eqn)
{

real R0_source;
real Dens1 = C_R(c,t);
real I0MC1;
real R0MC_source;

I0MC1 = (C_YI(c,t,0)*Dens1) / 164;
R0MC_source = 2*8.28971E-06*I0MC1;
R0_source = R0MC_source*82;
dS[eqn] = 0;
return R0_source;
}


But there is a big difference between results of this 2 cases.





Any ideas?

Boundary condition are identical
Laexzzz 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



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