
[Sponsors] 
April 20, 2006, 06:03 
UDF source term

#1 
Guest
Posts: n/a

Hi I am new to UDF in CFD.Iam doing two way coupling(turbulence modulationarticles effecting turbulence) problem in a vertical pipe In writing the code for source term for k equation I am struggling to define ds[eqn]
my source term for k equation is 1(t*/(t*+t_p)) where 1/t*=[1/(0.135(k/e))]+[urel/(0.22k^1.5/e)(turbulent time scale) t_p=rho_p*d_p^2/18*mu (particle response time or particle time constant) rho_p density of the particle d_p diameter of the particle mu viscosity of the fluid urel relative velocity whcich is equal to t_p*g I am trying in this way. #include "udf.h" #define alpha 1 #define dp 0.003 #define rhop 1020 #define u_rel 1 DEFINE_SOURCE(k_source,c,t,dS,eqn) { /* real x[ND_ND]; */ real source; t_p=((dp*dp)*rhop)/(18*C_MU_L(c,t)); /* particle time constant */ 1/t_t=(1/(0.135*(C_K(c,t)/C_D(c,t))))+(u_rel*C_D(c,t)/(0.22*C_K(c,t)^1.5));/* effective turbulent time scale */ source=(2*C_K(c,t)*alpha/t_p)(1(t_t/(t_t+t_p)); /* dS[eqn]= */ return source; } could you please figure out my problem in writing the proper source code 

April 20, 2006, 11:16 
Re: UDF source term

#2 
Guest
Posts: n/a

I THINK that you have two options:
1) setting dS = 0 or 2) setting dS = d(Sourceterm)/d(k), where k is the variable that you are solving for. I think k is then you turbulent energy. Kasper/Denmark 

April 21, 2006, 05:05 
Re: UDF source term

#3 
Guest
Posts: n/a

Thank you Kasper.U gave me little idea to work.I think I have to do some more changes to the code to run. If it has to derive the Source term with k do I need to assume all the remaining as constants?Please Let me know


January 11, 2013, 04:08 
Temperaturedependent heat source

#4 
Senior Member
Join Date: Nov 2009
Posts: 125
Rep Power: 7 
Dear all,
i want to apply a heat source that is temperaturedependent. It is a copper winding of an electrical machine, and the resistance of the winding increases with temperature, and consequently the heat loss increases with it. i've look at the following: 1) starting with understanding how DEFINE_PROFILE works for a wall heat generation. 2) looked into a simple code example for DEFINE_SOURCE in ansys help. But, am i right to take the following approach? 1) use DEFINE_SOURCE 2) use C_T to feedback temperature into the temperaturedependent equation to calculate the 'new' heat source value Any comments is greatly appreciated. Thanks!
__________________
Thank you for your kind attention. Kind regards, mactech001 Currently using: ANSYS v13 

May 1, 2013, 09:31 

#5 
Member
Sheng
Join Date: Jun 2011
Posts: 58
Rep Power: 6 
It looks you missed a multiply sign in the source term:
source=(2*C_K(c,t)*alpha/t_p)(1(t_t/(t_t+t_p)); source=(2*C_K(c,t)*alpha/t_p)*(1(t_t/(t_t+t_p)); Define ds[eqn] is simple for this case. Just find the partial derivative to C_K(c,t) of the source term. An undergraduate level math knowledge can get it. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Injection of the source term UDF  stage81  FLUENT  0  September 27, 2010 07:20 
UDF Source Term  Christian  FLUENT  4  August 1, 2009 05:53 
The source term of UDF  summer  FLUENT  0  August 24, 2006 17:44 
UDFs for Scalar Eqn  Fluid/Solid HT  Greg Perkins  FLUENT  0  October 13, 2000 23:03 
UDFs for Scalar Eqn  Fluid/Solid HT  Greg Perkins  FLUENT  0  October 11, 2000 03:43 