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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2011, 10:18
Unhappy UDF for VR Rate calculation
  #1
ADI
New Member
 
A. N.
Join Date: Oct 2009
Posts: 10
Rep Power: 17
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 10:47. Reason: More info found after further research.
ADI is offline   Reply With Quote

Old   May 20, 2014, 09:19
Default
  #2
New Member
 
Kostis Chatzi
Join Date: Apr 2014
Location: Greece
Posts: 20
Rep Power: 12
kostis217 is on a distinguished road
hi, i am experiencing a rather similar issue, have you found any luck with yours?
kostis217 is offline   Reply With Quote

Old   May 28, 2014, 00:11
Default
  #3
New Member
 
Jackson Sim
Join Date: Apr 2014
Posts: 7
Rep Power: 12
reformat is on a distinguished road
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 */
real H2O;
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 */
real conc_H2O;
conc_H2O = H2O * rho / mw_0;

Hope this helps
reformat is offline   Reply With Quote

Old   June 23, 2014, 18:31
Default
  #4
New Member
 
Kostis Chatzi
Join Date: Apr 2014
Location: Greece
Posts: 20
Rep Power: 12
kostis217 is on a distinguished road
thanks for your response
kostis217 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


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 03:51
UDF for catalyst volumetric reaction, temperature overshoot though rate is small elmcmaster FLUENT 0 October 11, 2010 10:37
Stain Rate UDF esinticik FLUENT 0 September 10, 2009 15:04
calculation average pressure in a plane with UDF Vitalij FLUENT 1 April 10, 2007 04:39
UDF about reaction rate Julien FLUENT 0 June 30, 2005 13:23


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