|
[Sponsors] |
Difference between chemical reaction and define_source macro |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 14, 2014, 05:06 |
Difference between chemical reaction and define_source macro
|
#1 |
New Member
Alexey
Join Date: Jan 2014
Posts: 18
Rep Power: 12 |
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 |
|
|
|