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

UDF for Reversible Reaction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 1, 2023, 22:53
Default UDF for Reversible Reaction
  #1
New Member
 
Join Date: May 2021
Location: Australia
Posts: 11
Rep Power: 5
Bluewhale is on a distinguished road
Hi,

I'm trying to get a reversible reaction going based on species concentrations.

CH4 (+Cs-H*) <-> CH3* + H*(+Cs-H*)

Is it possible to run a reversible reaction with the code below?


DEFINE_VR_RATE(myrate,c,t,r,mw,yi,rr,rr_t)

{
#if !RP_HOST
if (!strcmp(r->name, "reaction-46") && C_DPMS_SURF_YI(c,t,1)>0 )
{


real area=0,dia=0;

dia = pow((C_DPMS_SURF_YI(c,t,1)*C_VOLUME(c,t)*6/(2230*M_PI)),0.3333);
area=M_PI*dia*dia;
real rforward,diap,rbackward,keq,molconch4,molconch3,mo lconh;
char cuser[30];
molconch4=C_YI(c,t,4)*C_R(c,t)/(16.04*0.001);
molconch3 = C_YI(c,t,3)/(15.035*0.001)*C_R(c,t);
molconh = C_YI(c,t,1)/(1.00797*0.001)*C_R(c,t);
rforward=1e-11*molconch4*area*1.17e-11*pow(C_T(c,t),0.5);
if(molconch3>0 && molconh>0 && molconch4 >0)
{
keq= (molconch4)/(molconch3*molconh);
rbackward= rforward/keq;
*rr= -1*(rforward-rbackward);
}
else if (molconch3>0 && molconh>0 && molconch4 ==0)
*rr=rbackward;
else if(molconch3==0 && molconh==0 && molconch4 >0)
*rr=-1*rforward;
else
*rr=0;
}
Bluewhale is offline   Reply With Quote

Reply

Tags
chemical equilibrium, reaction kinetics, reversible reaction


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 Reaction Rate Vidushi Fluent UDF and Scheme Programming 5 May 27, 2020 07:48
UDF for Species transport reaction kirti verma Fluent UDF and Scheme Programming 2 June 13, 2019 02:21
UDF for volumetric reaction rate Boniface Omar Fluent UDF and Scheme Programming 0 July 25, 2016 02:39
Help! reaction udf for multiphase m_amiri Fluent UDF and Scheme Programming 2 January 15, 2015 09:54
UDF : Chemical Reaction in Catalytic Converter adhimac FLUENT 1 March 27, 2001 14:04


All times are GMT -4. The time now is 16:08.