|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Anh
Join Date: Sep 2014
Posts: 74
Rep Power: 13 ![]() |
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; } Last edited by dinhanh; October 15, 2024 at 06:28. Reason: reupload the figure |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |