|December 14, 2011, 10:18||
UDF for VR Rate calculation
I am fairly new to using UDF along with Fluent. I am trying to model reduction of CO2 with coal or Carbon. The reation rate is defined using Langmuir-Henselwood formulation and I am trying to do that with the UDF because most of the Species Transport models use the Arrhenius rate equation.
My question is, how do I use concentrations of the species' as my variable in the code.
Here is the code I have so far (fairly simple and premature):
#define K 1000
#define K2 0.508
#define Mtot 84.
DEFINE_VR_RATE(lang_hens_reac_rate,c,t,r,mole_weig ht,species_mf,rate,rr_t, yi)
real s1 = species_mf;
real s2 = specief_mf;
real mw1 = mole_weight;
real mw2 = mole_weight;
if (FLUID_THREAD_P(t) && THREAD_VAR(t).fluid.porous)
*rate = K2*mw1/(1+K*(mw1+mw2));
*rate = 0.;
*rr_t = *rate;
However, all the mw variables need to be concentrations. Please help me as soon as possible as I am running out of ideas and options
I found this piece of code that people are using to obtain concentration:
ci = yi[dindex][sp_id]*C_R(c,t_reactant)/mw[dindex][sp_id];
ci = MAX(ci,SMALL_S);
But i have no idea what all those arguements and variables and syntax are. Please help
The basic equation for calculating the reaction rate is:
rate = K2*[species 2]/(1+K*([species1]+[species2]))
where K and K2 are constants given and the objects in the square brackets are obviously concentrations that I need.
Last edited by ADI; December 14, 2011 at 10:47. Reason: More info found after further research.
|May 27, 2014, 23:11||
Join Date: Apr 2014
Posts: 7Rep Power: 4
I am also dealing with reaction rate equation in my CFD.
This is just an extract out from my UDF for concentration calculation:
#define mw_0 18.;
/* mass fraction of species based on species index on fluent panel */
H2O = C_YI(c,tp,0); /* H2) is the first species in my list thus id is 0 */
real density; /* rho is total density */
rho = C_R(c,t);
/* concentration of individual species */
/* mass fraction x density / molecular weight */
conc_H2O = H2O * rho / mw_0;
Hope this helps
|Thread||Thread Starter||Forum||Replies||Last Post|
|udf for transient mass flow rate email@example.com||Fluent UDF and Scheme Programming||0||February 22, 2011 03:51|
|UDF for catalyst volumetric reaction, temperature overshoot though rate is small||elmcmaster||FLUENT||0||October 11, 2010 09:37|
|Stain Rate UDF||esinticik||FLUENT||0||September 10, 2009 14:04|
|calculation average pressure in a plane with UDF||Vitalij||FLUENT||1||April 10, 2007 03:39|
|UDF about reaction rate||Julien||FLUENT||0||June 30, 2005 12:23|