CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   gradient source term UDF (http://www.cfd-online.com/Forums/fluent-udf/66219-gradient-source-term-udf.html)

ak6g08 July 9, 2009 06:37

gradient source term UDF
 
hi everyone,

I have a user defined scalar for a variable Q, and a user defined scalar for a variable V. In the scalar equation for Q, a source term appears as follows:

(Dq/dx)*(DV/dx)*constants (1)

where the variable Q appears as a source term for the user defined scalar equation for V as (Q/constant). Everything works beautifully when I turn this source term (eq 1) OFF.

The way I implemented this source term (equation 1) is within a DEFINE_SOURCE function as

C_UDSI_G(c,t,0)[0]*C_UDSI_G(c,t,1)[0]*constants
where dS[eqn]=0

and the solution diverges. I am pretty sure this is because of a checkerboarding effect as with pressure-velocity coupling. I therefore probably need to manually discretise the source term in the FLUENT UDF environment...how can I access north,south,west and east nodal positions so that I can do this in 2D?? and later in 3D? is this even possible in fluent?? This has been troubling me for quite some time now...any help is appreciated.

Thanks
AK


All times are GMT -4. The time now is 00:26.