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 to use volPointInterpolation (https://www.cfd-online.com/Forums/openfoam-solving/59373-how-use-volpointinterpolation.html)

oleg_weinstein October 16, 2007 07:24

Hello, How to use volPoint
 
Hello,

How to use volPointInterpolation?

I had looked on the follows examples:

OpenFOAM-1.3/applications/utilities/postProcessing/miscellaneous/sample/sample.C
OpenFOAM-1.3/applications/utilities/postProcessing/dataConversion/foamToVTK/foam ToVTK.C

But I not succeed to apply this to my case.

I have the field

volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

Inside the program I use the lines:

// Set up interpolation
autoPtr<pointmesh> pMeshPtr(new pointMesh(mesh));
autoPtr<volpointinterpolation> pInterpPtr
(
new volPointInterpolation(mesh, pMeshPtr())
);

How I can thus found pointScalarField Tp?

hjasak October 16, 2007 07:42

Try: pointMesh pMesh(mesh);
 
Try:

pointMesh pMesh(mesh);
volPointInterpolation vpi(mesh, pMesh);

pointScalarField Tp = vpi.interpolate(T);


Enjoy,

Hrv

P.S. Get rid of all those autoPtrs for things that C++ will do for you anyway.

oleg_weinstein October 19, 2007 06:34

Thank you, It works.
 
Thank you,

It works.

studrud August 24, 2009 04:34

hello,
i've tried to change foamToVTK.C to write out the pointScalarfield of p for my problem.

the code looks like this:

PtrList<volScalarField> vsf;
readFields(vMesh, vMesh.baseMesh(), objects, selectedFields, vsf);
print(" volScalarFields :", Info, vsf);

PtrList<volVectorField> vvf;
readFields(vMesh, vMesh.baseMesh(), objects, selectedFields, vvf);
print(" volVectorFields :", Info, vvf);

PtrList<volSphericalTensorField> vSpheretf;
readFields(vMesh, vMesh.baseMesh(), objects, selectedFields, vSpheretf);
print(" volSphericalTensorFields :", Info, vSpheretf);

PtrList<volSymmTensorField> vSymmtf;readFields(vMesh,
vMesh.baseMesh(), objects, selectedFields, vSymmtf);
print(" volSymmTensorFields :", Info, vSymmtf);

PtrList<volTensorField> vtf;
readFields(vMesh, vMesh.baseMesh(), objects, selectedFields, vtf);
print(" volTensorFields :", Info, vtf);

label nVolFields =
vsf.size()
+ vvf.size()
+ vSpheretf.size()
+ vSymmtf.size()
+ vtf.size();

//***********************************************
//this i've added
pointMesh pMesh(mesh);
volPointInterpolation pInterp(mesh, pMesh);

pointScalarField Pp(pInterp.interpolate(vsf.operator[]));

fileName FileName
(
fvPath/Pp
+ "_"
+ name(timeI)
+ ".dat"
);

internalWriter write(pMesh, binary, FileName);
write.write(Pp);
//***********************************************

the error, which i get, is this one:

foamToVTK.C:485: error: no matching function for call to 'Foam::internalWriter::internalWriter(Foam::pointM esh&, bool&, Foam::fileName&)'
internalWriter.H:78: note: candidates are: Foam::internalWriter::internalWriter(const Foam::vtkMesh&, bool, const Foam::fileName&)
internalWriter.H:59: note: Foam::internalWriter::internalWriter(const Foam::internalWriter&)
foamToVTK.C:486: error: no matching function for call to 'Foam::internalWriter::write(Foam::pointScalarFiel d&)'
make: *** [Make/linux64GccDPOpt/foamToVTK.o] Error 1


can someone please help me?

lakeat April 20, 2012 09:22

Quote:

pointMesh pMesh(mesh);
volPointInterpolation vpi(mesh, pMesh);

pointScalarField Tp = vpi.interpolate(T);
I tried to use this code do the interpolation, but I found on the boundaries, the results have not been interpolated.

The Tp boundary field is always shown as "calculated"..

Any ideas?

Arnoldinho October 11, 2012 08:27

Hi Daniel,

I ran into similar trouble as point values in my case are not interpolated at processor boundaries in parallel computations. Have you found a quick solution for it?

Arne

jameswilson620 May 18, 2015 19:51

These are pressing questions for those running in parallel. Any progress?

jameswilson620 May 27, 2015 12:24

for 2.3.0 I was able to add the appropriate headers and definitions to get a point interpolation of cell values. See:

http://www.cfd-online.com/Forums/ope...ue-access.html


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