|
[Sponsors] |
September 23, 2009, 13:55 |
coordinate based interpolation ??
|
#1 |
Member
Ken Darcovich
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 34
Rep Power: 17 |
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. |
|
September 28, 2009, 07:25 |
|
#2 |
New Member
Dan Lucas
Join Date: Apr 2009
Posts: 5
Rep Power: 17 |
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! |
|
November 24, 2009, 09:14 |
|
#3 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
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 |
|
November 24, 2009, 11:12 |
|
#4 |
Senior Member
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17 |
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).
|
|
November 24, 2009, 11:38 |
|
#5 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
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 |
|
November 25, 2009, 04:21 |
|
#6 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
cylindrical coordinate vs cartesian coordinate | Lam | FLUENT | 10 | May 11, 2013 14: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 06:59 |
Pressure based and Density based Solver | Xobile | Siemens | 1 | November 30, 2004 22:13 |
Cording Ground.for in Cylindrical coordinate | J.H. Lee. | Phoenics | 2 | March 28, 2003 05:28 |