|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Vyacheslav Papkov
Join Date: May 2022
Posts: 5
Rep Power: 4 ![]() |
Hi everyone!
I have a problem in UDF in steam conversion of methane. The problem in 2D, transient, when hydrogen appears and is carried away from the generation zone, an error occurs. Could you please suggest what is wrong with my UDF? #include "udf.h" #define A1 2.448e6 #define H1 1.165e8 DEFINE_VR_RATE(vol_reac_rate,c,t,r,wk,yk,rate,rr_t ) { real ci, prod, K1, DEN; int i; if (!strcmp(r->name, "reaction-1")) { prod = 1.; K1 = A1 * exp( - H1 / (UNIVERSAL_GAS_CONSTANT * C_T(c,t))); if (yk[2]==0) DEN = 1; else DEN = pow((1 + K1*wk[2]*yk[0]/(yk[2]*wk[0])),2.0); 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]); } for(i = 0; i < r->n_products; i++) { if (yk[r->product[i]]==0) prod *= 1; else { ci = C_R(c,t) * yk[r->product[i]] / wk[r->product[i]]; prod *= pow(ci, r->exp_product[i]); } } *rate = r->A * exp( - r->E / (UNIVERSAL_GAS_CONSTANT * C_T(c,t))) * pow(C_T(c,t), r->b) * prod / DEN; *rr_t = *rate; } else { 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; *rr_t = *rate; } } Thank you, everyone. |
|
![]() |
![]() |
![]() |
Tags |
cfd, fluent - udf, fluent - udf - parallel |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 17:22 |
Running Fluent from Python: UDF Compilation problems | Ames | Fluent UDF and Scheme Programming | 5 | November 16, 2020 06:12 |
volume flow rate for outlet boundry condition and dfine udf for it | raminostadi | FLUENT | 0 | December 24, 2016 01:52 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 09:56 |
Transient pressure UDF for parallel fluent | droberts | Fluent UDF and Scheme Programming | 5 | October 11, 2010 04:13 |