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

coordinate based interpolation ??

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 23, 2009, 12:55
Default coordinate based interpolation ??
  #1
Member
 
Ken Darcovich
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 30
Rep Power: 8
kdarc is on a distinguished road
Can someone tell me if there is a straightforward way to return a value of a variable by simply specifying x,y,z coordinates??

Would this also work on boundaries??

in pseudo-code, I'm seeking to implement something in OpenFoam equivalent to:

q_interpolated = interpolate(q_field, at point(x,y,z) )


thanks.
kdarc is offline   Reply With Quote

Old   September 28, 2009, 06:25
Default
  #2
New Member
 
Dan Lucas
Join Date: Apr 2009
Posts: 5
Rep Power: 8
DanL is on a distinguished road
I'd also like to know the answer to this question!

Also the inverse of defining a volVectorField from a field defined on an arbitrary set of Lagrangian points?

Cheers!
DanL is offline   Reply With Quote

Old   November 24, 2009, 09:14
Default
  #3
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 8
nikwin is on a distinguished road
I'm having the same problem and found that perhaps the following could be used, (which should interpolate a value from the cell to a point within the cell)

interpolationCellPoint< Type > Class Template Reference

But, I don't have the programming skills to understand how to use it since it seems to not be implemented directly as a class.

Anyone?

Thanks
/NW
nikwin is offline   Reply With Quote

Old   November 24, 2009, 11:12
Default
  #4
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 103
Rep Power: 8
kev4573 is on a distinguished road
I know that in general RBF interpolation has the ability to do this and it seems the code does live in the OpenFOAM code base in the interpolations section. Once you figure out how to get the object constructed the interpolation should be straight-forward. The interpolate(Field ) function should return a field of your interpolated values to the field you specfied in the constructor (if I am reading this code correctly).
kev4573 is offline   Reply With Quote

Old   November 24, 2009, 11:38
Default
  #5
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 8
nikwin is on a distinguished road
Thanks for your reply!

My problem is actually to construct an interpolationCellPoint. I've figured out that (basic programming) interpolationCellPoint<Type> expects me to define type for my class. So, I'm trying the following,

pointMesh pMesh(mesh);
volMesh vMesh(mesh);
volPointInterpolation interpMesh(mesh, pMesh);
interpolationCellPoint<vector> Uint(interpMesh,U,vMesh);

And getting the following error message since, I believe, I'm not defining a fvPatchField,

mySonicFoam.C: In function ‘int main(int, char**)’:
mySonicFoam.C:185: error: no matching function for call to ‘Foam::interpolationCellPoint<Foam::Vector<double> >::interpolationCellPoint(Foam::volPointInterpolat ion&, Foam::volVectorField&, Foam::volMesh&)’
/scratch/nwinkler/ProgramFiles/OF-1.5dev/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/interpolationCellPoint.C:37: note: candidates are: Foam::interpolationCellPoint<Type>::interpolationC ellPoint(const Foam::volPointInterpolation&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::Vector<double>]
/scratch/nwinkler/ProgramFiles/OF-1.5dev/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/interpolationCellPoint.H:52: note: Foam::interpolationCellPoint<Foam::Vector<double> >::interpolationCellPoint(const Foam::interpolationCellPoint<Foam::Vector<double> >&)
make: *** [Make/linux64GccDPOpt/mySonicFoam.o] Error 1

How can I construct/give a fvPatchField? Don't understand doxygen enough....

Regards
/NW
nikwin is offline   Reply With Quote

Old   November 25, 2009, 04:21
Default
  #6
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 8
nikwin is on a distinguished road
Programming skills....

interpolationCellPoint (const GeometricField< Type, fvPatchField, volMesh > &psi)

Says that it wants an argument not several. However, it works with 2 arguments as follows, (U interpolated to point xp)

pointMesh pMesh(mesh);
volPointInterpolation interpMesh(mesh, pMesh);
interpolationCellPoint<vector> Uint(interpMesh,U);
cell = mesh.findCell(xp);
vector Up = Uint.interpolate(xp,cell);

/NW
nikwin 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
cylindrical coordinate vs cartesian coordinate Lam FLUENT 10 May 11, 2013 13:05
momentum interpolation for collocated grid Hadian Main CFD Forum 4 December 25, 2009 08:25
incorrect temperature in pressure based solution Kian FLUENT 1 July 6, 2009 05:59
Pressure based and Density based Solver Xobile CD-adapco 1 November 30, 2004 22:13
Cording Ground.for in Cylindrical coordinate J.H. Lee. Phoenics 2 March 28, 2003 05:28


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