
[Sponsors] 
UDF to calculate phaseaveraged turbulence variables in a periodic flow 

LinkBack  Thread Tools  Display Modes 
October 26, 2011, 23:48 
UDF to calculate phaseaveraged turbulence variables in a periodic flow

#1 
New Member
Carl
Join Date: Aug 2010
Posts: 2
Rep Power: 0 
Hi,
I'm new to Fluent UDF. But I need to write a UDF to calculate phaseaverage turbulence variables in a 3D timeperiodic 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 ensembleaveraged result will not work in this case, due to pseudoturbulence (contribution from the periodic flow). I found some hints from the post by Lionel Larcheveque (Phase Averaged Turbulence Intensity ? ). 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 subinterval i you are, i.e. : A + B*D + (i1)*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 subinterval 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 

Tags 
phaseaverage, turbulence, udf 
Thread Tools  
Display Modes  


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  0  September 23, 2009 07:57 
UDF of two phase flow : drag coefficient  superxeonman  FLUENT  0  May 21, 2008 21:53 
periodic two phase flow  aahh  FLUENT  1  April 3, 2005 00: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 