|
[Sponsors] |
How to specify to the reaction by UDF? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 22, 2016, 11:00 |
How to specify to the reaction by UDF?
|
#1 |
New Member
luong hung truyen
Join Date: Sep 2016
Posts: 10
Rep Power: 10 |
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) } } " |
|
October 7, 2019, 19:25 |
Question
|
#2 |
Member
abdo
Join Date: Apr 2018
Posts: 42
Rep Power: 7 |
hello dear
I would to ask you if your problem solved or not yet thank you |
|
July 1, 2020, 01:01 |
|
#3 |
New Member
luong hung truyen
Join Date: Sep 2016
Posts: 10
Rep Power: 10 |
Not Yet!
If anyone knows the solution, please help us! Sincerely, |
|
November 19, 2020, 00:31 |
|
#4 |
New Member
hesam
Join Date: Jul 2020
Posts: 6
Rep Power: 6 |
Hello
Have your code problem been solved? |
|
November 19, 2020, 01:22 |
|
#5 |
New Member
luong hung truyen
Join Date: Sep 2016
Posts: 10
Rep Power: 10 |
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 |
|
November 19, 2020, 02:41 |
|
#6 | |
New Member
hesam
Join Date: Jul 2020
Posts: 6
Rep Power: 6 |
Quote:
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 |
||
November 19, 2020, 04:20 |
|
#7 |
New Member
luong hung truyen
Join Date: Sep 2016
Posts: 10
Rep Power: 10 |
||
November 20, 2020, 10:55 |
|
#8 |
Member
abdo
Join Date: Apr 2018
Posts: 42
Rep Power: 7 |
||
March 27, 2023, 03:41 |
|
#9 | |
New Member
Mihir
Join Date: Mar 2023
Posts: 2
Rep Power: 0 |
Quote:
Thanks in advance. |
||
March 27, 2023, 03:44 |
|
#10 | |
New Member
Mihir
Join Date: Mar 2023
Posts: 2
Rep Power: 0 |
Quote:
|
||
February 9, 2024, 02:35 |
Request for UDF Code
|
#11 |
New Member
Karnataka
Join Date: Jan 2024
Posts: 8
Rep Power: 2 |
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. |
|
Tags |
multiple reaction, reaction rate, udf code |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
surface reaction UDF | jeniuswx | Fluent UDF and Scheme Programming | 2 | August 8, 2017 13:06 |
UDF for volumetric reaction rate | Boniface Omar | Fluent UDF and Scheme Programming | 0 | July 25, 2016 03:39 |
Help! reaction udf for multiphase | m_amiri | Fluent UDF and Scheme Programming | 2 | January 15, 2015 10:54 |
surface reaction UDF | jeniuswx | Fluent UDF and Scheme Programming | 2 | April 11, 2013 04:33 |
UDF : Chemical Reaction in Catalytic Converter | adhimac | FLUENT | 1 | March 27, 2001 15:04 |