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

How to specify to the reaction by UDF?

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 3 Post By luonghungtruyen
  • 1 Post By khaledhmz
  • 1 Post By luonghungtruyen
  • 1 Post By hesamna
  • 2 Post By luonghungtruyen
  • 1 Post By luonghungtruyen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2016, 10:00
Default How to specify to the reaction by UDF?
  #1
New Member
 
luong hung truyen
Join Date: Sep 2016
Posts: 10
Rep Power: 9
luonghungtruyen is on a distinguished road
Dear everyone!
I am writing udf code for 2step-reaction of methane-air. When I compiled, the FLuent announced the parse error at line 18 (if (STREQ(0)) . It means that I used the wrong command to specify the first reaction.
I'd like to post my udf code as below.
Would you please teach me how to write a command to specify to the reaction?
I am very thankful to you so much!

"
#include "udf.h"
DEFINE_VR_RATE(vol_reac_rate, c, domain, r, mw, yi, rate,rr)
{
Thread *c_thread;

real cCH4,cO2,cCO,cCO2,cH2O;
thread_loop_c(c_thread, domain)
{

/* Calculate Arrhenius reaction rate */

begin_c_loop(c,c_thread)
{

/* specify 1st step: CH4+3/2O2=CO+2H2O */
if (STREQ(0))
{
cCH4 = C_R(c,c_thread) * C_YI(c,c_thread,0) / mw[0];
cO2 = C_R(c,c_thread) * C_YI(c,c_thread,1) / mw[1];
*rate = 2.8e9* exp( - 2.025e8/ (8314.459848 * C_T(c,c_thread))) * pow(cCH4,-0.3) *pow(cO2,1.3);
*rr = *rate;
}
/* specify 2nd step: CO+1/2O2=CO2 */
else (STREQ(1))
{
cO2 = C_R(c,c_thread) * C_YI(c,c_thread,1) / mw[1];
cCO = C_R(c,c_thread) * C_YI(c,c_thread,2) / mw[2];
cH2O = C_R(c,c_thread) * C_YI(c,c_thread,3) / mw[3];
*rate = 2.23e12* exp( - 1.67e8/ (8314.459848 * C_T(c,c_thread))) *cCO* pow(cH2O,0.5) *pow(cO2,0.25);
*rr = *rate;
}
}
end_c_loop(c,c_thread)
}
}

"
khaledhmz, hesamna and MIHIR DUTTA like this.
luonghungtruyen is offline   Reply With Quote

Old   October 7, 2019, 18:25
Smile Question
  #2
Member
 
abdo
Join Date: Apr 2018
Posts: 42
Rep Power: 7
khaledhmz is an unknown quantity at this point
hello dear
I would to ask you if your problem solved or not yet

thank you
luonghungtruyen likes this.
khaledhmz is offline   Reply With Quote

Old   July 1, 2020, 00:01
Default
  #3
New Member
 
luong hung truyen
Join Date: Sep 2016
Posts: 10
Rep Power: 9
luonghungtruyen is on a distinguished road
Not Yet!
If anyone knows the solution, please help us!

Sincerely,
khaledhmz likes this.
luonghungtruyen is offline   Reply With Quote

Old   November 18, 2020, 23:31
Default
  #4
New Member
 
hesam
Join Date: Jul 2020
Posts: 6
Rep Power: 5
hesamna is on a distinguished road
Hello
Have your code problem been solved?
luonghungtruyen likes this.
hesamna is offline   Reply With Quote

Old   November 19, 2020, 00:22
Default
  #5
New Member
 
luong hung truyen
Join Date: Sep 2016
Posts: 10
Rep Power: 9
luonghungtruyen is on a distinguished road
Hello everyone!

I found the solution to this problem.

1. To define the multi-reactions in fluent by UDF. I follow the structure of UDF codes, as presented in this site: http://jullio.pe.kr/fluent6.1/help/html/udf/node80.htm

2. You build the code and hook the macro.

3. You also define multi-reactions for the model of fuel-oxidizer
hesamna and MIHIR DUTTA like this.
luonghungtruyen is offline   Reply With Quote

Old   November 19, 2020, 01:41
Default
  #6
New Member
 
hesam
Join Date: Jul 2020
Posts: 6
Rep Power: 5
hesamna is on a distinguished road
Quote:
Originally Posted by luonghungtruyen View Post
Hello everyone!

I found the solution to this problem.

1. To define the multi-reactions in fluent by UDF. I follow the structure of UDF codes, as presented in this site: http://jullio.pe.kr/fluent6.1/help/html/udf/node80.htm

2. You build the code and hook the macro.

3. You also define multi-reactions for the model of fuel-oxidizer
Thanks for your kind response.
May I know where or what caused issue in your code?
Or May I ask you to shear the corrected above UDF with us?

I really appreciate your help
hesamna is offline   Reply With Quote

Old   November 19, 2020, 03:20
Default
  #7
New Member
 
luong hung truyen
Join Date: Sep 2016
Posts: 10
Rep Power: 9
luonghungtruyen is on a distinguished road
Quote:
Originally Posted by hesamna View Post
Thanks for your kind response.
May I know where or what caused issue in your code?
Or May I ask you to shear the corrected above UDF with us?

I really appreciate your help

Thank you for your interest!

Please check the inbox!
khaledhmz likes this.
luonghungtruyen is offline   Reply With Quote

Old   November 20, 2020, 09:55
Default
  #8
Member
 
abdo
Join Date: Apr 2018
Posts: 42
Rep Power: 7
khaledhmz is an unknown quantity at this point
Quote:
Originally Posted by luonghungtruyen View Post
Thank you for your interest!

Please check the inbox!
hello bro, can you sent me too, I still having problems with this

thanks in advance
khaledhmz is offline   Reply With Quote

Old   March 27, 2023, 02:41
Default
  #9
New Member
 
Mihir
Join Date: Mar 2023
Posts: 2
Rep Power: 0
MIHIR DUTTA is on a distinguished road
Quote:
Originally Posted by luonghungtruyen View Post
Hello everyone!

I found the solution to this problem.

1. To define the multi-reactions in fluent by UDF. I follow the structure of UDF codes, as presented in this site: http://jullio.pe.kr/fluent6.1/help/html/udf/node80.htm

2. You build the code and hook the macro.

3. You also define multi-reactions for the model of fuel-oxidizer
would yo ulike to share with me above three procedures?
Thanks in advance.
MIHIR DUTTA is offline   Reply With Quote

Old   March 27, 2023, 02:44
Default
  #10
New Member
 
Mihir
Join Date: Mar 2023
Posts: 2
Rep Power: 0
MIHIR DUTTA is on a distinguished road
Quote:
Originally Posted by luonghungtruyen View Post
Hello everyone!

I found the solution to this problem.

1. To define the multi-reactions in fluent by UDF. I follow the structure of UDF codes, as presented in this site: http://jullio.pe.kr/fluent6.1/help/html/udf/node80.htm

2. You build the code and hook the macro.

3. You also define multi-reactions for the model of fuel-oxidizer
Can you please tell me what is the step by step way to use the above link.
MIHIR DUTTA is offline   Reply With Quote

Old   February 9, 2024, 01:35
Default Request for UDF Code
  #11
New Member
 
Karnataka
Join Date: Jan 2024
Posts: 7
Rep Power: 2
SUDEEPNSHARSHA is on a distinguished road
Hello Sir,
I am trying to write a code for Steam Methane Reaction.
It would be very much helpful, if you could share me your code.
Thanks in advance.
SUDEEPNSHARSHA is offline   Reply With Quote

Reply

Tags
multiple reaction, reaction rate, udf code


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
surface reaction UDF jeniuswx Fluent UDF and Scheme Programming 2 August 8, 2017 12:06
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
surface reaction UDF jeniuswx Fluent UDF and Scheme Programming 2 April 11, 2013 03:33
UDF : Chemical Reaction in Catalytic Converter adhimac FLUENT 1 March 27, 2001 14:04


All times are GMT -4. The time now is 18:33.