# UDS

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 26, 2001, 08:26 UDS #1 Vale Guest   Posts: n/a I am trying to write a UDF for the source term of a UDS equation. Is there any possibility to access gradient of the UDS (something like the macros C_DUDX(c,t), C_DUDY(c,t)... used for velocity components)?

 July 26, 2001, 13:19 Re: UDS #2 Ugur Guest   Posts: n/a Try the array C_UDSI_G(c,t,i)[j]. i is the user defined scalar number and j is the direction. 0 for x direction gradient, 1 for y direction and 2 for z direction.

 July 26, 2001, 20:28 Re: UDS #3 Greg Perkins Guest   Posts: n/a This works, but you may need to be careful how you use it. For example if you want to modify the pde by adding a term like d/dx_i(thi) where thi is your uds, adding the term above will not strictly be conservative and numerical errors could result. For these applications, its better to apply the divergence theorem and determine the face fluxes yourself in the udf source term than use the pre-calculated gradient term. The section on the solver in the manual details this discretization process. This requires more programming and takes longer to compute inside Fluent, but it will give you the correct answer to your pde, which will not be the case if you add the gradient term. Greg

 July 27, 2001, 09:48 Re: UDS #4 Ugur Guest   Posts: n/a Thanks for your note, I already noticed it, but i have been using dUDS0/dx for another source term in my momentum equation. WIll it create the same problem? Ugur

 July 27, 2001, 09:54 Re: UDS #5 Greg Perkins Guest   Posts: n/a I suggest checking against an analytical solution for a pde to see the difference. You will need to decide for your application. You could always ask Fluent how that value is actually calculated - I think it might be cell to cell, rather than at faces, as required by the CV method etc. Greg

 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 Yang Chung FLUENT 1 November 17, 2015 02:14 gemini FLUENT 6 August 7, 2012 07:37 swati_mohanty FLUENT 2 November 30, 2010 04:17 kel85uk FLUENT 0 March 17, 2010 09:53 Z FLUENT 1 March 31, 2005 15:14

All times are GMT -4. The time now is 06:40.

 Contact Us - CFD Online - Privacy Statement - Top