# Standard k-eps with UDF/UDS

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 November 26, 2010, 10:08 Standard k-eps with UDF/UDS #1 New Member   Andreas Håkansson Join Date: Mar 2009 Location: Lund, Sweden Posts: 12 Rep Power: 8 Hi, I am trying to implement turbulence models in FLUENT using UDS/UDF. As a first step I tried with just implementing the Standard k-epsilon. However I cannot get it to work. In the first step I add two UDS variables and let them have the same diffusivites and sources as k and epsilon but I use the ordinary k and epsilon in the equations for UDS0 and UDS1. Then I patch UDS-0 and UDS-1 with k and epsilon respectively. What I would expect is that my UDS-0 and UDS-1 would keep like k and epsilon. Instead they quikly get very different and I even get negative values for UDS-1 (“epsilon”). I would be very thankful if someone could have a look and see if I am missing something in my implementation. #include "udf.h" #include "math.h" /* DEFINES CONSTANTS FOR THE TURBULENCE MODELS */ const real sigmaK = 1; const real sigmaEps = 1; const real C1eps = 1.44; const real C2eps = 1.92; DEFINE_TURBULENT_VISCOSITY(user_mu_t, c, t) { real mu_t; real rho = C_R(c,t); real k = C_K(c,t); real eps = C_D(c,t); //real k = C_UDSI(c,t,0); //real eps = C_UDSI(c,t,1); mu_t = M_keCmu*rho*SQR(k)/eps; //mu_t = 0.12*rho*SQR(k)/eps; return mu_t; } DEFINE_DIFFUSIVITY(k_diff, c, t, eqn) // Diffusiviteten för k { real mu = C_MU_L(c,t); real mu_t = C_MU_T(c,t); real diff; diff = mu+mu_t/sigmaK; return diff; } DEFINE_DIFFUSIVITY(eps_diff, c, t, eqn) // Diffusiviteten för epsilon { real mu = C_MU_L(c,t); real mu_t = C_MU_T(c,t); real diff; diff = mu+mu_t/sigmaEps; return diff; } /* 2D-VERSION OF THE k SOURCE-TERM*/ DEFINE_SOURCE(k_source_twod, c, t, dS, eqn) { real rho = C_R(c,t); real eps = C_D(c,t); //real eps = C_UDSI(c,t,1); real mu_t = C_MU_T(c,t); real Gk = 2*mu_t*(C_DUDX(c,t)*C_DUDX(c,t) + 0.5*(C_DVDX(c,t)+C_DUDY(c,t))*(C_DVDX(c,t)+C_DUDY( c,t)) + C_DVDY(c,t)*C_DVDY(c,t) ); real source = Gk - rho*eps; //dS[eqn] = 0.0; return source; } /* 2D-VERSION OF THE EPSILON SOURCE-TERM*/ DEFINE_SOURCE(eps_source_twod, c, t, dS, eqn) { real k = C_K(c,t); real eps = C_D(c,t); //real k = C_UDSI(c,t,0); //real eps = C_UDSI(c,t,1); real mu_t = C_MU_T(c,t); real rho = C_R(c,t); real Gk = 2*mu_t*(C_DUDX(c,t)*C_DUDX(c,t) + 0.5*(C_DVDX(c,t)+C_DUDY(c,t))*(C_DVDX(c,t)+C_DUDY( c,t)) + C_DVDY(c,t)*C_DVDY(c,t) ); real source = C1eps*eps/k*Gk-C2eps*rho*eps*eps/k; //dS[eqn] = 0.0; return source; }

 Tags fluent, turbulence models, udf, uds

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Henrik StrĂ¶m FLUENT 3 December 20, 2005 09:48 Allan Cross FLUENT 3 August 26, 2005 03:11 KEVIN FLUENT 3 March 25, 2004 09:32 C. ORTEGA FLUENT 0 July 7, 2003 08:35 N.A. Beishuizen CD-adapco 0 August 29, 2001 05:22

All times are GMT -4. The time now is 06:35.

 Contact Us - CFD Online - Top