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

2nd derivative in UDS

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 19, 2005, 12:35
Default 2nd derivative in UDS
  #1
Andrew Garrard
Guest
 
Posts: n/a
Please Please Help someone. I am trying to model a diffuion - convection - migration problem with a UDS. The transport equation I want to model is this:

del(vel * C) + del( D * del[C]) + del(D * C * A * del[thi]) = 0

Where del is the gradient (sometimes called nabla), vel is the velocity vector, C is the concentration, D is the diffusion coefficient, A is a constant and thi is another UDS (say UDS1).

I can write a diffusion/convection UDF easily using the F_FLUX macro, but I have no idea where to start with the last term for migration. Please Please someone help me.
  Reply With Quote

Old   January 19, 2005, 14:47
Default Re: 2nd derivative in UDS
  #2
Giordano Bruno
Guest
 
Posts: n/a
Hi Andrew,

if D and A are costant you could try to rewrite the third term in this way:

del(D * C * A * del[thi]) =

D*A*(del[thi]*del[C]+C*del(del[thi]).

Giordano Bruno
  Reply With Quote

Old   January 20, 2005, 06:13
Default Re: 2nd derivative in UDS
  #3
Andrew Garrard
Guest
 
Posts: n/a
Thanks Giordano, I can't say that I fully understand how that equation was derived, but, assuming that it is correct, how do I implement solving for C using a user defined scalar. With this equation I now have a first AND second derivative of thi and another first derivative of of C to deal with.
  Reply With Quote

Old   January 20, 2005, 06:53
Default Re: 2nd derivative in UDS
  #4
Giordano Bruno
Guest
 
Posts: n/a
You could implement the first term:

D*A*(del[thi]*del[C]

as dot product of C_UDSI_G(...thi) and C_UDSI_G(...C),

but for the last part of second term:

del(del[thi])

maybe you have to implement a code for partial derivative of thi gradient but I don't know if this is possible...

Good luck!!!

Giordano Bruno
  Reply With Quote

Old   January 20, 2005, 06:58
Default Re: 2nd derivative in UDS
  #5
Andrew Garrard
Guest
 
Posts: n/a
So, I am back where I started in the equation I first put up. - I can't get del(del[thi]).

The irritating thing is I have read a paper buy someone who has done it in fluent, I just have no idea how. Hopefully they will get back to me about it.
  Reply With Quote

Old   January 24, 2005, 11:54
Default Re: 2nd derivative in UDS
  #6
swarup
Guest
 
Posts: n/a
Hi Andrew,

will it be possible to view the second derivative of thi as first derivative of its first derivative? will you be able to find del(thi) first and then find del of del(thi). i guess you may have to use same macro twice some way.

swarup.
  Reply With Quote

Old   January 24, 2005, 12:15
Default Re: 2nd derivative in UDS
  #7
Andrew Garrard
Guest
 
Posts: n/a
Thanks for all your comments, but the person who did it got back to me. The way to do it is actually very simple. If you define the UDS flux, then you the term the UDF returns sits inside a del function anway, so you simply retun the first derivative and fluent takes care of the second part for you. I was trying to set it as a source term
  Reply With Quote

Old   July 22, 2013, 11:05
Default
  #8
New Member
 
liu hongbo
Join Date: Jul 2013
Posts: 5
Rep Power: 4
biker is on a distinguished road
"Thanks for all your comments, but the person who did it got back to me. The way to do it is actually very simple. If you define the UDS flux, then you the term the UDF returns sits inside a del function anway, so you simply retun the first derivative and fluent takes care of the second part for you. I was trying to set it as a source term"
dear friend, i have the same problem of solving the same equation in fluent ,i can't really understand your mean about what you say, could you explain it in detail one more time?
biker is offline   Reply With Quote

Old   July 29, 2013, 05:43
Default
  #9
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 531
Blog Entries: 14
Rep Power: 17
sbaffini will become famous soon enough
I try to understand and explain:

- the first approach tried by Andrew was to implement the last term as a source term. It seems it didn't worked. Still, i don't see why it shouldn't; you just need to define the scalar (an actual UDS) UDS1 = (some stuff) * del (UDS0). At this point, the gradient of UDS1 is also available and you can use it as a source term.

- the second approach, which turns out to work (but i kinda see problematic) is: as the required term has to appear under a divergence term, it is not much different from the convective term. Hence, the idea is to modify the definition of the convective flux (trough the UDS_FLUX routine) in order to take into account both the real convective part and the required additional term.
sbaffini is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boundary condition involving 2nd derivative of U maka OpenFOAM Pre-Processing 1 November 8, 2007 16:04
2nd order derivative calculation at the boundaries Vishal FLUENT 0 May 25, 2006 06:54
How to set B.C. of the 2nd or 3rd type in UDS? Ray Hong FLUENT 0 December 28, 2005 07:03
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12
2nd derivative on nonorthogonal FV-mesh Thomas Wolfanger Main CFD Forum 1 June 29, 1999 11:00


All times are GMT -4. The time now is 23:54.