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

one quastion about r->reactant[i]

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gearboy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2011, 15:59
Default one quastion about r->reactant[i]
  #1
New Member
 
Join Date: Nov 2010
Posts: 19
Rep Power: 15
m.beh is on a distinguished road
hi

I am writing a udf for a volumetric reaction rate, (there is a example in fluent udf manual).
If I want to reach a specific species properties, I should use
r->reactant[i]
i is the index of my species.

I wonder how can I found my species index.

for example I have a 3 gasses in my gas phase as mixture.
in the species dialog box under selected species I have:
CO
H2
O2
so is it true that their index are:
CO->0
H2->1
O2->2
and when i write
r->reactant[1] it is equal to H2?

or their index are arrange by their order in the reactions dialog box?
m.beh is offline   Reply With Quote

Old   August 7, 2011, 21:23
Default
  #2
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by m.beh View Post
hi

I am writing a udf for a volumetric reaction rate, (there is a example in fluent udf manual).
If I want to reach a specific species properties, I should use
r->reactant[i]
i is the index of my species.

I wonder how can I found my species index.

for example I have a 3 gasses in my gas phase as mixture.
in the species dialog box under selected species I have:
CO
H2
O2
so is it true that their index are:
CO->0
H2->1
O2->2
and when i write
r->reactant[1] it is equal to H2?

or their index are arrange by their order in the reactions dialog box?
If you want to store H2 and O2 index into H2_Num,O2_Num, then
//-----------------------------------------
int H2_Num,O2_Num,spe;
char *spe_name;
Domain*domain;
Material*mix_mat;
domain=Get_Domain(1);
mix_mat= mixture_material(domain);
mixture_species_loop_i(mix_mat,spe)
{
spe_name=MIXTURE_SPECIE_NAME(mix_mat,spe);
if(STREQ("H2",spe_name))
{
H2_Num=spe;
}
if(STREQ("O2",spe_name))
{
O2_Num=spe;
}

}
m.beh likes this.
gearboy is offline   Reply With Quote

Old   August 8, 2011, 03:47
Default thank you
  #3
New Member
 
Join Date: Nov 2010
Posts: 19
Rep Power: 15
m.beh is on a distinguished road
it is very use full and I use your code as ececute on demand
m.beh 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
quastion about a double stream tubetube model Eric Main CFD Forum 1 September 15, 2021 16:13


All times are GMT -4. The time now is 12:42.