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

Order of species in the array of mass fraction

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By vinerm
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 19, 2020, 10:33
Default Order of species in the array of mass fraction
  #1
New Member
 
Vidushi
Join Date: Sep 2018
Location: Cape Town
Posts: 20
Rep Power: 7
Vidushi is on a distinguished road
Hi everyone,

Does anyone know what is the order of species in the array of mass fractions yi or in the array mw which is passed by fluent to the UDF macro, DEFINE VR_RATE. Also does it store the mass fractions of:

1. All the species selected from the database, or

2. All the species in a mixture, or

3. All the species taking part in reactions




DEFINE VR_RATE( name,c,t,r,mw,yi,rr,rr_t)

Argument Type Description

symbol name UDF name.

cell_t c Cell index.

Thread *t Pointer to cell thread on which the volumetric reaction

rate is to be applied.

Reaction *r Pointer to data structure that represents the

current reaction.

real *mw Pointer to array of species molecular weights.

real *yi Pointer to array of the species mass fractions.

real *rr Pointer to laminar reaction rate.

real *rr_t Pointer to turbulent reaction rate.
Vidushi is offline   Reply With Quote

Old   May 19, 2020, 10:46
Default Species
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
The order is same as what you see in the Species Name List in GUI. You can also use the function specie_name(Domain *d, int i) with i being the index of the specie to fetch name and compare.

Mass fractions and other relevant parameters are stored for all the species that are in the Name List, whether those are included in the reactions or not.
Vidushi likes this.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 19, 2020, 13:31
Default
  #3
New Member
 
Vidushi
Join Date: Sep 2018
Location: Cape Town
Posts: 20
Rep Power: 7
Vidushi is on a distinguished road
Dear vinerm,

Thank you for your reply. Although I have just one more confusion.
By GUI, you mean which one of the two: the species in the Species Panel in the mixture Properties or the species in the materials panel because both the orders are different? Pictures attached for your reference.

Also, how to write this function specie_name that you mentioned?

Did you mean a function like this:


#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);
}
}


This code does not print anything for me
It gets compiled, but when I execute the DEFINE_ON_DEMAND, nothing prints on the console. Can you guess what might be the problem?
Attached Images
File Type: png pic_1-materials panel.PNG (68.3 KB, 14 views)
File Type: png Pic_2-Species Panel in Mixture Properties.PNG (25.1 KB, 17 views)
Vidushi is offline   Reply With Quote

Old   May 19, 2020, 15:05
Default Order
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
It is the one in the second image where listing is done and not the one in the materials panel.

Function requires two arguments, domain and specie index. So, specie_name(d, 0) will return h2o for your case. And there is no function called MIXTURE_SPECIE_NAME.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 19, 2020, 15:11
Default Mixture_specie_name
  #5
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
I apologize, MIXTURE_SPECIE_NAME function also exists and can be used as well. But usage is different from the function I mentioned.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 20, 2020, 05:44
Default Code
  #6
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
The code below is all you need to fetch order of species in Fluent.

Code:
#include "udf.h"

DEFINE_ON_DEMAND(fpr)
{
	Domain *d = Get_Domain(1);
	int i;
	for(i = 0; i < 4; i++)
	{
		Message("Index %d is %s\n", i, specie_name(d, i));
	}
}
snehitha likes this.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Tags
define vr_rate, macros, reaction rate, species, udf code


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
Mass fraction of species (Y) in reacting solvers mike.franky OpenFOAM Running, Solving & CFD 9 February 9, 2023 06:49
reactingFoam species are molar fraction or mass fraction? prasa OpenFOAM Running, Solving & CFD 2 March 17, 2016 02:35
To calculate area averaged species mass fraction from PDF Bharadwaj B S Fluent UDF and Scheme Programming 3 March 8, 2016 02:22
species transport-wavelike tail (mass fraction) Lilly FLUENT 0 December 7, 2012 09:45
chemical species mass fraction Green_Horn STAR-CD 0 February 27, 2012 14:57


All times are GMT -4. The time now is 16:37.