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/)
-   -   Problem with definition of normal gradient to a surface (https://www.cfd-online.com/Forums/openfoam-solving/108412-problem-definition-normal-gradient-surface.html)

batta31 October 23, 2012 03:53

Problem with definition of normal gradient to a surface
 
Hi guys!

I'm experiencing some troubles with the definition of the normal gradient of the velocity to a patch. What I need to obtain is the normal gradient to the patch of the normal component of the velocity and the tangential component of the velocity separately.

So I've tried so implement this piece of code:

word patchName1 = "foil";
label patchID1 = mesh.boundary().findPatchID(patchName1);
vectorField UN((mesh.boundary()[patchID1].nf() & U.boundaryField()[patchID1]) * mesh.boundary()[patchID1].nf());
vectorField UT(U.boundaryField()[patchID1] - UN);
vectorField gradUT(fvc::snGrad(UT));

But it doesn't work. Do you have any ideas? I really don't know what to do.

Cheers
Simone

batta31 October 26, 2012 08:48

There isn't anyone who can give me a suggestion?


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