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

To calculate area averaged species mass fraction from PDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2015, 03:14
Default To calculate area averaged species mass fraction from PDF
  #1
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Dear all,

I am having a problem in determining the mass fraction of a specie at the surface of sphere which is inside a flow domain (cylindrical) using UDF.

I have written a code for this from which the value of tot_frac will be used for mass flow rate calculation in other function.

Quote:
DEFINE_ADJUST(massfraccalc,d)
{
d=Get_Domain(1);
t=Lookup_Thread(d,ID);
begin_f_loop(f,t)
if PRINCIPAL_FACE_P(f,t)
{
d=Get_Domain(1);
t=Lookup_Thread(d,ID);
F_AREA(A,f,t);
tot_area+=NV_MAG(A);
mass_frac=mass_frac+(Pdf_Yi(c,t,3)*NV_MAG(A));
}
end_f_loop(f,t)
tot_frac=mass_frac/tot_area;
Message("Area averaged mass fraction of carbon dioxide(co2) is %e\n",tot_frac);
}

where Pdf_Yi(c,t,3) is the macro for fetching mass fraction. 3 is the specie index, i.e, in my case it is for co2.

I have tried this code for all other species (index) all seems to work fine but when I give specie index as 3, the value is always 0.00000e+0.

But the plot of area averaged mass fraction (monitor) is showing very different, it is varying every iteration.

QUESTION

Is there any problem with my UDF for area averaged mass fraction calculation?

Thanks in advance,
Bharadwaj B S
Bharadwaj B S is offline   Reply With Quote

Old   May 18, 2015, 03:16
Default Details
  #2
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Dear all,

All required variables are defined globally outside this function.

Thanks,
Bharadwaj B S
Bharadwaj B S is offline   Reply With Quote

Old   March 7, 2016, 04:08
Default
  #3
Member
 
志新高(Zhixin Gao)
Join Date: Aug 2014
Location: hz.China
Posts: 30
Rep Power: 12
zhixin is on a distinguished road
Dear Bharadwaj B S
maybe you have only three species, because when one use C_YI(c,t,i) macros, i=0,1,2 when there are 3 species(I am not sure if the macros you used like this or not).
zhixin is offline   Reply With Quote

Old   March 8, 2016, 03:22
Default Thank you
  #4
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Thanks for the reply. Issue was there very long back. I have used some other method to fetch mass fraction. I do not remember, sorry for that. Again huge thanks.

Regards,
Bharadwaj B S 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
Species Mole and Mass Fraction Macro combustion FLUENT 18 February 5, 2024 13:23
Conversion of mass fraction to mole fraction in FLUENT prince_pahariaa FLUENT 0 August 26, 2014 09:08
mass averaged pressure and area averaged pressure soni_sth CFX 7 February 14, 2012 17:37
How to calculate the mass fraction of species in Fluent? llrr FLUENT 0 May 21, 2010 05:41
UDF and PDF species mass fractions Ale FLUENT 0 July 18, 2003 10:04


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