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

udf-Surface Reaction Rate-parse error in line 34

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2014, 04:44
Default udf-Surface Reaction Rate-parse error in line 34
  #1
New Member
 
hena
Join Date: Aug 2014
Posts: 1
Rep Power: 0
priya_1985 is on a distinguished road
hello all,
i m new to c. i m trying to write Udf for surface reaction rate, which is showing parse error in line 34. can any buddy help to correct this.


#include "udf.h"

/* ARRHENIUS CONSTANTS */
#define PRE_EXP 1e+19
#define ACTIVE 2.22e+05
#define BETA 0.0

real arrhenius_rate(real temp)
{
return
PRE_EXP*pow(temp,BETA)*exp(-ACTIVE/(UNIVERSAL_GAS_CONSTANT*temp));
}

/* Species numbers. Must match order in Fluent panel */
#define h2o 0
#define n2 1
#define co 3.5
#define c7h5n3o6 1
#define c 3.5
#define NUM_SPECS 5

/* Reaction Exponents */
#define h2o_EXP 0
#define n2_EXP 0
#define co_EXP 0
#define c7h5n3o6_EXP 1
#define c_EXP 0

#define MW_c7h5n3o6 227.13
#define STOIC_c7h5n3o6 1.0

/* Reaction Rate Routine */

real reaction_rate(cell_t c,Thread *cthread,real mw[],real yi[])
{
real concenc7h5n3o6 = C_R(c,cthread)*(yi[c7h5n3o6]/mw[c7h5n3o6]);
return arrhenius_rate(C_T(c,cthread))*pow(real concenc7h5n3o6,c7h5n3o6_EXP);
}
priya_1985 is offline   Reply With Quote

Old   November 10, 2014, 03:48
Default
  #2
New Member
 
hana
Join Date: May 2014
Posts: 23
Rep Power: 12
bluenail is on a distinguished road
First of all,

there is no type of UDF function you upload

real reaction_rate(cell_t c,Thread *cthread,real mw[],real yi[])

UDF function name is like this

Section 2.3.1: DEFINE CHEM STEP
 Section 2.3.2: DEFINE CPHI
 Section 2.3.3: DEFINE DIFFUSIVITY
 Section 2.3.4: DEFINE DOM DIFFUSE REFLECTIVITY
 Section 2.3.5: DEFINE DOM SOURCE
 Section 2.3.6: DEFINE DOM SPECULAR REFLECTIVITY
 Section 2.3.7: DEFINE GRAY BAND ABS COEFF
 Section 2.3.8: DEFINE HEAT FLUX
 Section 2.3.9: DEFINE NET REACTION RATE
 Section 2.3.10: DEFINE NOX RATE
 Section 2.3.11: DEFINE PR RATE
 Section 2.3.12: DEFINE PRANDTL UDFs
 Section 2.3.13: DEFINE PROFILE
 Section 2.3.14: DEFINE PROPERTY UDFs
 Section 2.3.15: DEFINE SCAT PHASE FUNC
 Section 2.3.16: DEFINE SOLAR INTENSITY
 Section 2.3.17: DEFINE SOURCE
 Section 2.3.18: DEFINE SOX RATE
 Section 2.3.19: DEFINE SR RATE
 Section 2.3.20: DEFINE TURB PREMIX SOURCE
 Section 2.3.21: DEFINE TURBULENT VISCOSITY
 Section 2.3.22: DEFINE VR RATE
 Section 2.3.23: DEFINE WALL FUNCTIONS
bluenail is offline   Reply With Quote

Reply


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
Defining reaction rate with multiple surface reaction Fred Marias FLUENT 1 September 12, 2013 05:56
1.7.x Environment Variables on Linux 10.04 rasma OpenFOAM Installation 9 July 30, 2010 05:43
Problems of Duns Codes! Martin J Main CFD Forum 8 August 15, 2003 00:19
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


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