CFD Online URL
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Defining species mass fraction using a UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 25, 2009, 13:06
Default Defining species mass fraction using a UDF
  #1
T81
New Member
 
Join Date: Mar 2009
Posts: 15
Rep Power: 7
T81 is on a distinguished road
Hi there,
I'd like to know how to define species mass fraction with a UDF.

I found the macro C_YI(c,t,i), for defining the species mass fraction.
But how to hook this in fluent?
Probably under inlet at the boundary conditions panel,
but which is the appropriate general-purpose macro for this?

I tried the following but the mass fraction doesn't change.

Code:
DEFINE_PROFILE(species_profile, t, position)
{
  cell_t c;

  begin_c_loop(c, t)
  {
    if (temp_avg  > 700)
    {
       C_YI(c,t,0) = 0.2;
    }
    else
    {
       C_YI(c,t,0) = 0.8;
    }
 }
 end_c_loop(c, t)
}
Thanks in advance

Last edited by T81; March 25, 2009 at 14:55.
T81 is offline   Reply With Quote

Old   March 26, 2009, 04:57
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 7
coglione is on a distinguished road
Hello,

DEFINE_PROFILE has to return a value using C_PROFILE(c,t,i):

DEFINE_PROFILE(species_profile, t, i)
{
cell_t c;

begin_c_loop(c, t)
{
if (temp_avg > 700)
{
C_PROFILE(c,t,i) = 0.2;
}
else
{
C_PROFILE(c,t,i) = 0.8;
}
}
end_c_loop(c, t)
}Hook it in the boundary condition panel for your fluid zone(s) and make sure that Sum[C_YI(i)] = 1 is still valid after executing this UDF !

cheers
coglione is offline   Reply With Quote

Old   March 26, 2009, 05:59
Default
  #3
T81
New Member
 
Join Date: Mar 2009
Posts: 15
Rep Power: 7
T81 is on a distinguished road
coglione thank you very much for the quick response.
It works!!!

Thanks again
T81 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 12:29
UDF for Species mass fraction daniel FLUENT 3 June 22, 2005 09:40
UDF for Species mass fraction Rahul FLUENT 0 September 20, 2002 05:22
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 12:35.