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

UDF for mass fraction

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Bruno Machado

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2016, 23:34
Angry UDF for mass fraction
  #1
New Member
 
TheOneBird
Join Date: Apr 2016
Posts: 8
Rep Power: 10
TheOneBird is on a distinguished road
Hello Everyone,
I have a mixture with a number of fluids in it. I am confused about how I would write a UDF such as to vary these mass fractions of individual fluids across the inlet [edit: with position from the axis, I am running axi-symmetric].

Thanks!

Last edited by TheOneBird; April 5, 2016 at 09:46.
TheOneBird is offline   Reply With Quote

Old   April 5, 2016, 06:11
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by TheOneBird View Post
Hello Everyone,
I have a mixture with a number of fluids in it. I am confused about how I would write a UDF such as to vary these mass fractions of individual fluids across the inlet.

Thanks!
you gotta be more specific about what you want to do, otherwise we can not help. vary it based on what? time? temperature? pressure? position?

In a inlet boundary you can define the mass fraction of your species as a constant or depending on what you other variables you want to consider through UDF.
TheOneBird likes this.
Bruno Machado is offline   Reply With Quote

Old   April 5, 2016, 08:27
Default
  #3
New Member
 
TheOneBird
Join Date: Apr 2016
Posts: 8
Rep Power: 10
TheOneBird is on a distinguished road
Thank you for your answer Bruno,

Sorry my bad - must be my super lack of sleep.

Varied based on position from the axis. I am running axi-symmetric. It is a steady state,S-A model.

So all of my species are calculate through CEA. At the moment I am just trying for a simple step function.

massFraction(O2) = 0.1 for 0<= y <0.2,
massFraction(O2) = 0.4 for 0.2<= y <end

Thank you so much!
TheOneBird is offline   Reply With Quote

Old   April 5, 2016, 10:20
Default
  #4
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by TheOneBird View Post
Thank you for your answer Bruno,

Sorry my bad - must be my super lack of sleep.

Varied based on position from the axis. I am running axi-symmetric. It is a steady state,S-A model.

So all of my species are calculate through CEA. At the moment I am just trying for a simple step function.

massFraction(O2) = 0.1 for 0<= y <0.2,
massFraction(O2) = 0.4 for 0.2<= y <end

Thank you so much!
This is an example of profile for mass fraction. You can add the macro F_CENTROID(x,f,t) for the position and create your if conditions.

DEFINE_PROFILE(mass_fraction,t,i)
{
face_t f;
double Y_O2;

Y_O2 = 1.0;

begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = Y_O2;
}
end_f_loop(f,t)
}
Bruno Machado is offline   Reply With Quote

Old   April 5, 2016, 18:52
Default
  #5
New Member
 
TheOneBird
Join Date: Apr 2016
Posts: 8
Rep Power: 10
TheOneBird is on a distinguished road
That looks good! Thank you Bruno Machado!
TheOneBird is offline   Reply With Quote

Reply

Tags
ansys, fluent - udf, fluent 14 to fluent 15.


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
Stuck in a Rut- interDyMFoam! xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 08:09
udf: volume fraction gradient in eulerian model jwwang FLUENT 22 April 15, 2015 07:27
PB: Saving mass fraction of species on two points with an udf biget.a FLUENT 2 July 23, 2009 04:06
UDF for Species mass fraction daniel FLUENT 3 June 22, 2005 09:40
Species Mass Fraction inside UDF using PDF? Daniel Schneider FLUENT 0 September 20, 2000 07:34


All times are GMT -4. The time now is 07:05.