CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

How to use volPointInterpolation

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 16, 2007, 07:24
Default Hello, How to use volPoint
  #1
New Member
 
Oleg Weinstein
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 6
Rep Power: 8
oleg_weinstein is on a distinguished road
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?
oleg_weinstein is offline   Reply With Quote

Old   October 16, 2007, 07:42
Default Try: pointMesh pMesh(mesh);
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
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.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   October 19, 2007, 06:34
Default Thank you, It works.
  #3
New Member
 
Oleg Weinstein
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 6
Rep Power: 8
oleg_weinstein is on a distinguished road
Thank you,

It works.
oleg_weinstein is offline   Reply With Quote

Old   August 24, 2009, 04:34
Default
  #4
New Member
 
Join Date: Aug 2009
Posts: 4
Rep Power: 7
studrud is on a distinguished road
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:ointM 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:ointScalarFiel d&)'
make: *** [Make/linux64GccDPOpt/foamToVTK.o] Error 1


can someone please help me?
studrud is offline   Reply With Quote

Old   April 20, 2012, 09:22
Default
  #5
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: South Bend, IN, USA
Posts: 688
Blog Entries: 9
Rep Power: 12
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
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?
__________________
~
Daniel WEI
-------------
NatHaz Modeling Laboratory
Department of Civil & Environmental Engineering & Earth Sciences
University of Notre Dame, USA
Email || My Personal CFD Blog
lakeat is offline   Reply With Quote

Old   October 11, 2012, 08:27
Default
  #6
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
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
Arnoldinho is offline   Reply With Quote

Old   May 18, 2015, 19:51
Default
  #7
New Member
 
james wilson
Join Date: Aug 2014
Location: Orlando, Fl
Posts: 29
Rep Power: 2
jameswilson620 is on a distinguished road
These are pressing questions for those running in parallel. Any progress?
jameswilson620 is offline   Reply With Quote

Old   May 27, 2015, 12:24
Default
  #8
New Member
 
james wilson
Join Date: Aug 2014
Location: Orlando, Fl
Posts: 29
Rep Power: 2
jameswilson620 is on a distinguished road
for 2.3.0 I was able to add the appropriate headers and definitions to get a point interpolation of cell values. See:

interface reconstruction and point value access
jameswilson620 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 18:24.