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

Reaction rate under multi phases

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 16, 2012, 22:34
Default Reaction rate under multi phases
  #1
New Member
 
kong
Join Date: Sep 2011
Posts: 21
Rep Power: 5
kongl1986 is on a distinguished road
I want to write a UDF about reaction rate using DEFINE_VR_RATE.

#include "udf.h"
DEFINE_VR_RATE(vol_reac_rate,c,t,r,wk,yk,rate,rr_t )
{
real ci,prod;
int i;
prod=1.;
for(i=0;i<r->n_reactants;i++)
{
ci=C_R(c,t)*yk[r->reactant[i]]/wk[r->reactant[i]];
prod*=pow(ci,r->exp_reactant[i]);
}
*rate=r->A*exp(-r->E/(UNIVERSAL_GAS_CONSTANT*C_T(c,t)))*pow(C_T(c,t),r->b)*prod*(1-C_VOF(c,t));
*rr_t=*rate;
}


here Thread *t pointer to cell thread on which the volumetric reaction rate is to be applied.
1-C_VOF(c,t) is the volume fraction of second phase.
If there are more than two phases,
how can i specify the variables of the phases which are not applied by the reaction rate.

thank you
kongl1986 is offline   Reply With Quote

Old   February 16, 2012, 22:58
Default
  #2
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 105
Rep Power: 7
gearboy is on a distinguished road
Quote:
Originally Posted by kongl1986 View Post
I want to write a UDF about reaction rate using DEFINE_VR_RATE.

#include "udf.h"
DEFINE_VR_RATE(vol_reac_rate,c,t,r,wk,yk,rate,rr_t )
{
real ci,prod;
int i;
prod=1.;
for(i=0;i<r->n_reactants;i++)
{
ci=C_R(c,t)*yk[r->reactant[i]]/wk[r->reactant[i]];
prod*=pow(ci,r->exp_reactant[i]);
}
*rate=r->A*exp(-r->E/(UNIVERSAL_GAS_CONSTANT*C_T(c,t)))*pow(C_T(c,t),r->b)*prod*(1-C_VOF(c,t));
*rr_t=*rate;
}


here Thread *t pointer to cell thread on which the volumetric reaction rate is to be applied.
1-C_VOF(c,t) is the volume fraction of second phase.
If there are more than two phases,
how can i specify the variables of the phases which are not applied by the reaction rate.

thank you
I think (c,t) is the mixture, if you want to get vof of second phase, you shoud first use THREAD_SUB_THREAD to get the thread of second phase, says t_second_phase. then get its vof by C_VOF(c,t_second_phase)
gearboy is offline   Reply With Quote

Old   February 16, 2012, 23:38
Default
  #3
New Member
 
kong
Join Date: Sep 2011
Posts: 21
Rep Power: 5
kongl1986 is on a distinguished road
as described in help manual,
Thread *t pointer to cell thread on which the volumetric reaction rate is to be applied.
So i think t is only the phase applied the reaction rate , not the mixture.
I have tried
Thread***pt*=*THREAD_SUB_THREADS(t);
*Thread**tp*=*pt[0];
*Thread**ts*=*pt[1];
But fluent shows wrong.
BTW, I should define the phase before DEFINE_VR_RATE or after it?
kongl1986 is offline   Reply With Quote

Old   September 7, 2012, 08:43
Default
  #4
New Member
 
Join Date: Jul 2012
Posts: 19
Rep Power: 4
ravindra is on a distinguished road
hey friend did u find solution to your problem i m having the same problem i.e
whether t pointer to thread passed as argument in DEFINE_VR_RATE is for mixture level or for that particular reactive phase ?
ravindra is offline   Reply With Quote

Reply

Tags
phase, reaction rate

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF example for multi reaction in phases error3361 Fluent UDF and Scheme Programming 0 March 4, 2011 16:49
Segmentation fault in running alternateSteadyReactingFoam,why? NewKid OpenFOAM 18 January 20, 2011 17:55
UDF for catalyst volumetric reaction, temperature overshoot though rate is small elmcmaster FLUENT 0 October 11, 2010 09:37
UDF changing the rate exponent of a reaction Stefan H Fluent UDF and Scheme Programming 0 September 16, 2009 13:20
chemical reaction - decompostition La S. Hyuck CFX 1 May 23, 2001 00:07


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