CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Documentation for Neumann boundary conditions in OpenFOAM (https://www.cfd-online.com/Forums/openfoam-solving/240087-documentation-neumann-boundary-conditions-openfoam.html)

MamboJambo December 11, 2021 06:38

Documentation for Neumann boundary conditions in OpenFOAM
 
Hi,

I was looking to implement some Neumann boundary conditions.

I am taking a look at fixedGradient and https://www.openfoam.com/documentati...-gradient.html and mixed boundary conditions https://www.openfoam.com/documentati...d.html#details.

They appear to be the same (on the latter I should set the valueFraction to zero), but the documentation seems weird:
The fixedGradient will tell you that it is a Neumann condition defined as:

\phi_f = \phi_C + \Delta \nabla \phi_{ref}

Where \phi_{ref} should be the gradient normal to the face?


Upon checking the code, the implementation seems to be on the evaluate function with:
Code:

    Field<Type>::operator=
    (
        this->patchInternalField() + gradient_/this->patch().deltaCoeffs()
    );

And deltaCoeffs() should be the inverse of the distance between face center and cell center?

On the other hand the mixed boundary is defined as:

x_p = w x_p + (1-w) \left( x_c + \dfrac{\nabla_{\perp } x}{\Delta}\right)

Here \nabla_{\perp } is specifically stated to be the patch normal gradient and the distance term appears in the denominator.

Upon checking the code of the evaluate function I see:
Code:

    Field<Type>::operator=
    (
        valueFraction_*refValue_
      +
        (1.0 - valueFraction_)*
        (
            this->patchInternalField()
          + refGrad_/this->patch().deltaCoeffs()
        )
    );

Where the last term seems to be the same as the fixedGradient boundary.

So my question here is: Why two different documentations for something that seems to be the same ? Did I misunderstood something?


All times are GMT -4. The time now is 09:28.