|
[Sponsors] |
Order of species in the array of mass fraction |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 19, 2020, 11:33 |
Order of species in the array of mass fraction
|
#1 |
New Member
Vidushi
Join Date: Sep 2018
Location: Cape Town
Posts: 20
Rep Power: 8 |
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. |
|
May 19, 2020, 11:46 |
Species
|
#2 |
Senior Member
|
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.
__________________
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. |
|
May 19, 2020, 14:31 |
|
#3 |
New Member
Vidushi
Join Date: Sep 2018
Location: Cape Town
Posts: 20
Rep Power: 8 |
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? |
|
May 19, 2020, 16:05 |
Order
|
#4 |
Senior Member
|
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. |
|
May 19, 2020, 16:11 |
Mixture_specie_name
|
#5 |
Senior Member
|
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. |
|
May 20, 2020, 06:44 |
Code
|
#6 |
Senior Member
|
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)); } }
__________________
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. |
|
Tags |
define vr_rate, macros, reaction rate, species, udf code |
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 07:49 |
reactingFoam species are molar fraction or mass fraction? | prasa | OpenFOAM Running, Solving & CFD | 2 | March 17, 2016 03:35 |
To calculate area averaged species mass fraction from PDF | Bharadwaj B S | Fluent UDF and Scheme Programming | 3 | March 8, 2016 03:22 |
species transport-wavelike tail (mass fraction) | Lilly | FLUENT | 0 | December 7, 2012 10:45 |
chemical species mass fraction | Green_Horn | STAR-CD | 0 | February 27, 2012 15:57 |