CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Interpolation from particles (points) to vol (

astein June 15, 2012 09:51

Interpolation from particles (points) to vol
Dear Foamers,

I am looking for a possibility to interpolate values from lagrangian particles to the mesh volumes. Each parctile holds a separate value, such as a weight or whatever. What I need is an area-weighted field of all particles (many of them!).

One possibilty would be to loop over all cells (or particles) and just average the values of all particles within one cell. However, the area-weighting is lost by doing this. As far as I see it, the class pointVolInterpolation "only" interpolates from a full pointMesh to a volMesh and cannot be used for my problem. Am I right?

Any ideas? Thanks in advance!

anishtain4 June 15, 2012 14:25

I'm new with foam programming too, so maybe my words does not make sense for in this aspect
I think you should define an fvMesh which is moving and can be updated using .update() method, this would be your lagrangian mesh, and a stationary mesh which is your eulerian mesh. to have a area weighted average you shoudl use .Sf() and to use volume weighted .V(), a mass weighted would then be easy by multiplying .V() and rho

astein June 18, 2012 04:50

Hi all,

what I am looking for is a pointVolInterpolation which interpolates values from lagrangian particles to the cell centeres (not from mesh points to cell centeres as the existing pointVolInterpolation). So, the input needs to be a list of coordinates and scalars, output should be a volField<scalar>. As an alternative, a pointPointInterpolation would also help, meaning an interpolation from particles to mesh points.

Any ideas or hints for classes that could be adopted? Or can the existing pointVolInterpolation be used for that?

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