CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)

 andyru July 16, 2013 07:54

short question: zeroGradient equal fixedGradient=(0 0 0) ?!

Hello,

I looked at fixedGradientFvPatchField.C and
zeroGradientFvPatchField.C and for me

Code:

```type fixedGradient; value uniform (0 0 0);```
behaves like using:
Code:

`type zeroGradient;`
So why do we have zeroGradient? fixedGradient type would be enough?!
Or do I draw the wrong conclusion?

Best regards,

Andy

 Bernhard July 16, 2013 08:34

They are not the same. zeroGradient only garantuees the wall-normal derivative to be zero, not the complete gradient.

 andyru July 16, 2013 12:52

Thank you for the fast answer. I got it.

Next little question:
A given fixedGradient value (a b c) will specify the gradient of for example U in the standard Coordinate-System(x,y,z) on a patch
HTML Code:

`http://foam.sourceforge.net/docs/cpp/a00671.html#details`
This boundary condition supplies a fixed gradient condition, such that the patch values are calculated using:

http://foam.sourceforge.net/docs/cpp/form_17.png
where
http://foam.sourceforge.net/docs/cpp/form_18.png = patch values
http://foam.sourceforge.net/docs/cpp/form_19.png = internal field values
http://foam.sourceforge.net/docs/cpp/form_20.png = gradient (user-specified)
http://foam.sourceforge.net/docs/cpp/form_21.png = inverse distance from patch face centre to cell centre

Hence, x_p is independent from the normal patch face vector?