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

UFD code for sink term

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Bruno Machado

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 2, 2016, 01:55
Default UFD code for sink term
  #1
New Member
 
anubhav
Join Date: Sep 2014
Posts: 8
Rep Power: 12
anubhavd is on a distinguished road
I am trying to write a ufd code for nucleation of zinc vapor. As a result of nucleation the concentration of zinc vapor decrease. Can anybody help me from where i should start ? Should I treat this(nucleation) as mass sink term? If yes then how should I add this sink term in my model.

My model can be assumed a simple rectangle with one inlet and outlet.The zinc vapor are introduced from inlet at high temperature and as it proceeds to outlet there is drop in temperature. As a result of this temperature drop nucleation occurs.
anubhavd is offline   Reply With Quote

Old   February 2, 2016, 06:40
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
so the nucleation has a dependence on temperature (does it depends on position)? Can you post the formula?

You need to add a source term in the specie you want to decrease and also the same term in the mass equation (continuity), otherwise your balance wont match.
anubhavd and souza.emer like this.
Bruno Machado is offline   Reply With Quote

Old   February 3, 2016, 06:26
Default
  #3
New Member
 
anubhav
Join Date: Sep 2014
Posts: 8
Rep Power: 12
anubhavd is on a distinguished road
The formula for nucleation rate (m^-3 S^-1) is
Nucleation rate = (4*pi*r^2)*(exp(-del G/KT))

In short it depends upon temperature and mass concentration of zinc vapor rest all are constant.
anubhavd is offline   Reply With Quote

Old   February 3, 2016, 06:49
Default
  #4
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by anubhavd View Post
The formula for nucleation rate (m^-3 S^-1) is
Nucleation rate = (4*pi*r^2)*(exp(-del G/KT))

In short it depends upon temperature and mass concentration of zinc vapor rest all are constant.
Fluent source terms are defined in a generation rate/volume. In case of mass, for example, its unity is kg/m3.s. Thus, you gotta check your equation to match the same unity. This is just a draft of your source term. You need to define r, K and if -del G is the gradient of a concentration, you need to create an UDS and define it as your specie in order to obtain the gradient.

#include "udf.h"

#define PI 3.14159265

DEFINE_SOURCE(nucleation_source,c,t,dS,eqn)
{
real T, K, r;

T = C_T(c,t);
r = .......................;
K = ......................;

source = (4.0*PI*pow(r,2.0))*(exp(-del G/K*T));
dS[eqn] = 0.0;

return source;
}
Bruno Machado is offline   Reply With Quote

Old   February 3, 2016, 07:19
Default
  #5
New Member
 
anubhav
Join Date: Sep 2014
Posts: 8
Rep Power: 12
anubhavd is on a distinguished road
Dear Bruma

In Ansys help it is written that:
Note that if you define a mass source for a cell zone, you should also define a momentum source and, if appropriate for your model, energy and turbulence sources.
If you define only a mass source, that mass enters the domain with no momentum or thermal heat. The mass will therefore have to be accelerated and heated by the flow and, consequently, there may be a drop in velocity or temperature. This drop may or may not be perceptible, depending on the size of the source. (Note that defining only a momentum, energy, or turbulence source is acceptable.)

Is it necessary in mine case also?
anubhavd is offline   Reply With Quote

Old   February 3, 2016, 07:23
Default
  #6
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by anubhavd View Post
Dear Bruma

In Ansys help it is written that:
Note that if you define a mass source for a cell zone, you should also define a momentum source and, if appropriate for your model, energy and turbulence sources.
If you define only a mass source, that mass enters the domain with no momentum or thermal heat. The mass will therefore have to be accelerated and heated by the flow and, consequently, there may be a drop in velocity or temperature. This drop may or may not be perceptible, depending on the size of the source. (Note that defining only a momentum, energy, or turbulence source is acceptable.)

Is it necessary in mine case also?
I cant tell you. you should do this analyse and check if it is significant or not.
Bruno Machado 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
How would you code this simple term into OpenFOAM? CHARLES OpenFOAM Programming & Development 1 April 23, 2014 22:32
URGEN Is any one used CAFFAC code with source term Arash Main CFD Forum 3 January 8, 2002 19:55
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 16:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 09:10
UDF Scalar Code: HT 1 Greg Perkins FLUENT 8 October 20, 2000 13:40


All times are GMT -4. The time now is 20:08.