|
[Sponsors] |
July 26, 2001, 08:26 |
UDS
|
#1 |
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 |
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 |
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 |
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 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDS Flux Function Choice | Yang Chung | FLUENT | 1 | November 17, 2015 01:14 |
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 03:17 |
Doubts UDS Flux, UDS Unsteady for VOF model | kel85uk | FLUENT | 0 | March 17, 2010 08:53 |
A good question about UDS | Z | FLUENT | 1 | March 31, 2005 15:14 |