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

UDS

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 26, 2001, 08:26
Default 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)?
  Reply With Quote

Old   July 26, 2001, 13:19
Default 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.
  Reply With Quote

Old   July 26, 2001, 20:28
Default 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
  Reply With Quote

Old   July 27, 2001, 09:48
Default 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
  Reply With Quote

Old   July 27, 2001, 09:54
Default 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
  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
PEM modeling UDS diffusivity in mixture gemini FLUENT 6 August 7, 2012 07:37
fixed value in the domain for a UDS in case of multiphase flow swati_mohanty FLUENT 2 November 30, 2010 04:17
Doubts UDS Flux, UDS Unsteady for VOF model kel85uk FLUENT 0 March 17, 2010 09:53
UDS Flux Function Choice Yang Chung FLUENT 0 August 10, 2008 06:57
A good question about UDS Z FLUENT 1 March 31, 2005 15:14


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