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/)
-   -   Wall distance volScalarField (http://www.cfd-online.com/Forums/openfoam-solving/59557-wall-distance-volscalarfield.html)

r2d2 July 18, 2007 04:23

Hi all, Does anyone have any
 
Hi all,
Does anyone have any suggestion as to how to define a volScalarField that is the distance to the wall patches in the mesh.
tried:

#include "wallDist.H"

...bla bla

volScalarField d
(
IOobject
(
"d",
runTime.timeName(),
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("d", dimLength, SMALL),
calculatedFvPatchScalarField::typeName
);

d = wallDist(mesh);

...does not compile...
Error---->(
wallDistance.C: In function ‚int main(int, char**)‚:
wallDistance.C:43: warning: use of old-style cast
/home/radu/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude/wallDist.H:99: error: ‚Foam::wallDist::wallDist(const Foam::wallDist&)‚ is private
wallDistance.C:43: error: within this context
make: *** [Make/linuxGcc4DPOpt/wallDistance.o] Error 1



)


Is this going to give me the minimum of the distance (say if I have more than one patch or I have two connected wall patches like in a corner)?
Cheers,
Radu

eugene July 19, 2007 07:17

Try d = wallDist(mesh).y()
 
Try d = wallDist(mesh).y()

r2d2 July 19, 2007 08:01

Thanks Eugene, Seems to work
 
Thanks Eugene,
Seems to work fine. Tried it with icoFoam/cavity
and OK.
Radu


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