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

Realizable k-e Turbulent viscosity UDF

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2024, 06:26
Default Realizable k-e Turbulent viscosity UDF
  #1
Member
 
Anh
Join Date: Sep 2014
Posts: 74
Rep Power: 13
dinhanh is on a distinguished road
Hi Fluent Experts,

I am trying to write a UDF for the turbulent viscosity based on the Realizable k-e model (See the Figure below).
The UDF code is for 2D simulation, and I had trouble defining the term W. The code got an error when it compiled.

Is the definition of W correct? Thank you very much for your help.

The UDF code is:

#include "udf.h"

DEFINE_PROPERTY(tur_vis,c,t)
{
real mu_tur;
real Sii, Sij, Sjj, Wij, Wijr;
real SMU, WAS, PHI, USTAR;
real AS;
real CMU, y, a1, a2, a3, a4, a5, a6;
real betas=0.09;
real A0=4.04;
real wr=11.7 /***rotational speed***/

/*** Cal Sij and Wij
Sii=0.5*(C_DUDX(c,t)+C_DUDX(c,t));
Sij=0.5*(C_DUDY(c,t)+C_DVDX(c,t));
Sjj=0.5*(C_DVDY(c,t)+C_DVDY(c,t));

Wij=0.5*(C_DUDY(c,t)-C_DVDX(c,t));

/*** Cal vorticity with rotational rate ***/

Wijr=Wij-wr*C_D(c,t);

/*** Cal U* ***/

USTAR=sqrt(Sii*Sii+2*Sij*Sij+Sjj*Sjj+Wijr*Wijr);

/*** Cal Phi ***/

SMU=sqrt(Sii*Sii+2*Sij*Sij+Sjj*Sjj);
WAS=(2*Sij+Sii+Sjj)/pow(SMU,3);
PHI=1/3*pow(cos(sqrt(6)*WAS),-1);

/*** Cal As ***/

AS = sqrt(6)*cos(PHI);

/*** Cal CMU ***/

CMU=1/(A0+AS*USTAR/betas/C_O(c,t));

mu_tur=C_R(c,t)*pow(C_K(c,t),2)/C_D(c,t)*CMU

return mu_tur;
}
Attached Images
File Type: jpg 2b1f3f2e-454c-4fc5-9855-1e54848f22fe.jpg (36.9 KB, 1 views)

Last edited by dinhanh; October 15, 2024 at 06:28. Reason: reupload the figure
dinhanh is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turbulent viscosity for transitional SST model in ANSYS Fluent Bovinille Fluent UDF and Scheme Programming 0 October 11, 2023 14:19
UDF Turbulent Viscosity Damping Function Revolver2006 Fluent UDF and Scheme Programming 11 July 12, 2017 15:40
wrong results after use UDF turbulent viscosity lehoanganh07 Fluent UDF and Scheme Programming 0 July 21, 2014 12:12
setting value of turbulent intensity and turbulent viscosity ratio in wind tunnel nuimlabib Main CFD Forum 0 August 4, 2009 01:05
UDF of Turbulent viscosity justin FLUENT 0 November 24, 2006 07:36


All times are GMT -4. The time now is 16:27.