# 2nd derivative in UDS

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

 January 19, 2005, 12:35 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.

 January 19, 2005, 14:47 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

 January 20, 2005, 06:13 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.

 January 20, 2005, 06:53 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

 January 20, 2005, 06:58 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.

 January 24, 2005, 11:54 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.

 January 24, 2005, 12:15 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

 July 22, 2013, 11:05 #8 New Member   liu hongbo Join Date: Jul 2013 Posts: 5 Rep Power: 5 "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?

 July 29, 2013, 05:43 #9 Senior Member     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 613 Blog Entries: 17 Rep Power: 20 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.

 September 21, 2015, 09:15 #10 Member   Join Date: Nov 2014 Posts: 42 Rep Power: 4 Thank you for your posts. Last edited by Maryam-A; September 22, 2015 at 02:05.

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post maka OpenFOAM Pre-Processing 1 November 8, 2007 16:04 Vishal FLUENT 0 May 25, 2006 06:54 Ray Hong FLUENT 0 December 28, 2005 07:03 Andrea CFX 2 October 11, 2004 05:12 Thomas Wolfanger Main CFD Forum 1 June 29, 1999 11:00

All times are GMT -4. The time now is 02:36.