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

UDF to calculate phase-averaged turbulence variables in a periodic flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 27, 2011, 00:48
Unhappy UDF to calculate phase-averaged turbulence variables in a periodic flow
  #1
New Member
 
Carl
Join Date: Aug 2010
Posts: 2
Rep Power: 0
ShuangqingXu is on a distinguished road
Hi,

I'm new to Fluent UDF. But I need to write a UDF to calculate phase-average turbulence variables in a 3D time-periodic flow. I describe it in detail as follow:

I'm simulating a full 3D stirred vessel via both RANS and LES method. Comparisons between turbulence variables will be made. It's reported that direct ensemble-averaged result will not work in this case, due to pseudo-turbulence (contribution from the periodic flow). I found some hints from the post by Lionel Larcheveque (http://www.cfd-online.com/Forums/mai...intensity.html).

For convenience, I copied that original post below:

Suppose you have a periodic signal (for instance pressure signal). You can then define a period duration D. Then divide this duration into n equal intervals of time. At any given time t, you will be able to determine in which sub-interval i you are, i.e. :

A + B*D + (i-1)*D/n < t < A + B*D + i*D/n

with A a constant and B the number of periods since the beginning of the experiment or the calculation.

For each sub-interval 1 <= i <= n :

*** compute classical statistics Mi(u)=U_i, Mi(v)=V_i, Mi(u^2) and Mi(v^2) (M means mean, _i for phase i)

*** phase fluctuations u'_i and v'_i are given by :

u'_i=sqrt(Mi(u^2)-U_i^2)

v'_i=sqrt(Mi(v^2)-V_i^2)

*** phase averaged turbulent intensity may be defined for instance by the ratio :
sqrt(u'_i^2+v'_i^2)/sqrt(U_i^2+V_i^2)

In practice, you have to store arrays of size n for the sums of u, v, u^2 and v^2 and for the number of samples. At each time, identify the phase number i, and then add instantaneous u, v, u^2 and v^2 data to the i th element of the related arrays and increase by 1 the number of samples for the i th phase. At the end, for each i, divide the element i by the number of samples of the i th phase to obtain phase averaged statistics.


Since I'm new UDF user, could anybody kindly help me with that or give me some advice (which macros & functions should I use)?
Many Thanks!!!

ShuangqingXU
ShuangqingXu is offline   Reply With Quote

Reply

Tags
phase-average, turbulence, udf


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
How to access only one phase in multiphase model by UDF wersoe Fluent UDF and Scheme Programming 1 January 4, 2017 08:11
UDF of two phase flow : drag coefficient superxeonman FLUENT 0 May 21, 2008 22:53
periodic two phase flow aahh FLUENT 1 April 3, 2005 01:47
How to calculate the mass flow rate with UDF ? HP FLUENT 0 January 10, 2005 20:38
How to calculate density of solid phase zhou Main CFD Forum 0 December 17, 1999 20:06


All times are GMT -4. The time now is 23:45.