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

Problem with the UDF and the default turbulent viscosity of Realizable k-e

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 22, 2024, 21:37
Default Problem with the UDF and the default turbulent viscosity of Realizable k-e
  #1
Member
 
Anh
Join Date: Sep 2014
Posts: 72
Rep Power: 12
dinhanh is on a distinguished road
Hi Fluent experts,

I am trying to make the UDF for the Realizable k-epsilon turbulent viscosity based on the paper of Shih et al. and that expressed in the Fluent theory guide.

The UDF code is for 2D simulation as follows:

#include "udf.h"
#include "math.h"

DEFINE_TURBULENT_VISCOSITY(tur_vis,c,t)
{
* real mu_tur;
* real S11, S12, S22, W12, W12r, S;
* real SMU, WAS, PHI, USTAR;
* real AS;
* real CMU, a1, a2, a3, a4, a5, a6;
* real PHI2, F2;

/***/
* real betas=0.09;
* real A0=4.04;
* real rho=C_R(c,t);
* real k=C_K(c,t);
* real w=C_D(c,t);
* real CMUL=C_MU_L(c,t);
* real y=C_WALL_DIST(c,t);

/***/
* real wr=-1.485446130; * * * /***rotation speed unit: 1/s***/

/***/
* S11=0.5*(C_DUDX(c,t)+C_DUDX(c,t));
* S12=0.5*(C_DUDY(c,t)+C_DVDX(c,t));
* S22=0.5*(C_DVDY(c,t)+C_DVDY(c,t));
*
* W12=0.5*(C_DVDX(c,t)-C_DUDY(c,t));

/*** Cal vorticity with angular velocity wr ***/
*
* W12r=W12-wr;

/*** Cal U* ****/

* USTAR=sqrt(S11*S11+2.0*S12*S12+S22*S22+2.0*W12r*W1 2r);

/*** Cal Phi ***/

* SMU=sqrt(S11*S11+2.0*S12*S12+S22*S22);
* WAS=(pow(S11,3)+pow(S22,3)+3.0*pow(S12,2)*(S11+S22 ))/pow(SMU,3);
* PHI=1.0/3.0*acos(max(-1.0,min(sqrt(6.0)*WAS,1.0)));

/*** Cal As ***/
*
* AS = sqrt(6.0)*cos(PHI);

/*** Cal CMU ***/
*
* CMU=1.0/(A0+AS*USTAR*k/w);

/*** Cal Viscosity ***/

* mu_tur=CMU*rho*k*k/w;
**
* return mu_tur;
}

The simulations were performed for both the UDF and the default viscous model. However, there is a large deviation between these simulations' averaged results. I do not know why and why this difference is because the UDF code was based on the expression in the Fluent theory guide. I also compared the simulation between the UDF code and the default turbulent viscosity of the SST k-omega model and got a good agreement between the results.

Could anyone please help?

Thank you very much.
dinhanh 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



All times are GMT -4. The time now is 08:56.