|
[Sponsors] |
August 3, 2018, 00:46 |
Problem with yplus UDF
|
#1 |
New Member
XiangfeiKong
Join Date: Aug 2018
Posts: 1
Rep Power: 0 |
Hi, I want to write a udf to define turbulent Prandtl. Below is part of my code. However, I can not Reproduce the results in the literature. I wonder I wonder if the calculating of yplus is wrong. please. The model of turbulent Prandtl please see the attachments. Thanks!
Snipaste_2018-08-03_11-31-42.jpgg.jpg /* Specifying a Variable Temperature Prandtl Number */ #include "udf.h" #include "math.h" DEFINE_PRANDTL_T(Prt,c,t) { real pr_t; /* turbulent Prandtl */ real mu = C_MU_L(c,t); /* molecular dynamic viscosity */ real mu_t = C_MU_T(c,t); /* turbulent dynamic viscosity */ real thermalCon=C_K_L(c,t); /* molecular thermal conductivity */ real cp=C_CP(c,t); /* specific heat */ real pr_mol=mu*cp/thermalCon; /* molecular pr */ real density=C_R(c,t); /* molecular density */ real mu_ratio=mu_t/mu; /* mu_ratio */ real velocity_dudy=C_DUDY(c,t); /* velocity derivative */ real Tao_tur=mu*velocity_dudy; /* turbulence shear stress */ real velocity_F=sqrt(fabs(Tao_tur/density)); /* Friction Velocity */ real y; real y_plus; real x[2]; C_CENTROID(x,c,t); y=x[1]; y_plus=density*velocity_F*(0.004-y)/mu; /* Friction Velocity */ if (y_plus<=5) pr_t=1.0; else if (y_plus<100 && y_plus>5) pr_t=0.5+0.1*pr_mol/mu_ratio; else pr_t=0.85; return pr_t; } Last edited by Xiangfei; August 5, 2018 at 04:51. |
|
Tags |
udf.yplus. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 07:05 |
Problem with DPM simulation with particles injection and EXECUTE_AT_THE_END UDF. | Ari | Fluent UDF and Scheme Programming | 4 | May 31, 2016 09:51 |
udf loading problem | santu | Fluent UDF and Scheme Programming | 1 | May 22, 2015 16:47 |
Vaporization pressure UDF property problem? | lehoanganh07 | Fluent UDF and Scheme Programming | 1 | September 13, 2014 11:59 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 07:56 |