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

turbulent viscosity modification: mu_t as a function of local temperature gradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2022, 20:19
Default turbulent viscosity modification: mu_t as a function of local temperature gradient
  #1
New Member
 
Gopal Pandey
Join Date: Dec 2022
Location: AU
Posts: 7
Rep Power: 4
gopalpandey is on a distinguished road
Hi Everyone,
I have written the following UDF to modify the turbulent viscosity for the standard k-epsilon model to consider the influence of the local temperature gradient.

can please someone help me with what's wrong with the code? I will upload the errors in the comments!

#include "udf.h"
#include "math.h"
DEFINE_TURBULENT_VISCOSITY(m_mu_t,c,t)
{
real mu_t;
real rho=C_R(c,t); /*accessing density of the cell */
real k=C_K(c,t); /*accessing kinetic energy of the cell */
real d=C_D(c,t) /*accessing rate of dissipation of kinetic energy */
real c1=1.2,c2=1,ct; /*defining some empirical constant*/
real t_temp=C_T(c,t) /*accessing the cell temperature*/
real mtao_z=0.1; /*defining empirical constant*/
real m=0.1;
real mtao,c_mu;
real f_mz,tg,a;
real div_t=C_T_G(c,t); /*use of macros to access the temperature gradient*/
a=331*SQRT(t_temp/273);
mtao=SQRT(2*k/a);
if(mtao>mtao_z) /*applying Heaviside function */
f_mz=SQR(mtao)-SQR(mtao_z);
else
f_mz=0;
tg=(div_t*power(k,1.5))/(t_temp*d);
f_mt=(SQR(mtao)-SQR(m))*f_mz;
ct=1+(1.2*power(tg,0.6))/(1+f_mt);
c_mu=0.09/ct;
mu_t=c_mu*rho*power(k,2)/d;
return mu_t;
}



thanks in advance!
gopalpandey is offline   Reply With Quote

Old   December 28, 2022, 09:06
Default
  #2
Member
 
Odisha
Join Date: Jan 2020
Posts: 59
Rep Power: 6
Siba11 is on a distinguished road
I think your syntax for power function is incorrect.

It's pow(a,b).
Siba11 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF gradient od temperature and turbulent viscosity at wall Golaselo FLUENT 1 November 21, 2021 23:52
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 10:31
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 08:36
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58


All times are GMT -4. The time now is 15:09.