CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Interpolate in some points (http://www.cfd-online.com/Forums/openfoam-post-processing/63841-interpolate-some-points.html)

ivan_cozza April 21, 2009 12:23

Interpolate in some points
 
Hi Foamers,
I need to interpolate some volField from my cfd mesh to a 2D mesh for external calculations, so I need to interpolate in a cloud of points that I read from a file. I would like to do it in a code (no sample or probes), as the 2D mesh is quite big ( 300k nodes).
Which class can I use to interpolate in a list of points?
Thanks!

gschaider April 22, 2009 07:20

Quote:

Originally Posted by ivan_cozza (Post 213692)
I need to interpolate some volField from my cfd mesh to a 2D mesh for external calculations, so I need to interpolate in a cloud of points that I read from a file. I would like to do it in a code (no sample or probes), as the 2D mesh is quite big ( 300k nodes).
Which class can I use to interpolate in a list of points?

What I'd do (but I'm lazy and avoid "real" (==C++) programming if possible):
- Using the scripting language of your choice (Perl, Python, awk, ....) generate from the file of the 2D-Nodes a sampleDict (with a REAL long cloud entry)
- run sample
- Convert the result back to a format that is usable for you

Examples of using the interpolator-classes would be anything that has to do with lagrangian particles. For instance (maybe not the best example, but the one I found first):
Approx line 105 for creation: http://openfoam-extend.svn.sourcefor....C?view=markup
Approx line 161 for usage: http://openfoam-extend.svn.sourcefor....C?view=markup
Of course you'll have to find the appropriate cellI with findCell

Bernhard

ivan_cozza April 22, 2009 08:58

Quote:

Originally Posted by gschaider (Post 213758)
What I'd do (but I'm lazy and avoid "real" (==C++) programming if possible):
- Using the scripting language of your choice (Perl, Python, awk, ....) generate from the file of the 2D-Nodes a sampleDict (with a REAL long cloud entry)

Thank you, I will build the script soon.
Ivan


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