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

reaction in a cel zone

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 26, 2019, 12:47
Question reaction in a cel zone
  #1
New Member
 
ahmed mezer
Join Date: Feb 2019
Posts: 2
Rep Power: 0
AhmedM is on a distinguished road
hello... if i have a volumtric reaction rate and want it to occur in a selected cell zone that have ID=8 is this code right or what i need to correct it...
please reply
//////////////////////////////////////////////////////////
#include "udf.h"
thread_loop_f(f_thread, domain)
{
if (THREAD_ID(f_thread) == 8)
{
DEFINE_VR_RATE(user_rate, c, t, r, mole_weight, species_mf, rr)
{
real temp=C_T(c,t);
real D=15.0/pow(9.0,((temp-100.0)/9.0));
real s1 = species_mf[0];
real mw1 = mole_weight[0];
*rr=(2.303/D)*s1*mw1;
}
}
}
AhmedM is offline   Reply With Quote

Old   July 29, 2019, 00:05
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
#include "udf.h"
#include "math.h"

DEFINE_VR_RATE(user_rate, c, t, r, mole_weight, species_mf, rr)
{
real temp,D,s1,mw1;
temp=C_T(c,t);
if (THREAD_ID(t) == 8) 
{
D=15.0/pow(9.0,((temp-100.0)/9.0));
s1 = species_mf[0];
mw1 = mole_weight[0];
*rr=(2.303/D)*s1*mw1;
}
}
best regards
AlexanderZ is offline   Reply With Quote

Reply

Tags
fluent - udf, udf


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
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 10:52
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
Segmentation fault in running alternateSteadyReactingFoam,why? NewKid OpenFOAM 18 January 20, 2011 16:55
chemical reaction - decompostition La S. Hyuck CFX 1 May 23, 2001 00:07


All times are GMT -4. The time now is 17:48.