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

Source term in Fluent

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 30, 2014, 04:20
Default Source term in Fluent
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
I wanna put a source term (du/dz=constant) in a cell zone in the u equation to act like a shear stress

However, I have no experience of writing source term (didn't find relevant examples from internet)

Can you please suggest me some hints to write this source term?

Thanks
itsme_kit is offline   Reply With Quote

Old   May 30, 2014, 10:07
Default
  #2
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14
A CFD free user is on a distinguished road
Hi,
Nothing special makes you worry. The only thing you need to know is velocity gradient in a particular direction. Have a look at the manual and you find how to do that.
__________________
Regard yours
A CFD free user is offline   Reply With Quote

Old   May 30, 2014, 10:28
Default
  #3
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Quote:
Originally Posted by A CFD free user View Post
Hi,
Nothing special makes you worry. The only thing you need to know is velocity gradient in a particular direction. Have a look at the manual and you find how to do that.
Hi Azarafra

Thanks for your reply

There is one example shown in the manual (adding a momentum source to a duct flow)

The link: http://aerojet.engr.ucdavis.edu/flue...df/node232.htm

For this formula: S=-CV, I can understand this is to force velocity into zero, even though I don’t know how the value of constant C is figured out

For my case, I have a relationship: du/dz=constant value at a specific position

However, I have no idea how I can transfer my formula (du/dz=constant) into this kind of form (S=-CV)
itsme_kit is offline   Reply With Quote

Old   May 30, 2014, 11:58
Default
  #4
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14
A CFD free user is on a distinguished road
Quote:
Originally Posted by itsme_kit View Post
Hi Azarafza

Thanks for your reply

There is one example shown in the manual (adding a momentum source to a duct flow)

The link: http://aerojet.engr.ucdavis.edu/flue...df/node232.htm

For this formula: S=-CV, I can understand this is to force velocity into zero, even though I don’t know how the value of constant C is figured out

For my case, I have a relationship: du/dz=constant value at a specific position

However, I have no idea how I can transfer my formula (du/dz=constant) into this kind of form (S=-CV)

Well, I had a look at the manual and I think nothing is ambiguous. S, is source term and as it was mentioned in order to enhance stability and convergence, it's recommended that one employes the derivative term which is derivative with respect to the variable. So, in your case you need to use C_U_G(c,t)[2], which actually is dU/dz and G denotes gradient and index [2] means in direction z.
I hope it helps
__________________
Regard yours
A CFD free user is offline   Reply With Quote

Old   May 30, 2014, 12:11
Default
  #5
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Quote:
Originally Posted by A CFD free user View Post
Well, I had a look at the manual and I think nothing is ambiguous. S, is source term and as it was mentioned in order to enhance stability and convergence, it's recommended that one employes the derivative term which is derivative with respect to the variable. So, in your case you need to use C_U_G(c,t)[2], which actually is dU/dz and G denotes gradient and index [2] means in direction z. So, I suppose your source term is something like this:

S=-*C_U_G(c,t)[2]=K (cons)
dS[eqn]=0.0

I hope it helps
Hi Azarafra

I think I got your point

There are two things I'm still in doubt:

a) you said I need to use C_U_G(c,t) which is a gradient vector macro, but I found another macro for cell velocity derivative: C_DUDZ(c,t) in UDF manual

I'm not sure what's the difference between them

b) as the manual said: The solver linearizes source terms in order to enhance the stability and convergence of a solution. To
allow the solver to do this, you need to specify the dependent relationship between the source and
solution variables in your UDF, in the form of derivatives.

I couldn't understand this sentence. why derivative form can enhance stability and convergence

Thanks for your help again
itsme_kit is offline   Reply With Quote

Old   May 30, 2014, 13:23
Default
  #6
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14
A CFD free user is on a distinguished road
Quote:
Originally Posted by itsme_kit View Post
Hi Azarafra

I think I got your point

There are two things I'm still in doubt:

a) you said I need to use C_U_G(c,t) which is a gradient vector macro, but I found another macro for cell velocity derivative: C_DUDZ(c,t) in UDF manual

I'm not sure what's the difference between them

b) as the manual said: The solver linearizes source terms in order to enhance the stability and convergence of a solution. To
allow the solver to do this, you need to specify the dependent relationship between the source and
solution variables in your UDF, in the form of derivatives.

I couldn't understand this sentence. why derivative form can enhance stability and convergence

Thanks for your help again
OK, for the first question, I suppose there is no actually any difference between the two macros. Because C_U_G(c,t)[2] means as the same du/dz. For, the second question, I think you'd better have a look at the following book:

"Numerical heat transfer and fluid flow" written by Patankar pages 48 and 143. There's a good explanation there regarding source term.
__________________
Regard yours
A CFD free user is offline   Reply With Quote

Old   June 2, 2014, 06:36
Default
  #7
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Quote:
Originally Posted by A CFD free user View Post
OK, for the first question, I suppose there is no actually any difference between the two macros. Because C_U_G(c,t)[2] means as the same du/dz. For, the second question, I think you'd better have a look at the following book:

"Numerical heat transfer and fluid flow" written by Patankar pages 48 and 143. There's a good explanation there regarding source term.
Really appreciate your useful help
itsme_kit is offline   Reply With Quote

Old   June 2, 2014, 13:24
Default
  #8
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Quote:
Originally Posted by A CFD free user View Post
OK, for the first question, I suppose there is no actually any difference between the two macros. Because C_U_G(c,t)[2] means as the same du/dz. For, the second question, I think you'd better have a look at the following book:

"Numerical heat transfer and fluid flow" written by Patankar pages 48 and 143. There's a good explanation there regarding source term.
Hi I got another problem

Is the following structure correct?

DEFINE_SOURCE(dissipation_gradient,cell,thread,dS, eqn)
{
real source;
source=C_D_G(cell,thread)=-0.000003;
dS[eqn]=0.;
return source;
}

I got an error 'invalid lvalue in assignment' in line starting with 'source='
itsme_kit 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
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 10:03
Help- Additional TKE Source Term in Fluent prashantthaker208 FLUENT 0 May 23, 2014 00:00
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error FerdiFuchs OpenFOAM Community Contributions 27 April 16, 2014 15:14
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 17:18
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24


All times are GMT -4. The time now is 18:05.