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

Fluent, UDF volume rate transient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 26, 2023, 22:41
Smile Fluent, UDF volume rate transient
  #1
New Member
 
Vyacheslav Papkov
Join Date: May 2022
Posts: 5
Rep Power: 4
ChRiZZ is on a distinguished road
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.
ChRiZZ is offline   Reply With Quote

Reply

Tags
cfd, fluent - udf, fluent - udf - parallel


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
Running Fluent from Python: UDF Compilation problems Ames Fluent UDF and Scheme Programming 5 November 16, 2020 07:12
volume flow rate for outlet boundry condition and dfine udf for it raminostadi FLUENT 0 December 24, 2016 02:52
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
Transient pressure UDF for parallel fluent droberts Fluent UDF and Scheme Programming 5 October 11, 2010 05:13


All times are GMT -4. The time now is 02:41.