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

How do I know wich species has which integer value?

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 5 Post By gearboy
  • 2 Post By sega
  • 1 Post By Abhya
  • 1 Post By DrMaMad

Reply
 
LinkBack Thread Tools Search this Thread 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: 20
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: 20
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
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
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: 20
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: 20
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, 17:58
Default
  #7
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 83
Rep Power: 17
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 18:36.
Wikie is offline   Reply With Quote

Old   October 10, 2010, 10:01
Default
  #8
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
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 and chaitanyaarige like 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, 10:20
Default
  #9
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 83
Rep Power: 17
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, 11:50
Question
  #10
Member
 
Join Date: Jul 2012
Posts: 48
Rep Power: 14
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????
chaitanyaarige likes this.
Abhya is offline   Reply With Quote

Old   April 15, 2013, 11:59
Default
  #11
Member
 
Join Date: Jul 2012
Posts: 48
Rep Power: 14
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, 05:40
Default
  #12
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
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

Old   September 11, 2017, 09:32
Default
  #13
New Member
 
Hirakjyoti Barman
Join Date: Sep 2017
Posts: 7
Rep Power: 9
Hirakjyoti is on a distinguished road
Quote:
Originally Posted by gearboy View Post
Great job!
After loading in fluent it is showing
M_species_list:
0 .local.varargs
0 .local.end
0 save
.local.int i (r1)
1 push.int 0
3 save
4 push.string [5] Licl
7 call SV_SpeciesIndex (-1)
9 sto.int i (r1)
11 pop.int
12 save
13 push.string [36] species index=%d,species name=Licl

20 ld.int i (r1)
22 call CX_Message (-1)
24 pop.int
25 restore
26 ret.v
How can i know wht is the i for licl. plz hlp
Hirakjyoti is offline   Reply With Quote

Old   May 19, 2020, 14:25
Default
  #14
New Member
 
Vidushi
Join Date: Sep 2018
Location: Cape Town
Posts: 20
Rep Power: 8
Vidushi 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);
}
}
I executed the code, it gets compiled, and then it does not print anything for me Can anybody guess what might be the problem?
Vidushi is offline   Reply With Quote

Old   May 20, 2020, 01:34
Default
  #15
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
how did you run the code?
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   May 20, 2024, 12:13
Thumbs up
  #16
New Member
 
Mohammad
Join Date: May 2024
Posts: 7
Rep Power: 2
DrMaMad 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);
}
}
so informative
amilachandra likes this.
DrMaMad 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
How to specify surface flux of a species? ked FLUENT 18 February 15, 2022 16:03
Modelling Biomass Combustion via Species Transport Racheal FLUENT 39 January 8, 2022 08:42
PB: Saving mass fraction of species on two points with an udf biget.a FLUENT 2 July 23, 2009 04:06
Species order fluent Raddi FLUENT 1 March 13, 2009 01:21
mass fraction of species Ahmed FLUENT 0 April 18, 2007 12:57


All times are GMT -4. The time now is 11:55.