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

How do I know wich species has which integer value?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 3 Post By gearboy
  • 1 Post By sega

Reply
 
LinkBack Thread Tools Display Modes
Old   March 7, 2010, 07:17
Default How do I know wich species has which integer value?
  #1
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11
sega is on a distinguished road
For the usage of

Code:
C_YI(cell,thread,i)
I need to know which species hides behind the integer i!

How can I know this?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 7, 2010, 11:34
Default
  #2
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11
sega is on a distinguished road
May this be the list from the GUI:

Materials / Mixture / Properties: Mixture Species / Edit / Selected Species ?

Is there a way to search for a specific species in this list?
Just to make sure I got the right one?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 8, 2010, 03:34
Default
  #3
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 106
Rep Power: 7
gearboy is on a distinguished road
Quote:
Originally Posted by sega View Post
May this be the list from the GUI:

Materials / Mixture / Properties: Mixture Species / Edit / Selected Species ?

Is there a way to search for a specific species in this list?
Just to make sure I got the right one?
This is an example for printing the species information on the console.
#include "udf.h"
DEFINE_ON_DEMAND(species_list)
{
int i = -1;
char *spe_name;
Domain *d=NULL;
Material *mix_mat=NULL;
d=Get_Domain(1);
mix_mat= mixture_material(d);
mixture_species_loop_i(mix_mat,i)
{
spe_name=MIXTURE_SPECIE_NAME(mix_mat,i);
Message0("species index=%d,species name=%s\n",i,spe_name);
}
}
gearboy is offline   Reply With Quote

Old   March 8, 2010, 07:09
Default
  #4
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11
sega is on a distinguished road
Quote:
Originally Posted by gearboy View Post
This is an example for printing the species information on the console.
#include "udf.h"
DEFINE_ON_DEMAND(species_list)
{
int i = -1;
char *spe_name;
Domain *d=NULL;
Material *mix_mat=NULL;
d=Get_Domain(1);
mix_mat= mixture_material(d);
mixture_species_loop_i(mix_mat,i)
{
spe_name=MIXTURE_SPECIE_NAME(mix_mat,i);
Message0("species index=%d,species name=%s\n",i,spe_name);
}
}
Just great!
Thank you!
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 8, 2010, 09:25
Default how i can open the gambit file in fluent please tell me the saving file name ,
  #5
New Member
 
sunny rajpal
Join Date: Nov 2009
Posts: 1
Rep Power: 0
chemicalsunnyraj is an unknown quantity at this point
i have 6.3 fluent edison
chemicalsunnyraj is offline   Reply With Quote

Old   March 8, 2010, 09:30
Default
  #6
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11
sega is on a distinguished road
Quote:
Originally Posted by chemicalsunnyraj View Post
i have 6.3 fluent edison
How is this related to the topic?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   October 9, 2010, 16:58
Default
  #7
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 76
Rep Power: 7
Wikie is on a distinguished road
Hi,
I also have to know the numbers for the species, but I don't know how to run this code :-( Can anybody explain how I get this information out of this code? I also tried to copy the code and paste it into the console. I also tried to compile this code, but I don't know how to start it.

cheers
wikie


Quote:
Originally Posted by gearboy View Post
This is an example for printing the species information on the console.
#include "udf.h"
DEFINE_ON_DEMAND(species_list)
{
int i = -1;
char *spe_name;
Domain *d=NULL;
Material *mix_mat=NULL;
d=Get_Domain(1);
mix_mat= mixture_material(d);
mixture_species_loop_i(mix_mat,i)
{
spe_name=MIXTURE_SPECIE_NAME(mix_mat,i);
Message0("species index=%d,species name=%s\n",i,spe_name);
}
}

Last edited by Wikie; October 9, 2010 at 17:36.
Wikie is offline   Reply With Quote

Old   October 10, 2010, 09:01
Default
  #8
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11
sega is on a distinguished road
Quote:
Originally Posted by Wikie View Post
Hi,
I also have to know the numbers for the species, but I don't know how to run this code :-( Can anybody explain how I get this information out of this code? I also tried to copy the code and paste it into the console. I also tried to compile this code, but I don't know how to start it.

cheers
wikie
1. Read the manuel about UDF.
2. Save the code as *.c file.
3. In FLUENT go to menu: Define > User-Defined > Functions > Compiled ...
4. Add the c-File (Source File)
5. Click Load
6. FLUENT menu: Define > User-Defined > Execute on demand
7. Choose the function
8. Output appears. Done!
m.beh likes this.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   October 10, 2010, 09:20
Default
  #9
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 76
Rep Power: 7
Wikie is on a distinguished road
Hi Sega,

thanks a lot. I've already done nr. 1-5, but didn't know how to execute this file. Now it's working fine.

Thanks
wikie
Wikie is offline   Reply With Quote

Old   April 15, 2013, 10:50
Question
  #10
Member
 
Join Date: Jul 2012
Posts: 41
Rep Power: 5
Abhya is on a distinguished road
Quote:
Originally Posted by Wikie View Post
Hi,
I also have to know the numbers for the species, but I don't know how to run this code :-( Can anybody explain how I get this information out of this code? I also tried to copy the code and paste it into the console. I also tried to compile this code, but I don't know how to start it.

cheers
wikie
Wow!
thanks a lot That was so helpful to me! saved so much of my time!

Btw fluent manual (12.0 version) doesn't list anything about this macros right?? Plz correct me if i'm wrong!
where u got the info on using these macros????
Abhya is offline   Reply With Quote

Old   April 15, 2013, 10:59
Default
  #11
Member
 
Join Date: Jul 2012
Posts: 41
Rep Power: 5
Abhya is on a distinguished road
Hey I found another simple way to access the species index using macro - SV_SpeciesIndex("species_name")
species_name should exactly be the name we see in the Models-> Species transport panel!

Refer the following code for example :

Code:
#include "udf.h"
DEFINE_ON_DEMAND(M_species_list)
{
int i;

i = SV_SpeciesIndex("h2o");

Message("species index=%d,species name=h2o\n",i);

}
Abhya is offline   Reply With Quote

Old   April 17, 2013, 04:40
Default
  #12
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 106
Rep Power: 7
gearboy is on a distinguished road
Great job!

Quote:
Originally Posted by Abhya View Post
Hey I found another simple way to access the species index using macro - SV_SpeciesIndex("species_name")
species_name should exactly be the name we see in the Models-> Species transport panel!

Refer the following code for example :

Code:
#include "udf.h"
DEFINE_ON_DEMAND(M_species_list)
{
int i;
 
i = SV_SpeciesIndex("h2o");
 
Message("species index=%d,species name=h2o\n",i);
 
}
gearboy is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modelling Biomass Combustion via Species Transport Racheal FLUENT 29 June 4, 2015 19:48
PB: Saving mass fraction of species on two points with an udf biget.a FLUENT 2 July 23, 2009 03:06
Species order fluent Raddi FLUENT 1 March 13, 2009 01:21
mass fraction of species Ahmed FLUENT 0 April 18, 2007 11:57
How to specify surface flux of a species? ked FLUENT 16 February 9, 2006 21:14


All times are GMT -4. The time now is 08:36.