CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Gradient at face center of a scalar volume field (http://www.cfd-online.com/Forums/openfoam/90014-gradient-face-center-scalar-volume-field.html)

praveen June 28, 2011 12:33

Gradient at face center of a scalar volume field
 
Hello

How do I get the gradient vector at the face centers, given a scalar volume field ?

santiagomarquezd June 28, 2011 12:49

Praveen, it's usually achieved by a linear interpolation of fvc::grad(field) at faces. The following is an example taken from:

src/transportModels/interfaceProperties/interfaceProperties.C


Code:

00113    // Cell gradient of alpha
00114    const volVectorField gradAlpha(fvc::grad(alpha1_));
00115
00116    // Interpolated face-gradient of alpha
00117    surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha));

Regards.

praveen June 29, 2011 00:02

Thanks. So I guess there is no available scheme to directly obtain face gradients by applying a green-gauss or least-squares scheme centered at the face-center.

Bernhard June 29, 2011 02:20

What do you mean by directly? You set the discretization of grad(alpha) and interpolate(gradAlpha) in fvSchemes as you're used to.

praveen June 29, 2011 02:23

Without interpolation. Define a volume around the face center and apply green-gauss theorem. Or least squares method.

Bernhard June 30, 2011 08:00

If you're referring to a staggered kind of mesh, I don't think such a thing is possible in OpenFOAM


All times are GMT -4. The time now is 10:58.