CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to control the fvcgrad scheme (http://www.cfd-online.com/Forums/openfoam-solving/58470-how-control-fvcgrad-scheme.html)

ivan_cozza October 13, 2008 07:18

Hi to everybody! I need to co
 
Hi to everybody!
I need to control explicitly the interpolation scheme used in the fvc::grad operator. I read that if I use fvc::grad(phi), where phi is a vol<type>Field, the gradient is performed with the linear interpolation of phi on the cell-faces, while if I whant to control the interpolation scheme I have to set phi to a surface<type>Field.
The problem is that if I put

surfaceTensorField phi = mesh.Sf()*u1;

it doesn't work!
What's wrong?
Thank you, Ivan

schmidt_d October 14, 2008 09:57

Ivan, Actually, grad(phi) use
 
Ivan,
Actually, grad(phi) uses the corresponding technique stipulated in the fvSchemes file, which is not always linear interpolation. You can control this behavior by changing inputs, not code.
-DPS

ivan_cozza October 14, 2008 10:30

David, you mean that if I wan
 
David,
you mean that if I want to compute my gradient of volScalarField p with a (for example) cubic scheme I just have to write:

fvc::grad(p)

and after in the fvSchemes I have to write

gradSchemes
{
default Gauss cubic;
}

?
If it is, I misunderstood the programmer's guide passage in which it says that if put a vol<type>Field in a fvc::div or in a fvc:grad, the code uses by default a linear centred interpolation for the variables...


All times are GMT -4. The time now is 19:48.