CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Point Interpolation (https://www.cfd-online.com/Forums/openfoam-programming-development/89560-point-interpolation.html)

Andrea_85 June 16, 2011 08:32

Point Interpolation
 
Hi all,
is there a class to interpolate a vector or a scalar from the cells faces to the cells points or directly from the cell centers to the cells points? For example, How to get the gradient of a given quantity defined at the cells points?

thanks

andrea

marupio June 16, 2011 11:05

If you are using 1.6-extend, it is available in the volPointInterpolation class.

See a snippet here:

http://openfoamwiki.net/index.php/Op...tInterpolation

I can't find the class in 1.7.1, so I'm not sure where it went.

Andrea_85 June 16, 2011 11:33

Hi David,
thanks for reply!
I have already tried volPointInterpolation, but without success:(! In OF 1.7.1 is under src/finiteVolume/interpolation/volPointInterpolation.
I tried something like:

volVectorField gradA = fvc::grad(alpha1);
pointVectorField gradC = volPointInterpolate::interpolate(gradA);

maybe is not the correct syntax...Do you know which is the correct one to call this class?

thanks again

andrea

marupio June 16, 2011 19:23

try volPointInterpolation::interpolate

I've never actually used it, though...

Andrea_85 June 24, 2011 10:16

Hi, sorry for the late response. Thanks for your help. I still get an error:

now i simply write

pointScalarField alphaC = volPointInterpolation::interpolate(alpha1_);
fo get the alpha values on the vertices. Here the error:

Making dependency list for source file interfaceProperties.C
SOURCE=interfaceProperties.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/OpenFOAM/OpenFOAM-1.7.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/interfaceProperties.o
interfaceProperties.C: In member function ‘void Foam::interfaceProperties::calculateK()’:
interfaceProperties.C:152: error: cannot call member function ‘Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> > Foam::volPointInterpolation::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const [with Type = double]’ without object
interfaceProperties.C:152: warning: unused variable ‘alphaC’
make: *** [Make/linux64GccDPOpt/interfaceProperties.o] Error 1


Any idea of why??
Regards

andrea

ernsa August 25, 2011 04:40

Hi,

first you shoud define your "Vol to Point interpolator" in the following manner:

for example: interpolate a volScalarField s from cell to points

volPointInterpolation interpolateVolPoint (mesh);

pointScalarField sP = interpolateVolPoint.interpolate(s);


and don't forget to add

#include "volPointInterpolation.H"

Cheers,
Sandro

jameswilson620 May 18, 2015 19:41

Any luck Andrea????

Also, has anybody utilized/ported this code for new versions of OF? Im using OF230.

James

wyldckat September 20, 2015 08:33

Quote:

Originally Posted by jameswilson620 (Post 546800)
Also, has anybody utilized/ported this code for new versions of OF? Im using OF230.

For future reference:
  1. Sandro had already answered this question in the previous post #6. Namely that this is still present in OpenFOAM 2.3, but under a slightly different name and way of using it.
  2. James later answered his own question on another thread: http://www.cfd-online.com/Forums/ope...tml#post546806 - post #4

EmadTandis January 15, 2019 04:07

Quote:

Originally Posted by ernsa (Post 321509)
Hi,

first you shoud define your "Vol to Point interpolator" in the following manner:

for example: interpolate a volScalarField s from cell to points

volPointInterpolation interpolateVolPoint (mesh);

pointScalarField sP = interpolateVolPoint.interpolate(s);


and don't forget to add

#include "volPointInterpolation.H"

Cheers,
Sandro


Hello Sandro,
Have you had any experience in edgeCorrectedVolPointInterpolation class?
I cannot make any object of this class by :


const pointMesh& pMesh = pointMesh::New(mesh);
const volPointInterpolation& cpi2=edgeCorrectedVolPointInterpolation::New(mesh, pMesh);


All times are GMT -4. The time now is 13:42.