CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   How do I know wich species has which integer value? (http://www.cfd-online.com/Forums/fluent-udf/73398-how-do-i-know-wich-species-has-integer-value.html)

sega March 7, 2010 07:17

How do I know wich species has which integer value?
 
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?

sega March 7, 2010 11:34

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?

gearboy March 8, 2010 03:34

Quote:

Originally Posted by sega (Post 248879)
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);
}
}

sega March 8, 2010 07:09

Quote:

Originally Posted by gearboy (Post 248919)
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!

chemicalsunnyraj March 8, 2010 09:25

how i can open the gambit file in fluent please tell me the saving file name ,
 
i have 6.3 fluent edison

sega March 8, 2010 09:30

Quote:

Originally Posted by chemicalsunnyraj (Post 248969)
i have 6.3 fluent edison

How is this related to the topic?

Wikie October 9, 2010 16:58

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 (Post 248919)
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);
}
}


sega October 10, 2010 09:01

Quote:

Originally Posted by Wikie (Post 278546)
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!

Wikie October 10, 2010 09:20

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

Abhya April 15, 2013 10:50

Quote:

Originally Posted by Wikie (Post 278546)
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 April 15, 2013 10:59

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 April 17, 2013 04:40

Great job!

Quote:

Originally Posted by Abhya (Post 420693)
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);
 
}




All times are GMT -4. The time now is 19:44.