|
[Sponsors] |
Error in compiling a Volume Reaction Rate UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 6, 2018, 21:04 |
Error in compiling a Volume Reaction Rate UDF
|
#1 |
New Member
Henrique Coutinho
Join Date: Aug 2018
Posts: 3
Rep Power: 8 |
Hi everyone,
I have tried to compile a UDF that I have written for a specific volume reaction rate for enzyme inactivation in foods. I don't know why, but Fluent suddenly stops after I push the button "build" in the panel. I also tried to interpret the UDF, instead of compile it, but in this case, the following message appears on the screen: "Error: ... line 17: structure reference not implemented". I can't see the error in the source file. I would be glad if someone could give some tips to solve my problem. The UDF is presented below: #include "udf.h" #define DREF1 2.184e3 #define DREF2 7.353e1 #define AA 7.796e-1 #define Z1 4.63 #define Z2 1.0e2 #define TREF 3.5315e2 DEFINE_VR_RATE(user_rate, c, t, r, mole_weight, species_mf, rr) { real temper=C_T(c,t); real D1 = DREF1*pow(10.0,((TREF-temper)/Z1)); real D2 = DREF2*pow(10.0,((TREF-temper)/Z2)); real s1 = species_mf[0]; real mw1 = mole_weight[0]; if(STREQ(r->name,"reaction-1")){ *rr=-AA*(2.3026/D1)*s1/mw1-(1-AA)*(2.3026/D2)*s1/mw1; } } |
|
August 7, 2018, 03:45 |
|
#2 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Your line
Code:
DEFINE_VR_RATE(user_rate, c, t, r, mole_weight, species_mf, rr) In the Fluent help: Quote:
has eight arguments. So you missed something in your definition of your udf... |
||
August 7, 2018, 08:00 |
|
#3 |
New Member
Henrique Coutinho
Join Date: Aug 2018
Posts: 3
Rep Power: 8 |
Thanks for your reply!
I think this is not the problem. The last argument in the macro is "rr_t", which is used for turbulent reaction flow, I guess! And this is not the case. I think it has to to with "STREQ", but I have seen many examples of this, and I could not figure out what is wrong. Now, I try to compile it, and some "nmake" error appears... |
|
August 7, 2018, 08:56 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
While it might not cause your current problem, it is wrong, and you should fix it. Just add another argument...
I tried to compile your UDF, and it worked perfectly. Do you have this problem only with this UDF, or with all UDfs that you try to compile? |
|
August 7, 2018, 13:57 |
|
#5 |
New Member
Henrique Coutinho
Join Date: Aug 2018
Posts: 3
Rep Power: 8 |
I tried with another UDF but the same happened again. What is the Fluent and Visual Studio version that you use?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluent UDF urgent! Variable reaction rate | natantyt | Fluent UDF and Scheme Programming | 8 | October 17, 2021 04:35 |
UDF code help solve reaction rate equation palm oil | zirkov | Fluent UDF and Scheme Programming | 0 | February 13, 2017 11:34 |
Error:surface reaction rate UDF in 2D porous media | Ludaer | Fluent UDF and Scheme Programming | 2 | December 15, 2016 08:49 |
Unit of rate in udf of a surface reaction | borhan_sd@yahoo.com | Fluent UDF and Scheme Programming | 0 | June 11, 2013 04:28 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 06:42 |