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

UDF for VR Rate calculation

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   December 14, 2011, 09:18
Unhappy UDF for VR Rate calculation
  #1
ADI
New Member
 
A. N.
Join Date: Oct 2009
Posts: 10
Rep Power: 16
ADI is on a distinguished road
Send a message via MSN to ADI
Hello All,
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):


#include "udf.h"

#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[0];
real s2 = specief_mf[1];
real mw1 = mole_weight[0];
real mw2 = mole_weight[1];

if (FLUID_THREAD_P(t) && THREAD_VAR(t).fluid.porous)
*rate = K2*mw1/(1+K*(mw1+mw2));
else
*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.
__________________
Adi.

Last edited by ADI; December 14, 2011 at 09:47. Reason: More info found after further research.
ADI 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
udf for transient mass flow rate inlet mdzubairmanipal@gmail.com Fluent UDF and Scheme Programming 0 February 22, 2011 02: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


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