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

UDF source term

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 20, 2006, 07:03
Default UDF source term
  #1
Rajani Kanth.B
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
  Reply With Quote

Old   April 20, 2006, 12:16
Default Re: UDF source term
  #2
Kasper Skriver
Guest
 
Posts: n/a
I THINK that you have two options:

1) setting dS = 0

or

2) setting dS = d(Source-term)/d(k), where k is the variable that you are solving for. I think k is then you turbulent energy.

Kasper/Denmark
  Reply With Quote

Old   April 21, 2006, 06:05
Default Re: UDF source term
  #3
Rajani Kanth.B
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

  Reply With Quote

Old   January 11, 2013, 04:08
Default Temperature-dependent heat source
  #4
Senior Member
 
Join Date: Nov 2009
Posts: 125
Rep Power: 17
mactech001 is on a distinguished road
Dear all,

i want to apply a heat source that is temperature-dependent. 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 temperature-dependent 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
mactech001 is offline   Reply With Quote

Old   May 1, 2013, 10:31
Default
  #5
Member
 
Sheng
Join Date: Jun 2011
Posts: 62
Rep Power: 15
micro11sl is on a distinguished road
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.
micro11sl 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
Injection of the source term UDF stage81 FLUENT 0 September 27, 2010 08:20
UDF Source Term Christian FLUENT 4 August 1, 2009 06:53
The source term of UDF summer FLUENT 0 August 24, 2006 18:44
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 14, 2000 00:03
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 04:43


All times are GMT -4. The time now is 16:32.