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/)
-   -   How can I get the pressure gradient along the direction normal to the local wall surface (https://www.cfd-online.com/Forums/openfoam-solving/58331-how-can-i-get-pressure-gradient-along-direction-normal-local-wall-surface.html)

qtian January 14, 2008 15:28

Hello, Can anyone tell me h
 
Hello,

Can anyone tell me how to the pressure gradient normal to the local wall surface? I have caculated pressure gradient at the first node away from surface. However, I don't know how to get the information of local normal vectors to the wall. Thanks

eugene January 18, 2008 05:29

p.boundaryField().snGrad();
 
p.boundaryField()[patchID].snGrad();

Which is generally zero for walls.

You seem to want to extrapolate the pressure gradient. To do this you will need:

volVectorField gradp = fvc::grad(p);
vectorField nearSurfaceGradP = gradp.boundaryField()[patchID].patchInternalField();

const vectorField& surfaceNormal = mesh.boundary()[patchID].nf();

scalarField gradpWallNormal = nearSurfaceGradP & surfaceNormal;

kerstin November 17, 2008 07:11

Hi all, I tried this code a
 
Hi all,

I tried this code above to calculate the gradient of a tensor component in normal direction to the wall...

label wallPatchID = mesh.boundaryMesh().findPatchID("wall");
volScalarField S11 = StressTensor.component(tensor::XX);

volVectorField gradS11 = fvc::grad(S11);
vectorField nearSurfaceGradS11 = gradS11.boundaryField()[wallPatchID].patchInternalField();
scalarField gradS11WallNormal = nearSurfaceGradS11 & surfaceNormal;

Compiles without errors. But I get an error message if I try to run the case.

#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/data/home/openfoam/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/data/home/openfoam/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 ?? in "/lib64/tls/libc.so.6"
#3 Foam::tmp<foam::field<foam::innerproduct<foam::vec tor<double>, Foam::Vector<double> >::type> > Foam::operator&<foam::vector<double>, Foam::Vector<double> >(Foam::
UList<foam::vector<double> > const&, Foam::UList<foam::vector<double> > const&) in "/data/home/openfoam/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/lami nar
PTT"

It looks like having problems with the vector product in the last line?

Kerstin

spam3c April 4, 2014 05:05

any quick post processing tool to compute pressure gradients in the domain
 
Hi,

Do we have any option/tool in openfoam
like a post processing tool to compute pressure gradients in three directions in a 3D domain?

Thanks, regards


All times are GMT -4. The time now is 21:16.