|
[Sponsors] |
May 30, 2014, 04:20 |
Source term in Fluent
|
#1 |
Senior Member
Join Date: Jan 2012
Posts: 197
Rep Power: 14 |
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 |
|
May 30, 2014, 10:07 |
|
#2 |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
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 |
|
May 30, 2014, 10:28 |
|
#3 | |
Senior Member
Join Date: Jan 2012
Posts: 197
Rep Power: 14 |
Quote:
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) |
||
May 30, 2014, 11:58 |
|
#4 | |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
Quote:
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 |
||
May 30, 2014, 12:11 |
|
#5 | |
Senior Member
Join Date: Jan 2012
Posts: 197
Rep Power: 14 |
Quote:
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 |
||
May 30, 2014, 13:23 |
|
#6 | |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
Quote:
"Numerical heat transfer and fluid flow" written by Patankar pages 48 and 143. There's a good explanation there regarding source term.
__________________
Regard yours |
||
June 2, 2014, 06:36 |
|
#7 | |
Senior Member
Join Date: Jan 2012
Posts: 197
Rep Power: 14 |
Quote:
|
||
June 2, 2014, 13:24 |
|
#8 | |
Senior Member
Join Date: Jan 2012
Posts: 197
Rep Power: 14 |
Quote:
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=' |
||
|
|
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 |