CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   Two ways for Gradient: two different worlds? (

frank October 4, 2008 09:35

Two ways for Gradient: two different worlds?
hi all,

I add an additional variable named 'myav' for a 3D subdomain with poisson equation to my model in CFX 10.0. I want to get the Gradient of 'myav', so i have done the following in user CEL subroutine and the core part is

CALL USER_GETVAR('myfluid.myav.Gradient',...)

and set the returned value to another additional variable named 'myavGrad'.This method can be found in given by opaque. Everything goes well.

But in CFX-POST, There is a variable named 'myav.Gradient' given by the system. So the two methods should give out the same gradient distribution, but they do not. The distribution by system is right and gradient by fortran subroutine is irrational.


I check the help document for USER_GETVAR. There is a paragraph about 'LOCALE',Gradient for 'Vertices', 'ELement averaged' and 'face averaged'. Is it where the difference comes from? How to select the LOCALE in USER_GETVAR?

Any suggestion will be appreciated.


frank October 4, 2008 21:46

Re: Two ways for Gradient: two different worlds?
Sorry,they are the same. The difference come from me!

CycLone October 6, 2008 10:46

Re: Two ways for Gradient: two different worlds?
Hi Frank,

Version 11 introduced CEL functions you can use in the solver to return gradients; you no longer need to use FORTRAN for this. The gradient of "myav" in the X direction is simply myav.Gradient X.

To get the gradients, create a second AV of type vector, "myav gradient" and set the X, Y, and Z components of the vecotr equal to myav.Gradient X, myav.Gradient Y, and myav.Gradient Z respectively.


All times are GMT -4. The time now is 08:20.